:root {
  --bg: #090a12;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f6f4ed;
  --muted: #b5b1a8;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #ffd36a;
  --accent-2: #9be7ff;
  --bad: #ff6b6b;
  --good: #75f0a2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  --radius: 24px;
}

* { box-sizing: border-box; }

[v-cloak] { display: none; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 211, 106, 0.18), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(155, 231, 255, 0.16), transparent 26%),
    linear-gradient(140deg, #090a12 0%, #111522 50%, #0c0b13 100%);
  color: var(--text);
  overflow-x: hidden;
}

button, input { font: inherit; }

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  color: #111;
  background: var(--accent);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 211, 106, 0.22);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
  touch-action: manipulation;
}

button:hover { transform: translateY(-1px); filter: brightness(1.02); }
button:active { transform: translateY(1px) scale(0.99); }
button.secondary { background: rgba(255,255,255,0.11); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
button.danger { background: rgba(255, 107, 107, 0.16); color: #fff; border: 1px solid rgba(255, 107, 107, 0.3); box-shadow: none; width: 100%; }

input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  padding: 14px 14px;
  outline: none;
}

input:focus { border-color: rgba(255, 211, 106, 0.65); }

.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 18px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 6vw, 48px); letter-spacing: -0.05em; }
h2 { font-size: clamp(26px, 5vw, 48px); line-height: 0.96; letter-spacing: -0.05em; margin-bottom: 16px; }
h3 { margin-bottom: 8px; }

.eyebrow, .kicker { color: var(--accent-2); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
.kicker { margin-bottom: 10px; }
.muted, .legal-note, small { color: var(--muted); }
.legal-note { font-size: 13px; margin: 16px 0 0; }

.shell { max-width: 1240px; margin: 0 auto; padding: 18px; }
.panel {
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.045));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-panel, .result-panel, .leaderboard-panel { padding: clamp(18px, 4vw, 34px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 24px; align-items: stretch; }

.status-pill {
  border-radius: 999px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.status-pill.ok { color: var(--good); border-color: rgba(117, 240, 162, .3); }
.status-pill.warn { color: var(--bad); border-color: rgba(255, 107, 107, .35); }

.wallet-card, .rules-card, .mode-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}
.wallet-card { margin: 22px 0; }
.wallet-card label { display: block; font-weight: 750; margin-bottom: 8px; }
.wallet-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.wallet-card small { display: block; margin-top: 8px; line-height: 1.45; }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card p { min-height: 44px; color: var(--muted); }
.mode-card button { width: 100%; }
.mode-card.ranked { border-color: rgba(255, 211, 106, 0.34); }

.rules-card ul { list-style: none; padding: 0; margin: 0 0 18px; }
.rules-card li { color: var(--muted); padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.rules-card li span { color: var(--accent); font-weight: 900; margin-right: 6px; }
.mini-stats, .stats-grid, .result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-stats div, .stats-grid div, .result-grid div {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: 13px;
}
.mini-stats b, .stats-grid b, .result-grid b { display: block; font-size: 25px; }
.mini-stats small, .stats-grid small, .result-grid small { display: block; margin-top: 4px; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.game-panel, .stats-panel { padding: clamp(16px, 3vw, 24px); }
.game-head, .section-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.game-head h2 { margin: 0; font-size: clamp(54px, 14vw, 120px); }
.lives { font-size: 24px; letter-spacing: 3px; color: rgba(255,255,255,.22); }
.lives .alive { color: var(--bad); }

.book-strip {
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.18);
}
.book-title { color: var(--accent-2); font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.fragment { line-height: 1.55; color: rgba(246,244,237,.9); min-height: 52px; }
.progress-line, .pulse-bar {
  margin-top: 14px;
  height: 8px;
  background: rgba(255,255,255,.09);
  border-radius: 999px;
  overflow: hidden;
}
.progress-line span, .pulse-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .08s linear; }

.signal-stage {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.signal-stage.perfect { box-shadow: 0 0 0 2px rgba(117,240,162,.38); }
.signal-stage.good { box-shadow: 0 0 0 2px rgba(255,211,106,.35); }
.signal-stage.miss { box-shadow: 0 0 0 2px rgba(255,107,107,.34); }

.pulse-zone { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; }
.pulse-bar { margin: 0; height: 12px; }
.countdown { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; color: var(--text); }


.action-guide {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  background: rgba(0,0,0,.22);
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.action-guide.tap-now,
.action-guide.hold-now,
.action-guide.release-now {
  border-color: rgba(255, 211, 106, .7);
  box-shadow: 0 0 0 3px rgba(255, 211, 106, .12), 0 18px 44px rgba(255, 211, 106, .13);
}
.action-guide.keep-holding {
  border-color: rgba(155, 231, 255, .62);
  box-shadow: 0 0 0 3px rgba(155, 231, 255, .10);
}
.action-guide.late {
  border-color: rgba(255, 107, 107, .62);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, .12);
}
.action-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.action-topline strong {
  display: block;
  font-size: clamp(26px, 6vw, 54px);
  letter-spacing: -.045em;
  line-height: .95;
}
.action-guide.tap-now .action-topline strong,
.action-guide.hold-now .action-topline strong,
.action-guide.release-now .action-topline strong { color: var(--accent); }
.action-guide.keep-holding .action-topline strong { color: var(--accent-2); }
.action-guide.late .action-topline strong { color: var(--bad); }
.current-note-badge {
  min-width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: var(--accent);
  font-size: 34px;
  font-weight: 950;
}
.current-note-badge.long { min-width: 94px; }
.rhythm-lane {
  position: relative;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,.03)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 54px);
  border: 1px solid rgba(255,255,255,.13);
}
.lane-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(255,211,106,.10), rgba(255,211,106,.02));
  pointer-events: none;
}
.hit-gate {
  position: absolute;
  left: 22%;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(255,211,106,.12), 0 0 30px rgba(255,211,106,.35);
}
.hit-gate span {
  position: absolute;
  top: -4px;
  left: 11px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .12em;
  font-weight: 900;
}
.moving-note {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--accent);
  color: #111;
  border: 2px solid rgba(255,255,255,.58);
  box-shadow: 0 16px 36px rgba(0,0,0,.32), 0 0 34px rgba(255,211,106,.24);
  font-size: 32px;
  font-weight: 950;
  transition: left .045s linear;
}
.moving-note.long {
  min-width: 118px;
  border-radius: 999px;
}
.action-guide.holding .moving-note {
  filter: brightness(1.12);
  box-shadow: 0 0 0 6px rgba(155, 231, 255, .13), 0 20px 46px rgba(0,0,0,.34);
}
.hold-helper { margin-top: 12px; }
.hold-helper-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.hold-helper-label strong { color: var(--text); }
.hold-helper-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}
.hold-helper-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .05s linear;
}
.action-hint {
  min-height: 24px;
  margin-top: 11px;
  color: var(--muted);
  font-weight: 700;
}
.pulse-zone.compact {
  opacity: .78;
  margin-top: 10px;
}

.signal-row {
  display: flex;
  gap: 10px;
  overflow: hidden;
  padding: 18px 0 20px;
  min-height: 75px;
  align-items: center;
}
.signal-chip {
  min-width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.62);
  font-size: 25px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .15s ease, background .15s ease;
}
.signal-chip.long { min-width: 76px; }
.signal-chip.current {
  background: var(--accent);
  color: #111;
  transform: scale(1.12);
  box-shadow: 0 16px 34px rgba(255,211,106,.22);
}

.tap-button {
  width: 100%;
  min-height: 154px;
  border-radius: 28px;
  font-size: clamp(26px, 6vw, 44px);
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.tap-button small { display: block; color: rgba(0,0,0,.55); font-size: 13px; margin-top: 6px; }
.tap-button.holding { filter: brightness(1.13); transform: scale(.995); box-shadow: 0 0 0 5px rgba(155,231,255,.17), 0 18px 48px rgba(155,231,255,.18); }
.feedback { min-height: 28px; margin-top: 14px; text-align: center; font-weight: 800; }

.detail-list { margin: 18px 0; color: var(--muted); }
.detail-list p { margin: 8px 0; }
.detail-list strong { color: var(--text); }

.result-panel { text-align: center; margin-bottom: 18px; }
.result-grid { grid-template-columns: repeat(4, 1fr); margin: 20px 0; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.leaderboard-panel { margin-top: 18px; }
.empty { padding: 18px; border-radius: 16px; border: 1px dashed var(--line); color: var(--muted); }
table { width: 100%; border-collapse: collapse; overflow: hidden; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
th { color: var(--accent-2); font-size: 13px; }
td { color: rgba(246,244,237,.88); }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; }
  .hero-grid, .game-layout { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-panel { order: -1; }
}

@media (max-width: 560px) {
  .topbar { padding-top: 16px; }
  .shell { padding: 12px; }
  .hero-panel, .result-panel, .leaderboard-panel, .game-panel, .stats-panel { padding: 15px; border-radius: 20px; }
  .wallet-row { grid-template-columns: 1fr; }
  .game-head { align-items: flex-start; }
  .lives { font-size: 18px; }
  .pulse-zone { grid-template-columns: 1fr; gap: 8px; }
  .countdown { text-align: left; }
  .action-topline { align-items: flex-start; }
  .current-note-badge { min-width: 52px; height: 52px; font-size: 29px; }
  .current-note-badge.long { min-width: 80px; }
  .rhythm-lane { height: 76px; }
  .moving-note { min-width: 48px; height: 48px; font-size: 28px; }
  .moving-note.long { min-width: 96px; }
  .tap-button { min-height: 142px; }
  th:nth-child(4), td:nth-child(4), th:nth-child(6), td:nth-child(6) { display: none; }
}
