/* ── Game arena ─────────────────────────────────────────── */
.game-arena {
  position: relative;
  padding: 0.5rem 0 2.5rem;
}

.game-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  background: var(--bg-arena);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-game);
}

.game-main {
  padding: 1.25rem 1.5rem 1.5rem;
  border-right: 1px solid var(--border);
}

/* Score hero */
.score-hero {
  text-align: center;
  margin-bottom: 1rem;
}

.score-hero-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.score-hero-value {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  text-shadow: none;
  transition: transform 0.1s;
}

.score-hero-value.bump {
  transform: scale(1.06);
  color: var(--accent);
}

.score-hero-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.score-hero-sub strong { color: var(--gold); }

/* Stats strip */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.5rem;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Spacebar key */
.key-zone {
  position: relative;
  margin-bottom: 1rem;
}

.pop-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.float-pop {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  animation: floatUp 0.75s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-70px) scale(1.15); }
}

.spacebar-btn {
  width: 100%;
  min-height: 140px;
  background: linear-gradient(180deg, var(--key-face) 0%, var(--key-face-mid) 100%);
  border: 1px solid var(--key-edge);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.07s, box-shadow 0.07s, border-color 0.2s;
  box-shadow: var(--shadow-key);
  position: relative;
  overflow: hidden;
}

.spacebar-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.spacebar-btn:hover { border-color: var(--text-muted); }
.spacebar-btn:active,
.spacebar-btn.pressed {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--key-edge);
}

.spacebar-label {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.spacebar-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.key-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.key-prompt kbd {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg-primary);
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* Combo */
.combo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 28px;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.combo-bar.active { color: var(--gold); }
.combo-bar .combo-count { font-family: var(--font-mono); font-size: 1rem; }

.game-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-actions button {
  font-family: var(--font-body);
  font-size: 0.78rem;
}

/* Shop */
.upgrade-shop {
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  max-height: 520px;
}

.shop-head {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 2;
}

.shop-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  animation: shopPulse 1.5s ease-in-out infinite;
}

.shop-badge[hidden] { display: none; }

@keyframes shopPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.shop-list {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
}

.upgrade-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  padding: 0.7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.45rem;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.upgrade-item.affordable {
  border-color: var(--border-accent);
  background: var(--bg-primary);
}

.upgrade-item.affordable:hover {
  transform: translateX(2px);
  border-color: var(--accent);
}

.upgrade-item.disabled { opacity: 0.45; }

.upgrade-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.upgrade-body { min-width: 0; }

.upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
}

.upgrade-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.upgrade-owned {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.upgrade-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0.4rem;
}

.upgrade-buy {
  padding: 0.3rem 0.65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-mono);
}

.upgrade-buy:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Start overlay */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(250, 248, 245, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.4s, visibility 0.4s;
}

.start-overlay.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  text-align: center;
  max-width: 420px;
}

.start-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.start-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.start-btn kbd {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.start-hint {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast */
.toast-stack {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  right: 12px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.35s ease-out, toastOut 0.35s ease-in 2.65s forwards;
  max-width: 260px;
}

.toast-gold { border-color: var(--gold); color: var(--gold); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* Reset modal */
.reset-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 1rem;
}

.reset-modal[hidden] { display: none; }

.reset-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
}

.reset-modal-content h3 { font-family: var(--font-display); margin-bottom: 0.75rem; }
.reset-modal-content p { color: var(--text-secondary); margin-bottom: 1.25rem; font-size: 0.9rem; }
.reset-modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Mobile play bar */
.mobile-play-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 0.65rem 1rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.mobile-play-bar button {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}

@media (max-width: 768px) {
  .game-panel { grid-template-columns: 1fr; }
  .game-main { border-right: none; border-bottom: 1px solid var(--border); }
  .upgrade-shop { max-height: none; }
  .mobile-play-bar { display: block; }
  body { padding-bottom: 60px; }
}
