/* The clubhouse: pixel-art course behind the hero, this week's courses below */
.hub { flex: 1 0 auto; }
.hub[hidden], .play[hidden] { display: none; }
.play { flex: 1 0 auto; display: flex; flex-direction: column; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: max(560px, 88svh);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: #0b0f0a;
  isolation: isolate;
  /* text colors follow the sky: dark on morning/day skies, light at dusk/night */
  --hero-text: #fbf5e8;
  --hero-muted: rgba(251, 245, 232, 0.82);
  --hero-shadow: #1d1a14;
}
.hero[data-sky="morning"], .hero[data-sky="day"] {
  --hero-text: #10240f;
  --hero-muted: rgba(16, 36, 15, 0.82);
  --hero-shadow: rgba(255, 255, 255, 0.55);
}
.hero { color: var(--hero-text); }
.scene { position: absolute; inset: 0; z-index: -1; display: flex; justify-content: center; align-items: flex-end; }
.scene .pixel-canvas { cursor: default; }

.hero-content {
  width: 100%;
  max-width: 520px;
  padding: max(8svh, 48px) 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.logo {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(3.2rem, 15vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-shadow: 0 5px 0 var(--hero-shadow);
  animation: logo-in 0.5s steps(5) both;
}
@keyframes logo-in { from { opacity: 0; transform: translateY(-16px); } }
.tagline {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--hero-muted);
  margin-top: 6px;
}
.rules { color: var(--hero-muted); max-width: 34ch; font-size: 0.98rem; text-wrap: balance; font-weight: 500; }

/* Chunky pixel buttons: square corners and a solid "pressed" shadow */
.tee-btn {
  margin-top: 14px;
  width: min(100%, 340px);
  min-height: 66px;
  padding: 10px 24px;
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-family: var(--font-pixel);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.15), inset 0 3px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
}
.tee-btn:hover { filter: brightness(1.07); }
.tee-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.15); }
.tee-btn.is-done { background: var(--color-surface); color: var(--color-text); }
.tee-score { font-family: var(--font-main); font-size: 0.85rem; font-weight: 600; color: var(--tier-birdie); }
.hero-empty { margin-top: 16px; font-weight: 600; }

.hero-meta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hero-muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.hero-meta b { color: var(--hero-text); }
.hero-links { display: flex; gap: 8px; margin-top: 2px; }
.hero-links button {
  color: var(--hero-text);
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 2px solid currentColor;
  opacity: 0.9;
}
.hero-links button:hover { opacity: 1; background: rgba(127, 127, 127, 0.15); }

.sound-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  font-size: 1.15rem;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  z-index: 2;
}
.sound-btn:hover { background: rgba(0, 0, 0, 0.5); }

.scroll-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fbf5e8;
  text-decoration: none;
  text-shadow: 0 2px 0 #1d1a14;
  white-space: nowrap;
}
.scroll-hint span { font-size: 1.2rem; animation: bob 1.2s steps(2) infinite; }
@keyframes bob { 50% { translate: 0 4px; } }

/* ---------- This week's courses ---------- */
.courses { max-width: 560px; margin: 0 auto; padding: 36px 16px 24px; scroll-margin-top: 8px; }
.courses-head { display: flex; flex-direction: column; gap: 2px; }
.courses-head h2 { font-family: var(--font-pixel); font-size: 2rem; line-height: 1.1; }
.courses-head p { color: var(--color-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.courses-head b { color: var(--color-text); }
.courses-intro { color: var(--color-muted); font-size: 0.92rem; margin: 10px 0 18px; max-width: 46ch; }

.course-grid { display: grid; gap: 14px; }
.course-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--color-surface);
  border-left: 6px solid var(--flag);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
}
.course-body { min-width: 0; }
.course-kicker { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.course-card h3 { font-family: var(--font-pixel); font-size: 1.4rem; line-height: 1.15; margin: 1px 0 2px; }
.course-status { font-size: 0.85rem; color: var(--color-muted); }
.course-card.is-done .course-status { color: var(--tier-birdie); font-weight: 700; }
.course-btn { min-height: 44px; padding: 0 16px; white-space: nowrap; font-family: var(--font-pixel); font-size: 1rem; border-radius: 0; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.course-card:not(.is-done) .course-btn { background: var(--color-accent); color: var(--color-accent-text); border-color: transparent; }

/* tiny pixel flag built from boxes */
.course-flag { position: relative; width: 22px; height: 34px; }
.course-flag .pf-pole { position: absolute; left: 4px; top: 2px; width: 3px; height: 30px; background: var(--color-text); }
.course-flag .pf-flag { position: absolute; left: 7px; top: 2px; width: 13px; height: 9px; background: var(--c); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.course-flag .pf-cup { position: absolute; left: 0; bottom: 0; width: 11px; height: 3px; background: rgba(0, 0, 0, 0.45); }

@media (max-width: 400px) {
  .course-card { grid-template-columns: auto 1fr; }
  .course-btn { grid-column: 1 / -1; width: 100%; }
}

/* ---------- Header during play ---------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px 0 8px;
  color: var(--color-text);
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  border: 2px solid var(--color-border);
  justify-self: start;
}
.back-btn:hover { background: var(--color-surface-2); }
@media (max-width: 380px) { .back-text { display: none; } }
