.game-page {
  padding: 0;
}

.game-screen {
  padding: 12px 0 24px;
}

.game-screen-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100dvh - 72px);
}

.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.game-bar-copy h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink-900);
}

.game-bar-copy p {
  margin: 2px 0 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ink-600);
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.hud-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(244, 114, 182, 0.22);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-500);
}

.hud-item strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-700);
}

.hud-status {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-600);
}

.game-stage {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.game-canvas-wrapper {
  position: relative;
  flex: 1 1 auto;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.9), rgba(244, 232, 255, 0.92));
  border: 1px solid rgba(225, 220, 255, 0.7);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  min-height: 0;
}

.game-canvas {
  width: 100%;
  height: min(62dvh, calc(100dvh - 220px));
  min-height: 280px;
  display: block;
  background: transparent;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.35rem);
  font-weight: 700;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 16px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.4s ease;
}

.game-overlay[hidden] {
  display: flex;
  opacity: 0;
  visibility: hidden;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.game-controls .btn {
  min-width: 0;
  flex: 1 1 0;
  padding: 10px 14px;
}

.btn-light {
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn-light:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.25);
}

.game-extras {
  display: grid;
  gap: 12px;
}

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

.score-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-history-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-600);
}

.link-btn {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-600);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}

.link-btn:hover,
.link-btn:focus-visible {
  color: var(--brand-700);
}

.score-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.score-history-item time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-400);
}

.score-history-empty {
  color: var(--ink-400);
  font-style: italic;
  font-size: 0.85rem;
}

.game-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setting-toggle {
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.92);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.setting-toggle:hover,
.setting-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.setting-toggle[data-state="on"] {
  border-color: rgba(236, 72, 153, 0.4);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(14, 165, 233, 0.12));
}

.setting-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-700);
}

.setting-state {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-500);
}

@media (max-width: 640px) {
  .game-screen {
    padding: 8px 0 16px;
  }

  .game-bar-copy p {
    font-size: 0.8rem;
  }

  .game-canvas {
    height: min(58dvh, calc(100dvh - 210px));
  }

  .game-controls .btn {
    flex: 1 1 30%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-overlay {
    transition: none;
  }

  .btn,
  .btn:hover,
  .btn:focus-visible {
    transition: none;
  }
}
