/* ============================================================
   GreenGame.be · Royal Golf Club Oudenaarde edition
   Mobile-first, Augusta-Oudenaarde theme
   ============================================================ */

:root {
  --gg-bg:           #0e1410;
  --gg-bg-2:         #161e18;
  --gg-bg-3:         #1f2820;
  --gg-bg-card:      #141a15;
  --gg-olive:        #8a8260;
  --gg-olive-light:  #a39a72;
  --gg-olive-dim:    #5b563f;
  --gg-cream:        #f5efe0;
  --gg-cream-dim:    #d6cdb5;
  --gg-fairway:      #7d9c5d;
  --gg-fairway-deep: #5a7d3f;
  --gg-sand:         #e0d2a8;
  --gg-success:      #7da55c;
  --gg-danger:       #b25c4d;
  --gg-warning:      #d4a574;
  --gg-border:       rgba(138, 130, 96, 0.28);
  --gg-border-soft:  rgba(138, 130, 96, 0.14);
  --gg-shadow-sm:    0 2px 6px rgba(0,0,0,0.35);
  --gg-shadow:       0 6px 18px rgba(0,0,0,0.45);
  --gg-serif:        'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --gg-sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--gg-olive-light); text-decoration: none; }
a:hover { color: var(--gg-cream); }

/* --- body --- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--gg-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--gg-cream-dim);
  background: var(--gg-bg);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 800px 400px at 50% 0%, rgba(138,130,96,0.05), transparent 70%),
    radial-gradient(ellipse 600px 300px at 50% 100%, rgba(138,130,96,0.04), transparent 70%);
}

/* --- typography --- */
h1, h2, h3, h4 {
  font-family: var(--gg-serif);
  font-weight: 500;
  color: var(--gg-cream);
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.4rem; line-height: 1.2; }
h3 { font-size: 1.1rem; }
.eyebrow {
  font-family: var(--gg-serif);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gg-olive);
  margin-bottom: 0.6rem;
}
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gg-olive-dim), transparent);
  margin: 1.2rem auto;
  max-width: 220px;
  border: 0;
}

/* --- layout --- */
.gg-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  min-height: 100vh;
  position: relative;
}

/* --- header --- */
.gg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.2rem;
  border-bottom: 1px solid var(--gg-border-soft);
  margin-bottom: 0.9rem;
}
.gg-header-logos {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.gg-header-logos img,
.gg-header-logos svg { height: 54px; width: auto; }
.gg-header .mute-btn {
  background: transparent;
  border: 1px solid var(--gg-border);
  color: var(--gg-olive-light);
  padding: 0.45rem 0.55rem;
  border-radius: 50%;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.gg-header .mute-btn:hover { border-color: var(--gg-olive); color: var(--gg-cream); }
.gg-header .mute-btn svg { height: 16px; width: 16px; }

/* --- hero --- */
.gg-hero {
  text-align: center;
  padding: 0.5rem 0 0.4rem;
}
.gg-hero h1 { font-size: 1.85rem; }
.gg-hero p {
  font-family: var(--gg-serif);
  font-style: italic;
  color: var(--gg-olive-light);
  max-width: 22rem;
  margin: 0.4rem auto 0;
  font-size: 1rem;
}

/* --- mode cards --- */
.gg-mode-list {
  display: grid;
  gap: 0.9rem;
  margin: 1.5rem 0 1rem;
}
.gg-mode {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--gg-bg-card);
  border: 1px solid var(--gg-border);
  border-left: 3px solid var(--gg-olive);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.2s, background 0.2s;
  position: relative;
}
.gg-mode:hover {
  border-color: var(--gg-olive-light);
  background: var(--gg-bg-2);
  transform: translateY(-1px);
}
.gg-mode-title {
  font-family: var(--gg-serif);
  font-size: 1.35rem;
  color: var(--gg-cream);
  margin: 0 0 0.2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.gg-mode-sub {
  font-size: 0.85rem;
  color: var(--gg-olive-light);
}
.gg-mode-tag {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gg-bg);
  background: var(--gg-olive);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.gg-mode.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  border-left-color: var(--gg-olive-dim);
}
.gg-mode.is-master {
  border-left-color: var(--gg-fairway);
}

/* --- buttons --- */
.gg-btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  background: var(--gg-olive);
  color: var(--gg-bg);
  border: 1px solid var(--gg-olive);
  border-radius: 4px;
  font-family: var(--gg-sans);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.gg-btn:hover { background: var(--gg-olive-light); color: var(--gg-bg); }
.gg-btn:active { transform: translateY(1px); }
.gg-btn.secondary {
  background: transparent;
  color: var(--gg-olive-light);
}
.gg-btn.secondary:hover {
  background: var(--gg-bg-2);
  color: var(--gg-cream);
}
.gg-btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.gg-btn[disabled], .gg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- bottom nav / link row --- */
.gg-nav-link {
  display: block;
  text-align: center;
  padding: 0.9rem;
  color: var(--gg-olive-light);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--gg-border-soft);
  border-radius: 4px;
  margin-top: 0.6rem;
}
.gg-nav-link:hover { color: var(--gg-cream); border-color: var(--gg-olive); }

/* --- footer --- */
.gg-footer {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--gg-border-soft);
  text-align: center;
  font-size: 0.75rem;
  color: var(--gg-olive-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.gg-footer a { color: var(--gg-olive); }

/* ============================================================
   GAME SCREEN
   ============================================================ */
.gg-game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.2rem 0 0.6rem;
  font-family: var(--gg-serif);
  font-size: 0.95rem;
  color: var(--gg-olive-light);
  letter-spacing: 0.1em;
}
.gg-game-meta .question-counter {
  font-size: 1.05rem;
  color: var(--gg-cream);
}
.gg-game-meta .total-time {
  color: var(--gg-cream);
}

/* timer bar */
.gg-timer {
  height: 6px;
  background: var(--gg-bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.9rem;
}
.gg-timer-fill {
  height: 100%;
  background: var(--gg-olive-light);
  width: 100%;
  transform-origin: left center;
  transition: width 0.1s linear, background-color 0.3s;
}
.gg-timer.warn .gg-timer-fill { background: var(--gg-warning); }
.gg-timer.danger .gg-timer-fill { background: var(--gg-danger); }

/* photo */
.gg-photo-wrap {
  position: relative;
  width: 100%;
  background: var(--gg-bg-2);
  border: 1px solid var(--gg-border);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gg-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--gg-bg-2);
  transition: opacity 0.25s;
}
.gg-photo-wrap.is-loading img { opacity: 0; }
.gg-photo-wrap .photo-spinner {
  position: absolute;
  width: 28px; height: 28px;
  border: 2px solid var(--gg-olive-dim);
  border-top-color: var(--gg-olive-light);
  border-radius: 50%;
  animation: gg-spin 0.9s linear infinite;
  opacity: 0;
}
.gg-photo-wrap.is-loading .photo-spinner { opacity: 1; }
@keyframes gg-spin { to { transform: rotate(360deg); } }

/* feedback overlays */
.gg-photo-wrap .feedback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--gg-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--gg-cream);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.gg-photo-wrap.flash-correct { box-shadow: inset 0 0 0 4px var(--gg-success); }
.gg-photo-wrap.flash-wrong { box-shadow: inset 0 0 0 4px var(--gg-danger); }
.gg-photo-wrap.flash-correct .feedback,
.gg-photo-wrap.flash-wrong .feedback { opacity: 1; }
.gg-photo-wrap.flash-wrong .feedback { color: #f4d4cc; }

/* hole grid — 6×3 numpad layout to keep the screen scroll-free on mobile */
.gg-holes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 0.8rem;
}
.gg-hole {
  aspect-ratio: 1 / 1;
  background: var(--gg-bg-card);
  border: 1px solid var(--gg-border);
  border-radius: 5px;
  font-family: var(--gg-serif);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--gg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.gg-hole::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--gg-border-soft);
  border-radius: 3px;
  pointer-events: none;
}
.gg-hole:active { transform: scale(0.97); }
.gg-hole.is-wrong {
  background: rgba(178, 92, 77, 0.12);
  border-color: var(--gg-danger);
  color: var(--gg-danger);
  cursor: not-allowed;
}
.gg-hole.is-wrong::after {
  content: '✕';
  position: absolute;
  font-size: 0.7rem;
  top: 2px; right: 4px;
  color: var(--gg-danger);
  font-family: var(--gg-sans);
}
.gg-hole.is-correct {
  background: rgba(125, 165, 92, 0.18);
  border-color: var(--gg-success);
  color: var(--gg-success);
}
.gg-hole.is-disabled-all {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   RESULT / NAME ENTRY / LEADERBOARD
   ============================================================ */
.gg-result {
  text-align: center;
  padding: 1rem 0;
}
.gg-result .result-time {
  font-family: var(--gg-serif);
  font-size: 3.2rem;
  color: var(--gg-cream);
  margin: 0.5rem 0 0.2rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.gg-result .result-time small {
  font-size: 1.4rem;
  color: var(--gg-olive-light);
  font-weight: 400;
}
.gg-result .result-line {
  color: var(--gg-olive-light);
  font-family: var(--gg-serif);
  font-style: italic;
  margin: 0;
}
.gg-result .stat-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--gg-olive-light);
}
.gg-result .stat-row strong {
  display: block;
  color: var(--gg-cream);
  font-family: var(--gg-serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.1rem;
}

.gg-name-form {
  margin: 1.5rem 0 0.5rem;
}
.gg-name-form label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gg-olive);
  margin-bottom: 0.5rem;
  text-align: center;
}
.gg-name-form input[type="text"] {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--gg-bg-card);
  border: 1px solid var(--gg-border);
  border-radius: 4px;
  color: var(--gg-cream);
  font-family: var(--gg-serif);
  font-size: 1.15rem;
  text-align: center;
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.2s;
}
.gg-name-form input[type="text"]:focus { border-color: var(--gg-olive-light); }
.gg-name-form .privacy {
  font-size: 0.72rem;
  color: var(--gg-olive-dim);
  text-align: center;
  margin: 0.7rem 0 1rem;
  line-height: 1.5;
}
.gg-name-form button { width: 100%; }

/* leaderboard */
.gg-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--gg-border-soft);
}
.gg-tab {
  flex: 1;
  padding: 0.6rem 0.4rem;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--gg-olive);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--gg-sans);
  transition: color 0.15s, border-color 0.15s;
}
.gg-tab.is-active {
  color: var(--gg-cream);
  border-bottom-color: var(--gg-olive);
}
.gg-tab:disabled { opacity: 0.35; }

.gg-board {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--gg-serif);
}
.gg-board th, .gg-board td {
  padding: 0.7rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--gg-border-soft);
  font-weight: 400;
  font-size: 0.95rem;
}
.gg-board th {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gg-olive);
  font-family: var(--gg-sans);
  font-weight: 500;
}
.gg-board td.pos {
  width: 2.2rem;
  color: var(--gg-olive-light);
  text-align: center;
}
.gg-board td.time { text-align: right; color: var(--gg-cream); white-space: nowrap; }
.gg-board td.date {
  font-size: 0.78rem;
  color: var(--gg-olive);
  white-space: nowrap;
  font-family: var(--gg-sans);
}
.gg-board tr:first-child td.pos { color: var(--gg-cream); font-weight: 500; }
.gg-board tr.you { background: rgba(138, 130, 96, 0.08); }
.gg-board .empty {
  text-align: center;
  color: var(--gg-olive-dim);
  padding: 2rem 1rem;
  font-style: italic;
}

/* misc */
.flash-message {
  background: rgba(178, 92, 77, 0.15);
  border-left: 3px solid var(--gg-danger);
  color: var(--gg-cream);
  padding: 0.7rem 1rem;
  border-radius: 4px;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.flash-message.success {
  background: rgba(125, 165, 92, 0.15);
  border-left-color: var(--gg-success);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 540px) {
  .gg-shell { max-width: 540px; padding: 0 1.5rem 2rem; }
  .gg-photo-wrap { aspect-ratio: 16 / 11; }
  .gg-hero h1 { font-size: 2.2rem; }
}
@media (min-width: 720px) {
  .gg-holes { gap: 8px; }
  .gg-hole { font-size: 1.5rem; }
}

/* small phones */
@media (max-width: 360px) {
  .gg-hero h1 { font-size: 1.55rem; }
  .gg-hole { font-size: 1.05rem; }
  .gg-holes { gap: 5px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition: none !important; }
}
