:root {
  --navy: #0b1533;
  --navy-2: #14224f;
  --navy-3: #1d2f66;
  --gold: #f5c542;
  --gold-deep: #b8860b;
  --red: #c8102e;
  --red-deep: #8f0b21;
  --cream: #fff8e7;
  --muted: #b9c2e0;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 0%, rgba(245, 197, 66, 0.12), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(200, 16, 46, 0.18), transparent 45%),
    var(--navy);
  overflow-x: hidden;
}

a { color: var(--gold); }

h1, h2 { font-family: "Playfair Display", Georgia, serif; }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---------- Ticker ---------- */
.ticker {
  display: flex;
  align-items: stretch;
  background: var(--red);
  border-bottom: 3px solid var(--gold);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ticker-label {
  background: var(--gold);
  color: var(--navy);
  padding: 8px 12px;
  flex-shrink: 0;
  z-index: 1;
}
.ticker-window { overflow: hidden; flex: 1; }
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  padding: 8px 0;
  animation: ticker 80s linear infinite;
}
.ticker-track span { padding: 0 2.5rem; }
.ticker-track span::before { content: "★"; color: var(--gold); margin-right: 2.5rem; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 28px 0 8px; }
.kicker {
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin: 0 0 12px;
}
h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  font-weight: 900;
  line-height: 1.02;
  background: linear-gradient(180deg, #fff3c4 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}
h1 span {
  display: block;
  font-style: italic;
  font-size: 0.55em;
  font-weight: 700;
}
.sub {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}
.sub strong { color: var(--cream); }

/* ---------- Clock ---------- */
.clock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.tile {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--navy-3), var(--navy-2));
  padding: 18px 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 0 var(--gold-deep), 0 14px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--gold-deep), 0 6px 14px rgba(0, 0, 0, 0.4); }
.num {
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(2.4rem, 9vw, 5.5rem);
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.label {
  margin-top: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--gold);
  text-align: center;
}
.label small {
  display: block;
  font-family: "Playfair Display", serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}
.hint { text-align: center; color: var(--muted); font-style: italic; margin: 18px 0 28px; }

.clock.speeding .num { color: var(--gold); animation: jitter 0.08s infinite; }
@keyframes jitter {
  0% { transform: translate(0, 0); }
  50% { transform: translate(2px, -2px); }
  100% { transform: translate(-2px, 1px); }
}

/* ---------- Cards ---------- */
.card {
  background: rgba(20, 34, 79, 0.75);
  border: 1px solid rgba(245, 197, 66, 0.35);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}
.card h2 { margin: 0 0 14px; color: var(--gold); font-size: 1.45rem; }

/* ---------- Progress ---------- */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-head h2 { margin-bottom: 18px; }
.pct { font-family: "Anton", sans-serif; font-size: 2rem; color: var(--cream); }
.bar {
  position: relative;
  height: 28px;
  border-radius: 999px;
  background: #0a1129;
  border: 2px solid var(--gold-deep);
  margin: 20px 0 10px;
}
.fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 14px, #e03a52 14px 28px);
  transition: width 0.6s ease;
}
.golfer, .hole {
  position: absolute;
  bottom: 8px;
  font-size: 2rem;
  line-height: 1;
  transform: translateX(-50%);
}
.golfer { left: 0; transition: left 0.6s ease; }
.hole { left: calc(100% - 10px); }
.milestone { margin: 14px 0 0; color: var(--muted); font-style: italic; }

/* ---------- Buttons ---------- */
.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.btn {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.1s ease, filter 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.96); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-deep); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 4px 0 var(--gold-deep); }
.btn-ghost { background: transparent; color: var(--cream); border: 2px solid rgba(255, 248, 231, 0.4); }
.badge {
  background: #fff;
  color: var(--red);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
}

/* ---------- Bronzer ---------- */
.bronzer label {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 12px;
  gap: 12px;
}
.bronzer strong { color: var(--gold); font-family: "Playfair Display", serif; font-style: italic; }
input[type="range"] {
  width: 100%;
  accent-color: #ff8c1a;
  height: 28px;
}
.tan-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: #ff7a00;
  mix-blend-mode: multiply;
  opacity: 0;
  z-index: 50;
  transition: opacity 0.2s ease;
}

/* ---------- Units ---------- */
.units {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.unit {
  background: rgba(11, 21, 51, 0.7);
  border-radius: 14px;
  padding: 16px;
  border-left: 4px solid var(--red);
}
.unit-value {
  font-family: "Anton", sans-serif;
  font-size: 1.9rem;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.unit-name { font-weight: 800; color: var(--gold); margin-top: 2px; }
.unit-note { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------- Generator ---------- */
.gen-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gen-head h2 { margin: 0; }
.parody {
  border: 2px solid var(--red);
  color: #ff6b81;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: rotate(-4deg);
}
.post {
  background: #fff;
  color: #14171a;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.post.pop { animation: postPop 0.35s ease; }
@keyframes postPop { 0% { transform: scale(0.96); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }
.post-top { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffe2b8;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.post-name { font-weight: 800; }
.check { color: #1d9bf0; }
.post-handle { color: #657786; font-size: 0.9rem; }
.post-body { font-size: 1.15rem; line-height: 1.45; margin: 14px 0; }
.post-stats { display: flex; gap: 22px; color: #657786; font-size: 0.9rem; }
.gen-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.fineprint { color: var(--muted); font-size: 0.8rem; margin: 12px 0 0; }

/* ---------- Golf ---------- */
.golf-hud {
  display: grid;
  grid-template-columns: 2.2fr repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.golf-hud div {
  background: rgba(11, 21, 51, 0.7);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
.golf-hud span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 800;
}
.golf-hud b {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--cream);
  white-space: nowrap;
}
.golf-hud em { font-style: normal; }
#gWindArrow {
  display: inline-block;
  font-style: normal;
  color: var(--gold);
  transition: transform 0.4s ease;
}
.golf-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid var(--gold-deep);
}
#golf {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 5;
  touch-action: none;
  cursor: crosshair;
}
.golf-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: rgba(11, 21, 51, 0.85);
  overflow-y: auto;
}
.golf-overlay.show { display: flex; }
.golf-overlay h3 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--gold);
  margin: 0 0 8px;
}
.golf-overlay p { margin: 0 0 10px; max-width: 460px; }
#gCard { font-weight: 800; }
.golf-tip { color: var(--muted); font-style: italic; margin: 12px 0 0; min-height: 1.4em; }
.golf-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.scorecard-wrap { overflow-x: auto; margin-top: 14px; }
.scorecard {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  text-align: center;
  background: var(--cream);
  color: var(--navy);
  border-radius: 10px;
  overflow: hidden;
}
.scorecard th, .scorecard td {
  padding: 6px 4px;
  border: 1px solid rgba(11, 21, 51, 0.15);
  min-width: 28px;
}
.scorecard th:first-child {
  text-align: left;
  padding-left: 10px;
  background: var(--navy-2);
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}
.scorecard tr:first-child th { background: var(--navy-2); color: var(--cream); }
.scorecard tr:first-child th:last-child,
.scorecard td:last-child { font-weight: 800; }
.scorecard .cur { background: rgba(245, 197, 66, 0.45); }
.scorecard tr:first-child .cur { background: var(--gold); color: var(--navy); }
.scorecard .official td { color: var(--red); font-weight: 800; }

.share { text-align: center; margin: 10px 0 0; }

/* ---------- Footer ---------- */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 40px;
  border-top: 1px solid rgba(245, 197, 66, 0.2);
}
footer p { margin: 4px 0; }
kbd {
  background: var(--navy-3);
  border: 1px solid var(--gold-deep);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--gold);
}

/* ---------- Floating bits ---------- */
.pop-word {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  font-family: "Anton", sans-serif;
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--red), 0 0 12px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
  animation: floatUp 1.1s ease-out forwards;
  white-space: nowrap;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -70%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}

.rain {
  position: fixed;
  top: -60px;
  z-index: 60;
  pointer-events: none;
  font-size: 2rem;
  animation: fall linear forwards;
}
.rain.word {
  font-family: "Anton", sans-serif;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--red);
}
@keyframes fall {
  to { transform: translateY(calc(100vh + 120px)) rotate(var(--spin, 360deg)); }
}

/* ---------- Sharpie ---------- */
#sharpie {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 40;
  pointer-events: none;
}
#sharpie.active { pointer-events: auto; cursor: crosshair; touch-action: none; }
.sharpie-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 70;
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 32px);
}
.sharpie-bar.show { display: flex; }
.sharpie-bar span { font-weight: 800; font-size: 0.9rem; }
.sharpie-bar .btn { padding: 8px 12px; }

/* ---------- Dialog ---------- */
dialog {
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--navy);
  max-width: min(520px, calc(100vw - 32px));
  padding: 26px;
}
dialog::backdrop { background: rgba(5, 10, 25, 0.75); }
dialog h2 { margin: 0 0 12px; color: var(--red); }
dialog blockquote {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.25rem;
  margin: 0;
  padding-left: 14px;
  border-left: 4px solid var(--gold-deep);
}
dialog .reply { font-family: "Anton", sans-serif; font-size: 2rem; margin: 18px 0; min-height: 2.4rem; }
dialog .reply.shake { animation: shake 0.4s ease; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; }
dialog .btn-ghost { color: var(--navy); border-color: var(--navy); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 60px;
  transform: translate(-50%, -20px);
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .clock { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: repeat(2, 1fr); }
  .btn { padding: 12px 10px; font-size: 0.92rem; }
  .sharpie-bar span { display: none; }
  .golf-hud { grid-template-columns: repeat(2, 1fr); }
  .golf-hud div:first-child { grid-column: 1 / -1; }
  .golf-overlay { padding: 12px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation-duration: 400s; }
  .clock.speeding .num { animation: none; }
}
