/* Shardfall — epic-whimsical: night-blue glass panels, gold filigree edges,
   sky-blue for the party, crimson for foes. Tokens mirror THEME in data.js. */
@font-face { font-family: "Cinzel Decorative"; src: url(fonts/cinzel-decorative-900.woff2) format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Cinzel Decorative"; src: url(fonts/cinzel-decorative-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url(fonts/cinzel-500.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #0b0f1d;
  --surface: #141a2e;
  --edge: #2d3658;
  --ink: #f3eee2;
  --muted: #a9a8c0;
  --accent: #7fd6ff;
  --reward: #ffcf5a;
  --danger: #ff5a6a;
  --gold: #ffcf5a;
  --gold-dim: #b8913a;
  --glass: rgba(14, 18, 36, 0.86);
  --font-ui: "Lexend", system-ui, sans-serif;
  --font-title: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-head: "Cinzel", Georgia, serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: none;
}
button { font-family: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
#cv, #overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#overlay { pointer-events: none; }
.ico { display: inline-block; width: 1.1em; height: 1.1em; background: currentColor; vertical-align: -0.18em;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.touch .key-only { display: none !important; }
.touch-only { display: none; }
.touch .touch-only { display: flex; }

/* ---------------------------------------------------------------- buttons */
.btn {
  min-height: 48px; min-width: 14rem; padding: 0.7rem 1.6rem; cursor: pointer;
  border: 1px solid var(--gold-dim); border-radius: 10px;
  background: linear-gradient(180deg, rgba(40, 48, 84, 0.95), rgba(20, 24, 46, 0.95));
  color: var(--ink); font-size: 1.02rem; font-weight: 600; letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 120ms, border-color 120ms, box-shadow 160ms;
}
.btn:hover, .btn:focus-visible { border-color: var(--gold); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 1px rgba(255,207,90,.35), 0 8px 24px rgba(0,0,0,.4); }
.btn.primary { background: linear-gradient(180deg, #ffd978, #d99a2b); color: #2a1a06; border-color: #ffe7a6; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.primary:hover { box-shadow: 0 0 22px rgba(255, 207, 90, 0.45), 0 8px 24px rgba(0,0,0,.4); }
.btn.danger { border-color: #8a3040; color: #ffb3bb; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.pill { min-height: 44px; padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--edge); background: var(--glass); cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.pill:hover:not(:disabled) { border-color: var(--gold); }
.pill:disabled { opacity: 0.4; }
.iconbtn, .closebtn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--edge); background: var(--glass); cursor: pointer; font-size: 1.3rem; display: grid; place-items: center; flex: none; }
.iconbtn:hover, .closebtn:hover { border-color: var(--gold); }
.kbd { font-size: 0.72rem; margin-left: 0.2rem; }
a.back { color: var(--muted); font-size: 0.8rem; text-decoration: none; }
a.back:hover { color: var(--gold); }
.seg { min-height: 40px; }
.seg[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #2a1a06; }

/* ---------------------------------------------------------------- screens */
.screen {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  padding: calc(12px + var(--sat)) calc(14px + var(--sar)) calc(12px + var(--sab)) calc(14px + var(--sal));
  background: radial-gradient(ellipse at 50% 30%, rgba(11, 15, 29, 0.25), rgba(6, 8, 18, 0.78));
}
.screen[hidden] { display: none; }
#scrPause, #scrHow { z-index: 40; background: rgba(6, 8, 18, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.scr-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scr-head h2 { margin: 0; font-family: var(--font-head); font-size: 1.4rem; letter-spacing: 0.06em; flex: 1; color: var(--gold); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.scr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }

.title-screen { align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 45%, rgba(8,10,24,0.1), rgba(6,8,18,0.6)); }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.logo {
  margin: 0; font-family: var(--font-title); font-weight: 900; font-size: clamp(3rem, 11vw, 7.2rem); line-height: 0.95; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff7dc 0%, #ffd76a 45%, #d9892b 75%, #8a4a1a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #3a1e0a) drop-shadow(0 0 28px rgba(255, 190, 90, 0.45));
}
.logo span:last-child { background: linear-gradient(180deg, #e6f7ff 0%, #8fd8ff 50%, #3d7ad8 100%); -webkit-background-clip: text; background-clip: text; }
html:not(.rm) .logo { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.tagline { margin: 0 0 6px; max-width: 34rem; color: #e8e2f8; font-size: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.menu-col { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; text-shadow: 0 1px 6px #000; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0; }

/* ---------------------------------------------------------------- draft */
.draft-body { flex: 1; display: flex; gap: 14px; min-height: 0; margin-top: 10px; }
.champ-grid { flex: 1.4; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: max-content; gap: 10px; overflow-y: auto; align-content: start; padding: 2px; }
.champ {
  position: relative; display: flex; gap: 10px; align-items: center; padding: 10px; cursor: pointer; text-align: left;
  border: 1px solid var(--edge); border-radius: 12px; background: var(--glass); min-height: 96px;
  transition: border-color 120ms, transform 120ms, box-shadow 160ms;
}
.champ:hover { border-color: var(--gold-dim); }
.champ.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(255, 207, 90, 0.3); }
.champ.sel::after { content: ""; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold) url(ui/check.svg) center / 14px no-repeat; }
.champ canvas { width: 72px; height: 72px; image-rendering: pixelated; flex: none; background: radial-gradient(circle at 50% 70%, rgba(255,255,255,.12), transparent 70%); border-radius: 10px; }
.champ .cname { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.champ .ctitle { color: var(--muted); font-size: 0.8rem; }
.champ .crole { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }
.champ .cicons { display: flex; gap: 4px; margin-top: 6px; }
.champ .cicons .ico { width: 18px; height: 18px; opacity: 0.85; }
.champ-detail { flex: 1; border: 1px solid var(--edge); border-radius: 12px; background: var(--glass); padding: 14px; overflow-y: auto; }
.champ-detail h3 { margin: 0; font-family: var(--font-head); font-size: 1.3rem; }
.champ-detail .lore { color: var(--muted); font-style: italic; font-size: 0.85rem; margin: 4px 0 10px; }
.skill-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.skill-row .sicon { flex: none; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--edge); background: rgba(0,0,0,.25); }
.skill-row .sicon .ico { width: 26px; height: 26px; }
.skill-row b { font-size: 0.92rem; }
.skill-row .slot { font-size: 0.7rem; color: var(--gold); margin-right: 4px; }
.skill-row p { margin: 2px 0 0; font-size: 0.82rem; color: #cfcbe0; line-height: 1.35; }
.picks { display: flex; gap: 8px; }
.picks canvas { width: 48px; height: 48px; image-rendering: pixelated; border: 1px solid var(--gold-dim); border-radius: 10px; background: var(--glass); }
.picks .empty { width: 48px; height: 48px; border: 1px dashed var(--edge); border-radius: 10px; }

/* ---------------------------------------------------------------- map */
.map-screen { background: linear-gradient(180deg, rgba(6,8,18,0.35), rgba(6,8,18,0.15) 40%, rgba(6,8,18,0.55)); }
.actname { flex: 1; text-align: center; }
.actname small { color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.72rem; }
.actname h2 { margin: 0; font-family: var(--font-head); color: var(--gold); font-size: 1.5rem; text-shadow: 0 2px 10px #000; }
.gold { display: flex; gap: 6px; align-items: center; font-size: 1.15rem; color: var(--gold); padding: 6px 12px; border: 1px solid var(--edge); border-radius: 999px; background: var(--glass); }
.map-wrap { position: relative; flex: 1; margin: 8px 0; min-height: 0; border-radius: 18px; background: radial-gradient(ellipse at center, rgba(8, 10, 24, 0.45), rgba(8, 10, 24, 0.15) 70%, transparent); }
#mapLines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#mapNodes { position: absolute; inset: 0; }
.node {
  position: absolute; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; border: 2px solid var(--edge); background: #10152a; color: var(--muted);
  box-shadow: 0 4px 12px rgba(0,0,0,.5); transition: transform 120ms;
}
.node .ico { width: 28px; height: 28px; }
.node.boss { width: 76px; height: 76px; }
.node.boss .ico { width: 42px; height: 42px; }
.node.reach { color: var(--ink); border-color: var(--gold); background: radial-gradient(circle, #2a3260, #141a36); }
html:not(.rm) .node.reach { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 207, 90, 0.18), 0 0 22px rgba(255, 207, 90, 0.45); } }
.node.reach:hover, .node.reach:focus-visible { transform: translate(-50%, -50%) scale(1.1); }
.node.done { opacity: 0.55; }
.node.done::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold) url(ui/check.svg) center / 12px no-repeat; }
.node.cur { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 214, 255, 0.4); opacity: 1; }
.node.locked { cursor: default; opacity: 0.8; }
.node .nlabel { position: absolute; top: 100%; margin-top: 4px; font-size: 0.66rem; white-space: nowrap; color: #d9d4ea; padding: 1px 7px; border-radius: 999px; background: rgba(10, 12, 26, 0.72); }
.node.reach .nlabel { color: var(--gold); }
.t-battle { --c: #e8e2f8; } .t-elite { --c: #ff8a5a; } .t-boss { --c: #ff5a6a; } .t-shrine { --c: #c9a4ff; }
.t-merchant { --c: #ffcf5a; } .t-forge { --c: #7fd6ff; } .t-rest { --c: #8dff9a; }
.node .ico { color: var(--c); }
.map-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.party-strip { display: flex; gap: 8px; }
.pcard { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border: 1px solid var(--edge); border-radius: 12px; background: var(--glass); }
.pcard canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.pcard .pname { font-size: 0.8rem; font-weight: 600; }
.pcard .hpbar { width: 76px; height: 7px; border-radius: 4px; background: #2a2238; overflow: hidden; margin-top: 3px; }
.pcard .hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #5fd3ff, #9ff0ff); }
.pcard .hpnum { font-size: 0.7rem; color: var(--muted); }
.pcard.dead { opacity: 0.5; filter: grayscale(1); }
.relic-strip { display: flex; gap: 6px; flex-wrap: wrap; max-width: 50%; justify-content: flex-end; }
.relic { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--gold-dim); background: var(--glass); display: grid; place-items: center; color: var(--gold); cursor: pointer; position: relative; }
.relic .ico { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- choice sheets */
#scrChoice, #scrEnd { align-items: center; justify-content: center; background: rgba(6, 8, 18, 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.choice-wrap { width: min(62rem, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px; border: 1px solid var(--gold-dim); border-radius: 16px; background: linear-gradient(180deg, rgba(22,28,52,.96), rgba(12,15,30,.96)); box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08); }
.choice-wrap h2 { margin: 0; font-family: var(--font-head); color: var(--gold); font-size: 1.6rem; text-align: center; }
.choice-wrap h2.big { font-family: var(--font-title); font-size: clamp(2rem, 7vw, 3.4rem); }
.choice-text { margin: 0; color: #d9d4ea; text-align: center; max-width: 44rem; line-height: 1.5; }
.cards { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.card {
  flex: 1 1 13rem; max-width: 17rem; min-height: 11rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; cursor: pointer;
  padding: 14px 12px; border: 1px solid var(--edge); border-radius: 14px; background: linear-gradient(180deg, rgba(40,48,84,.6), rgba(16,20,40,.8));
  transition: transform 140ms, border-color 140ms, box-shadow 160ms;
}
.card:hover:not(:disabled), .card:focus-visible { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 0 24px rgba(255, 207, 90, 0.25); }
.card:disabled { opacity: 0.5; cursor: default; }
.card .cico { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; background: rgba(0,0,0,.3); border: 1px solid var(--edge); }
.card .cico .ico { width: 38px; height: 38px; }
.card .ctitle { font-weight: 700; font-size: 1rem; }
.card .csub { font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.card .ctext { font-size: 0.84rem; color: #cfcbe0; line-height: 1.4; }
.card .price { margin-top: auto; display: flex; gap: 5px; align-items: center; color: var(--gold); font-weight: 700; }
.card .price.poor { color: var(--muted); }
.card .price.poor::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url(ui/lock.svg) center / contain no-repeat; mask: url(ui/lock.svg) center / contain no-repeat; }
.card.bought { border-color: #5a7a4a; }
.card.bought .price::before { content: ""; width: 14px; height: 14px; background: #8dff9a; -webkit-mask: url(ui/check.svg) center / contain no-repeat; mask: url(ui/check.svg) center / contain no-repeat; }
.choice-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.choice-foot .btn { min-width: 10rem; }
.end-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 10px; width: 100%; max-width: 36rem; }
.end-stats div { padding: 10px; border: 1px solid var(--edge); border-radius: 10px; text-align: center; background: rgba(0,0,0,.2); }
.end-stats b { display: block; font-size: 1.5rem; color: var(--gold); }
.end-stats span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.how-wrap, .pause-wrap { align-items: stretch; max-width: 46rem; }
#scrHow, #scrPause { align-items: center; justify-content: center; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { flex: 1; text-align: left; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 12px; }
.how-grid h3 { margin: 0 0 4px; font-family: var(--font-head); color: var(--gold); font-size: 1.05rem; }
.how-grid p { margin: 0 0 6px; color: #d9d4ea; font-size: 0.9rem; line-height: 1.45; }
.settings { display: flex; flex-direction: column; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--edge); }
.setrow { display: grid; grid-template-columns: 6rem 1fr 3rem; align-items: center; gap: 12px; min-height: 44px; }
.setrow b { text-align: right; color: var(--gold); font-weight: 600; }
.settings .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.pause-wrap .menu-col .btn { width: 100%; }
.pause-wrap a.back { text-align: center; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud[hidden] { display: none; }
#hud button { pointer-events: auto; }
.hud-top { position: absolute; top: calc(8px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); display: flex; gap: 10px; align-items: flex-start; }
.teams { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--glass); border: 1px solid var(--edge); }
.teambar { display: flex; align-items: center; gap: 8px; }
.tlabel { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); width: 2.6rem; }
.track { width: 120px; height: 8px; border-radius: 4px; background: #231c33; overflow: hidden; }
.track i { display: block; height: 100%; width: 100%; transition: width 400ms; }
.teambar.p i { background: linear-gradient(90deg, #3aa8e8, #9ff0ff); }
.teambar.e i { background: linear-gradient(90deg, #c02a3a, #ff8a8a); }
.turninfo { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#turnName { padding: 4px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
#turnName.p { color: var(--accent); border-color: rgba(127,214,255,.5); }
#turnName.e { color: var(--danger); border-color: rgba(255,90,106,.5); }
#timer { font-size: 1.5rem; font-weight: 800; text-shadow: 0 2px 6px #000; min-width: 2.5ch; text-align: center; }
#timer.low { color: var(--danger); }
#timer.off { opacity: 0; }
.wind { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--glass); border: 1px solid var(--edge); }
.windbar { position: relative; width: 130px; height: 10px; border-radius: 5px; background: #231c33; overflow: hidden; }
.windbar i { position: absolute; top: 0; bottom: 0; }
#windL { right: 50%; background: linear-gradient(270deg, #7fd6ff, #d8f4ff); }
#windR { left: 50%; background: linear-gradient(90deg, #7fd6ff, #d8f4ff); }
.windbar b { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--gold); }
#banner { position: absolute; top: 24%; left: 0; right: 0; text-align: center; pointer-events: none; opacity: 0; transition: opacity 250ms, transform 250ms; transform: scale(0.92); }
#banner.show { opacity: 1; transform: scale(1); }
#banner .bt { font-family: var(--font-title); font-weight: 900; font-size: clamp(2rem, 6vw, 3.6rem); color: #fff4d6; text-shadow: 0 3px 0 #3a1e0a, 0 0 24px rgba(255,190,90,.6); }
#banner .bs { font-family: var(--font-head); font-size: clamp(0.9rem, 2.4vw, 1.2rem); color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 2px 6px #000; }
#banner.danger .bt { color: #ffd6f0; text-shadow: 0 3px 0 #3a0a2a, 0 0 24px rgba(200,90,255,.7); }
html.rm #banner { transition: opacity 200ms; transform: none; }
#toast { position: fixed; z-index: 60; top: calc(78px + var(--sat)); left: 50%; transform: translate(-50%, -12px); padding: 8px 16px; border-radius: 999px; background: rgba(14,18,36,.95); border: 1px solid var(--gold-dim); font-size: 0.9rem; opacity: 0; transition: opacity 200ms, transform 200ms; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.hud-bottom { position: absolute; left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); bottom: calc(8px + var(--sab)); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.dock { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 auto; }
#walkbar { width: 180px; height: 5px; border-radius: 3px; background: rgba(35,28,51,.85); overflow: hidden; }
#walkbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf5a, #fff0b8); width: 100%; }
#skillbar { display: flex; gap: 8px; padding: 6px; border-radius: 16px; background: var(--glass); border: 1px solid var(--edge); }
.skill {
  position: relative; width: 62px; height: 62px; border-radius: 12px; cursor: pointer; display: grid; place-items: center;
  border: 1px solid var(--edge); background: linear-gradient(180deg, #232a4a, #151a32); color: var(--ink);
}
.skill .ico { width: 34px; height: 34px; }
.skill .key { position: absolute; left: 4px; top: 3px; font-size: 0.64rem; font-weight: 700; color: var(--gold); }
.skill.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255, 207, 90, 0.5); }
.skill:disabled { cursor: default; }
.skill.cool .ico, .skill.used .ico { opacity: 0.28; }
.skill .cd { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: #fff; text-shadow: 0 2px 4px #000; }
.skill .ring { position: absolute; inset: -3px; border-radius: 14px; pointer-events: none; }
.skill.ult.ready { border-color: #ffcf5a; }
html:not(.rm) .skill.ult.ready { animation: ultglow 1.2s ease-in-out infinite; }
@keyframes ultglow { 50% { box-shadow: 0 0 20px rgba(255, 207, 90, 0.8); } }
.skill .ultfill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0 0 11px 11px; background: linear-gradient(0deg, rgba(255,207,90,.45), rgba(255,207,90,.1)); pointer-events: none; }
.skill .free { position: absolute; right: 3px; bottom: 2px; font-size: 0.56rem; color: var(--accent); font-weight: 700; }
#skillTip { position: absolute; left: 50%; top: calc(92px + var(--sat)); transform: translateX(-50%); max-width: min(26rem, 92vw); padding: 8px 12px; border-radius: 10px; background: rgba(14,18,36,.95); border: 1px solid var(--edge); font-size: 0.82rem; text-align: center; pointer-events: none; }
#skillTip b { color: var(--gold); }
.sidebtns { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#movepad { gap: 8px; align-items: flex-end; }
.padbtn { width: 60px; height: 60px; border-radius: 16px; border: 1px solid var(--edge); background: var(--glass); font-size: 1.3rem; cursor: pointer; touch-action: none; }
.padbtn.on { border-color: var(--gold); background: rgba(255, 207, 90, 0.2); }
#hud.enemy .dock, #hud.enemy .sidebtns, #hud.enemy #movepad { opacity: 0.35; pointer-events: none; }
#hud.enemy .dock button, #hud.enemy .sidebtns button, #hud.enemy #movepad button { pointer-events: none; }
#rotateHint { position: fixed; z-index: 70; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(14,18,36,.92); border: 1px solid var(--gold-dim); font-size: 0.8rem; pointer-events: none; white-space: nowrap; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px), (max-height: 520px) {
  .champ-grid { grid-template-columns: repeat(2, 1fr); }
  .champ { min-height: 80px; padding: 8px; }
  .champ canvas { width: 56px; height: 56px; }
  .track { width: 80px; }
  .windbar { width: 90px; }
  .btn { min-width: 12rem; min-height: 44px; padding: 0.55rem 1.2rem; }
}
@media (max-height: 520px) {
  .screen { padding-top: calc(6px + var(--sat)); padding-bottom: calc(6px + var(--sab)); }
  .logo { font-size: clamp(2.4rem, 9vh, 4.4rem); }
  .tagline { font-size: 0.85rem; }
  .title-wrap { gap: 8px; }
  .menu-col { gap: 7px; }
  .skill { width: 52px; height: 52px; }
  .skill .ico { width: 28px; height: 28px; }
  .padbtn { width: 52px; height: 52px; }
  #skillTip { top: calc(74px + var(--sat)); font-size: 0.74rem; padding: 5px 10px; }
  .champ .ctitle { display: none; }
  .champ .cname { font-size: 0.98rem; }
  .champ .crole { font-size: 0.64rem; }
  .champ .cicons .ico { width: 15px; height: 15px; }
  .teams { padding: 4px 8px; }
  .wind { padding: 4px 8px; }
  #timer { font-size: 1.2rem; }
  .node { width: 46px; height: 46px; }
  .node .ico { width: 24px; height: 24px; }
  .node.boss { width: 62px; height: 62px; }
  .pcard canvas { width: 32px; height: 32px; }
  .pcard .hpbar { width: 56px; }
  .scr-head h2, .actname h2 { font-size: 1.15rem; }
  .card { min-height: 9rem; padding: 10px; }
  .card .cico { width: 46px; height: 46px; }
  .choice-wrap { padding: 12px; gap: 8px; }
  .draft-body { margin-top: 6px; }
}
@media (max-width: 640px) {
  .draft-body { flex-direction: column; }
  .champ-detail { flex: none; max-height: 40vh; }
  .champ-grid { grid-template-columns: repeat(2, 1fr); }
  .hud-top { flex-wrap: wrap; }
  .relic-strip { max-width: 100%; justify-content: flex-start; }
  .sidebtns .pill { font-size: 0.78rem; }
}
