/* ============================================================
   Wayward Birdie — Disc Golf Game Styles
   Extends styles.css (does not modify it)
   ============================================================ */

/* ── Page layout ────────────────────────────────────────────── */
.game-page-hero {
  padding: 5rem 0 2rem;
}

#game-root {
  position: relative;
  background: var(--clr-card-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 820px;
  margin: 0 auto 3rem;
  box-shadow: var(--shadow);
}

/* ── HUD bar ─────────────────────────────────────────────────── */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: var(--clr-deep);
  border-bottom: 1px solid var(--clr-border);
  gap: 1rem;
  flex-wrap: wrap;
}

.game-hud__info {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

#hud-hole {
  font-family: var(--ff-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-heading);
}

#hud-name {
  font-size: 0.82rem;
  color: var(--clr-aurora-1);
  font-weight: 600;
}

#hud-par {
  font-size: 0.78rem;
  color: var(--clr-muted);
  font-family: var(--ff-head);
}

.game-hud__right {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

#hud-throws {
  font-family: var(--ff-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-gold);
  line-height: 1;
}

.game-hud__throws-label {
  font-size: 0.72rem;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Disc flight numbers ─────────────────────────────────────── */
.game-hud__disc-nums {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.disc-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.2rem;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--clr-border);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  line-height: 1.1;
}

.disc-num__lbl {
  font-size: 0.56rem;
  font-family: var(--ff-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-aurora-1);
  font-weight: 700;
}

.disc-num span:last-child {
  font-family: var(--ff-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--clr-gold);
}

/* ── Shot type toggle ────────────────────────────────────────── */
.shot-toggle {
  font-family: var(--ff-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--clr-aurora-1);
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--clr-aurora-1);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.3;
  margin-right: 0.5rem;
}

.shot-toggle:hover {
  background: var(--clr-aurora-1);
  color: #000;
}

.shot-toggle--fh {
  color: var(--clr-gold);
  border-color: var(--clr-gold);
}

.shot-toggle--fh:hover {
  background: var(--clr-gold);
  color: #000;
}

/* ── Canvas ──────────────────────────────────────────────────── */
#game-canvas {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Hint bar ────────────────────────────────────────────────── */
.game-hint {
  padding: 0.5rem 1.25rem;
  background: var(--clr-deep);
  border-top: 1px solid var(--clr-border);
  font-size: 0.78rem;
  color: var(--clr-muted);
  font-style: italic;
  text-align: center;
}

/* ── Message overlay (hole complete / penalty) ───────────────── */
/* The hidden attribute must beat the display:flex below, or the
   overlays render permanently on page load */
.game-message[hidden],
.game-scorecard[hidden] {
  display: none;
}

.game-message {
  position: absolute;
  inset: 0;
  background: rgba(7, 14, 24, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(2px);
}

[data-theme="light"] .game-message {
  background: rgba(240, 245, 239, 0.85);
}

.game-message__inner {
  background: var(--clr-card-bg);
  border: 1px solid var(--clr-border-strong);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.75rem;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.45);
}

.game-message__inner h2 {
  font-size: 1.9rem;
  color: var(--clr-heading);
  margin: 0 0 0.6rem;
}

.game-message__inner p {
  color: var(--clr-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

/* ── Scorecard overlay ───────────────────────────────────────── */
.game-scorecard {
  position: absolute;
  inset: 0;
  background: rgba(7, 14, 24, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 1rem;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}

[data-theme="light"] .game-scorecard {
  background: rgba(240, 245, 239, 0.93);
}

.game-scorecard__inner {
  background: var(--clr-card-bg);
  border: 1px solid var(--clr-border-strong);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 540px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.game-scorecard__inner h2 {
  font-size: 1.6rem;
  color: var(--clr-heading);
  margin: 0 0 0.3rem;
}

.game-scorecard__subtitle {
  color: var(--clr-aurora-1);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.82rem;
}

.scorecard-table th {
  color: var(--clr-aurora-1);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--clr-border);
  font-family: var(--ff-head);
}

.scorecard-table td {
  padding: 0.35rem 0.5rem;
  color: var(--clr-light);
  border-bottom: 1px solid var(--clr-border-subtle);
}

.scorecard-table td:nth-child(2) {
  text-align: left;
  font-size: 0.78rem;
  color: var(--clr-muted);
}

.score--under { color: var(--clr-aurora-1); font-weight: 700; }
.score--over  { color: var(--clr-gold); }
.score--even  { color: var(--clr-muted); }

.scorecard-total-row td {
  font-weight: 700;
  color: var(--clr-heading);
  border-top: 2px solid var(--clr-border-strong);
  border-bottom: none;
  padding-top: 0.6rem;
  font-size: 0.88rem;
}

/* ── Instructions block ──────────────────────────────────────── */
.game-instructions {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.game-instructions__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 180px;
}

.game-instructions__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.game-instructions__text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--clr-heading);
  margin-bottom: 0.2rem;
}

.game-instructions__text span {
  font-size: 0.78rem;
  color: var(--clr-muted);
  line-height: 1.5;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .game-hud {
    padding: 0.5rem 0.9rem;
    gap: 0.5rem;
  }

  .game-hud__disc-nums {
    gap: 0.35rem;
  }

  .disc-num {
    min-width: 1.8rem;
    padding: 0.1rem 0.25rem;
  }

  .disc-num__lbl { font-size: 0.5rem; }
  .disc-num span:last-child { font-size: 0.72rem; }

  #game-root {
    border-radius: var(--radius);
  }

  .game-message__inner {
    padding: 1.75rem 1.5rem;
  }

  .game-scorecard__inner {
    padding: 1.5rem 1rem;
  }

  .scorecard-table {
    font-size: 0.75rem;
  }

  .game-instructions {
    gap: 1.25rem;
  }
}
