/* ============================================================
   ???3D 蝡嗆?????neon-noir design system
   Zero-asset stylesheet: no external references of any kind,
   system CJK fonts only.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --p1:#25e8ff;
  --p1-dim:#0d7f8f;
  --p2:#ff3ea5;
  --p2-dim:#8f1a5e;
  --bg-0:#070310;
  --bg-1:#140a2e;
  --bg-2:#2a1055;
  --violet:#6b3ad6;
  --gold:#ffcf5c;
  --ok:#4dffa8;
  --bad:#ff5c72;
  --ink:#eef4ff;
  --ink-dim:#9fb0d8;
  --card:rgba(13,8,36,.78);
  --line:rgba(150,180,255,.16);
  --rarity-common:#9ad7ff;
  --rarity-rare:#8b6bff;
  --rarity-epic:#ffb347;
  --hud-h:104px;
  --bar-h:196px;
  --r:14px;
  --font-cjk: "Noto Sans TC","PingFang TC","Microsoft JhengHei","Heiti TC",system-ui,sans-serif;
  --font-mono: ui-monospace,"Cascadia Mono",Consolas,monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-cjk);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button {
  font-family: var(--font-cjk);
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .45; }
small { display: block; font-size: 9px; letter-spacing: .18em; opacity: .7; font-family: var(--font-mono); }

/* ---------- app grid ---------- */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: var(--hud-h) 1fr var(--bar-h);
  background: var(--bg-0);
}

/* ---------- stage ---------- */
#stage {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 68%, #2a1055 0%, #140a2e 45%, #070310 100%);
}
#gl-canvas { width: 100%; height: 100%; display: block; }
#stage-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 140px 30px rgba(3,0,12,.85);
}
#boot-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; z-index: 5;
  background: radial-gradient(ellipse at 50% 60%, #2a1055, #070310);
}
#boot-fallback .fb-title { font-size: 24px; font-weight: 700; color: var(--gold); margin: 0 0 8px; }
#boot-fallback .fb-sub { font-size: 11px; color: var(--ink-dim); font-family: var(--font-mono); letter-spacing: .12em; margin: 0; }

/* ---------- HUD top ---------- */
#hud-top {
  display: grid;
  grid-template-rows: 34px 70px;
  background: linear-gradient(180deg, rgba(10,4,28,.96), rgba(10,4,28,.72));
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
#hud-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap; overflow: hidden;
}
.profile-chip {
  font-size: 10px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 8px; letter-spacing: .08em;
}
.rank-badge {
  width: 22px; height: 22px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, #7a4b2a, #3c2414);
  color: #ffe2b8;
  border: 1px solid rgba(255,207,92,.35);
}
.rank-name { font-weight: 700; font-size: 13px; }
.rank-en { font-size: 9px; font-family: var(--font-mono); letter-spacing: .2em; color: var(--ink-dim); }
.stat-chip { font-size: 12px; color: var(--ink); }
.stat-chip b { font-family: var(--font-mono); font-size: 13px; }
.stat-chip i {
  font-style: normal; font-size: 8px; letter-spacing: .16em;
  color: var(--ink-dim); font-family: var(--font-mono); margin-left: 3px;
}
.xp-bar {
  position: relative; width: 96px; height: 8px;
  background: rgba(107,58,214,.25);
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.xp-bar-in {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--p1));
  animation: xp-fill .45s ease-out;
}
.xp-text { font-size: 10px; font-family: var(--font-mono); color: var(--ink-dim); }
.onboard-chip {
  font-size: 10px; color: #08040f;
  background: linear-gradient(90deg, var(--gold), #ffe9a8);
  border-radius: 999px; padding: 1px 9px; font-weight: 700;
  animation: glow-pulse 2.2s ease-in-out infinite;
}
.mute-badge {
  margin-left: auto; font-size: 10px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}

/* ---------- players row ---------- */
.players-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 10px; padding: 0 14px;
}
.player-block {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 12px; border-radius: var(--r);
  background: var(--card);
}
.player-block.p1 { border: 1px solid rgba(37,232,255,.4); border-left: 4px solid var(--p1); }
.player-block.p2 { border: 1px solid rgba(255,62,165,.4); border-right: 4px solid var(--p2); align-items: flex-end; }
.pb-line { display: flex; align-items: center; gap: 8px; }
.pb-name { font-size: 20px; font-weight: 800; }
.player-block.p1 .pb-name { color: var(--p1); text-shadow: 0 0 14px rgba(37,232,255,.5); }
.player-block.p2 .pb-name { color: var(--p2); text-shadow: 0 0 14px rgba(255,62,165,.5); }
.pb-en { font-size: 10px; font-family: var(--font-mono); letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
.pips { display: flex; gap: 6px; }
.pip {
  width: 13px; height: 13px; transform: rotate(45deg);
  border: 1.5px solid var(--line); border-radius: 3px;
  background: rgba(20,10,46,.6);
}
.player-block.p1 .pip.is-won { background: var(--p1); border-color: var(--p1); box-shadow: 0 0 10px var(--p1); animation: pip-pop .4s cubic-bezier(.2,2.2,.4,1); }
.player-block.p2 .pip.is-won { background: var(--p2); border-color: var(--p2); box-shadow: 0 0 10px var(--p2); animation: pip-pop .4s cubic-bezier(.2,2.2,.4,1); }
.charge-pips { display: flex; gap: 3px; align-items: center; }
.charge-pips .cp {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(150,180,255,.15); border: 1px solid var(--line);
}
.player-block.p1 .charge-pips .cp.is-full { background: var(--p1); box-shadow: 0 0 7px var(--p1); border-color: var(--p1); }
.player-block.p2 .charge-pips .cp.is-full { background: var(--p2); box-shadow: 0 0 7px var(--p2); border-color: var(--p2); }
.charge-pips .cp-num { font-size: 9px; font-family: var(--font-mono); color: var(--ink-dim); margin-left: 4px; }
.armed-chip {
  font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: rgba(255,207,92,.16); color: var(--gold);
  border: 1px solid rgba(255,207,92,.5);
}

/* ---------- HUD center ---------- */
#hud-center { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 150px; }
.round-label { font-size: 17px; font-weight: 800; letter-spacing: .06em; }
.round-sub { font-size: 8.5px; font-family: var(--font-mono); letter-spacing: .18em; color: var(--ink-dim); }
.timer-ring {
  position: relative; width: 54px; height: 54px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p, 100) * 1%), rgba(150,180,255,.12) 0);
  display: flex; align-items: center; justify-content: center;
}
.timer-ring.is-low { animation: timer-pulse .5s ease-in-out infinite; }
.timer-disc {
  width: 42px; height: 42px; border-radius: 50%;
  background: #0d0824; display: flex; align-items: center; justify-content: center;
}
#timer-num { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.mode-label { font-size: 11px; color: var(--ink-dim); margin-top: 1px; }
.mode-sub { font-size: 8px; font-family: var(--font-mono); letter-spacing: .2em; color: var(--ink-dim); opacity: .8; }

/* ---------- banner ---------- */
#banner {
  position: fixed; left: 50%; top: 26vh; transform: translateX(-50%);
  text-align: center; z-index: 20; pointer-events: none;
  padding: 10px 30px; border-radius: var(--r);
}
#banner.banner-tone-gold #banner-zh {
  background: linear-gradient(90deg, #fff3cf, var(--gold), #fff3cf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255,207,92,.65));
}
#banner.banner-tone-info #banner-zh {
  background: linear-gradient(90deg, #d8fbff, var(--p1));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(37,232,255,.55));
}
#banner.banner-tone-bad #banner-zh {
  background: linear-gradient(90deg, #ffd8e2, var(--bad));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(255,92,114,.55));
}
#banner-zh { font-size: clamp(28px, 4.6vw, 44px); font-weight: 900; letter-spacing: .08em; }
#banner-en { font-size: 11px; font-family: var(--font-mono); letter-spacing: .34em; color: var(--ink-dim); margin-top: 2px; }
#banner.is-in { animation: banner-in .38s cubic-bezier(.2,1.6,.4,1); }
#banner.is-out { animation: banner-out .3s ease-in forwards; }

/* ---------- toasts ---------- */
#toast-layer {
  position: fixed; left: 14px; bottom: calc(var(--bar-h) + 12px);
  display: flex; flex-direction: column; gap: 6px; z-index: 20; pointer-events: none;
}
.toast {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--p1);
  border-radius: 10px; padding: 7px 12px; max-width: 300px;
  animation: toast-in .32s ease-out;
  box-shadow: 0 6px 22px rgba(3,0,12,.6);
}
.toast .t-zh { font-size: 12.5px; font-weight: 700; }
.toast .t-en { font-size: 9px; font-family: var(--font-mono); letter-spacing: .14em; color: var(--ink-dim); }
.toast.is-gold { border-left-color: var(--gold); }

/* ---------- ability bar ---------- */
#ability-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto minmax(0, 1fr) auto;
  align-items: stretch; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(10,4,28,.97), rgba(10,4,28,.8));
  border-top: 1px solid var(--line);
  z-index: 10;
  overflow: hidden;
  position: relative; /* hint chips anchor here, outside the six grid columns */
}
.hand-panel { display: flex; gap: 8px; align-items: center; }
.hand-btn {
  width: 72px; height: 76px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.hand-btn .hb-glyph { font-size: 30px; font-weight: 900; line-height: 1; }
.hand-btn .hb-en { font-size: 9px; font-family: var(--font-mono); letter-spacing: .18em; color: var(--ink-dim); }
.hand-btn .hb-key { font-size: 11px; font-family: var(--font-mono); color: var(--ink-dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
#hand-p1 .hand-btn:hover:not(:disabled) { border-color: var(--p1); box-shadow: 0 0 16px rgba(37,232,255,.35); transform: translateY(-3px); }
#hand-p2 .hand-btn:hover:not(:disabled) { border-color: var(--p2); box-shadow: 0 0 16px rgba(255,62,165,.35); transform: translateY(-3px); }
.hand-btn:active:not(:disabled) { transform: translateY(1px) scale(.96); }
#hand-p1 .hand-btn.is-locked { border-color: var(--p1); box-shadow: 0 0 14px rgba(37,232,255,.45) inset; }
#hand-p2 .hand-btn.is-locked { border-color: var(--p2); box-shadow: 0 0 14px rgba(255,62,165,.45) inset; }
.hand-btn:disabled { opacity: .35; }
/* five cards per player, always all visible: equal columns that are allowed to
   shrink (minmax(0,1fr)) instead of overflowing into a hidden scroll strip. */
.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px; align-items: center; padding: 2px;
  min-width: 0; overflow: hidden;
}
.ability-card {
  min-width: 0; height: 58px; border-radius: 10px;
  padding: 5px 8px; position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  text-align: left; transition: transform .1s ease, box-shadow .1s ease;
}
.ability-card .ab-name { font-size: 13px; font-weight: 800; }
.ability-card .ab-en { font-size: 8px; font-family: var(--font-mono); letter-spacing: .16em; color: var(--ink-dim); }
.ability-card .ab-cost { position: absolute; top: 5px; right: 7px; font-size: 10px; font-family: var(--font-mono); color: var(--gold); }
.ability-card.is-armed { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,207,92,.5); animation: glow-pulse 1.6s ease-in-out infinite; }
.ability-card.is-armed::after { content: "撌脰???ARMED"; position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 8px; color: var(--gold); font-family: var(--font-mono); letter-spacing: .12em; }
.ability-card.is-locked { opacity: .45; }
.ability-card.is-locked .ab-lock { font-size: 9px; color: var(--ink-dim); }
.ability-card.is-poor { opacity: .6; }
.ability-card.is-poor .ab-cost { color: var(--bad); }
.ability-card:not(.is-locked):not(.is-poor):hover { transform: translateY(-3px); border-color: rgba(150,180,255,.45); }
.ability-card.card-slam { animation: card-slam .45s cubic-bezier(.2,2.4,.4,1); }
.pick-slot {
  min-width: 92px; padding: 8px 10px; border-radius: 12px;
  background: var(--card); border: 1px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.pick-label { font-size: 9px; font-family: var(--font-mono); letter-spacing: .16em; color: var(--ink-dim); }
.pick-glyph { font-size: 34px; font-weight: 900; line-height: 1.1; }
.pick-slot.is-locked { border-style: solid; border-color: var(--gold); }
.pick-slot.is-reveal .pick-glyph { animation: pop-in .4s cubic-bezier(.2,2.2,.4,1); }
#pick-p1.is-reveal { border-color: var(--p1); }
#pick-p2.is-reveal { border-color: var(--p2); }
.hint-chip {
  /* absolutely anchored above the centre pick column ??never a grid cell,
     so the ability bar keeps its fixed six columns */
  position: absolute;
  bottom: 10px;
  z-index: 6;
  align-self: center; font-size: 11px; padding: 6px 10px;
  border-radius: 999px; background: rgba(255,207,92,.12);
  border: 1px solid rgba(255,207,92,.5); color: var(--gold);
  max-width: 150px; text-align: center;
}
#hint-p1 { left: 50%; transform: translateX(calc(-50% - 140px)); }
#hint-p2 { left: 50%; transform: translateX(calc(-50% + 140px)); }

/* ---------- controls hint ---------- */
#controls-hint {
  position: fixed; left: 0; right: 0; bottom: 2px;
  text-align: center; font-size: 11px; color: var(--ink-dim);
  z-index: 9; pointer-events: none; font-family: var(--font-mono);
}

/* ---------- overlay system ---------- */
#overlay-root { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(42,16,85,.82), rgba(7,3,16,.94));
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: banner-in .3s ease-out;
}
#screen-levelup, #screen-rankup, #screen-chest { z-index: 40; }
.hidden { display: none !important; }

/* ---------- generic buttons / panels ---------- */
.btn {
  padding: 10px 20px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  font-size: 15px; font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn small { margin-top: 2px; }
.btn:hover { transform: translateY(-2px); border-color: rgba(150,180,255,.5); box-shadow: 0 8px 24px rgba(3,0,12,.6); }
.btn:active { transform: translateY(1px) scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #ffe9a8, var(--gold) 55%, #d99a1f);
  color: #1a0f00; border-color: rgba(255,231,160,.7);
}
.btn-primary small { color: #4a3300; opacity: .85; }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255,207,92,.35); }
.btn-danger { border-color: rgba(255,92,114,.55); color: #ffd8de; }
.btn-ghost { border-style: dashed; color: var(--ink-dim); font-weight: 500; }
.btn-gold { border-color: rgba(255,207,92,.7); color: var(--gold); animation: glow-pulse 1.8s ease-in-out infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 32px; max-width: min(860px, 92vw); max-height: 84vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(3,0,12,.7);
  text-align: center;
}
.panel-title { font-size: 24px; margin: 0 0 6px; }
.panel-title small { margin-top: 2px; }
.panel-sub { color: var(--ink-dim); font-size: 12px; margin: 0 0 8px; }

/* ---------- title screen ---------- */
.screen-title .title-stack { text-align: center; animation: title-float 7s ease-in-out infinite; }
.t-zh-big {
  font-size: clamp(56px, 11vw, 108px); font-weight: 900; letter-spacing: .12em; line-height: 1.05;
  background: linear-gradient(180deg, #ffffff, var(--p1) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(37,232,255,.55));
}
.t-zh-mid {
  font-size: clamp(24px, 4.4vw, 40px); font-weight: 800; letter-spacing: .3em; margin-top: 4px;
  background: linear-gradient(90deg, var(--p2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.t-en { font-size: 12px; font-family: var(--font-mono); letter-spacing: .5em; color: var(--ink-dim); margin-top: 8px; }
.t-tag { font-size: 15px; color: var(--ink); margin-top: 14px; }
.t-daily { font-size: 12px; color: var(--gold); margin-top: 10px; font-family: var(--font-mono); }

/* ---------- result ---------- */
.result-panel { min-width: min(520px, 92vw); }
.result-headline { font-size: 34px; margin: 0; }
.result-headline small { margin-top: 3px; }
.result-headline.is-win { color: var(--ok); text-shadow: 0 0 22px rgba(77,255,168,.5); }
.result-headline.is-lose { color: var(--bad); text-shadow: 0 0 22px rgba(255,92,114,.5); }
.result-score { font-size: 46px; font-weight: 900; font-family: var(--font-mono); margin: 6px 0; }
.result-detail { color: var(--ink-dim); font-size: 12px; }
.delta-row { display: flex; gap: 12px; justify-content: center; margin: 16px 0 4px; flex-wrap: wrap; }
.delta-tile {
  min-width: 130px; padding: 10px 14px; border-radius: var(--r);
  background: rgba(20,10,46,.7); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.delta-tile .dt-k { font-size: 10px; color: var(--ink-dim); font-family: var(--font-mono); letter-spacing: .08em; }
.delta-tile .dt-v { font-size: 22px; font-weight: 900; font-family: var(--font-mono); color: var(--gold); animation: pop-in .4s cubic-bezier(.2,2.2,.4,1); }
.ach-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.ach-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,207,92,.14); border: 1px solid rgba(255,207,92,.55);
  color: var(--gold); font-weight: 700;
  animation: pop-in .45s cubic-bezier(.2,2.2,.4,1);
}

/* ---------- level up ---------- */
.levelup-panel { min-width: 320px; }
.lu-ring {
  width: 168px; height: 168px; margin: 6px auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,207,92,.2), rgba(107,58,214,.25) 70%);
  border: 2px solid rgba(255,207,92,.7);
  animation: glow-pulse 1.6s ease-in-out infinite;
}
.lu-level { font-size: 30px; font-weight: 900; }
.lu-level small { margin-top: 4px; }
.lu-unlock {
  font-size: 16px; color: var(--ink); margin-bottom: 14px;
  border: 1px dashed rgba(255,207,92,.6); border-radius: 10px; padding: 8px 14px;
}

/* ---------- rank up ---------- */
.rankup-panel { min-width: 320px; position: relative; overflow: hidden; }
.ru-glow {
  position: absolute; inset: -40%;
  background: radial-gradient(circle at 50% 40%, rgba(255,207,92,.35), transparent 60%);
  animation: rank-sweep 1.4s ease-in-out;
  pointer-events: none;
}
.ru-name { font-size: 36px; font-weight: 900; margin: 10px 0 4px; position: relative; }
.ru-name small { margin-top: 4px; }
.ru-reward { font-size: 15px; color: var(--gold); margin-bottom: 16px; position: relative; }

/* ---------- chest ---------- */
.chest-panel { min-width: 340px; }
.chest { position: relative; width: 150px; height: 120px; margin: 8px auto 14px; }
.chest-aura {
  position: absolute; inset: -42%;
  border-radius: 50%; pointer-events: none;
  animation: glow-pulse 1.9s ease-in-out infinite;
}
.chest.rarity-common .chest-aura { background: radial-gradient(circle, rgba(154,215,255,.4), transparent 62%); }
.chest.rarity-rare .chest-aura { background: radial-gradient(circle, rgba(139,107,255,.45), transparent 62%); }
.chest.rarity-epic .chest-aura { background: radial-gradient(circle, rgba(255,179,71,.5), transparent 62%); }
.chest-body {
  position: absolute; left: 12px; right: 12px; bottom: 0; height: 66px;
  border-radius: 10px 10px 14px 14px;
  background: linear-gradient(180deg, #6b3ad6, #2a1055 70%);
  border: 2px solid rgba(255,207,92,.55);
}
.chest-lid {
  position: absolute; left: 8px; right: 8px; top: 12px; height: 42px;
  border-radius: 16px 16px 6px 6px; transform-origin: 50% 0%;
  background: linear-gradient(180deg, #8a5bff, #4a2499);
  border: 2px solid rgba(255,207,92,.65);
  transition: transform .5s cubic-bezier(.3,1.6,.5,1);
}
.chest.is-open .chest-lid { animation: lid-open .6s cubic-bezier(.3,1.8,.5,1) forwards; }
.chest.is-shaking { animation: chest-shake .5s ease-in-out; }
.chest-lock {
  position: absolute; left: 50%; top: 46px; transform: translateX(-50%);
  width: 22px; height: 26px; border-radius: 5px;
  background: linear-gradient(180deg, #ffe9a8, var(--gold));
  box-shadow: 0 0 14px rgba(255,207,92,.8);
}
.chest-title { font-size: 22px; font-weight: 900; }
.chest-title small { margin-top: 2px; }
.chest.rarity-common .chest-title { color: var(--rarity-common); }
.chest.rarity-rare .chest-title { color: var(--rarity-rare); }
.chest.rarity-epic .chest-title { color: var(--rarity-epic); }
.chest-sub { font-size: 11px; color: var(--ink-dim); margin: 4px 0 10px; }
.chest-cards { display: flex; gap: 10px; justify-content: center; min-height: 90px; margin-bottom: 12px; }
.chest-card {
  width: 74px; height: 90px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  perspective: 600px;
}
.chest-card .cc-val { font-size: 20px; font-weight: 900; font-family: var(--font-mono); color: var(--gold); }
.chest-card .cc-k { font-size: 9px; color: var(--ink-dim); font-family: var(--font-mono); }
.chest-card.is-flip { animation: flip-card .55s cubic-bezier(.2,1.4,.4,1) both; }
.chest-card.rarity-common { border-color: var(--rarity-common); box-shadow: 0 0 12px rgba(154,215,255,.4); }
.chest-card.rarity-rare { border-color: var(--rarity-rare); box-shadow: 0 0 14px rgba(139,107,255,.5); }
.chest-card.rarity-epic { border-color: var(--rarity-epic); box-shadow: 0 0 18px rgba(255,179,71,.6); }

/* ---------- vault ---------- */
/* flex column: title + tabs stay put, the body scrolls, the close button is a
   real footer instead of floatng over the achievement grid. */
.vault-panel {
  min-width: min(720px, 92vw);
  display: flex; flex-direction: column;
  max-height: 84vh; overflow: hidden;
}
.vault-panel > .panel-title,
.vault-panel > .tab-row { flex: 0 0 auto; }
#btn-vault-close { flex: 0 0 auto; margin-top: 14px; align-self: center; }
.tab-row { display: flex; gap: 8px; justify-content: center; margin: 10px 0 14px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); background: rgba(20,10,46,.6); color: var(--ink-dim);
}
.tab-btn small { margin-top: 1px; }
.tab-btn.is-on { color: #14081f; background: linear-gradient(135deg, #d8fbff, var(--p1)); border-color: var(--p1); }
.tab-btn.is-on small { color: #06333b; }
.vault-panel-body { flex: 1 1 auto; min-height: 160px; max-height: none; overflow-y: auto; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.v-card {
  background: rgba(20,10,46,.66); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 3px;
}
.v-card .v-zh { font-size: 14px; font-weight: 800; }
.v-card .v-en { font-size: 8.5px; font-family: var(--font-mono); letter-spacing: .16em; color: var(--ink-dim); }
.v-card .v-desc { font-size: 11px; color: var(--ink-dim); }
.v-card.is-done { border-color: rgba(77,255,168,.5); }
.v-card.is-done .v-zh { color: var(--ok); }
.v-card.is-current { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,207,92,.3); }
.v-card .v-reward { font-size: 11px; color: var(--gold); }
.ladder-bar { height: 7px; border-radius: 999px; background: rgba(150,180,255,.14); overflow: hidden; margin-top: 4px; }
.ladder-bar-in { height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); }
.swatches { display: flex; gap: 4px; margin-top: 3px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); }
.chest-slot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(20,10,46,.66); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
}
.chest-slot .cs-name { font-weight: 800; font-size: 14px; }
.chest-slot.rarity-common .cs-name { color: var(--rarity-common); }
.chest-slot.rarity-rare .cs-name { color: var(--rarity-rare); }
.chest-slot.rarity-epic .cs-name { color: var(--rarity-epic); }

/* ---------- daily ---------- */
.daily-panel { min-width: min(560px, 92vw); }
.daily-meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0 14px; }
.dm-chip {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); background: rgba(20,10,46,.6);
}
.dm-chip small { display: inline; margin-left: 4px; color: var(--ink-dim); }
.daily-grid { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.cell {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900;
  border: 1px solid var(--line); background: rgba(20,10,46,.6); color: var(--ink-dim);
}
.cell-win { background: rgba(77,255,168,.16); border-color: var(--ok); color: var(--ok); animation: pop-in .4s cubic-bezier(.2,2.2,.4,1); }
.cell-loss { background: rgba(255,92,114,.16); border-color: var(--bad); color: var(--bad); animation: pop-in .4s cubic-bezier(.2,2.2,.4,1); }
.cell-tie { background: rgba(255,207,92,.14); border-color: var(--gold); color: var(--gold); animation: pop-in .4s cubic-bezier(.2,2.2,.4,1); }
.daily-share {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim);
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
  word-break: break-all;
}
.daily-reward { font-size: 13px; color: var(--gold); margin-bottom: 4px; }
.daily-reward small { display: inline; margin-left: 5px; }

/* ---------- howto ---------- */
.howto-panel { min-width: min(760px, 94vw); }
.howto-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; margin: 10px 0; }
.howto-col h3 { font-size: 14px; margin: 0 0 8px; color: var(--p1); }
.ht-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ht-table th { text-align: left; padding: 6px 8px; white-space: nowrap; color: var(--ink-dim); font-weight: 700; border-bottom: 1px solid var(--line); }
.ht-table td { padding: 6px 8px; border-bottom: 1px solid rgba(150,180,255,.08); }

/* ---------- confetti (CSS layer under WebGL podium) ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 15; overflow: hidden; }
.confetti-bit {
  position: absolute; top: -14px; width: 8px; height: 12px; border-radius: 2px;
  animation: confetti-fall linear forwards;
}

/* ============================================================
   keyframes
   ============================================================ */
@keyframes pip-pop {
  0% { transform: rotate(45deg) scale(.2); }
  60% { transform: rotate(45deg) scale(1.5); }
  100% { transform: rotate(45deg) scale(1); }
}
@keyframes banner-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.86); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes banner-out {
  0% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(.92); }
}
@keyframes card-slam {
  0% { transform: translateY(-26px) scale(1.25); opacity: .4; }
  55% { transform: translateY(2px) scale(.94); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
@keyframes toast-in {
  0% { opacity: 0; transform: translateX(-26px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes chest-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-7deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(4deg); }
}
@keyframes lid-open {
  0% { transform: rotate(0deg) translateY(0); }
  100% { transform: rotate(-98deg) translateY(-6px); }
}
@keyframes flip-card {
  0% { transform: rotateY(180deg) scale(.7); opacity: 0; }
  60% { transform: rotateY(0deg) scale(1.08); opacity: 1; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
@keyframes glow-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}
@keyframes rank-sweep {
  0% { transform: translateX(-120%) rotate(8deg); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateX(120%) rotate(-8deg); opacity: 0; }
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(78vh) rotate(660deg); opacity: .1; }
}
@keyframes xp-fill {
  0% { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}
@keyframes timer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,207,92,.55); }
  50% { box-shadow: 0 0 0 7px rgba(255,207,92,0); }
}
@keyframes title-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes pop-in {
  0% { transform: scale(.3); opacity: 0; }
  65% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width:1100px) {
  .pb-name { font-size: 16px; }
  .round-label { font-size: 14px; }
  #hud-profile { gap: 7px; font-size: 11px; }
  .xp-bar { width: 70px; }
  .hand-btn { width: 72px; height: 72px; }
  .hand-btn .hb-glyph { font-size: 25px; }
  .ability-card { min-width: 0; height: 54px; }
}

@media (max-width:900px) {
  :root { --hud-h: 96px; --bar-h: 240px; }
  #app { grid-template-rows: var(--hud-h) 1fr var(--bar-h); }
  .players-row { grid-template-columns: 1fr auto 1fr; gap: 6px; padding: 0 8px; }
  .pb-en { display: none; }
  #controls-hint { display: none; }
  #ability-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "pick hintbar"
      "cards cards";
    row-gap: 8px;
    overflow-y: auto;
  }
  #hand-p1 { grid-area: pick; grid-column: 1; display: grid; grid-template-columns: repeat(3, 1fr); }
  #hand-p2 { grid-area: hintbar; grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); }
  #cards-p1 { grid-area: cards; }
  #cards-p2 { display: none; }
  #pick-p1 { grid-column: 1; }
  #pick-p2 { grid-column: 2; }
  #hint-p1, #hint-p2 { display: none; }
  .hand-btn { width: 100%; height: 64px; }
  .cards { grid-template-columns: repeat(5, minmax(76px, 1fr)); overflow-x: auto; overflow-y: hidden; }
  #banner-zh { font-size: 26px; }
  .howto-cols { grid-template-columns: 1fr; }
}

@media (max-height:760px) {
  :root { --hud-h: 92px; --bar-h: 168px; }
  .players-row { grid-template-rows: 1fr; }
  .panel { padding: 16px 20px; }
  .hand-btn { width: 68px; height: 62px; }
  .hand-btn .hb-glyph { font-size: 22px; }
  .ability-card { height: 50px; min-width: 0; }
  .t-zh-big { font-size: clamp(40px, 9vw, 72px); }
  #toast-layer { bottom: calc(var(--bar-h) + 8px); }
}

/* ============================================================
   extended polish: focus states, scrollbars, variants, motion
   ============================================================ */

/* ---------- accessibility: visible keyboard focus ---------- */
.btn:focus-visible,
.hand-btn:focus-visible,
.ability-card:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .title-stack,
  .onboard-chip,
  .ability-card.is-armed,
  .btn-gold,
  .chest-aura,
  .lu-ring,
  .timer-ring.is-low { animation: none; }
  .btn, .hand-btn, .ability-card { transition: none; }
}

/* ---------- panel scrollbars (dark, thin) ---------- */
.panel::-webkit-scrollbar,
.vault-panel-body::-webkit-scrollbar,
.cards::-webkit-scrollbar,
#ability-bar::-webkit-scrollbar {
  width: 8px; height: 8px;
}
.panel::-webkit-scrollbar-track,
.vault-panel-body::-webkit-scrollbar-track,
.cards::-webkit-scrollbar-track,
#ability-bar::-webkit-scrollbar-track {
  background: rgba(20,10,46,.5);
  border-radius: 999px;
}
.panel::-webkit-scrollbar-thumb,
.vault-panel-body::-webkit-scrollbar-thumb,
.cards::-webkit-scrollbar-thumb,
#ability-bar::-webkit-scrollbar-thumb {
  background: rgba(107,58,214,.6);
  border-radius: 999px;
}
.panel::-webkit-scrollbar-thumb:hover,
.vault-panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(139,107,255,.8);
}

/* ---------- hand panel player theming ---------- */
#hand-p1 .hand-btn { border-bottom: 3px solid rgba(37,232,255,.35); }
#hand-p2 .hand-btn { border-bottom: 3px solid rgba(255,62,165,.35); }
#hand-p1 .hand-btn .hb-glyph { color: var(--ink); text-shadow: 0 0 12px rgba(37,232,255,.35); }
#hand-p2 .hand-btn .hb-glyph { color: var(--ink); text-shadow: 0 0 12px rgba(255,62,165,.35); }
#hand-p1 .hand-btn:disabled .hb-glyph,
#hand-p2 .hand-btn:disabled .hb-glyph { text-shadow: none; }
.hand-panel { padding: 2px; border-radius: 16px; }

/* ---------- ability card detail states ---------- */
.ability-card .ab-lock {
  font-size: 9px; color: var(--ink-dim);
  font-family: var(--font-mono); letter-spacing: .06em;
}
.ability-card.is-locked { border-style: dashed; }
.ability-card.is-poor .ab-name { opacity: .7; }
.ability-card:disabled { cursor: default; }
.cards { scrollbar-width: thin; }
.cards .ability-card:first-child { margin-left: 0; }

/* ---------- pick slot states ---------- */
.pick-slot { transition: border-color .2s ease, box-shadow .2s ease; }
.pick-slot.is-locked {
  box-shadow: 0 0 14px rgba(255,207,92,.25);
  animation: pop-in .3s cubic-bezier(.2,2.2,.4,1);
}
#pick-p1.is-reveal { box-shadow: 0 0 18px rgba(37,232,255,.4); }
#pick-p2.is-reveal { box-shadow: 0 0 18px rgba(255,62,165,.4); }

/* ---------- banner extra tones ---------- */
#banner { max-width: 80vw; }
#banner.banner-tone-gold { text-shadow: 0 4px 30px rgba(3,0,12,.9); }
#banner.banner-tone-info { text-shadow: 0 4px 30px rgba(3,0,12,.9); }
#banner.banner-tone-bad { text-shadow: 0 4px 30px rgba(3,0,12,.9); }

/* ---------- toast variants ---------- */
.toast.is-gold .t-zh { color: var(--gold); }
.toast .t-zh { letter-spacing: .02em; }

/* ---------- stat chips alignment ---------- */
#hud-profile .stat-chip { display: inline-flex; align-items: baseline; gap: 2px; }
#hud-profile > * { flex: 0 0 auto; }
#hud-profile .mute-badge:hover { color: var(--ink); border-color: rgba(150,180,255,.4); }
#hud-profile .onboard-chip.hidden { display: none; }

/* ---------- player block detail ---------- */
.player-block { transition: box-shadow .25s ease; }
.player-block.p1.is-active { box-shadow: 0 0 22px rgba(37,232,255,.25); }
.player-block.p2.is-active { box-shadow: 0 0 22px rgba(255,62,165,.25); }
.pb-line { min-height: 18px; }

/* ---------- timer ring detail ---------- */
.timer-ring { transition: transform .2s ease; }
.timer-ring.is-low { transform: scale(1.08); }
.timer-disc { box-shadow: inset 0 0 8px rgba(107,58,214,.5); }

/* ---------- vault cards ---------- */
.v-card { transition: transform .15s ease, border-color .15s ease; }
.v-card:hover { transform: translateY(-2px); }
.v-card .v-desc { line-height: 1.35; }
.chest-slot { transition: border-color .15s ease; }
.chest-slot:hover { border-color: rgba(255,207,92,.5); }
.chest-slot .btn { padding: 6px 14px; font-size: 13px; }

/* ---------- daily grid ---------- */
.cell { transition: transform .15s ease; }
.cell:hover { transform: scale(1.06); }
.daily-grid { flex-wrap: wrap; }
.daily-share { font-size: 11.5px; }

/* ---------- delta tiles ---------- */
.delta-tile { transition: transform .2s ease; }
.delta-tile:hover { transform: translateY(-2px); }
.delta-tile .dt-v.is-negative { color: var(--bad); }

/* ---------- chest art refinement ---------- */
.chest-body::after {
  content: '';
  position: absolute; inset: 6px 10px auto 10px; height: 8px;
  border-radius: 4px;
  background: rgba(255,207,92,.25);
}
.chest-lid::after {
  content: '';
  position: absolute; left: 10px; right: 10px; top: 8px; height: 6px;
  border-radius: 3px;
  background: rgba(255,231,160,.3);
}
.chest.is-open .chest-lock { opacity: 0; transition: opacity .3s ease; }

/* ---------- buttons sizing ---------- */
.btn small { letter-spacing: .16em; }
.btn-row .btn { min-width: 130px; }
.btn-col .btn { width: 100%; }
.btn-danger:hover { box-shadow: 0 8px 24px rgba(255,92,114,.3); }
.btn-ghost:hover { color: var(--ink); }

/* ---------- overlay idle behaviour ---------- */
#overlay-root.overlay-idle { pointer-events: none; }
.screen > .panel { animation: pop-in .35s cubic-bezier(.2,1.8,.4,1); }

/* ---------- howto table ---------- */
.ht-table th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; }
.ht-table td { color: var(--ink); }

/* ---------- levelup / rankup extra ---------- */
.lu-unlock.is-empty { border-style: solid; border-color: var(--line); color: var(--ink-dim); }
.ru-name span { font-size: 36px; }
.ru-reward { letter-spacing: .04em; }

/* ---------- boot fallback ---------- */
#boot-fallback .fb-title { text-shadow: 0 0 24px rgba(255,207,92,.4); }

/* ---------- stage vignette ---------- */
#stage-vignette { background: radial-gradient(ellipse at 50% 60%, transparent 55%, rgba(3,0,12,.55) 100%); }

/* ---------- misc ---------- */
.hidden { display: none !important; }
#app { isolation: isolate; }
body { text-rendering: optimizeLegibility; }
button { -webkit-tap-highlight-color: transparent; }
#controls-hint { letter-spacing: .04em; }
#controls-hint b { color: var(--ink); }

/* ---------- wide screens ---------- */
@media (min-width: 1600px) {
  :root { --hud-h: 112px; --bar-h: 204px; }
  .hand-btn { width: 92px; height: 92px; }
  .hand-btn .hb-glyph { font-size: 34px; }
  .ability-card { min-width: 0; height: 64px; }
  .ability-card .ab-name { font-size: 15px; }
  .pick-slot { min-width: 132px; }
  .panel { padding: 32px 40px; }
  .panel-title { font-size: 28px; }
  .t-zh-big { font-size: clamp(72px, 10vw, 128px); }
  #hud-profile { font-size: 13px; }
  .xp-bar { width: 120px; }
  .toast { max-width: 360px; }
  .toast .t-zh { font-size: 14px; }
  .chest { width: 170px; height: 136px; transform: scale(1.1); }
  .daily-grid .cell { width: 58px; height: 58px; }
}

/* ---------- extra narrow phones ---------- */
@media (max-width: 560px) {
  :root { --hud-h: 88px; --bar-h: 250px; }
  .pb-name { font-size: 14px; }
  .rank-en, .xp-text { display: none; }
  .stat-chip i { display: none; }
  .timer-ring { width: 44px; height: 44px; }
  .timer-disc { width: 34px; height: 34px; }
  #banner { top: 30vh; }
  #banner-en { letter-spacing: .2em; }
  .panel { padding: 14px 14px; max-height: 78vh; }
  .delta-tile { min-width: 100px; }
  .hand-btn { height: 58px; }
  .hand-btn .hb-en { display: none; }
  .hand-btn .hb-key { font-size: 9px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .howto-cols { gap: 10px; }
  .t-tag { font-size: 13px; }
  .t-en { letter-spacing: .3em; }
}

/* ---------- landscape phones ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --hud-h: 76px; --bar-h: 140px; }
  .pips { gap: 4px; }
  .pip { width: 10px; height: 10px; }
  .hand-btn { width: 60px; height: 52px; }
  .hand-btn .hb-glyph { font-size: 20px; }
  .ability-card { height: 44px; min-width: 0; }
  .pick-glyph { font-size: 24px; }
  #hud-profile { font-size: 10px; gap: 6px; }
  .rank-name { font-size: 11px; }
  .screen { padding: 10px; }
  .panel { padding: 10px 14px; max-height: 92vh; }
}

/* ============================================================
   motion timing helpers and secondary states
   ============================================================ */

/* ---------- banner tone underlines ---------- */
#banner.banner-tone-gold::after,
#banner.banner-tone-info::after,
#banner.banner-tone-bad::after {
  content: '';
  display: block;
  height: 2px;
  margin: 6px auto 0;
  width: 60%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: .7;
}

/* ---------- hand key emphasis while selecting ---------- */
.hand-btn .hb-key { transition: background .15s ease, color .15s ease; }
.hand-btn:not(:disabled) .hb-key { background: rgba(107,58,214,.25); color: var(--ink); }
.hand-btn:not(:disabled):hover .hb-key { background: rgba(255,207,92,.3); color: var(--gold); }
.hand-btn.is-locked .hb-key { background: rgba(255,207,92,.4); color: var(--gold); }

/* ---------- armed card underline meter ---------- */
.ability-card.is-armed::before {
  content: '';
  position: absolute; left: 6px; right: 6px; bottom: 4px;
  height: 2px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ---------- pip idle shimmer ---------- */
.pip { transition: background .25s ease, box-shadow .25s ease; }
.pip:not(.is-won) { background: rgba(20,10,46,.6); }

/* ---------- charge pips overflow marker ---------- */
.charge-pips.is-max .cp.is-full { animation: glow-pulse 1.4s ease-in-out infinite; }
.charge-pips .cp { transition: background .2s ease, box-shadow .2s ease; }

/* ---------- armed chip pop ---------- */
.armed-chip { animation: pop-in .35s cubic-bezier(.2,2.2,.4,1); }
.armed-chip.hidden { display: none; }

/* ---------- profile strip separators ---------- */
#hud-profile > * + * { position: relative; }
.profile-chip { text-transform: none; }

/* ---------- result achievements staggered entry ---------- */
.ach-chip:nth-child(2) { animation-delay: .12s; }
.ach-chip:nth-child(3) { animation-delay: .24s; }
.ach-chip:nth-child(4) { animation-delay: .36s; }
.ach-row:empty { display: none; }

/* ---------- score emphasis ---------- */
.result-score { letter-spacing: .06em; text-shadow: 0 0 26px rgba(107,58,214,.6); }

/* ---------- daily reward chip ---------- */
.daily-reward strong { color: var(--gold); }

/* ---------- vault empty states ---------- */
.vault-panel-body > .panel-sub { padding: 24px 8px; }

/* ---------- chest card idle float ---------- */
.chest-card { transition: transform .18s ease; }
.chest-card:hover { transform: translateY(-3px); }
.chest-cards:empty::after {
  content: '暺???敺蝷箏??OPEN TO REVEAL CARDS';
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-dim); font-family: var(--font-mono);
}

/* ---------- toast entrance from left with fade ---------- */
.toast { opacity: 0; animation: toast-in .32s ease-out forwards; }

/* ---------- tab focus order hint ---------- */
.tab-row .tab-btn + .tab-btn { margin-left: 2px; }

/* ---------- ladder bar pulse when current ---------- */
.v-card.is-current .ladder-bar-in { animation: xp-fill 1.2s ease-out; }

/* ---------- howto panel header accent ---------- */
.howto-col h3 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.howto-col + .howto-col h3 { color: var(--p2); }

/* ---------- controls hint colouring ---------- */
#controls-hint { text-shadow: 0 1px 3px rgba(3,0,12,.8); }

/* ---------- stage glow floor hint ---------- */
#stage::after {
  content: '';
  position: absolute; left: 50%; bottom: 12%;
  width: 60%; height: 24%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(107,58,214,.28), transparent 70%);
  pointer-events: none;
}

/* ---------- panel header ornament ---------- */
.panel-title { letter-spacing: .04em; }
.panel-title small { color: var(--ink-dim); }

/* ---------- gold button gradient shift on hover ---------- */
.btn-primary { background-size: 160% 160%; background-position: 0% 50%; transition: background-position .25s ease, transform .12s ease; }
.btn-primary:hover { background-position: 100% 50%; }

/* ---------- pick label letterspacing ---------- */
.pick-label { letter-spacing: .14em; }

/* ---------- hint chip pulse when available ---------- */
.hint-chip:not(.hidden) { animation: glow-pulse 2.4s ease-in-out infinite; cursor: pointer; user-select: none; }
.hint-chip.hidden { display: none; }

/* ============================================================
   ability cards: five equal columns that stay legible as the bar
   gets tight — all five abilities must always be readable at once
   ============================================================ */
.ability-card .ab-name,
.ability-card .ab-en,
.ability-card .ab-lock { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1599px) {
  .ability-card { padding: 4px 6px; }
  .ability-card .ab-name { font-size: 12px; }
  .ability-card .ab-en { font-size: 7px; letter-spacing: .1em; }
  .ability-card .ab-lock { font-size: 8px; }
  .ability-card .ab-cost { font-size: 9px; top: 4px; right: 5px; }
}

