/* GridSweeper — Design tokens from DESIGN.md */

@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/SpaceGrotesk-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/SpaceGrotesk-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/SpaceGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Liberation Mono';
  src: url('assets/fonts/LiberationMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Liberation Mono';
  src: url('assets/fonts/LiberationMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* UI Colors */
  --primary: #258cf4;
  --primary-hover: #3b9af5;
  --primary-pressed: #1f7fda;
  --destructive: #ef4444;
  --destructive-hover: #f65d5d;
  --destructive-pressed: #dc2626;
  --bg-top: #071524;
  --bg-bottom: #071b2c;
  --surface-card: rgba(15, 26, 36, 0.85);
  --surface-panel: #1e293b;
  --surface-button-idle: #1e2a3f;
  --surface-button-idle-hover: #22324a;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-tertiary: #475569;
  --empty: #334155;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-faint: rgba(255, 255, 255, 0.05);
  --border-faintest: rgba(255, 255, 255, 0.02);

  /* Decorative */
  --glow-blue: rgba(28, 69, 140, 0.12);
  --glow-purple: rgba(61, 51, 148, 0.10);

  /* Region palette */
  --region-0: #0d9488;
  --region-1: #8b5cf6;
  --region-2: #b91c1c;
  --region-3: #eab308;
  --region-4: #22c55e;
  --region-5: #ec4899;
  --region-6: #6366f1;
  --region-7: #f97316;
  --region-8: #06b6d4;

  /* Cell states */
  --cell-hidden: rgb(51, 61, 84);
  --cell-hidden-border: rgb(63, 74, 97);
  --cell-exploded-bg: rgba(240, 69, 69, 0.34);
  --cell-exploded-border: rgba(240, 69, 69, 0.7);

  /* Fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Liberation Mono', ui-monospace, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  background-color: var(--bg-bottom);
  color: var(--text-primary);
  font-family: var(--font-display);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

#app {
  height: 100%;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- SVG Icons --- */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* --- Screens --- */

.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  position: relative;
}
.screen.active {
  display: flex;
}

/* Desktop breakpoint: center content */
@media (min-width: 600px) {
  .screen {
    margin: 0 auto;
  }
}

/* ===========================
   MENU SCREEN
   =========================== */

#menu-screen {
  padding: clamp(20px, 4.3vh, 60px) clamp(12px, 5.1vw, 34px) 0;
  padding-top: max(clamp(20px, 4.3vh, 60px), env(safe-area-inset-top, 0px));
  padding-bottom: clamp(60px, 10vh, 90px); /* space for fixed bottom nav */
}

/* Menu header / logo */
.menu-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: clamp(10px, 3vh, 40px);
}

.menu-logo {
  margin-bottom: clamp(8px, 1.6vh, 20px);
}

.logo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3px, 0.5vh, 6px);
  width: clamp(36px, 6vh, 60px);
  height: clamp(36px, 6vh, 60px);
}

.logo-cell {
  border-radius: clamp(4px, 0.7vh, 8px);
}
.logo-blue {
  background: var(--primary);
}
.logo-teal {
  background: var(--region-0);
}

.menu-title {
  font-size: clamp(18px, 3.4vh, 42px);
  font-weight: 700;
  margin-bottom: clamp(2px, 0.4vh, 8px);
}

.menu-subtitle {
  font-size: clamp(10px, 1.4vh, 20px);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Mode cards */
.menu-modes {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 20px);
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.mode-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: clamp(8px, 1.4vh, 20px);
  padding: clamp(16px, 2.8vh, 36px) clamp(16px, 4vw, 28px);
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease;
  overflow: hidden;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-display);
  width: 100%;
}
.mode-card:hover {
  background: var(--surface-button-idle-hover);
  border-color: rgba(255, 255, 255, 0.12);
}
.mode-card:active {
  background: var(--surface-button-idle);
}
.mode-card[disabled] {
  opacity: 0.5;
  cursor: default;
}

.mode-card-top {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 16px);
  margin-bottom: clamp(8px, 1.4vh, 18px);
}

.mode-card-icon {
  width: clamp(36px, 5.5vh, 52px);
  height: clamp(36px, 5.5vh, 52px);
  border-radius: clamp(8px, 1.2vh, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.mode-card-icon-timed {
  background: rgba(37, 140, 244, 0.15);
  color: var(--primary);
}
.mode-card-icon-leisure {
  background: rgba(34, 197, 94, 0.15);
  color: var(--region-4);
}
.mode-card-icon-daily {
  width: clamp(32px, 4.5vh, 44px);
  height: clamp(32px, 4.5vh, 44px);
  border-radius: clamp(6px, 1vh, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--region-1);
}

.mode-card-badge {
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.2vh, 16px);
  font-weight: 700;
  padding: clamp(3px, 0.5vh, 6px) clamp(8px, 1.2vw, 14px);
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.mode-card-badge-timed {
  background: rgba(37, 140, 244, 0.15);
  color: var(--primary);
}
.mode-card-badge-leisure {
  background: rgba(34, 197, 94, 0.15);
  color: var(--region-4);
}

.mode-card-decorative {
  position: absolute;
  right: clamp(-10px, -1vw, -4px);
  bottom: clamp(-10px, -1vh, -4px);
  width: clamp(80px, 14vh, 130px);
  height: clamp(80px, 14vh, 130px);
  opacity: 0.06;
  color: var(--text-primary);
  pointer-events: none;
}

.mode-card-body {
  position: relative;
}

.mode-card-title {
  font-size: clamp(14px, 2.3vh, 34px);
  font-weight: 700;
  margin-bottom: 4px;
}

.mode-card-desc {
  font-size: clamp(10px, 1.4vh, 20px);
  color: var(--text-secondary);
  font-weight: 400;
}

/* Daily puzzle teaser (smaller card) */
.mode-card-daily {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 1.6vh, 20px) clamp(12px, 3vw, 20px);
}
.mode-card-daily-content {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
}
.mode-card-daily-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mode-card-daily-title {
  font-size: clamp(12px, 1.8vh, 24px);
  font-weight: 700;
}
.mode-card-chevron {
  width: clamp(12px, 1.8vh, 20px);
  height: clamp(12px, 1.8vh, 20px);
  color: var(--text-tertiary);
}

/* Bottom navigation — persistent, fixed at bottom */
.bottom-nav {
  display: none;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: clamp(10px, 1.6vh, 20px) 0;
  padding-bottom: max(clamp(10px, 1.6vh, 20px), env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(7, 21, 36, 0.85), rgba(7, 21, 36, 0.95));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bottom-nav.active {
  display: flex;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.4vh, 6px);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-size: clamp(9px, 1.2vh, 14px);
  font-weight: 500;
  padding: clamp(4px, 0.6vh, 10px) clamp(12px, 3vw, 24px);
  transition: color 200ms ease;
}
.nav-item:hover {
  color: var(--text-secondary);
}
.nav-item-active {
  color: var(--primary);
}

.nav-label {
  letter-spacing: 0.02em;
}
.nav-item[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===========================
   STATS SCREEN
   =========================== */

#stats-screen {
  padding: clamp(20px, 4.3vh, 60px) clamp(12px, 5.1vw, 34px) 0;
  padding-top: max(clamp(20px, 4.3vh, 60px), env(safe-area-inset-top, 0px));
  padding-bottom: clamp(60px, 10vh, 90px); /* space for fixed bottom nav */
}

.stats-header {
  text-align: center;
  margin-bottom: clamp(16px, 2.5vh, 32px);
}

.stats-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 3.4vh, 42px);
  color: var(--text-primary);
}

/* Mode tabs (segmented control) */
.stats-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-panel);
  border-radius: clamp(8px, 1.4vh, 20px);
  padding: 3px;
  margin-bottom: clamp(16px, 2.5vh, 32px);
  width: 100%;
}

.stats-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.6vh, 8px);
  padding: clamp(8px, 1.2vh, 14px) 0;
  border: none;
  border-radius: clamp(6px, 1vh, 16px);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(12px, 1.6vh, 20px);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.stats-tab:hover {
  color: var(--text-primary);
}
.stats-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Stat cards — 2x2 grid */
.stats-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.2vh, 16px);
  margin-bottom: clamp(20px, 3vh, 40px);
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-faint);
  border-radius: clamp(8px, 1.4vh, 20px);
  padding: clamp(12px, 2vh, 24px);
  text-align: center;
}

.stat-card-label {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(9px, 1.2vh, 14px);
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: clamp(4px, 0.6vh, 8px);
}

.stat-card-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(22px, 3.6vh, 48px);
  color: var(--text-primary);
}

.stat-card-sub {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(9px, 1.2vh, 14px);
  color: var(--text-tertiary);
  margin-top: clamp(2px, 0.3vh, 4px);
}

/* Best times list */
.stats-times {
  width: 100%;
}

.stats-times-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(12px, 1.8vh, 22px);
  color: var(--text-primary);
  margin-bottom: clamp(8px, 1.2vh, 16px);
}

.stats-time-row {
  display: flex;
  align-items: baseline;
  padding: clamp(6px, 0.8vh, 10px) 0;
  border-bottom: 1px solid var(--border-faintest);
}

.stats-time-level {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(12px, 1.6vh, 20px);
  color: var(--text-secondary);
  white-space: nowrap;
}

.stats-time-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border-subtle);
  margin: 0 clamp(8px, 1.2vh, 16px);
  min-width: 20px;
  align-self: center;
}

.stats-time-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(12px, 1.6vh, 20px);
  color: var(--text-primary);
  white-space: nowrap;
}

.stats-time-empty {
  color: var(--text-tertiary);
}

/* Empty state */
.stats-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(32px, 6vh, 80px) 0;
  gap: clamp(12px, 2vh, 24px);
}

.stats-empty-icon {
  color: var(--text-tertiary);
  opacity: 0.5;
}

.stats-empty-message {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(12px, 1.8vh, 22px);
  color: var(--text-secondary);
  max-width: 250px;
}

.stats-empty-cta {
  margin-top: clamp(4px, 0.8vh, 12px);
}

/* ===========================
   GAME SCREEN
   =========================== */

#game-screen {
  padding: clamp(8px, 1.5vh, 24px) clamp(12px, 3vw, 24px) 0;
  padding-top: max(clamp(8px, 1.5vh, 24px), env(safe-area-inset-top, 0px));
  padding-bottom: 0;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: clamp(4px, 0.7vh, 10px);
}

.game-header-left {
  flex: 1;
}

.game-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.game-level {
  font-size: clamp(14px, 2.3vh, 34px);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.game-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.progress-dot {
  width: clamp(8px, 1.2vh, 16px);
  height: clamp(8px, 1.2vh, 16px);
  border-radius: 999px;
  background: var(--empty);
  transition: background-color 200ms ease;
}
.progress-dot.filled {
  background: var(--primary);
}

/* Timer (centered in header for timed mode) */
.game-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(14px, 2.7vh, 38px);
  text-align: center;
}
.game-timer.warning {
  color: var(--destructive);
}

/* Timer progress bar */
.game-timer-bar-track {
  width: 100%;
  height: 3px;
  background: var(--surface-panel);
  border-radius: 2px;
  margin-bottom: clamp(4px, 0.7vh, 10px);
  overflow: hidden;
}
.game-timer-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 250ms linear;
}
.game-timer-bar.warning {
  background: var(--destructive);
}

.icon-btn {
  background: var(--surface-button-idle);
  border: 1px solid var(--border-faintest);
  border-radius: clamp(6px, 0.9vh, 14px);
  color: var(--text-primary);
  width: clamp(32px, 4.5vh, 48px);
  height: clamp(32px, 4.5vh, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 200ms ease;
}
.icon-btn:hover {
  background: var(--surface-button-idle-hover);
}

/* Game main area — flex-grow to fill available space */
.game-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding-top: clamp(8px, 2vh, 24px);
  padding-bottom: clamp(70px, 10vh, 100px); /* space for fixed footer */
}

/* Grid shell */
.grid-shell {
  background: rgba(31, 41, 59, 0.20);
  border: 1px solid var(--border-subtle);
  border-radius: clamp(10px, 1.8vh, 24px);
  padding: clamp(4px, 0.7vh, 10px);
  aspect-ratio: 1;
  width: 100%;
  max-width: min(520px, calc(100vh - 220px));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.grid {
  display: grid;
  gap: clamp(2px, 0.4vh, 6px);
  width: 100%;
  height: 100%;
}

/* Cells */
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14%;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  border: 1px solid var(--cell-hidden-border);
  background: var(--cell-hidden);
  transition: background-color 120ms ease-out, transform 120ms ease-out, opacity 120ms ease-out;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  container-type: inline-size;
}

/* Cell reveal animation */
.cell.cell-reveal {
  animation: cellReveal 120ms ease-out;
}
@keyframes cellReveal {
  from { transform: scale(0.95); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}

/* Flag place animation */
.cell.cell-flag-in {
  animation: flagIn 100ms ease-out;
}
@keyframes flagIn {
  from { transform: scale(0.8); opacity: 0.5; }
  to { transform: scale(1); opacity: 1; }
}

/* Flag remove animation */
.cell.cell-flag-out {
  animation: flagOut 80ms ease-in;
}
@keyframes flagOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0.7; }
}

.cell.revealed {
  border-color: rgba(255, 255, 255, 0.06);
}

.cell.flagged {
  border-color: var(--cell-hidden-border);
}

.cell.exploded {
  background: var(--cell-exploded-bg) !important;
  border-color: var(--cell-exploded-border);
  border-width: 2px;
}

.cell:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  z-index: 1;
}

.cell-value {
  font-size: clamp(10px, 42cqi, 40px);
  line-height: 1;
}

.cell-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-primary);
}

/* Game footer — fixed at bottom during game */
.game-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: clamp(8px, 1.4vh, 20px) 0;
  padding-bottom: max(clamp(8px, 1.4vh, 20px), env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 14px);
  background: linear-gradient(180deg, rgba(7, 21, 36, 0.85), rgba(7, 21, 36, 0.95));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Mode switcher */
.mode-switcher {
  display: flex;
  background: var(--surface-panel);
  border-radius: clamp(6px, 0.9vh, 14px);
  padding: 3px;
  gap: 3px;
}

.mode-btn {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(10px, 1.6vh, 24px);
  padding: clamp(6px, 1vh, 14px) clamp(16px, 3vw, 32px);
  border: none;
  border-radius: clamp(4px, 0.7vh, 12px);
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: background-color 200ms ease, color 200ms ease;
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.6vw, 8px);
  letter-spacing: 0.05em;
}
.mode-btn .icon {
  opacity: 0.7;
}
.mode-btn.active {
  background: var(--primary);
  color: var(--text-primary);
}
.mode-btn.active .icon {
  opacity: 1;
}

/* Mines counter */
.mines-counter {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.4vh, 22px);
  color: var(--text-tertiary);
  text-align: center;
  letter-spacing: 0.1em;
}

/* ===========================
   MODAL
   =========================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: clamp(10px, 1.8vh, 24px);
  padding: clamp(24px, 4vh, 48px) clamp(16px, 4vw, 32px) clamp(16px, 3vh, 36px);
  max-width: 360px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(20px);
  transform: translateY(20px);
  transition: transform 200ms ease-out;
}
.modal-overlay.active .modal-card {
  transform: translateY(0);
}

/* Icon circle at top of modal */
.modal-icon-circle {
  width: clamp(48px, 7vh, 72px);
  height: clamp(48px, 7vh, 72px);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(10px, 1.6vh, 20px);
}
.modal-icon-win {
  background: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 0 24px rgba(37, 140, 244, 0.3);
}
.modal-icon-loss {
  background: var(--destructive);
  color: var(--text-primary);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.3);
}

.modal-title {
  font-size: clamp(18px, 3.4vh, 42px);
  font-weight: 700;
  margin-bottom: clamp(4px, 0.7vh, 10px);
}

.modal-subtitle {
  font-size: clamp(10px, 1.4vh, 20px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: clamp(4px, 0.7vh, 10px);
}

.modal-progress-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: clamp(12px, 2vh, 24px);
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  margin-bottom: clamp(16px, 2.5vh, 32px);
}

.modal-stat-card {
  background: transparent;
  border: 1px solid var(--border-faint);
  border-radius: clamp(8px, 1.2vh, 16px);
  padding: clamp(10px, 1.6vh, 20px) clamp(20px, 4vw, 40px);
  text-align: center;
  min-width: clamp(90px, 16vw, 140px);
}

.modal-stat-label {
  font-size: clamp(9px, 1.2vh, 16px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.modal-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(16px, 3.2vh, 42px);
}

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

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(12px, 1.8vh, 26px);
  padding: clamp(10px, 1.6vh, 22px) 24px;
  border: none;
  border-radius: clamp(6px, 0.9vh, 14px);
  cursor: pointer;
  transition: background-color 200ms ease;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:active {
  background: var(--primary-pressed);
}

.btn-destructive {
  background: var(--destructive);
}
.btn-destructive:hover {
  background: var(--destructive-hover);
}
.btn-destructive:active {
  background: var(--destructive-pressed);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-faintest);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-ghost:hover {
  background: var(--surface-button-idle-hover);
  color: var(--text-primary);
}

/* Glassmorphism background decorations */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
.bg-glow-blue {
  width: 64vmin;
  height: 64vmin;
  background: var(--glow-blue);
  top: 20%;
  left: 30%;
  filter: blur(80px);
}
.bg-glow-purple {
  width: 60vmin;
  height: 60vmin;
  background: var(--glow-purple);
  top: 35%;
  right: 20%;
  filter: blur(80px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}
