:root {
  --night: #090d18;
  --deep: #111a2a;
  --panel: #17263a;
  --panel-strong: #20364a;
  --ink: #fff8e8;
  --muted: #becbd0;
  --gold: #f6cf73;
  --emerald: #6de0aa;
  --danger: #ff806f;
  --line: rgba(209, 226, 229, 0.24);
  --font: "Palatino Linotype", Palatino, Georgia, serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
html { background: #050810; }
body { color: var(--ink); background: radial-gradient(circle at 16% 8%, rgba(42,111,106,.24), transparent 34%), radial-gradient(circle at 88% 88%, rgba(100,50,114,.25), transparent 36%), linear-gradient(150deg,#0b1220,#080c16 55%,#140d1d); font-family: var(--font); font-size: 16px; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
#bo-app { position: relative; width: min(100%,1120px); height: 100dvh; margin: auto; overflow: hidden; background: rgba(10,17,29,.88); box-shadow: 0 0 80px #000; }
.bo-topbar { position: absolute; z-index: 20; inset: 0 0 auto; height: 70px; display: grid; grid-template-columns: 46px minmax(0,1fr) 46px 46px; align-items: center; gap: 9px; padding: max(9px,env(safe-area-inset-top)) 14px 8px; border-bottom: 1px solid var(--line); background: rgba(12,22,36,.94); backdrop-filter: blur(14px); }
.bo-icon { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(214,231,232,.35); border-radius: 13px; color: var(--ink); background: #243b50; box-shadow: 0 5px 12px rgba(0,0,0,.28); font-weight: 800; text-decoration: none; }
.bo-brand { min-width: 0; text-align: center; }
.bo-brand span, .bo-eyebrow, .bo-heading span, .bo-world-title span, .bo-hand-heading span { display: block; color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.bo-brand strong { display: block; overflow: hidden; font-size: 1.35rem; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.bo-screen { position: absolute; inset: 70px 0 0; min-width: 0; min-height: 0; overflow: hidden; padding: 20px clamp(14px,4vw,42px) max(16px,env(safe-area-inset-bottom)); scrollbar-color: #60798a transparent; }
.bo-screen.is-active { animation: bo-screen-in .22s ease-out; }
@keyframes bo-screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Title */
#bo-menu { display: grid; align-content: center; min-height: calc(100dvh - 70px); padding-bottom: 9vh; }
.bo-menu-art { position: absolute; right: 3%; top: 12%; width: min(42vw,400px); aspect-ratio: 1; border: 1px solid rgba(246,207,115,.18); border-radius: 50%; background: radial-gradient(circle,rgba(246,207,115,.14) 0 31%,rgba(122,83,151,.14) 32% 53%,transparent 54%); }
.bo-menu-art i { position: absolute; left: 47%; top: 47%; width: 16%; height: 24%; border: 2px solid #f7d48c; border-radius: 10px; background: #854d5e; transform-origin: 50% 160%; box-shadow: 0 8px 18px #0006; }
.bo-menu-art i:nth-child(1) { transform: rotate(-56deg); }
.bo-menu-art i:nth-child(2) { transform: rotate(-28deg); background: #426f9d; }
.bo-menu-art i:nth-child(3) { transform: rotate(0); background: #4a8764; }
.bo-menu-art i:nth-child(4) { transform: rotate(28deg); background: #694f8e; }
.bo-menu-art i:nth-child(5) { transform: rotate(56deg); background: #8c6339; }
#bo-menu h1 { position: relative; z-index: 2; max-width: 760px; margin: 10px 0 20px; font-size: clamp(3rem,8vw,6.4rem); line-height: .94; letter-spacing: -.045em; text-shadow: 0 5px 0 #070a12; }
#bo-menu h1 em { color: var(--gold); font-style: normal; }
.bo-lede { position: relative; z-index: 2; max-width: 590px; margin-bottom: 0; color: #d4dcda; font-size: 1.08rem; line-height: 1.6; }
.bo-menu-actions { position: relative; z-index: 2; display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; max-width: 760px; margin-top: 34px; }
.bo-menu-actions button { min-height: 94px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #20354a; text-align: left; box-shadow: 0 10px 24px rgba(0,0,0,.32); }
.bo-menu-actions strong, .bo-menu-actions span { display: block; }
.bo-menu-actions strong { font-size: 1.2rem; }
.bo-menu-actions span { margin-top: 7px; color: #c8d4d5; font-size: .88rem; line-height: 1.4; }
.bo-primary { border-color: #f4d58a !important; color: #fff9ec; background: linear-gradient(135deg,#ad5b43,#704976) !important; font-weight: 800; }
.bo-menu-stats { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 24px; color: #afbec2; font-size: .9rem; }
.bo-menu-stats b { color: #fff; }

/* Shared */
.bo-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.bo-heading > div { min-width: 0; flex: 1; }
.bo-heading h2 { margin: 4px 0 0; font-size: clamp(1.7rem,5vw,2.6rem); line-height: 1.05; }
.bo-heading > b { padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold); background: #22394d; font-size: .85rem; white-space: nowrap; }
.bo-intro { max-width: 760px; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.bo-sticky { width: 100%; min-height: 56px; border-radius: 15px; box-shadow: 0 10px 24px rgba(0,0,0,.28); }
#bo-starters, #bo-map, #bo-shop { display: flex; flex-direction: column; }
#bo-starters .bo-heading, #bo-starters .bo-intro, #bo-map .bo-runbar, #bo-map .bo-world-title, #bo-map .bo-map-legend, #bo-shop .bo-heading, #bo-shop .bo-shop-tabs { flex: 0 0 auto; }
#bo-starters .bo-card-grid, #bo-map .bo-route, #bo-shop .bo-shop-grid { min-height: 0; flex: 1 1 auto; }

/* Cards */
.bo-card-grid { display: flex; align-items: center; gap: 18px; overflow-x: auto; overflow-y: hidden; padding: 8px 8px 18px; scroll-snap-type: x mandatory; }
.bo-card-grid .bo-card { flex: 0 0 168px; width: 168px; scroll-snap-align: center; }
.bo-card { --card: #426c9b; position: relative; display: grid; grid-template-rows: auto 29% minmax(0,1fr) auto; gap: 9px; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1/2; padding: 13px 12px 12px; overflow: hidden; border: 3px solid color-mix(in srgb,var(--card),white 38%); border-radius: 13px; color: #fffaf0; background: linear-gradient(160deg,color-mix(in srgb,var(--card),white 7%),color-mix(in srgb,var(--card),#101522 30%)); box-shadow: 0 9px 0 color-mix(in srgb,var(--card),#080a10 52%),0 15px 22px rgba(0,0,0,.38); text-align: left; isolation: isolate; }
.bo-card::before { position: absolute; z-index: -1; inset: 5px; border: 1px solid rgba(255,245,215,.42); border-radius: 8px; box-shadow: inset 0 0 0 3px rgba(12,18,27,.16); content: ""; pointer-events: none; }
.bo-card::after { position: absolute; z-index: -1; right: 9px; bottom: 8px; width: 24px; height: 24px; border-right: 2px solid rgba(255,244,210,.32); border-bottom: 2px solid rgba(255,244,210,.32); content: ""; transform: rotate(0deg); }
.bo-card header { position: relative; display: flex; align-items: flex-start; gap: 8px; }
.bo-card header strong { min-width: 0; flex: 1; font-size: .92rem; line-height: 1.12; overflow-wrap: anywhere; }
.bo-card .bo-level { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border: 1px solid rgba(255,228,151,.65); border-radius: 50%; color: #ffe59f; background: rgba(10,15,25,.9); font-size: .95rem; font-weight: 800; }
.bo-card-art { position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,245,215,.42); border-radius: 7px; background: radial-gradient(circle at 50% 42%,rgba(255,255,255,.22),transparent 48%),rgba(10,18,28,.24); box-shadow: inset 0 0 18px rgba(5,8,14,.32); }
.bo-card-art::before, .bo-card-art::after { position: absolute; width: 62%; height: 62%; border: 1px solid rgba(255,246,216,.24); content: ""; transform: rotate(45deg); }
.bo-card-art::after { width: 40%; height: 40%; transform: rotate(0); }
.bo-card-art span { position: relative; z-index: 1; color: rgba(255,249,225,.92); font-size: 2.25rem; text-shadow: 0 2px 7px rgba(0,0,0,.48); }
.bo-card p { position: relative; overflow: hidden; margin: 0; align-self: start; color: inherit; font-size: .72rem; line-height: 1.34; }
.bo-card footer { position: relative; display: flex; justify-content: space-between; gap: 8px; color: rgba(255,255,255,.83); font-size: .72rem; line-height: 1.2; }
.bo-card footer span:last-child { text-align: right; }
.bo-card.selected { border-color: #fff0a8; box-shadow: 0 0 0 4px rgba(246,207,115,.35),0 14px 25px rgba(0,0,0,.45); transform: translateY(-5px); }
.bo-card[data-color="Red"] { --card: #ad4649; }
.bo-card[data-color="Orange"] { --card: #b96a31; }
.bo-card[data-color="Yellow"] { --card: #b7992f; color: #17130c; }
.bo-card[data-color="Green"] { --card: #3b8059; }
.bo-card[data-color="Blue"] { --card: #3d6f9f; }
.bo-card[data-color="Purple"] { --card: #725194; }
.bo-card[data-color="White"] { --card: #d3d4cc; color: #171c25; }
.bo-card[data-color="Black"] { --card: #292e3a; }
.bo-card[data-color="Brown"] { --card: #795437; border-style: double; border-width: 4px; }
.bo-card[data-color="Yellow"] footer, .bo-card[data-color="White"] footer { color: rgba(18,20,22,.8); }
.bo-card-back { display: grid; grid-template-rows: 1fr; padding: 8px; border-color: #d5b66c; background: #1b304a; box-shadow: 0 9px 0 #09111e,0 15px 22px rgba(0,0,0,.45); }
.bo-card-back::before { inset: 7px; border: 2px solid #b99953; box-shadow: inset 0 0 0 4px #14243a,inset 0 0 0 5px rgba(226,196,117,.5); }
.bo-card-back::after { display: none; }
.bo-card-back-frame { position: relative; display: grid; place-content: center; justify-items: center; gap: 7px; overflow: hidden; border: 1px solid rgba(241,214,145,.55); border-radius: 5px; background: repeating-linear-gradient(45deg,rgba(230,199,119,.07) 0 8px,transparent 8px 16px),radial-gradient(circle,#3b5872 0 3px,transparent 4px) 0 0/22px 22px,#13263d; text-align: center; }
.bo-card-back-frame::before, .bo-card-back-frame::after { position: absolute; width: 64%; aspect-ratio: 1; border: 2px solid rgba(230,198,113,.55); content: ""; transform: rotate(45deg); }
.bo-card-back-frame::after { width: 44%; border-width: 1px; transform: rotate(0); }
.bo-card-back-frame i, .bo-card-back-frame b, .bo-card-back-frame small { position: relative; z-index: 1; }
.bo-card-back-frame i { display: grid; place-items: center; width: 50px; height: 50px; border: 2px solid #dbbd73; border-radius: 50%; color: #ffe59a; background: #17283d; font-size: 1.7rem; font-style: normal; box-shadow: 0 0 0 5px rgba(8,17,28,.55); }
.bo-card-back-frame b { color: #f8dfa0; font-size: .76rem; letter-spacing: .12em; }
.bo-card-back-frame small { color: #b9cbd3; font-size: .46rem; letter-spacing: .1em; }

/* Map */
.bo-runbar { display: grid; grid-template-columns: 48px repeat(3,1fr); align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: rgba(24,42,58,.92); }
.bo-runbar div { text-align: center; }
.bo-runbar span, .bo-play-hud span { display: block; color: #b3c3c7; font-size: .68rem; font-weight: 700; letter-spacing: .08em; }
.bo-runbar b { color: #ffe28f; font-size: 1.05rem; }
.bo-world-title { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.bo-world-title > div:first-child { min-width: 0; flex: 1; }
.bo-world-title h2 { margin: 2px 0; font-size: clamp(1.55rem,4.5vw,2.25rem); line-height: 1; }
.bo-world-title p { margin: 0; color: #b8c7c9; font-size: .82rem; }
.bo-lucky-medallion { display: grid; place-items: center; flex: 0 0 56px; width: 56px; height: 56px; border: 2px solid #f5d179; border-radius: 50%; background: #473754; box-shadow: 0 0 24px rgba(208,143,230,.2); }
.bo-lucky-medallion small { font-size: .62rem; }
.bo-lucky-medallion b { font-size: 1.35rem; }
.bo-route { position: relative; display: flex; flex-direction: column-reverse; gap: clamp(4px,1dvh,11px); min-height: 0; padding: 10px 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(circle at 50% 105%,rgba(81,139,124,.22),transparent 45%),linear-gradient(155deg,rgba(17,41,50,.98),rgba(31,25,51,.98)); }
.bo-route::before { position: absolute; inset: 0; opacity: .22; background-image: radial-gradient(circle at 15% 20%,#b7e3df 0 1px,transparent 2px),radial-gradient(circle at 75% 60%,#dfc0ef 0 1px,transparent 2px); background-size: 57px 57px,83px 83px; content: ""; pointer-events: none; }
.bo-route-edges { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.bo-route-edge { fill: none; stroke: #759098; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 3 9; opacity: .35; }
.bo-route-edge.visited { stroke: #8dc7b5; opacity: .7; }
.bo-route-edge.available { stroke: #ffe18b; stroke-width: 3; opacity: 1; filter: drop-shadow(0 0 5px rgba(255,225,139,.5)); }
.bo-map-row { position: relative; z-index: 1; min-height: 44px; flex: 1 1 0; }
.bo-map-nodes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: center; width: min(100%,760px); height: 100%; min-height: 44px; margin: 0 auto; }
.bo-node { position: relative; display: grid; justify-self: center; justify-items: center; align-content: center; width: 96px; min-height: 44px; padding: 0 3px; border: 0; color: #e8f0ed; background: transparent; font-weight: 700; text-align: center; }
.bo-node-glyph { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #7bb9c8; border-radius: 50%; color: #eaffff; background: #22485a; box-shadow: 0 4px 10px rgba(0,0,0,.45); font-size: .95rem; }
.bo-node strong { margin-top: 3px; font-size: .62rem; line-height: 1; }
.bo-node small { min-height: .62rem; margin-top: 1px; color: #bdd0d2; font-size: .5rem; font-weight: 400; }
.bo-node[data-type="battle"] .bo-node-glyph { border-color: #ef8b82; background: #8b3f47; }
.bo-node[data-type="shop"] .bo-node-glyph { border-color: #f5d272; color: #251c10; background: #d7a93d; }
.bo-node[data-type="merchant"] .bo-node-glyph { border-color: #8ff0c3; background: #277d60; }
.bo-node[data-type="boss"] .bo-node-glyph { width: 40px; height: 40px; border-color: #e49cff; background: #71458b; font-size: 1.12rem; }
.bo-node.available .bo-node-glyph { border-color: #ffe18b; box-shadow: 0 0 0 5px rgba(255,225,139,.16),0 0 19px rgba(255,225,139,.58); animation: bo-node-pulse 1.8s ease-in-out infinite; }
.bo-node.available:hover { transform: translateY(-3px); }
.bo-node.locked { opacity: .46; }
.bo-node.visited { opacity: .66; filter: saturate(.45); }
@keyframes bo-node-pulse { 50% { box-shadow: 0 0 0 8px rgba(255,225,139,.08),0 0 22px rgba(255,225,139,.68); } }
.bo-map-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px 13px; margin: 8px 0 0; color: #b7c5c8; font-size: .7rem; }
.bo-map-legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #6cb7cc; content: ""; }

/* Event and deck choice */
.bo-play-screen { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px max(8px,env(safe-area-inset-bottom)); }
.bo-play-hud { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-height: 46px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 13px; background: #192d40; }
.bo-play-hud > div:first-child { min-width: 0; flex: 1; }
.bo-play-hud strong { display: block; overflow: hidden; margin-top: 1px; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.bo-currency { display: flex; gap: 12px; }
.bo-currency span { color: var(--gold); font-size: .8rem; }
.bo-currency .emerald { color: var(--emerald); }
.bo-objective { display: grid; grid-template-columns: 66px minmax(0,1fr) 68px; flex: 0 0 auto; align-items: center; gap: 9px; margin: 0; min-height: 58px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg,#252d4b,#173b43); }
.bo-objective > div:first-child, .bo-objective > div:last-child { text-align: center; }
.bo-objective small { display: block; color: #bdcbcd; font-size: .65rem; font-weight: 700; letter-spacing: .06em; }
.bo-objective strong { color: #ffe182; font-size: 1.5rem; line-height: 1; }
.bo-objective em { display: block; margin-top: 3px; color: #ff9e85; font-size: .68rem; font-style: normal; }
.bo-objective-track > span { font-size: .88rem; font-weight: 700; }
.bo-objective-track i, .bo-duel-hud i { display: block; height: 10px; margin: 6px 0; overflow: hidden; border-radius: 999px; background: #0a111c; }
.bo-objective-track i b, .bo-duel-hud i b { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#60d79d,#ffd761); transition: width .25s; }
.bo-objective-track > small { text-align: center; }
.bo-objective.core-failed { border-color: var(--danger); animation: bo-failure .45s ease both; }
@keyframes bo-failure { 25%,75% { transform: translateX(-5px); filter: saturate(1.8); } 50% { transform: translateX(5px); } }
.bo-duel-hud { display: grid; grid-template-columns: 1fr 36px 1fr; flex: 0 0 auto; gap: 8px; margin: 0; min-height: 48px; padding: 6px 10px; border: 1px solid rgba(178,128,170,.48); border-radius: 13px; background: #251e36; }
.bo-duel-hud > div:not(.bo-versus) { text-align: center; }
.bo-duel-hud span { font-size: .68rem; }
.bo-duel-hud strong { font-size: .82rem; }
.bo-duel-hud > div:last-child i b { background: #ef6262; }
.bo-versus { display: grid; place-items: center; color: #ffd86b; font-size: 1.05rem; font-weight: 800; }
.bo-casting-board { display: grid; grid-template: auto minmax(0,1fr) / minmax(0,1fr) 205px; flex: 0 0 178px; min-height: 0; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 17px; background: radial-gradient(circle at 35% 40%,rgba(74,101,136,.15),transparent 48%),#111d2e; box-shadow: inset 0 0 45px rgba(63,80,112,.12); }
.bo-hand-heading { display: flex; grid-column: 1; grid-row: 1; align-items: end; justify-content: space-between; gap: 12px; padding: 0 3px 6px; }
.bo-hand-heading strong { display: block; margin-top: 2px; font-size: .9rem; }
.bo-hand-heading > b { color: #e5d4a7; font-size: .85rem; white-space: nowrap; }
.bo-hand { display: flex; grid-column: 1; grid-row: 2; align-items: center; gap: 9px; min-height: 0; padding: 3px 6px 10px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-padding-inline: 7px; scroll-snap-type: x mandatory; scrollbar-color: #657d8c #0b1421; touch-action: pan-x pan-y; }
.bo-hand-card { flex: 0 0 76px; width: 76px; min-height: 0; aspect-ratio: 1/2; scroll-snap-align: center; transition: transform .18s,box-shadow .18s,border-color .18s; }
.bo-hand-card .bo-card-back-frame { gap: 3px; }
.bo-hand-card .bo-card-back-frame i { width: 30px; height: 30px; font-size: 1.05rem; box-shadow: 0 0 0 3px rgba(8,17,28,.55); }
.bo-hand-card .bo-card-back-frame b { font-size: .47rem; }
.bo-hand-card .bo-card-back-frame small { display: none; }
.bo-selection { display: flex; grid-column: 2; grid-row: 1; align-items: center; gap: 8px; min-height: 0; margin: 0 0 6px 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: #1c3042; }
.bo-selection > div { min-width: 0; flex: 1; }
.bo-selection small { display: block; color: var(--gold); font-size: .66rem; font-weight: 700; letter-spacing: .1em; }
.bo-selection strong, .bo-selection span { display: block; }
.bo-selection strong { margin: 2px 0; font-size: .82rem; }
.bo-selection span { color: #c7d3d4; font-size: .68rem; line-height: 1.25; }
.bo-selection.is-risky { border-color: #ff8b77; background: #4b2931; }
.bo-selection.is-risky span { color: #ffd6ce; font-weight: 700; }
.bo-reserve-row { display: grid; grid-column: 2; grid-row: 2; grid-template-columns: 1fr; align-content: center; gap: 8px; margin: 0 0 0 8px; padding: 8px 9px; border-radius: 12px; background: #0d1827; }
.bo-last-cast small, .bo-core-orb > span { display: block; color: #9fb2b8; font-size: .65rem; font-weight: 700; letter-spacing: .08em; }
.bo-last-cast strong { display: block; overflow: hidden; margin-top: 2px; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.bo-core-orb { display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: center; gap: 5px; text-align: left; }
.bo-core-orb > strong { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #c08e54; border-radius: 50%; background: #9b693c; box-shadow: 0 0 18px rgba(228,167,82,.3); font-size: .95rem; }
.bo-core-orb > i { display: block; width: 100%; height: 4px; border-radius: 999px; background: #55362d; }
.bo-feedback { flex: 0 0 auto; min-height: 32px; margin: 0; padding: 7px 10px; border-radius: 10px; color: #e2e9e6; background: #192d3a; font-size: .75rem; line-height: 1.3; }
.bo-cast-tray, .bo-saved { min-height: 0; margin: 0; padding: 6px 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #101d2a; }
.bo-cast-tray { position: relative; flex: 1 1 90px; background: radial-gradient(circle at 50% 55%,rgba(101,77,133,.22),transparent 38%),linear-gradient(135deg,#122536,#171d33); }
.bo-cast-tray::before { position: absolute; left: 50%; top: 55%; width: min(22dvh,140px); aspect-ratio: 1; border: 1px solid rgba(246,207,115,.12); border-radius: 50%; content: ""; transform: translate(-50%,-50%); box-shadow: 0 0 0 12px rgba(246,207,115,.025),0 0 0 28px rgba(109,224,170,.02); pointer-events: none; }
.bo-saved { flex: 0 0 72px; }
.bo-cast-tray header, .bo-saved header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: #bdcbce; font-size: .62rem; font-weight: 700; letter-spacing: .05em; }
.bo-cast-tray > div, .bo-saved > div { position: relative; display: flex; align-items: center; gap: 8px; height: calc(100% - 16px); overflow-x: auto; padding: 2px 4px 5px; }
#bo-cast-list:empty { display: grid; place-items: center; color: #728792; font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
#bo-cast-list:empty::after { content: "Cast spells appear here"; }
.bo-mini-card { flex: 0 0 42px; width: 42px; height: auto; aspect-ratio: 1/2; padding: 5px 2px; border: 1px solid rgba(235,244,242,.5); border-radius: 5px; color: #fff; background: var(--mini,#345e7b); box-shadow: 0 3px 0 color-mix(in srgb,var(--mini,#345e7b),#05080c 55%); font-size: .48rem; text-align: center; }
.bo-mini-card b { display: block; margin: 3px 0 1px; font-size: .78rem; }
.bo-play-actions { display: grid; grid-template-columns: .8fr 1.25fr; flex: 0 0 auto; gap: 7px; margin: 0; }
.bo-play-actions button { min-height: 46px; border-radius: 12px; font-weight: 800; }
.bo-stop { border: 1px solid #a9827c; background: #593b49; }
.bo-draw { border: 1px solid #f2d47d; background: linear-gradient(135deg,#b96143,#7e4e88); }

/* Shops and dialogs */
.bo-shop-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.bo-shop-tabs button { min-height: 46px; flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 999px; background: #223a4e; font-weight: 700; }
.bo-shop-tabs button.active { color: #231a13; background: #f4cf76; }
.bo-shop-grid { display: flex; align-items: center; gap: 16px; overflow-x: auto; overflow-y: hidden; padding: 6px 8px 14px; scroll-snap-type: x mandatory; }
.bo-shop-offer { display: grid; align-content: start; flex: 0 0 184px; max-height: 100%; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #1b3043; scroll-snap-align: center; }
.bo-shop-offer .bo-card { width: 156px; min-height: 0; margin: auto; }
.bo-shop-offer > button:not(.bo-card) { width: 100%; min-height: 46px; margin-top: 11px; padding: 10px; border: 0; border-radius: 11px; color: #fff; background: #448c68; font-weight: 800; }
.bo-shop-offer h3 { margin-bottom: 8px; font-size: 1.25rem; }
.bo-shop-offer p { color: #c7d3d4; line-height: 1.45; }
.bo-dialog { width: min(620px,calc(100vw - 22px)); max-height: calc(100dvh - 22px); padding: 25px; overflow: auto; border: 1px solid rgba(211,228,230,.4); border-radius: 21px; color: var(--ink); background: #1b2c40; box-shadow: 0 25px 80px #000d; }
.bo-dialog::backdrop { background: rgba(3,6,13,.86); backdrop-filter: blur(4px); }
.bo-x { float: right; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #2c475c; font-weight: 800; }
.bo-dialog h2 { margin-bottom: 16px; font-size: clamp(1.7rem,6vw,2.35rem); }
.bo-dialog ol { padding-left: 24px; color: #d5dfdc; font-size: .98rem; line-height: 1.6; }
.bo-dialog li + li { margin-top: 8px; }
.bo-rule-note { padding: 13px; border-radius: 12px; color: #f5d68e; background: #101c2b; font-size: .9rem; line-height: 1.45; }
.bo-choice-list { display: grid; gap: 10px; }
.bo-choice-list button { min-height: 60px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #28465b; text-align: left; }
.bo-choice-list strong, .bo-choice-list span { display: block; }
.bo-choice-list strong { font-size: 1rem; }
.bo-choice-list span { margin-top: 5px; color: #c6d4d5; font-size: .86rem; line-height: 1.4; }
.bo-deck-inspector { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,176px)); justify-content: center; gap: 17px; }
#bo-card-detail > .bo-card { width: min(176px,100%); margin: 0 auto 20px; }
.bo-debug-button { position: fixed; z-index: 50; right: 12px; bottom: 12px; padding: 10px; border: 1px solid #ffda72; border-radius: 11px; background: #592e64; color: #fff; }
.bo-debug-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bo-debug-grid label { display: grid; gap: 5px; color: #c4d0d2; font-size: .82rem; }
.bo-debug-grid input, .bo-debug-grid select, .bo-debug-grid button { width: 100%; min-height: 42px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: #fff; background: #10202d; }
.bo-debug-grid .wide { grid-column: 1/-1; }

@media (max-width: 700px) {
  .bo-menu-art { right: -13%; opacity: .55; }
  .bo-menu-actions { grid-template-columns: 1fr; }
  .bo-route { padding-inline: 10px; }
}
@media (max-width: 460px) {
  body { font-size: 15px; }
  .bo-topbar { grid-template-columns: 40px minmax(0,1fr) 40px 40px; gap: 6px; padding-inline: 8px; }
  .bo-icon { width: 40px; height: 40px; }
  .bo-brand span { display: none; }
  .bo-brand strong { font-size: 1.18rem; }
  .bo-screen { padding: 10px 8px max(8px,env(safe-area-inset-bottom)); }
  #bo-menu { align-content: start; padding-top: 7vh; }
  #bo-menu h1 { font-size: 3rem; }
  .bo-menu-art { top: 1%; right: -35%; opacity: .4; }
  .bo-lede { max-width: 88%; font-size: 1rem; }
  .bo-menu-actions { margin-top: 24px; }
  .bo-menu-actions button { min-height: 84px; }
  .bo-menu-stats { font-size: .8rem; }
  .bo-heading { gap: 9px; }
  .bo-heading > b { padding: 8px 9px; font-size: .75rem; }
  .bo-card-grid { gap: 12px; padding: 4px 5px 12px; }
  .bo-card-grid .bo-card { flex-basis: 148px; width: 148px; }
  .bo-runbar { grid-template-columns: 42px repeat(3,1fr); gap: 4px; padding: 7px; }
  .bo-runbar span { font-size: .58rem; }
  .bo-world-title { margin: 6px 0; }
  .bo-world-title h2 { font-size: 1.55rem; }
  .bo-world-title p { font-size: .72rem; }
  .bo-lucky-medallion { flex-basis: 48px; width: 48px; height: 48px; }
  .bo-route { gap: clamp(2px,.6dvh,6px); padding: 6px 3px; }
  .bo-map-row, .bo-map-nodes { min-height: 39px; }
  .bo-node { width: 90px; min-height: 39px; padding-inline: 2px; }
  .bo-node-glyph { width: 30px; height: 30px; font-size: .82rem; }
  .bo-node[data-type="boss"] .bo-node-glyph { width: 35px; height: 35px; }
  .bo-node strong { margin-top: 2px; font-size: .57rem; }
  .bo-node small { font-size: .46rem; }
  .bo-map-legend { gap: 3px 9px; margin-top: 5px; font-size: .62rem; }
  .bo-play-screen { padding: 5px; gap: 4px; }
  .bo-play-hud { min-height: 41px; padding: 5px 8px; }
  .bo-play-hud strong { font-size: .84rem; }
  .bo-currency { gap: 7px; }
  .bo-objective { grid-template-columns: 53px minmax(0,1fr) 60px; gap: 5px; min-height: 51px; padding: 5px 6px; }
  .bo-objective strong { font-size: 1.3rem; }
  .bo-objective em { font-size: .58rem; }
  .bo-objective-track > span { font-size: .7rem; }
  .bo-duel-hud { grid-template-columns: 1fr 30px 1fr; min-height: 43px; padding: 4px 6px; }
  .bo-casting-board { grid-template-columns: minmax(0,1fr) 116px; flex-basis: 158px; min-height: 0; padding: 6px; border-radius: 14px; }
  .bo-hand-heading { padding-inline: 3px; padding-bottom: 3px; }
  .bo-hand-heading strong { font-size: .74rem; }
  .bo-hand-heading > b { font-size: .68rem; }
  .bo-hand { gap: 7px; padding: 2px 3px 7px; }
  .bo-hand-card { flex-basis: 62px; width: 62px; min-height: 0; padding: 5px; }
  .bo-hand-card .bo-card-back-frame i { width: 25px; height: 25px; font-size: .85rem; }
  .bo-hand-card .bo-card-back-frame b { font-size: .39rem; }
  .bo-selection { margin-left: 5px; padding: 5px 6px; }
  .bo-selection small { font-size: .54rem; }
  .bo-selection strong { font-size: .68rem; }
  .bo-selection span { display: -webkit-box; overflow: hidden; font-size: .57rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .bo-reserve-row { gap: 5px; margin-left: 5px; padding: 5px 6px; }
  .bo-last-cast strong { font-size: .62rem; }
  .bo-core-orb { grid-template-columns: minmax(0,1fr) 31px; gap: 4px; }
  .bo-core-orb > strong { width: 31px; height: 31px; font-size: .78rem; }
  .bo-feedback { min-height: 28px; padding: 5px 8px; font-size: .67rem; }
  .bo-play-actions button { min-height: 41px; font-size: .8rem; }
  .bo-cast-tray, .bo-saved { padding: 4px 6px; }
  .bo-saved { flex-basis: 64px; }
  .bo-mini-card { flex-basis: 36px; width: 36px; }
  .bo-mini-card b { font-size: .65rem; }
  .bo-shop-grid { gap: 12px; padding-inline: 4px; }
  .bo-shop-offer { flex-basis: 174px; padding: 9px; }
  .bo-shop-offer .bo-card { width: 150px; }
  .bo-dialog { padding: 20px 16px; }
  .bo-deck-inspector { grid-template-columns: repeat(2,minmax(0,145px)); }
  .bo-debug-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
