@font-face {
  font-family: 'Anton';
  src: url('assets/fonts/anton.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('assets/fonts/chakra-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('assets/fonts/chakra-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('assets/fonts/chakra-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('assets/fonts/chakra-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #ff2447;
  --pink: #ff4d9d;
  --gold: #ffb347;
  --ink: #08030a;
  --ink-2: #12060d;
  --panel: rgba(14, 5, 11, 0.76);
  --panel-solid: #12060d;
  --line: rgba(255, 36, 71, 0.3);
  --line-hot: rgba(255, 77, 157, 0.7);
  --text: #fff0f5;
  --muted: rgba(255, 208, 222, 0.62);
  --muted-2: rgba(255, 208, 222, 0.4);
  --shadow-red: 0 0 18px rgba(255, 36, 71, 0.42), 0 0 54px rgba(255, 36, 71, 0.16);
  --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --font-ui: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #050105;
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  font-family: var(--font-ui);
  color: var(--text);
  cursor: pointer;
  border: 0;
  background: none;
}

[hidden] { display: none !important; }

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.city {
  position: fixed;
  inset: 0;
  background-image: url('assets/bg_city.webp');
  background-position: center 62%;
  background-size: cover;
  filter: saturate(1.16) brightness(0.55) contrast(1.05);
  transform: scale(1.03);
  z-index: 0;
}

.city::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(5, 0, 6, 0.9) 0%, rgba(5, 0, 6, 0.35) 34%, rgba(5, 0, 6, 0.1) 60%, transparent 100%),
    linear-gradient(180deg, rgba(5, 0, 6, 0.72) 0%, rgba(5, 0, 6, 0.18) 32%, rgba(5, 0, 6, 0.52) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 20, 60, 0.22), transparent 58%);
}

.haze {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 85%, rgba(255, 28, 68, 0.2), transparent 58%);
  animation: breathe 7s ease-in-out infinite;
}

.rain {
  position: fixed;
  inset: -20% 0 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  background-image: repeating-linear-gradient(108deg, transparent 0 35px, rgba(255, 120, 150, 0.09) 35px 36px, transparent 36px 78px);
  background-size: 160px 160px;
  animation: rainfall 1.6s linear infinite;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.22;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

@keyframes breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes rainfall {
  from { background-position: 0 0, 0 0; }
  to { background-position: -60px 160px, -120px 160px; }
}

/* ---------------- Shell ---------------- */
.shell {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1760px;
  height: 100%;
  margin: 0 auto;
  padding: calc(10px + var(--safe-t)) 14px calc(14px + var(--safe-b));
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 286px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "top top top"
    "left stage right";
  gap: 12px;
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 36, 71, 0.09), transparent 46%),
    linear-gradient(90deg, rgba(10, 3, 9, 0.96), rgba(22, 5, 14, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 160, 185, 0.14), 0 14px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 0.82;
  letter-spacing: 0.015em;
  background: linear-gradient(180deg, #ffd6df 0%, #ff6a87 26%, #ff1f3d 58%, #8a0823 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 36, 71, 0.55));
  padding-right: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: 0.12em;
  color: #fff6f8;
  text-shadow: 0 0 16px rgba(255, 36, 71, 0.4);
  white-space: nowrap;
}

.brand-edition {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--pink);
  white-space: nowrap;
}

.score-cluster {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 10px;
  margin-left: auto;
  margin-right: 6px;
}

.score-label {
  grid-column: 1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.score-value {
  grid-column: 1;
  grid-row: 2;
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 0.96;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #ffd3de 40%, #ff4d78 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(255, 36, 71, 0.5));
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}

.best-value {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}

.best-value span { color: var(--gold); font-weight: 700; }

.top-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 92, 130, 0.32);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 60, 100, 0.12), rgba(20, 5, 13, 0.5));
  color: #ffd8e2;
  transition: border-color 0.16s, background 0.16s, color 0.16s, transform 0.12s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--line-hot); background: rgba(255, 36, 71, 0.2); color: #fff; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.off { color: rgba(255, 200, 214, 0.4); border-color: rgba(255, 92, 130, 0.16); }

.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.side-left { grid-area: left; }
.side-right { grid-area: right; }

.card {
  position: relative;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(255, 36, 71, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(14, 5, 11, 0.88), rgba(9, 3, 8, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 150, 175, 0.1), 0 10px 26px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.card-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--pink);
  text-transform: uppercase;
}

.rank-name {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 0.94;
  letter-spacing: 0.03em;
  color: #fff4f7;
  text-shadow: 0 0 18px rgba(255, 36, 71, 0.42);
  text-transform: uppercase;
}

.rank-track, .boss-track, .energy-track {
  position: relative;
  height: 8px;
  margin-top: 10px;
  border-radius: 99px;
  background: rgba(255, 130, 160, 0.13);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #c31034 0%, #ff2447 45%, #ff4d9d 82%, #ffb347 100%);
  box-shadow: 0 0 12px rgba(255, 36, 71, 0.7);
  transition: width 0.35s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.rank-next {
  margin-top: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.combo-card {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.combo-value {
  font-family: var(--font-display);
  font-size: 49px;
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 77, 157, 0.55);
  font-variant-numeric: tabular-nums;
}
.combo-card.hot {
  border-color: var(--line-hot);
  box-shadow: inset 0 1px 0 rgba(255, 190, 210, 0.2), 0 0 26px rgba(255, 36, 71, 0.32);
}
.combo-card.hot .combo-value {
  background: linear-gradient(180deg, #fff 0%, #ffb347 55%, #ff2447 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: combopulse 0.9s ease-in-out infinite alternate;
}
@keyframes combopulse {
  from { filter: drop-shadow(0 0 8px rgba(255, 77, 157, 0.6)); }
  to { filter: drop-shadow(0 0 22px rgba(255, 179, 71, 0.85)); }
}
.combo-sub {
  margin-top: 4px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.boss-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 7px;
  gap: 8px;
}
.boss-meter-head span { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); }
.boss-meter-head b { font-family: var(--font-display); font-size: 22px; color: var(--gold); letter-spacing: 0.03em; }
.boss-meter-foot {
  margin-top: 7px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}
.boss-meter.live { border-color: rgba(255, 179, 71, 0.55); box-shadow: 0 0 24px rgba(255, 60, 70, 0.28); }
.boss-meter.live .boss-meter-head b { color: #fff; }

.stats-card { margin-top: auto; }
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 100, 130, 0.08);
}
.stat-row:last-child { border-bottom: 0; }
.stat-row b { font-size: 13px; color: #ffdce5; letter-spacing: 0.05em; }

.energy-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 36, 71, 0.1), rgba(9, 3, 8, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 150, 175, 0.12), 0 10px 26px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}
.energy-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--pink);
}
.energy-head b { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.04em; color: #fff; }
.energy-track { height: 10px; margin-top: 8px; }
.energy-track .meter-fill { background: linear-gradient(90deg, #ff2447, #ff4d9d 55%, #ffd27a); }

.specials { display: flex; flex-direction: column; gap: 8px; }

.special {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255, 70, 105, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(38, 8, 18, 0.9), rgba(15, 4, 11, 0.9));
  color: var(--text);
  text-align: left;
  transition: border-color 0.16s, transform 0.12s, box-shadow 0.16s, opacity 0.16s;
}
.special:hover { border-color: var(--line-hot); box-shadow: 0 0 18px rgba(255, 36, 71, 0.22); }
.special:active { transform: scale(0.985); }
.special.armed {
  border-color: var(--line-hot);
  box-shadow: 0 0 22px rgba(255, 36, 71, 0.45), inset 0 0 18px rgba(255, 36, 71, 0.15);
}
.special.disabled { opacity: 0.4; cursor: not-allowed; filter: saturate(0.5); }
.special.disabled:hover { border-color: rgba(255, 70, 105, 0.28); box-shadow: none; }

.sp-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 90, 125, 0.36);
  background: radial-gradient(circle at 50% 40%, rgba(255, 60, 100, 0.3), rgba(20, 5, 12, 0.7));
  color: #ffb9c8;
}
.sp-icon svg { width: 20px; height: 20px; }
.special[data-special="pulse"] .sp-icon { color: #ff9fbe; }
.special[data-special="nuke"] .sp-icon { color: #ffd27a; }

.sp-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.sp-name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #fff1f5;
  white-space: nowrap;
}
.sp-desc {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-cost {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.03em;
  color: var(--gold);
  padding-left: 2px;
}
.special.disabled .sp-cost { color: var(--muted); }

.special-readout {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
}

.stage-wrap {
  grid-area: stage;
  position: relative;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-wrap::before {
  content: '';
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 30, 70, 0.16), transparent 62%);
  filter: blur(18px);
  pointer-events: none;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.hint {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border: 1px solid rgba(255, 80, 115, 0.3);
  border-radius: 99px;
  background: rgba(10, 3, 9, 0.82);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
}
.hint.hide { opacity: 0; }

.target-banner {
  position: fixed;
  top: calc(8px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  z-index: 59;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border: 1px solid var(--line-hot);
  border-radius: 99px;
  background: rgba(16, 4, 12, 0.94);
  box-shadow: 0 0 26px rgba(255, 36, 71, 0.4);
  white-space: nowrap;
}
.target-banner span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ffd6e0;
}
.target-banner button {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(255, 90, 125, 0.4);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #ffd6e0;
  background: rgba(255, 36, 71, 0.16);
}

/* ---------------- Screens ---------------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b));
  background:
    radial-gradient(ellipse at 50% 40%, rgba(60, 5, 22, 0.42), rgba(4, 1, 5, 0.88) 62%),
    rgba(4, 1, 5, 0.62);
  backdrop-filter: blur(7px);
  animation: fadein 0.24s ease-out;
}
#screen-start { background: radial-gradient(ellipse at 50% 36%, rgba(80, 6, 30, 0.3), rgba(4, 1, 5, 0.72) 68%), rgba(4, 1, 5, 0.35); }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.screen-panel {
  position: relative;
  width: min(560px, 94vw);
  max-height: calc(100dvh - 28px - var(--safe-t) - var(--safe-b));
  overflow: auto;
  padding: 26px 30px 22px;
  border: 1px solid rgba(255, 60, 100, 0.4);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 36, 71, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(17, 5, 13, 0.97), rgba(7, 2, 8, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 170, 192, 0.16), 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 70px rgba(255, 30, 70, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 36, 71, 0.5) transparent;
}
.screen-panel::-webkit-scrollbar { width: 6px; }
.screen-panel::-webkit-scrollbar-thumb { background: rgba(255, 36, 71, 0.45); border-radius: 9px; }

.start-panel { text-align: center; width: min(590px, 94vw); }

.start-topline {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--pink);
  margin-bottom: 14px;
}

.brand-lockup {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  line-height: 0.8;
}

.logo-word {
  font-family: var(--font-display);
  font-size: clamp(74px, 15vw, 118px);
  line-height: 0.78;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffe1e8 0%, #ff718d 22%, #ff1f3d 55%, #7e0822 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 36, 71, 0.6)) drop-shadow(0 8px 26px rgba(0, 0, 0, 0.6));
}

.logo-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-display);
  font-size: clamp(30px, 6.4vw, 50px);
  line-height: 0.84;
  letter-spacing: 0.06em;
  color: #fff5f7;
  text-shadow: 0 0 20px rgba(255, 36, 71, 0.45);
  padding-bottom: 5px;
}
.logo-stack span:last-child {
  color: transparent;
  background: linear-gradient(180deg, #ffd7e0, #ff3d62 65%, #a30c2d);
  -webkit-background-clip: text;
  background-clip: text;
}

.edition-line {
  margin-top: 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.52em;
  color: #ffbccc;
  text-indent: 0.52em;
}

.tagline {
  margin: 14px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(23px, 4.4vw, 34px);
  letter-spacing: 0.09em;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 77, 157, 0.75), 0 0 48px rgba(255, 36, 71, 0.5);
}
.tagline::before, .tagline::after { content: '//'; color: var(--red); opacity: 0.9; margin: 0 10px; font-size: 0.7em; }

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 150, 170, 0.55);
  background: linear-gradient(180deg, #ff5d7b 0%, #ff2447 46%, #b50e2e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 0 30px rgba(255, 36, 71, 0.42), 0 14px 34px rgba(0, 0, 0, 0.45);
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.09em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(120, 0, 20, 0.55), 0 0 16px rgba(255, 255, 255, 0.25);
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}
.btn-primary { white-space: nowrap; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 0 44px rgba(255, 36, 71, 0.6), 0 16px 38px rgba(0, 0, 0, 0.5); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.compact { min-height: 46px; font-size: 18px; padding: 0 24px; }

#btn-start { width: 100%; margin-top: 2px; }

.start-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.start-meta > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 80, 115, 0.24);
  border-radius: 10px;
  background: rgba(255, 36, 71, 0.05);
  text-align: left;
}
.start-meta span { font-size: 8px; font-weight: 700; letter-spacing: 0.24em; color: var(--muted); }
.start-meta b { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.05em; color: #ffe4ea; }

.leaderboard-box {
  margin-top: 14px;
  border: 1px solid rgba(255, 80, 115, 0.24);
  border-radius: 12px;
  background: rgba(255, 36, 71, 0.04);
  overflow: hidden;
}
.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 7px;
  border-bottom: 1px solid rgba(255, 80, 115, 0.14);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--pink);
}
.lb-head span:last-child { color: var(--muted-2); letter-spacing: 0.16em; }
.lb-list { padding: 5px 0; }
.lb-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.lb-rank { font-family: var(--font-display); font-size: 13px; color: var(--muted-2); }
.lb-row:nth-child(1) .lb-rank { color: var(--gold); }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ffe8ee; text-align: left; }
.lb-name a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255, 100, 135, 0.3); }
.lb-row.mine .lb-name { color: var(--pink); font-weight: 700; }
.lb-value { font-family: var(--font-display); font-size: 15px; color: #ffdce4; letter-spacing: 0.04em; }
.lb-empty { padding: 12px; font-size: 10px; letter-spacing: 0.16em; color: var(--muted-2); text-align: center; }
.lb-retry { display: block; margin: 4px auto 8px; font-size: 9px; letter-spacing: 0.14em; color: var(--gold); text-decoration: underline; }

.start-actions, .over-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.start-actions > *, .over-actions > * { flex: 1; }
.over-actions .btn-primary { font-size: 20px; padding: 0 14px; white-space: nowrap; letter-spacing: 0.05em; }

.btn-ghost {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 90, 125, 0.34);
  background: rgba(255, 36, 71, 0.07);
  color: #ffd3de;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: border-color 0.16s, background 0.16s;
}
.btn-ghost:hover { border-color: var(--line-hot); background: rgba(255, 36, 71, 0.16); }

.start-foot {
  margin-top: 12px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  line-height: 1.6;
}

.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-kicker { font-size: 9px; font-weight: 700; letter-spacing: 0.3em; color: var(--pink); }
.btn-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 90, 125, 0.3);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
.btn-close:hover { color: #fff; border-color: var(--line-hot); }

.panel-title {
  margin: 8px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 36, 71, 0.4);
}

.help-panel { width: min(680px, 95vw); }
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.help-item {
  padding: 10px 12px;
  border: 1px solid rgba(255, 80, 115, 0.2);
  border-radius: 10px;
  background: rgba(255, 36, 71, 0.04);
}
.help-item b { display: block; font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; color: var(--pink); margin-bottom: 3px; }
.help-item p { margin: 0; font-size: 11px; line-height: 1.55; color: rgba(255, 226, 234, 0.78); }
.help-controls {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px dashed rgba(255, 90, 125, 0.28);
  border-radius: 8px;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  line-height: 1.7;
}
.help-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 16px;
}
.help-ranks span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 80, 115, 0.22);
  border-radius: 99px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.help-ranks span.got { color: var(--gold); border-color: rgba(255, 179, 71, 0.4); }

.pause-panel { text-align: center; width: min(420px, 92vw); }
.pause-panel .btn-primary, .pause-panel .btn-ghost { width: 100%; margin-top: 10px; }
.panel-copy { margin: 0 0 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.05em; }

.over-panel { text-align: center; width: min(520px, 94vw); }
.over-score {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(64px, 13vw, 100px);
  line-height: 0.9;
  background: linear-gradient(180deg, #fff, #ffd0dc 36%, #ff3d62 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 36, 71, 0.55));
  font-variant-numeric: tabular-nums;
}
.over-label { font-size: 9px; font-weight: 700; letter-spacing: 0.34em; color: var(--muted); margin-top: 2px; }
.over-rank { margin-top: 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.2em; color: var(--muted); }
.over-rank b { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.06em; color: var(--gold); margin-left: 6px; }
.over-best { margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: var(--pink); min-height: 14px; }
.over-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.over-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 80, 115, 0.22);
  border-radius: 9px;
  background: rgba(255, 36, 71, 0.04);
}
.over-stats span { font-size: 7.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); }
.over-stats b { font-family: var(--font-display); font-size: 20px; color: #ffe4ea; letter-spacing: 0.04em; }

/* ---------------- Boss cinematic ---------------- */
.cinematic {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(140, 8, 36, 0.55), rgba(5, 1, 6, 0.97) 66%),
    #050106;
  animation: fadein 0.28s ease-out;
}
.cinematic::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 60, 90, 0.05) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}
.cinematic-inner {
  position: relative;
  width: min(720px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: bossIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bossIn {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.boss-round-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: var(--pink);
}
.boss-cinematic-title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(30px, 11vw, 96px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 26px rgba(255, 36, 71, 0.8), 0 0 90px rgba(255, 36, 71, 0.4);
}
.boss-art {
  width: min(300px, 44vh);
  max-width: 60vw;
  margin: 6px 0 2px;
  filter: drop-shadow(0 0 34px rgba(255, 20, 60, 0.55)) drop-shadow(0 20px 40px rgba(0, 0, 0, 0.8));
  animation: bossFloat 2.2s ease-in-out infinite alternate;
}
@keyframes bossFloat {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-7px) scale(1.015); }
}
.boss-entry-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.14em;
  color: var(--pink);
  text-shadow: 0 0 18px rgba(255, 77, 157, 0.7);
}
.boss-entry-sub {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--muted);
}
.boss-entry-bar {
  width: min(380px, 74vw);
  height: 6px;
  margin-top: 14px;
  border-radius: 99px;
  background: rgba(255, 80, 115, 0.16);
  overflow: hidden;
}
.boss-entry-bar .meter-fill { background: linear-gradient(90deg, #ff2447, #ffb347); }

/* ---------------- Toasts ---------------- */
.toast-stack {
  position: fixed;
  z-index: 58;
  left: 50%;
  top: calc(8px + var(--safe-t));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
  width: min(420px, 90vw);
  align-items: center;
}
.toast {
  padding: 9px 18px;
  border-radius: 99px;
  border: 1px solid rgba(255, 110, 140, 0.5);
  background: rgba(18, 5, 13, 0.94);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 36, 71, 0.28);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff0f4;
  text-align: center;
  animation: toastIn 0.24s ease-out;
  backdrop-filter: blur(8px);
}
.toast b { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.06em; color: var(--gold); margin-left: 6px; }
.toast.rank { border-color: rgba(255, 179, 71, 0.6); }
.toast.boss { border-color: rgba(255, 77, 157, 0.7); color: #ffd6e6; }
.toast.warn { border-color: rgba(255, 90, 90, 0.55); }
.toast.out { animation: toastOut 0.28s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(0.98); } }

@keyframes denyPulse {
  0%, 100% { border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 150, 175, 0.12), 0 10px 26px rgba(0, 0, 0, 0.32); }
  40% { border-color: #ffe0e7; box-shadow: 0 0 34px rgba(255, 70, 110, 0.85); background: rgba(255, 36, 71, 0.26); }
}
@keyframes denyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.energy-card.denied { animation: denyPulse 0.22s ease-in-out 2; }
.special.denied { animation: denyShake 0.3s ease-in-out 1; border-color: #ffe0e7; box-shadow: 0 0 18px rgba(255, 70, 110, 0.45); }

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  html, body { overflow: hidden; }
  .shell {
    padding: calc(7px + var(--safe-t)) 7px calc(7px + var(--safe-b));
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "top"
      "left"
      "stage"
      "right";
    gap: 7px;
  }
  .topbar { min-height: 56px; padding: 6px 10px; border-radius: 13px; }
  .brand-logo { font-size: 34px; }
  .brand-title { font-size: 17px; }
  .brand-edition { font-size: 8px; letter-spacing: 0.26em; }
  .score-value { font-size: 32px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 9px; }
  .icon-btn svg { width: 17px; height: 17px; }

  .side { flex-direction: row; gap: 7px; }
  .side-left { align-items: stretch; }
  .side-left .card { flex: 1; padding: 8px 10px; border-radius: 11px; min-width: 0; }
  .side-left .card-kicker { font-size: 7.5px; letter-spacing: 0.22em; }
  .rank-name { font-size: 17px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rank-track { height: 6px; margin-top: 6px; }
  .rank-next { font-size: 7px; margin-top: 5px; letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .combo-card { flex: 0 0 92px !important; }
  .combo-value { font-size: 29px; }
  .combo-sub { display: none; }
  .boss-meter { display: block !important; }
  .boss-meter-head { margin-top: 3px; }
  .boss-meter-head span { font-size: 7.5px; letter-spacing: 0.1em; }
  .boss-meter-head b { font-size: 15px; }
  .boss-track { height: 6px; margin-top: 6px; }
  .boss-meter-foot { display: none; }
  .stats-card { display: none; }

  .side-right { flex-direction: row; align-items: stretch; gap: 7px; }
  .energy-card { flex: 0 0 74px; padding: 7px 8px; border-radius: 11px; display: flex; flex-direction: column; justify-content: center; }
  .energy-head { flex-direction: column; align-items: flex-start; gap: 1px; font-size: 7px; letter-spacing: 0.12em; }
  .energy-head b { font-size: 17px; }
  .energy-track { height: 6px; margin-top: 4px; }
  .specials { flex: 1; flex-direction: row; gap: 6px; }
  .special {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 6px 4px;
    text-align: center;
    border-radius: 10px;
    min-width: 0;
  }
  .sp-icon { width: 26px; height: 26px; border-radius: 7px; }
  .sp-icon svg { width: 16px; height: 16px; }
  .sp-body { align-items: center; width: 100%; overflow: hidden; }
  .sp-name { font-size: 10px; letter-spacing: 0.03em; white-space: normal; line-height: 1.05; }
  .sp-desc { display: none; }
  .sp-cost { position: static; font-size: 12px; padding: 0; }
  .special-readout { display: none; }
  .hint { bottom: 2px; font-size: 7px; padding: 4px 10px; letter-spacing: 0.12em; }
  .stage-wrap::before { inset: 2% 2%; }

  .start-panel { padding: 20px 18px 16px; }
  .help-panel { padding: 20px 18px; }
  .help-grid { grid-template-columns: 1fr; }
  .help-item p { font-size: 10.5px; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .brand-logo { font-size: 36px; }
  .score-cluster { margin-right: 0; }
  .best-value { font-size: 9px; }
  .top-actions { gap: 5px; }
  .top-actions .icon-btn { width: 32px; height: 32px; }
  .brand { gap: 6px; }
  .logo-word { font-size: clamp(66px, 20vw, 92px); }
  .logo-stack { font-size: clamp(26px, 8vw, 38px); }
  .tagline { font-size: 22px; margin: 12px 0 14px; }
  .tagline::before, .tagline::after { margin: 0 6px; }
  .over-stats span { font-size: 7px; }
}

@media (max-height: 720px) and (min-width: 981px) {
  .topbar { min-height: 58px; }
  .brand-logo { font-size: 36px; }
  .brand-title { font-size: 20px; }
  .score-value { font-size: 34px; }
  .rank-name { font-size: 23px; }
  .combo-value { font-size: 40px; }
  .card { padding: 10px 12px; }
  .screen-panel { padding: 18px 24px; }
  .logo-word { font-size: clamp(58px, 9vw, 88px); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .shell {
    grid-template-columns: 142px minmax(0, 1fr) 176px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "top top top"
      "left stage right";
    gap: 6px;
    padding: calc(5px + var(--safe-t)) 6px calc(5px + var(--safe-b));
  }
  .topbar { min-height: 44px; padding: 4px 10px; border-radius: 10px; }
  .brand-logo { font-size: 28px; }
  .brand-title { font-size: 15px; }
  .brand-edition { display: none; }
  .brand-text { display: flex; }
  .score-value { font-size: 26px; }
  .score-label { font-size: 7px; }
  .best-value { font-size: 8px; }
  .icon-btn { width: 30px; height: 30px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .side { flex-direction: column; gap: 5px; }
  .side-left .card { padding: 6px 8px; border-radius: 9px; }
  .rank-name { font-size: 15px; }
  .rank-next { font-size: 6.5px; }
  .combo-card { flex: 1 1 auto !important; display: flex; flex-direction: column; justify-content: center; }
  .combo-value { font-size: 24px; }
  .boss-meter { flex: 1 1 auto; }
  .boss-meter-head b { font-size: 13px; }
  .stats-card { display: none; }
  .energy-card { flex: 0 0 auto; }
  .energy-head { flex-direction: row; align-items: baseline; }
  .specials { flex-direction: column; flex: 1; gap: 4px; }
  .special { grid-template-columns: 24px minmax(0,1fr) auto; padding: 4px 6px; }
  .sp-icon { width: 22px; height: 22px; }
  .sp-icon svg { width: 14px; height: 14px; }
  .sp-body { align-items: flex-start; }
  .sp-name { font-size: 9px; white-space: nowrap; }
  .sp-cost { font-size: 11px; }
  .special-readout { display: none; }
  .hint { display: none; }
  .start-panel { width: min(740px, 94vw); display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px 20px; text-align: left; align-items: center; max-height: calc(100dvh - 16px); padding: 16px 22px; }
  .start-topline, .brand-lockup, .edition-line { grid-column: 1; }
  .brand-lockup { justify-content: flex-start; }
  .tagline { grid-column: 1; margin: 6px 0 10px; }
  #btn-start { grid-column: 1; }
  .start-meta { grid-column: 1; margin-top: 8px; }
  .leaderboard-box { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }
  .start-actions { grid-column: 1 / span 2; margin-top: 8px; }
  .start-foot { grid-column: 1 / span 2; margin-top: 6px; }
  .logo-word { font-size: clamp(54px, 10vw, 78px); }
  .logo-stack { font-size: clamp(22px, 4vw, 32px); }
  .over-panel { width: min(820px, 95vw); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; text-align: left; padding: 16px 22px; }
  .over-score, .over-label, .panel-kicker, .over-rank, .over-best, .over-stats, .over-actions, .start-foot { grid-column: 1; }
  .over-panel .leaderboard-box { grid-column: 2; grid-row: 1 / span 7; margin-top: 0; }
  .over-actions { margin-top: 8px; }
  .screen-panel .logo-word { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .haze, .rain, .combo-card.hot .combo-value, .boss-art { animation: none !important; }
}
