@font-face {
  font-family: 'Geomanist Extra';
  src: url('fonts/geomanist-extra.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Intro Light';
  src: url('fonts/intro-light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #22d3ee;
  --accent2: #0ea5e9;
  --danger: #ef4444;
  --font-heading: 'Geomanist Extra', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: 'Intro Light', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; min-height: 100%;
  font-family: var(--font-text);
  background: #0f172a;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}
body.game {
  height: 100%; overflow: hidden;
  touch-action: none; overscroll-behavior: none;
}
#game { display: block; position: fixed; top: 0; left: 0; }

#hud {
  position: fixed; left: 0; right: 0;
  top: calc(18px + env(safe-area-inset-top, 0px));
  display: flex; justify-content: center;
  pointer-events: none;
  z-index: 5;
}
#hud .scoreBox {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 22px; border-radius: 999px;
  color: #f1f5f9; font-weight: 700; font-size: 1.1rem;
  letter-spacing: 0.02em;
}

#muteBtn {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(15,23,42,0.55); border: 1px solid rgba(255,255,255,0.12);
  color: #f1f5f9; font-size: 1.15rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 6;
}

#duckBtn {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(15,23,42,0.55); border: 1px solid rgba(255,255,255,0.15);
  color: #f1f5f9; font-size: 1.6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 6; user-select: none; touch-action: none;
}
#duckBtn:active { background: rgba(34,211,238,0.35); }

.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,11,20,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 20px;
  z-index: 10;
}
.hidden { display: none !important; }

.card {
  background: rgba(15,23,42,0.88);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 38px 30px;
  max-width: 420px; width: 100%;
  text-align: center;
  color: #f1f5f9;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.card.wide { max-width: 560px; }
.card h1 {
  font-size: clamp(1.5rem, 6vw, 1.85rem);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.card p {
  color: #94a3b8; font-size: 0.95rem; line-height: 1.5;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,211,238,0.12); color: var(--accent);
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  margin-top: 18px;
}
.stat-row { display: flex; justify-content: center; gap: 30px; margin: 22px 0; }
.stat { text-align: center; }
.stat .value { font-size: clamp(1.6rem, 7vw, 1.9rem); font-weight: 800; color: var(--accent); }
.stat .label {
  font-size: 0.72rem; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 0.06em; margin-top: 2px;
}
.new-record {
  color: #fbbf24; font-weight: 700; margin-bottom: 8px; font-size: 0.95rem;
}

.form-field {
  text-align: left; margin-top: 16px;
}
.form-field label {
  display: block; font-size: 0.78rem; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16); border-radius: 12px;
  padding: 11px 14px; color: #f1f5f9; font-size: 0.95rem;
  font-family: inherit; resize: vertical;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
}
.form-field select {
  color-scheme: dark;
}
.form-field select option {
  background: #0f172a; color: #f1f5f9;
}
.form-error {
  color: var(--danger); font-size: 0.82rem; margin-top: 10px; min-height: 1.2em;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #03151c; font-size: 1.05rem; font-weight: 800;
  padding: 15px 38px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 24px rgba(34,211,238,0.3);
  margin-top: 22px;
}
button.primary:active { transform: scale(0.97); }
button.primary:disabled {
  opacity: 0.55; cursor: not-allowed; transform: none;
}
button.secondary {
  background: transparent; border: 1px solid rgba(255,255,255,0.18);
  color: #f1f5f9; font-size: 0.9rem; font-weight: 700;
  padding: 11px 26px; border-radius: 999px; cursor: pointer;
  margin-top: 12px;
}
button.danger {
  display: block; width: 100%;
  background: transparent; border: 1px solid rgba(239,68,68,0.4);
  color: var(--danger); font-size: 0.85rem; font-weight: 700;
  padding: 10px 22px; border-radius: 999px; cursor: pointer;
  margin-top: 14px;
}
button.danger:hover { background: rgba(239,68,68,0.1); }
button.danger:disabled {
  opacity: 0.5; cursor: not-allowed;
}

.controls-hint {
  font-size: 0.78rem; color: #64748b; margin-top: 18px; line-height: 1.6;
}
kbd {
  background: #1e293b; border: 1px solid #334155; border-radius: 6px;
  padding: 2px 8px; font-size: 0.78rem; font-family: inherit;
}
.version-tag {
  margin-top: 16px; font-size: 0.68rem; color: #475569; letter-spacing: 0.05em;
}

/* ---- Wall of Fame ---- */
.wof-page {
  min-height: 100%;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
}
.wof-date {
  color: #64748b; font-size: 0.85rem; margin-top: -4px; margin-bottom: 20px;
}
table.wof-table {
  width: 100%; border-collapse: collapse; margin-top: 8px; text-align: left;
}
table.wof-table th {
  font-size: 0.72rem; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
table.wof-table td {
  padding: 10px; font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
table.wof-table tr:first-child td { font-weight: 800; color: #fbbf24; }
table.wof-table td.rank { width: 2.2em; color: #64748b; }
table.wof-table td.score { text-align: right; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.wof-empty { color: #94a3b8; font-size: 0.9rem; padding: 20px 0; text-align: center; }
