/* Frogs on Ice: single dark look (a night-time frozen lake). */
:root {
  color-scheme: dark;
  --bg: #06111c;
  --ink: #eef7fb;
  --muted: #9fb8c8;
  --faint: #5f7a8c;
  --grey-name: #8198a9;   /* guests and bots, wherever names are listed */
  --panel: rgba(8, 22, 36, 0.88);
  --panel-2: #0c1e30;
  --panel-3: #11283d;
  --line: rgba(190, 232, 255, 0.14);
  --line-2: rgba(190, 232, 255, 0.3);
  --ice: #cdeefc;
  --ice-2: #8fcbe6;
  --carrot: #ff7a2e;
  --carrot-hi: #ffac5e;
  --carrot-ink: #2a1004;
  --common: #c3d2dc;
  --rare: #52c6ff;
  --epic: #b68cff;
  --legendary: #ffcb4d;
  --pact: #ff4f6d;
  --good: #7fe3a8;
  --frog: #8fe36f;
  --display: 'Bagel Fat One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --ui: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
kbd {
  font-family: var(--ui); font-weight: 700; font-size: 0.72em; letter-spacing: 0.02em;
  display: inline-block; min-width: 1.6em; padding: 0.12em 0.45em; text-align: center;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
  background: rgba(205, 238, 252, 0.06); color: var(--ink);
}

#app { position: fixed; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
body.playing #game { cursor: none; }
/* The UI grows with the window (js/ui/scale.js sets --ui-zoom); the game canvas does not.
   Inside these layers vw/vh grow with the zoom too, so px caps do the limiting. */
#hud, .screen, #practice, #pr-open, .notice-overlay { zoom: var(--ui-zoom, 1); }

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding-block: 24px; padding-inline: 16px; overflow: auto;
}
.screen.dim { background: radial-gradient(ellipse at 50% 40%, rgba(6, 17, 28, 0.55), rgba(6, 17, 28, 0.93) 70%); }
.screen.menu {
  justify-content: flex-start;
  background: linear-gradient(90deg, rgba(6, 17, 28, 0.94) 0%, rgba(6, 17, 28, 0.78) 42%, rgba(6, 17, 28, 0.15) 78%, rgba(6, 17, 28, 0.35) 100%);
}

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ice-2);
}
h2 {
  font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 44px); line-height: 1;
  margin: 6px 0 14px; text-wrap: balance; letter-spacing: 0.01em;
}
.fine { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 62ch; margin: 0 0 14px; }

/* ---------- Menu ---------- */
.menu-grid {
  width: min(1060px, 56vw); margin-inline: clamp(0px, 3vw, 48px) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); gap: 32px; align-items: center;
}
.menu .title { font-size: clamp(64px, 7.4vw, 136px); }
.menu-brand { max-width: 560px; }
.title {
  font-family: var(--display); font-weight: 400; margin: 10px 0 14px;
  font-size: clamp(64px, 11vw, 150px); line-height: 0.86; letter-spacing: 0.005em;
  background: linear-gradient(180deg, #ffffff 0%, #d9f3ff 45%, #7cc4e4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(4, 40, 66, 0.9)) drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
  text-wrap: balance;
}
.title-pre {
  display: block; font-size: 0.34em; line-height: 1; margin-bottom: 0.08em; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #d9ffb8 0%, var(--frog) 60%, #4fae3c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { font-size: 18px; line-height: 1.5; color: var(--ink); max-width: 46ch; margin: 0 0 22px; }
.rules-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 52ch; }
.rules-list li {
  color: var(--muted); font-size: 14.5px; line-height: 1.45;
  padding-left: 18px; position: relative;
}
.rules-list li::before {
  content: ''; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px;
  background: var(--carrot); border-radius: 2px; transform: rotate(45deg);
}
.rules-list b { color: var(--ink); font-weight: 700; }

.menu-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; display: grid; gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}
.field { display: grid; gap: 8px; }
.field.two { grid-template-columns: 1fr 1fr; gap: 16px; }
.field.two > div { display: grid; gap: 8px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 13px; color: var(--faint); line-height: 1.5; }

#player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#player-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px;
}
#player-list .who { font-weight: 700; }
#player-list .dev { color: var(--muted); margin-left: auto; font-size: 13px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }

.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button {
  flex: 1 1 auto; min-width: 40px; border: 0; background: transparent; color: var(--muted);
  padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.seg button:hover { color: var(--ink); background: rgba(205, 238, 252, 0.06); }
.seg button[aria-pressed="true"] { background: var(--ice); color: #06243a; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1.4; }
.check input { accent-color: var(--carrot); width: 16px; height: 16px; margin: 2px 0 0; }

.menu-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  border: 1px solid var(--line-2); background: var(--panel-3); color: var(--ink);
  padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { background: #173552; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--carrot); border-color: transparent; color: var(--carrot-ink);
  box-shadow: 0 4px 0 #a8420f, 0 10px 24px rgba(255, 122, 46, 0.25);
}
.btn.primary:hover { background: var(--carrot-hi); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #a8420f; }
.btn.primary kbd { border-color: rgba(42, 16, 4, 0.35); background: rgba(42, 16, 4, 0.08); color: var(--carrot-ink); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
#howto { border-top: 1px solid var(--line); padding-top: 14px; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; }
.keys th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 0; width: 30%; }
.keys td { padding: 4px 0; }
.keys td kbd { margin-right: 3px; }
.keys td.pad { color: var(--faint); text-align: right; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#hud-round {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
#omen-label { color: var(--carrot-hi); font-weight: 600; }
#omen-label:empty { display: none; }

/* As wide as the longest name needs (within limits); the rows share one set of columns. */
#scoreboard {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px;
  width: max-content; min-width: 210px; max-width: min(340px, 42vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; column-gap: 8px; row-gap: 2px; font-size: 13.5px;
}
#scoreboard.online { grid-template-columns: 12px minmax(0, 1fr) auto auto auto; }
.sb-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 4px 6px; border-radius: 8px; }
#scoreboard .ping { text-align: right; }
/* The round (and its omen) at the top of the scoreboard. */
.sb-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 2px 6px 7px; margin-bottom: 3px; border-bottom: 1px solid var(--line); }
.sb-head b { font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.sb-head b span { font-family: var(--ui); font-weight: 700; font-size: 13px; color: var(--muted); }
.sb-omen { font-size: 12.5px; font-weight: 700; color: var(--carrot-hi); cursor: help; pointer-events: auto; }
.sb-head small { font-size: 11.5px; color: var(--faint); }
.ping { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--faint); white-space: nowrap; }
.ping.good { color: var(--good); }
.ping.ok { color: var(--legendary); }
.ping.bad { color: #ff8fa3; }
.ping.bot { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
.sb-row.me { background: rgba(205, 238, 252, 0.07); }
.sb-row.out { opacity: 0.42; }
.sb-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.nm.grey, .nmcell.grey, .grey { color: var(--grey-name); }
.sb-row .hp { width: 34px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.sb-row .hp i { display: block; height: 100%; background: var(--ice); }
.sb-row .pts { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

#killfeed {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px;
  display: grid; gap: 4px; max-width: min(360px, 40vw);
}
.kf { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; font-size: 13px; animation: kfin 0.25s ease-out; }
.kf b { font-weight: 800; }
.kf .verb { color: var(--muted); }
@keyframes kfin { from { transform: translateX(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

#banner {
  position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%);
  text-align: center; opacity: 0; transition: opacity 0.25s ease; width: min(90vw, 760px);
}
#banner.show { opacity: 1; }
#banner-title {
  font-family: var(--display); font-size: clamp(44px, 8vw, 96px); line-height: 1; color: #fff;
  text-shadow: 0 5px 0 rgba(4, 40, 66, 0.9), 0 12px 40px rgba(0, 0, 0, 0.6);
}
#banner-sub { margin-top: 10px; font-size: 17px; font-weight: 600; color: var(--ice); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
#banner-sub .omen { color: var(--carrot-hi); }
/* The round's countdown under the banner once the clip is closed: the same pill and big 3, 2, 1 as on the clip. */
#banner-count { margin-top: 12px; min-height: 1px; font-variant-numeric: tabular-nums; }
#banner-count.soon span {
  display: inline-block; font-size: 15px; font-weight: 800; color: #fff; padding: 5px 12px; border-radius: 999px;
  background: rgba(6, 17, 28, 0.72); border: 1px solid var(--line-2);
}
#banner-count.big span {
  display: inline-block; font-family: var(--display); font-size: 116px; line-height: 1; color: #fff;
  text-shadow: 0 5px 0 rgba(4, 40, 66, 0.9), 0 10px 32px rgba(0, 0, 0, 0.6);
  animation: lpcount 1s ease-out forwards;
}
/* This match's movement spell (learning round), on the clip and under the banner. */
.move-kit, #lp-kit { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--ice); }
#lp-kit { justify-content: flex-start; margin: 0 0 10px; }
#lp-kit .move-kit { margin: 0; justify-content: flex-start; }
.move-kit .kit-chip { text-shadow: none; }
button.kit-chip { font: inherit; cursor: pointer; }
button.kit-chip:hover, button.kit-chip:focus-visible { border-color: var(--ice-2); background: var(--panel-3); }
.kit-play { font-size: 10px; color: var(--ice-2); margin-left: 2px; }
#banner-sub .move-kit { width: fit-content; margin: 10px auto 0; padding: 6px 8px 6px 16px; border-radius: 999px; background: rgba(8, 22, 36, 0.88); border: 1px solid var(--line-2); text-shadow: none; }
/* Learning round: the spell everyone got */
.learn-card {
  display: flex; align-items: center; gap: 16px; text-align: left; margin: 6px auto 14px; width: fit-content; max-width: 100%;
  padding: 14px 20px 14px 14px; border-radius: 18px; background: rgba(8, 22, 36, 0.9); border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ic) 35%, transparent), 0 14px 40px rgba(0, 0, 0, 0.45);
  animation: dealin 0.45s ease-out;
}
.lc-icon { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--ic); background: rgba(205, 238, 252, 0.07); }
.lc-icon svg { width: 38px; height: 38px; }
.lc-tag { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lc-tag kbd { margin-left: 6px; letter-spacing: 0; font-size: 12px; }
.lc-name { font-family: var(--display); font-size: 30px; line-height: 1.1; color: #fff; text-shadow: none; }
.lc-desc { font-size: 15px; font-weight: 500; color: var(--ice); text-shadow: none; }

#callout {
  position: absolute; left: 50%; top: 20%; transform: translateX(-50%);
  font-family: var(--display); font-size: clamp(28px, 4.5vw, 48px); letter-spacing: 0.02em; white-space: nowrap;
  color: var(--carrot-hi); text-shadow: 0 4px 0 rgba(60, 20, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
}
#callout.pop { animation: pop 1.3s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  12% { opacity: 1; transform: translateX(-50%) scale(1.12); }
  22% { transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}
#netstat {
  position: absolute; left: 12px; bottom: 10px; font-size: 12px; font-weight: 600; color: var(--muted);
  background: rgba(6, 17, 28, 0.7); padding: 4px 8px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.settings { display: grid; gap: 16px; margin-bottom: 4px; }
.settings .check b { color: var(--ink); }
#spectate {
  position: absolute; left: 50%; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-size: 14px; color: var(--muted); white-space: nowrap;
}

#spellbars {
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; gap: 22px; align-items: flex-end; max-width: calc(100vw - 32px);
}
.bar { display: grid; gap: 6px; justify-items: center; }
.bar-tag { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; display: flex; gap: 6px; align-items: center; }
.bar-slots { display: flex; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 7px; }
.slot {
  position: relative; width: 62px; height: 62px; border-radius: 12px; overflow: hidden;
  background: var(--panel-3); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--slot-c, var(--ice));
}
.slot svg { width: 33px; height: 33px; }
.slot.empty { color: var(--faint); background: transparent; border-style: dashed; }
.slot.empty .slot-name { display: block; }
.slot-name { display: none; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.slot .cd {
  position: absolute; inset: 0; background: conic-gradient(rgba(3, 10, 18, 0.78) calc(var(--cd, 0) * 1turn), transparent 0);
}
.slot .cdn { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #000; }
.slot .key {
  position: absolute; left: 3px; bottom: 2px; font-size: 11.5px; font-weight: 800; color: var(--muted);
  background: rgba(3, 10, 18, 0.7); padding: 0 4px; border-radius: 4px;
}
.slot .pips { position: absolute; top: 3px; right: 4px; display: flex; gap: 2px; }
.slot .pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--carrot-hi); }
.slot.ready { box-shadow: inset 0 0 0 1px rgba(205, 238, 252, 0.25); }
.slot.flash { animation: slotflash 0.35s ease-out; }
.slot.fresh { animation: freshslot 1.1s ease-in-out 5; }
@keyframes freshslot { 50% { box-shadow: inset 0 0 0 2px var(--slot-c, #fff), 0 0 18px var(--slot-c, #fff); } }
@keyframes slotflash { from { box-shadow: inset 0 0 0 2px #fff, 0 0 16px rgba(205, 238, 252, 0.6); } to { box-shadow: inset 0 0 0 1px rgba(205, 238, 252, 0.25); } }

/* ---------- Draft ---------- */
.draft { width: min(1100px, 100%); display: grid; gap: 22px; }
.draft-head { text-align: center; display: grid; justify-items: center; gap: 2px; }
.draft-head h2 { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.draft-head h2 .swatch { width: 18px; height: 18px; }
#draft-note { font-size: 14px; color: var(--muted); }
#draft-note:empty { display: none; }
#draft-cards { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.card {
  --rc: var(--common);
  position: relative; width: 220px; min-height: 238px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: inset 0 3px 0 var(--rc), 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  animation: dealin 0.35s ease-out backwards;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
@keyframes dealin { from { transform: translateY(24px) rotate(-2deg); opacity: 0; } }
.card:hover, .card.sel { transform: translateY(-6px); border-color: var(--rc); box-shadow: inset 0 3px 0 var(--rc), 0 0 0 1px var(--rc), 0 24px 50px rgba(0, 0, 0, 0.45); }
.card.r-rare { --rc: var(--rare); }
.card.r-epic { --rc: var(--epic); }
.card.r-legendary { --rc: var(--legendary); }
.card.t-pact { --rc: var(--pact); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.card-type { color: var(--muted); }
.card-rarity { color: var(--rc); }
.card-icon {
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  color: var(--ic, var(--ice)); background: rgba(205, 238, 252, 0.06); border: 1px solid var(--line);
}
.card-icon svg { width: 36px; height: 36px; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.05; margin: 2px 0 0; letter-spacing: 0.01em; }
.card p { margin: 0 0 22px; font-size: 15px; line-height: 1.4; color: var(--ink); }
.card > kbd { position: absolute; right: 12px; bottom: 12px; }
.draft-foot { display: grid; justify-items: center; }

/* Action bar preview in the draft: shows where a highlighted card lands, and lets you swap keys. */
.loadout { display: grid; gap: 12px; justify-items: center; width: 100%; }
.loadout-slots {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px;
}
.lslot {
  --ic: var(--faint);
  width: 106px; min-height: 112px; padding: 7px 6px 8px; border-radius: 12px; cursor: pointer; text-align: center;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--ink);
  display: grid; justify-items: center; align-content: start; gap: 4px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.lslot:hover { border-color: var(--line-2); }
.lslot .lhead { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 4px; }
.lslot .lkey { font-size: 10.5px; font-weight: 800; color: var(--ink); background: rgba(3, 10, 18, 0.75); border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 5px; }
.lslot .lcat { font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.lslot .lic { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ic); }
.lslot .lic svg { width: 30px; height: 30px; }
.lslot .lname { font-size: 12px; font-weight: 700; line-height: 1.2; }
.lslot .lname b { color: var(--carrot-hi); font-weight: 800; }
.lslot .lbadge { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--carrot); color: var(--carrot-ink); white-space: nowrap; }
.lslot.empty { background: transparent; border-style: dashed; }
.lslot.empty .lname { color: var(--faint); font-weight: 600; }
.lslot.target { border-color: var(--carrot-hi); border-style: solid; background: var(--panel-3); transform: translateY(-5px); box-shadow: 0 0 0 1px var(--carrot-hi), 0 10px 26px rgba(255, 172, 94, 0.28); }
.lslot.target .lic { animation: ghost 0.9s ease-in-out infinite alternate; }
.lslot.target.t-new .lbadge { background: var(--good); color: #05301a; }
.lslot.target.t-empower .lbadge { background: var(--legendary); color: #2f2100; }
.lslot.target.t-rune .lbadge { background: var(--epic); color: #1b0b33; }
.lslot.picking { outline: 2px dashed var(--ice); outline-offset: 3px; }
.lslot.cursor { box-shadow: inset 0 0 0 2px var(--ice); }
@keyframes ghost { from { opacity: 0.45; transform: scale(0.92); } to { opacity: 1; transform: scale(1.05); } }
.loadout-side { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; }
.loadout-passives { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.loadout-passives .none { font-size: 12.5px; color: var(--faint); }
.loadout-hint { font-size: 12.5px; color: var(--muted); }
.chip.preview { border-color: var(--carrot-hi); box-shadow: 0 0 0 1px var(--carrot-hi); animation: ghost 0.9s ease-in-out infinite alternate; }
@media (max-width: 720px) { .lslot { width: calc(33.33% - 6px); } }
@media (prefers-reduced-motion: reduce) { .lslot.target .lic, .chip.preview { animation: none; } }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 6px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600;
}
.chip svg { width: 16px; height: 16px; color: var(--ic, var(--ice)); }
.chip .lv { color: var(--carrot-hi); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Practice Pond spellbook ---------- */
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
/* The whole height of the window on the right, packed tight enough not to scroll (it only scrolls in a
   very short window); the spell bar moves over to stay clear of it (body.practice-panel). */
#practice {
  position: absolute; z-index: 7; top: calc(12px + env(safe-area-inset-top, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); right: 12px;
  width: min(340px, calc(100vw - 24px)); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
}
body.practice-panel #spellbars { left: calc((100% - 364px) / 2); }
#pr-open { position: absolute; z-index: 7; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.pr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pr-head h3 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; margin: 4px 0 0; }
.pr-hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.pr-toggles { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pr-slot { display: grid; gap: 5px; padding-top: 7px; border-top: 1px solid var(--line); }
.pr-slot-head { display: flex; gap: 8px; align-items: center; font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pr-slot-head .lkey { font-size: 10.5px; font-weight: 800; color: var(--ink); background: rgba(3, 10, 18, 0.75); border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 5px; letter-spacing: 0; }
.pr-spells { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-spell {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 700;
}
.pr-spell:hover { border-color: var(--line-2); }
.pr-spell svg { width: 16px; height: 16px; color: var(--ic, var(--ice)); }
.pr-spell.on { background: var(--ice); color: #06243a; border-color: transparent; }
.pr-spell.on svg { color: #06243a; }
.pr-mods { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pr-level { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pr-level button, .pr-rune {
  border: 1px solid var(--line-2); background: var(--panel-3); color: var(--ink); border-radius: 8px;
  font-size: 12px; font-weight: 700; padding: 3px 9px; cursor: pointer;
}
.pr-level button:disabled { opacity: 0.35; cursor: default; }
.pr-rune.on { background: var(--epic); color: #1b0b33; border-color: transparent; }
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; margin-top: auto; border-top: 1px solid var(--line); }
.pr-spell:focus-visible, .pr-rune:focus-visible, .pr-level button:focus-visible { outline: 2px solid var(--carrot-hi); outline-offset: 2px; }

/* ---------- Sheets (results, final, grimoire, pause) ---------- */
.sheet {
  width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.sheet.wide { width: min(980px, 100%); }
.sheet.narrow { width: min(460px, 100%); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.table-wrap { overflow-x: auto; }
.standings { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.standings th { text-align: left; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.standings td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.standings td.num, .standings th.num { text-align: right; }
.standings tr.me td { background: rgba(205, 238, 252, 0.05); }
.standings .nmcell { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.standings .gain { color: var(--good); font-weight: 800; }
.standings .place { font-family: var(--display); font-size: 18px; color: var(--muted); width: 2.4em; }
.standings tr:first-child .place { color: var(--legendary); }

/* ---------- Final standings: the podium scene on the canvas (ui/podium.js), the standings beside it ---------- */
#screen-final { display: block; padding: 0; overflow: hidden; background: linear-gradient(90deg, rgba(6, 17, 28, 0) 50%, rgba(6, 17, 28, 0.45)); }
.podium-head {
  position: absolute; top: 14px; left: 16px; right: calc(min(400px, 42vw) + 40px); width: fit-content; max-width: calc(100% - 32px); margin-inline: auto;
  padding: 10px 22px 12px; border-radius: 18px; background: rgba(6, 17, 28, 0.72); border: 1px solid var(--line);
  text-align: center; pointer-events: none;
}
.podium-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin: 6px 0 0; }
.final-board {
  position: absolute; top: 16px; right: 16px; bottom: 16px; width: min(400px, 42vw);
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); animation: boardin 0.5s ease-out;
}
@keyframes boardin { from { opacity: 0; transform: translateX(24px); } }
.final-board .section-title { margin: 0 0 2px; }
.final-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.final-rows li {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 7px;
  padding: 9px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line);
}
.final-rows li.me { background: var(--panel-3); border-color: var(--line-2); }
.final-rows .place { font-family: var(--display); font-size: 20px; line-height: 1; color: var(--muted); width: 1.2em; text-align: center; }
.final-rows li:nth-child(1) .place { color: #ffd23f; }
.final-rows li:nth-child(2) .place { color: #cfe3ee; }
.final-rows li:nth-child(3) .place { color: #e39a5b; }
.fr-main { display: grid; min-width: 0; }
.fr-main .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-main small { font-size: 12px; color: var(--muted); }
.fr-pts { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-pts b { font-size: 17px; color: var(--ink); }
.fr-xp { grid-column: 3 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fr-xp .xpbar { flex: 1; }
.fr-lv { display: inline-block; min-width: 3.3em; }
.fr-gain { min-width: 5.2em; text-align: right; white-space: nowrap; color: var(--good); }
.fr-xp.up .fr-lv { color: var(--legendary); animation: lvup 0.6s ease-out; }
@keyframes lvup { from { transform: scale(1.7); } }
.final-board .sheet-actions { margin-top: auto; padding-top: 6px; }
@media (max-width: 860px) {
  .podium-head { top: 10px; right: 16px; }
  .final-board { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 52vh; }
}
@media (prefers-reduced-motion: reduce) { .final-board, .fr-xp.up .fr-lv { animation: none; } }#pause-build { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Spell demos ---------- */
#learn-pop { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(6, 17, 28, 0.35); }
.lp-card {
  pointer-events: auto; width: min(560px, 100%); padding: 16px 18px 14px; border-radius: 20px;
  background: rgba(8, 22, 36, 0.95); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: dealin 0.4s ease-out;
}
.lp-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.lp-title h3 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 400; color: #fff; }
.lp-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(205, 238, 252, 0.07); color: var(--ic, var(--ice)); }
.lp-icon svg { width: 26px; height: 26px; }
#lp-key { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 700; }
#lp-key kbd { font-size: 14px; }
#lp-canvas, #dd-canvas { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #0a2236; }
#lp-desc { margin: 10px 0 8px; font-size: 15px; color: var(--ice); }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#lp-note { font-size: 13px; font-weight: 600; color: var(--muted); }
#lp-note .omen { color: var(--carrot-hi); font-weight: 800; }
/* The round's countdown, over the clip: a quiet pill while there is time, then big 3, 2, 1. */
.lp-stage { position: relative; }
#lp-count { position: absolute; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
#lp-count.soon { display: flex; align-items: flex-start; justify-content: flex-end; padding: 10px; }
#lp-count.soon span {
  font-size: 13px; font-weight: 800; color: #fff; padding: 4px 10px; border-radius: 999px;
  background: rgba(6, 17, 28, 0.72); border: 1px solid var(--line-2);
}
#lp-count.big { display: grid; place-items: center; border-radius: 12px; background: radial-gradient(closest-side, rgba(6, 17, 28, 0.5), rgba(6, 17, 28, 0)); }
#lp-count.big span {
  font-family: var(--display); font-size: 116px; line-height: 1; color: #fff;
  text-shadow: 0 5px 0 rgba(4, 40, 66, 0.9), 0 10px 32px rgba(0, 0, 0, 0.6);
  animation: lpcount 1s ease-out forwards;
}
@keyframes lpcount {
  0% { opacity: 0; transform: scale(1.7); }
  14% { opacity: 1; transform: scale(0.94); }
  24% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0.35; transform: scale(0.9); }
}
/* The draft makes room for a demo column while it offers something new to you. */
.draft.with-demo { width: min(1440px, 100%); grid-template-columns: minmax(0, 1fr) 300px; column-gap: 28px; }
.draft.with-demo > :not(#draft-demo) { grid-column: 1; }
.draft.with-demo > #draft-demo { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
#draft-demo {
  padding: 12px 14px; border-radius: 16px; background: rgba(8, 22, 36, 0.95); border: 1px solid var(--line-2);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
#draft-demo h4 { margin: 2px 0 8px; font-size: 17px; font-weight: 800; min-height: 1.3em; }
#dd-desc { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; min-height: 2.9em; }
#draft-demo.idle #dd-canvas { opacity: 0.25; }
.card-new {
  position: absolute; top: -9px; right: 12px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; background: var(--frog); color: #0b2a07;
}
@media (max-width: 1180px) {
  .draft.with-demo { grid-template-columns: minmax(0, 1fr); }
  .draft.with-demo > #draft-demo { grid-column: 1; grid-row: auto; justify-self: center; width: min(420px, 100%); }
}

input.speed { width: 100%; accent-color: var(--carrot); }
.speed-val { color: var(--ink); letter-spacing: 0; margin-left: 6px; }

/* ---------- Online ---------- */
.timer { font-size: 13px; font-weight: 700; color: var(--ice-2); font-variant-numeric: tabular-nums; min-height: 1.2em; }
#results-timer { margin-top: 10px; }.online .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.online .row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.online input {
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; min-width: 0; flex: 1 1 180px;
}
.online input:focus-visible { outline: 2px solid var(--carrot-hi); outline-offset: 2px; }
#on-code { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 800; flex: 0 1 140px; }
.on-login { display: grid; gap: 8px; max-width: 520px; }
.on-login .fine { margin-top: 4px; }
.on-error { color: #ff9aac; font-weight: 600; font-size: 14px; margin: 0 0 12px; }
.on-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.on-col { display: grid; gap: 10px; align-content: start; }
.on-col .label { margin-top: 6px; }
.profile-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px;
  border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line);
}
.pf-name { font-family: var(--display); font-size: 22px; color: var(--frog); }
.pf-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: 14px; }
.pf-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
#on-rename { margin-left: auto; }
.btn.danger { border-color: #ff8fa3; color: #ffb3c1; }
.legal { margin: 2px 0 0; font-size: 12px; color: var(--faint); }
.legal a, .online a { color: var(--muted); }
/* privacy and terms pages */
body.doc-page { overflow: auto; height: auto; background: var(--bg); }
.doc { max-width: 720px; margin: 0 auto; padding: 40px 16px 80px; line-height: 1.6; color: var(--ink); }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: 40px; margin: 0 0 4px; }
.doc h2 { font-size: 18px; margin: 28px 0 6px; }
.doc p, .doc li { color: var(--muted); }
.doc a { color: var(--ice-2); }
.doc .todo { color: var(--legendary); font-weight: 700; }
.room-list, .member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.room-list li, .member-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 44px;
  border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px;
}
.room-list li.none { color: var(--faint); justify-content: center; }
.room-list .rc { font-weight: 800; letter-spacing: 0.2em; }
.room-list .rm { color: var(--ice-2); font-weight: 700; }
.room-list .rp { color: var(--muted); margin-left: auto; font-size: 13px; }
.member-list .who { font-weight: 700; }
.member-list .tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--carrot-hi); margin-left: 4px; }
.member-list .st { margin-left: auto; font-size: 13px; color: var(--faint); }
.member-list .st.ok { color: var(--good); font-weight: 700; }
.member-list li.me { border-color: var(--line-2); }
.member-list li.away { opacity: 0.55; }
.room-head { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: end; }
.room-code { display: grid; gap: 2px; }
.room-code b { font-family: var(--display); font-size: 40px; letter-spacing: 0.12em; color: var(--ice); line-height: 1; }
.room-share { display: grid; gap: 4px; min-width: 0; }
.room-share code { font-size: 13px; color: var(--ice-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; user-select: all; overflow-wrap: anywhere; }
#room-config { gap: 14px; }
#room-config .fine { margin: 0; font-size: 13px; }
.seg button:disabled { cursor: default; }
.seg button:disabled:hover { background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"]:disabled, .seg button[aria-pressed="true"]:disabled:hover { background: var(--ice); color: #06243a; opacity: 0.8; }
@media (max-width: 760px) { .on-cols { grid-template-columns: 1fr; } }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .menu-grid { width: min(640px, 100%); margin-inline: auto; grid-template-columns: 1fr; gap: 24px; }
  .screen.menu { background: rgba(6, 17, 28, 0.8); align-items: flex-start; }
}
@media (max-width: 860px) {
  .screen.menu { background: rgba(6, 17, 28, 0.86); align-items: flex-start; }
  #scoreboard { min-width: 170px; max-width: 46vw; font-size: 12.5px; }
  .slot { width: 48px; height: 48px; }
  .slot svg { width: 25px; height: 25px; }
}
@media (max-width: 520px) {
  .field.two { grid-template-columns: 1fr; }
  .card { width: 100%; min-height: 0; }
  #killfeed { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .kf, #callout.pop, .slot.fresh, .learn-card, .lp-card, #draft-demo, #lp-count.big span, #banner-count.big span { animation: none; }
  #callout.pop { opacity: 1; }
  .btn { transition: none; }
}

/* The big notice over everything (index.html #notice): the game didn't load, a new version is
   out, or we're working on the servers. */
.notice-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(4, 12, 20, 0.9); backdrop-filter: blur(6px); }
.notice-card { width: min(640px, 100%); display: grid; gap: 18px; justify-items: center; padding: 40px 44px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); text-align: center; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55); }
.notice-logo { width: min(320px, 70%); height: auto; }
.notice-card h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); color: var(--ink); }
.notice-card p { margin: 0; max-width: 46ch; font-size: 17px; color: var(--muted); line-height: 1.55; }
.notice-card .row { justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.notice-card .btn { font-size: 17px; padding: 12px 28px; }
/* The opening draft's starting kit (ui.js renderDraft). */
.kit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.kit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); color: var(--ink); }
.kit-chip svg { width: 18px; height: 18px; }
.kit-chip kbd { font-size: 11px; }
@media (max-width: 520px) { .notice-overlay { padding: 16px; } .notice-card { padding: 28px 20px; gap: 14px; } .notice-card p { font-size: 16px; } }
/* The feedback box uses the same card, with a form in it. */
.feedback-card { justify-items: stretch; gap: 10px; text-align: left; padding: 32px 36px; }
.feedback-card h2 { font-size: clamp(24px, 3.4vw, 32px); }
.feedback-card p { font-size: 15px; }
.feedback-card .label { margin-top: 8px; }
.feedback-card input, .feedback-card textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; width: 100%; box-sizing: border-box;
}
.feedback-card textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.feedback-card input:focus-visible, .feedback-card textarea:focus-visible { outline: 2px solid var(--carrot-hi); outline-offset: 2px; }
.feedback-card #feedback-status:empty { display: none; }
.feedback-card .row { justify-content: flex-start; }
@media (max-width: 560px) { .feedback-card { padding: 24px 18px; } }
