/* ---- Hub card grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
  max-width: 960px;
  margin: 0 auto;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--bg-1);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-height: 120px;
  border: 1px solid transparent;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.game-card:active {
  transform: scale(0.97);
  border-color: var(--accent);
}

.game-card .icon {
  font-size: 32px;
  line-height: 1;
}

.game-card h2 {
  font-size: 18px;
}

.game-card p {
  font-size: 13px;
}

.badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge--sp {
  background: var(--bg-2);
  color: var(--fg-1);
}

.badge--mp {
  background: var(--accent);
  color: #06231d;
}

/* ---- Buttons ---- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  min-height: 48px;
  min-width: var(--touch-target-min);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-family);
  background: var(--bg-2);
  color: var(--fg-0);
  transition: transform 0.08s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--accent);
  color: #06231d;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--bg-2);
  color: var(--fg-1);
}

/* ---- In-game HUD ---- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

.hud-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  background: rgba(20, 23, 31, 0.7);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  min-height: var(--touch-target-min);
}

.hud-scores {
  display: flex;
  gap: var(--space-4);
  background: rgba(20, 23, 31, 0.7);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.hud-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

.hud-score .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-1);
}

.hud-score .value {
  font-size: 18px;
  font-weight: 700;
}

/* ---- Overlays (menu / game over / win) ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  text-align: center;
  padding: var(--space-5);
  background: rgba(11, 13, 18, 0.92);
}

.overlay[hidden] {
  display: none;
}

.overlay .stat {
  font-size: 15px;
  color: var(--fg-1);
}

.overlay .stat strong {
  color: var(--fg-0);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.overlay .actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

.toast {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.toast.show {
  animation: toast-pop 0.6s ease forwards;
}

@keyframes toast-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1);
  }
}
