/* ── Geometry Highscore — UI styling ────────────────────────────────── */

:root {
  --bg:         #0a0a18;
  --bg2:        #14143a;
  --neon-cyan:  #00e0ff;
  --neon-pink:  #ff3df1;
  --neon-lime:  #b9ff3d;
  --neon-amber: #ffb83d;
  --paper:      #ffffff;
  --dark:       #08081a;
  --dark-soft:  #1c1c34;
  --shadow:     0 6px 0 rgba(0,0,0,0.35), 0 14px 28px rgba(0,224,255,0.20);
  --shadow-soft:0 3px 0 rgba(0,0,0,0.25);
  --scale: 1;
}

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

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  color: var(--paper);
  font-family: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  background:
    radial-gradient(1200px 800px at 50% 50%, #1c1c4a 0%, #0a0a18 60%, #000 100%);
}

button { font-family: inherit; cursor: pointer; }

.app  { position: fixed; inset: 0; overflow: hidden; }
.stage {
  position: absolute;
  left: 50%; top: 50%;
  width: 800px; height: 600px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--scale));
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,224,255,0.18), 0 0 60px rgba(255,61,241,0.08);
  background: #06061a;
}

canvas#game {
  position: absolute; inset: 0;
  width: 800px; height: 600px;
  display: block;
  image-rendering: auto;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  border: 2.5px solid var(--dark);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 900;
  font-size: 16px;
  color: var(--dark);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s ease, filter 0.15s ease;
  min-height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
}
.btn:hover  { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.btn:focus-visible { outline: 3px solid var(--neon-amber); outline-offset: 3px; }
.btn--primary { background: linear-gradient(180deg, #5cf3ff, #00a8c4); color: var(--dark); box-shadow: var(--shadow); border-color: #002b3a; }
.btn--ghost   { background: rgba(255,255,255,0.92); }
.btn--accent  { background: linear-gradient(180deg, #ffe27a, #d99c00); color: var(--dark); box-shadow: var(--shadow); border-color: #4a3500; }
.btn--big     { padding: 14px 28px; font-size: 20px; min-height: 56px; border-radius: 22px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.85);
  background: rgba(20,20,58,0.85);
  color: var(--paper);
  font-size: 17px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s ease, background 0.15s ease;
  padding: 0;
}
.icon-btn:hover  { background: rgba(40,40,90,0.95); }
.icon-btn:active { transform: scale(0.94); }

/* ── HUD ──────────────────────────────────────────────────────────────── */
.hud {
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
  gap: 10px;
}
.hud__right { display: flex; gap: 6px; align-items: center; }
.hud__right .icon-btn,
.hud__right .hud__pill,
.hud__pill { pointer-events: auto; }
.hud__pill {
  background: rgba(10,10,30,0.72);
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 4px 12px;
  display: flex; flex-direction: column;
  align-items: center;
  line-height: 1;
  min-width: 86px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 14px rgba(0,224,255,0.18);
}
.hud__pill--score  { border-color: var(--neon-cyan); }
.hud__pill--record { border-color: var(--neon-pink); }
.hud__label { font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; color: rgba(255,255,255,0.7); font-weight: 800; }
.hud__value { font-size: 18px; font-weight: 900; color: var(--paper); margin-top: 2px; font-variant-numeric: tabular-nums; }
.hud__pill--score .hud__value  { color: var(--neon-cyan);  text-shadow: 0 0 10px rgba(0,224,255,0.6); }
.hud__pill--record .hud__value { color: var(--neon-pink);  text-shadow: 0 0 10px rgba(255,61,241,0.6); }

/* ── Overlays ─────────────────────────────────────────────────────────── */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(10,10,30,0.65) 0%, rgba(20,20,58,0.65) 100%);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }

.panel {
  background: rgba(10,10,30,0.92);
  border: 2.5px solid var(--neon-cyan);
  border-radius: 22px;
  padding: 26px 32px 22px;
  text-align: center;
  max-width: 540px; width: 100%;
  box-shadow: 0 0 24px rgba(0,224,255,0.35), 0 14px 28px rgba(0,0,0,0.55);
  position: relative;
  animation: panelPop 0.32s cubic-bezier(.34,1.56,.64,1);
  color: var(--paper);
}
@keyframes panelPop {
  0%   { transform: scale(0.86); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); }
}
.title {
  margin: 0 0 8px;
  font-size: 44px; font-weight: 900; letter-spacing: -1px;
  color: var(--neon-cyan);
  text-shadow: 0 0 18px rgba(0,224,255,0.65), 0 3px 0 rgba(0,0,0,0.4);
  line-height: 1;
}
.title__hi {
  color: var(--neon-pink);
  text-shadow: 0 0 18px rgba(255,61,241,0.65);
}
.sub  { margin: 0; font-size: 19px; font-weight: 900; color: var(--paper); }
.hint { margin: 8px 0 14px; font-size: 14px; color: rgba(255,255,255,0.8); font-weight: 700; }
.hint strong { color: var(--neon-lime); }
.record-pill {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--neon-amber);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 900;
  font-size: 14px;
  color: var(--paper);
  margin-bottom: 12px;
}
.record-pill strong { color: var(--neon-amber); font-variant-numeric: tabular-nums; }
.overlay__corner {
  position: absolute;
  top: 12px; right: 12px;
  display: flex; gap: 8px;
}

/* ── Startscherm — strakke arcade-card ───────────────────────────────── */
.overlay--start {
  background: linear-gradient(180deg, rgba(4,4,14,0.78) 0%, rgba(10,10,30,0.78) 100%);
  backdrop-filter: blur(4px);
}
.panel--start {
  width: 660px;
  max-width: 660px;
  min-height: 410px;
  padding: 62px 48px 28px;
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(6, 6, 20, 0.94);
  border: 2px solid var(--neon-cyan);
  border-radius: 24px;
  box-shadow: 0 0 28px rgba(0,224,255,0.28), 0 18px 40px rgba(0,0,0,0.55);
  position: relative;
}
.panel__corner {
  position: absolute;
  top: 14px; right: 14px;
  display: flex; gap: 10px;
  z-index: 1;
}
.icon-btn--card {
  width: 44px; height: 44px;
  font-size: 16px;
  background: rgba(20, 22, 50, 0.65);
  border: 1.5px solid rgba(255,255,255,0.32);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.92);
}
.icon-btn--card:hover {
  background: rgba(36, 40, 80, 0.85);
  border-color: rgba(255,255,255,0.55);
}
.title--start {
  margin: 0;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: none;
  display: inline-flex; gap: 14px;
  align-items: baseline; justify-content: center;
  flex-wrap: wrap;
}
.title__a {
  color: var(--neon-cyan);
  text-shadow: 0 0 22px rgba(0,224,255,0.55);
}
.title__b {
  color: var(--neon-pink);
  text-shadow: 0 0 22px rgba(255,61,241,0.55);
}
.lead {
  margin: 38px 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--paper);
  letter-spacing: 0.2px;
}
.lead-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.58);
  letter-spacing: 0.2px;
}
.lead-sub em {
  font-style: normal;
  color: rgba(0,224,255,0.85);
  font-weight: 700;
}
.action-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  gap: 24px;
  margin-top: auto;
  padding-top: 28px;
}
.record-pill--start {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 220px;
  justify-content: center;
  background: rgba(255,184,61,0.08);
  border: 1.5px solid var(--neon-amber);
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin: 0;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.record-pill__icon { font-size: 18px; line-height: 1; }
.record-pill__label { color: rgba(255,255,255,0.7); letter-spacing: 0.8px; }
.record-pill--start strong {
  color: var(--neon-amber);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 2px;
  text-shadow: 0 0 10px rgba(255,184,61,0.45);
}
.btn--cta {
  width: 280px;
  min-height: 76px;
  font-size: 22px;
  padding: 0 28px;
  border-radius: 22px;
  letter-spacing: 0.4px;
  gap: 10px;
}
.btn--cta .btn__icon {
  font-size: 18px;
  display: inline-flex; align-items: center;
}

/* Game-over paneel */
.panel--over { padding: 22px 28px; max-width: 460px; border-color: var(--neon-pink); box-shadow: 0 0 24px rgba(255,61,241,0.35), 0 14px 28px rgba(0,0,0,0.55); }
.over__title { margin: 0 0 8px; font-size: 30px; color: var(--neon-pink); font-weight: 900; letter-spacing: -0.5px; text-shadow: 0 0 14px rgba(255,61,241,0.6); }
.over__row   { margin: 4px 0; font-size: 16px; font-weight: 800; color: var(--paper); }
.over__row strong { color: var(--neon-cyan); font-variant-numeric: tabular-nums; }
.over__row--score { font-size: 22px; margin-top: 8px; }
.over__row--score strong { color: var(--neon-pink); }
.over__submit { display: flex; justify-content: center; margin-top: 10px; }
.over__actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .panel, .overlay { animation: none !important; }
}
