:root {
  color-scheme: dark;

  /* ═══ PRESTIGE PALETTE — Old Money Golf ═══ */

  /* Backgrounds - Deep, rich, quiet */
  --bg: #0a100d;
  --bg-elevated: #111916;

  /* Panel surfaces - Subtle warmth */
  --panel: rgba(15, 22, 18, 0.92);
  --panel-border: rgba(180, 162, 130, 0.18);

  /* Accent - Champagne Gold (trophy/brass tone) */
  --accent: #c9a962;
  --accent-soft: rgba(201, 169, 98, 0.15);
  --accent-bright: #d4b978;

  /* Golf Greens - Authentic turf tones */
  --green-dark: #0d1f16;
  --green-mid: #1a3d2a;
  --green-bright: #2a5c40;
  --green-accent: #3d7a58;

  /* Text - Cream/ivory warmth */
  --text: #f0ebe3;
  --text-muted: #a8a093;
  --text-subtle: #6d675e;

  /* Heritage accents */
  --brass: #b8a066;
  --pewter: #7a7d80;
  --burgundy: #722f37;

  /* Typography */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-weight: 400;
  letter-spacing: 0.3px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--green-dark);
  border-bottom: 1px solid rgba(180, 162, 130, 0.25);
  /* Subtle top highlight for depth */
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.brand {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  /* Subtle gold ambient glow */
  text-shadow: 0 0 40px rgba(201, 169, 98, 0.12);
}

.sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-subtle);
}

#main {
  position: relative;
  flex: 1;
  display: flex;
}

#green-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  /* Refined green with subtle vignette */
  background: radial-gradient(
    ellipse 120% 100% at 50% 30%,
    var(--green-mid) 0%,
    var(--green-dark) 50%,
    var(--bg) 100%
  );
}

#green-canvas,
#ball-canvas,
#overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#green-canvas {
  background: transparent;
}

#ball-canvas {
  pointer-events: none;
}

#overlay-canvas {
  touch-action: none;
}

#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  pointer-events: auto;
}

/* ═══ UI PANELS — Refined Clubhouse Aesthetic ═══ */

.status {
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text);
  /* Subtle depth */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

.controls {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  width: 240px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

.control-hint {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.power-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.power-meter span {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ═══ DROP BALL BUTTON ═══ */

.drop-ball-btn {
  width: 100%;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text);
  background: var(--green-mid);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drop-ball-btn:hover {
  background: var(--green-bright);
  border-color: var(--accent);
}

.drop-ball-btn:active {
  transform: scale(0.98);
}

.drop-ball-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.power-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(180, 162, 130, 0.12);
  overflow: hidden;
}

.power-fill {
  height: 100%;
  width: 0%;
  /* Gold gradient — trophy aesthetic */
  background: linear-gradient(90deg, var(--brass), #d4c193);
  transition: width 0.1s ease-out;
}

/* ═══ SESSION STATS — Scorecard Aesthetic ═══ */

.session-stats {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  width: 240px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

.session-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-family: var(--font-body);
  font-size: 13px;
}

.session-row span:first-child {
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.session-row span:last-child {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ═══ HELP OVERLAY ═══ */

#help {
  position: absolute;
  bottom: 20px;
  left: 20px;
  padding: 10px 14px;
  background: rgba(10, 16, 13, 0.85);
  border-radius: 4px;
  border: 1px solid var(--panel-border);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.footer {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: #080c0a;
  border-top: 1px solid rgba(180, 162, 130, 0.12);
  color: var(--text-subtle);
}

.footer-email {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-email:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer::before,
.footer::after {
  content: "◆";
  font-size: 6px;
  opacity: 0.35;
  color: var(--brass);
}

/* ═══ RESPONSIVE — Maintaining Elegance at All Sizes ═══ */

@media (max-width: 768px) {
  .topbar {
    height: 60px;
    padding: 0 20px;
  }

  .brand {
    font-size: 20px;
    letter-spacing: 1.5px;
  }

  .controls,
  .session-stats {
    width: 200px;
    padding: 12px 14px;
  }

  #hud {
    top: 14px;
    left: 14px;
    gap: 10px;
  }

  #help {
    left: 14px;
    bottom: 14px;
    max-width: 70%;
  }

  .footer {
    height: 40px;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .topbar {
    height: 52px;
    padding: 0 16px;
  }

  .brand {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .sub {
    display: none;
  }

  .controls,
  .session-stats {
    width: 170px;
    padding: 10px 12px;
  }

  .session-title {
    font-size: 10px;
  }

  .session-row {
    font-size: 10px;
  }

  .footer::before,
  .footer::after {
    display: none;
  }
}
