/* Village Fairways public open-tee-time heat map: /heatmap. */
:root {
  --g1: #0e3d21; --g2: #14532d; --g3: #2f6b45;
  --gl: #e9f1ea; --gb: #cfe0d4; --brass: #b3872f;
  --bg: #f3f6f1; --card: #fff; --text: #16211a; --muted: #55615a;
  --link: #14532d; --edge: #cfe0d4;
  --heat-green: #1f7a45; --heat-green-ink: #fff;
  --heat-yellow: #f3cd52; --heat-yellow-ink: #3a2c00;
  --heat-red: #b8372b; --heat-red-ink: #fff;
  --heat-unknown: #e2e7e1; --heat-unknown-ink: #4f5a52;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10150f; --card: #1a2018; --text: #edf2ea; --muted: #aeb8ae;
    --gl: #202d21; --gb: #344536; --edge: #344536; --link: #93d3a8; --brass: #d0a659;
    --heat-green: #2f8f57; --heat-green-ink: #fff;
    --heat-yellow: #d9b23f; --heat-yellow-ink: #241b00;
    --heat-red: #c4473a; --heat-red-ink: #fff;
    --heat-unknown: #2a332a; --heat-unknown-ink: #b7c1b7;
  }
}
/* Status bar backdrop for the installed app (black-translucent status bar). Height is 0 in a browser tab. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: #0e3d21; z-index: 90; pointer-events: none; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.5;
}
.band {
  background: linear-gradient(160deg, var(--g1), var(--g2) 55%, var(--g3));
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
}
.band-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.mark {
  flex: none; width: 40px; height: 40px; border-radius: 11px; background: #f4f8f2; color: #14532d;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.band h1 { margin: 0; font-size: 21px; line-height: 1.2; flex: 1; min-width: 0; }
.band-link {
  flex: none; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none;
  border: 1.5px solid rgba(255,255,255,.7); border-radius: 10px; padding: 8px 12px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.view-switch {
  max-width: 720px; margin: 12px auto 0; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.view-switch a {
  min-height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-weight: 800; color: var(--text); background: var(--card); border: 1.5px solid var(--gb);
}
.view-switch a:first-child { border-radius: 12px 0 0 12px; border-right-width: 0; }
.view-switch a:last-child { border-radius: 0 12px 12px 0; }
.view-switch a[aria-current="page"] { background: var(--g2); border-color: var(--g2); color: #fff; }
.map-link {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; margin-bottom: 8px;
  border: 1.5px solid var(--g2); color: var(--link); font-weight: 800; text-decoration: none;
}
main { max-width: 720px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
a { color: var(--link); }
a:focus-visible, button:focus-visible { outline: 3px solid #d4a94f; outline-offset: 2px; }
.lead { color: var(--muted); margin: 12px 0 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.party { margin-bottom: 14px; }
.party-label { margin: 0 0 6px; font-weight: 700; font-size: 15px; }
.party-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.party-buttons button {
  min-height: 48px; border: 1.5px solid var(--gb); border-radius: 12px; background: var(--card); color: var(--text);
  font: inherit; font-size: 19px; font-weight: 800; cursor: pointer;
}
.party-buttons button[aria-pressed="true"] { background: var(--g2); border-color: var(--g2); color: #fff; }

.next-card { background: var(--card); border: 1px solid var(--edge); border-left: 6px solid var(--heat-green); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.next-kicker { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.next-title { margin: 4px 0 0; font-size: 20px; font-weight: 800; line-height: 1.25; }
.next-sub { margin: 4px 0 0; color: var(--muted); }
.next-action {
  margin-top: 12px; width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--g2); color: #fff;
  font: inherit; font-weight: 800; cursor: pointer;
}
.status { color: var(--muted); font-size: 14px; margin: 0 0 10px; min-height: 1.5em; }

.heat { table-layout: fixed; border-collapse: separate; border-spacing: 4px; margin: 0 -4px; width: calc(100% + 8px); }
.heat th { font-weight: 700; text-align: center; vertical-align: bottom; padding: 2px 0 4px; }
.heat .corner { width: 25%; text-align: left; color: var(--muted); font-size: 12px; }
.heat .day span, .heat .block span { display: block; }
.day-rel, .day-top { font-size: 13px; line-height: 1.2; font-weight: 800; white-space: nowrap; }
.day-rel { color: var(--link); }
.day-label { font-size: 13px; line-height: 1.2; white-space: nowrap; }
.day-note { font-size: 11px; color: var(--muted); font-weight: 600; }
.heat .block { text-align: left; vertical-align: middle; }
.block-name { font-size: 13px; line-height: 1.15; }
.block-hours { font-size: 11px; color: var(--muted); font-weight: 600; }
.heat td { padding: 0; }
.cell {
  width: 100%; min-height: 66px; border: 0; border-radius: 10px; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font: inherit; line-height: 1.1;
}
button.cell { cursor: pointer; }
.cell.green { background: var(--heat-green); color: var(--heat-green-ink); }
.cell.yellow { background: var(--heat-yellow); color: var(--heat-yellow-ink); }
.cell.red { background: var(--heat-red); color: var(--heat-red-ink); }
.cell.unknown, .cell.past { background: var(--heat-unknown); color: var(--heat-unknown-ink); }
.cell-count { font-size: 22px; font-weight: 800; }
.cell-unit { font-size: 11px; font-weight: 700; }
.cell-times { font-size: 11px; opacity: .9; margin-top: 2px; }
.cell-word { font-size: 13px; font-weight: 800; }

.legend { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 6px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.swatch { flex: none; width: 18px; height: 18px; border-radius: 5px; display: inline-block; }
.swatch.green { background: var(--heat-green); }
.swatch.yellow { background: var(--heat-yellow); }
.swatch.red { background: var(--heat-red); }
.swatch.unknown { background: var(--heat-unknown); border: 1px solid var(--gb); }
.fine { color: var(--muted); font-size: 13px; }

.detail {
  width: min(100% - 24px, 600px); max-height: calc(92vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border: 0; border-radius: 18px; padding: 20px 16px; background: var(--card); color: var(--text);
  box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.detail::backdrop { background: rgba(10, 20, 12, .55); }
.detail-close-form { position: absolute; right: 10px; top: 10px; margin: 0; }
.detail-close {
  width: 44px; height: 44px; border: 1px solid var(--gb); border-radius: 50%; background: var(--card); color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.detail-kicker { margin: 0 52px 4px 0; color: var(--link); font-size: 13px; font-weight: 800; }
.detail h2 { margin: 0 52px 6px 0; font-size: 20px; line-height: 1.25; }
.detail-sub { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.course-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.course { border: 1.5px solid var(--gb); border-radius: 13px; padding: 12px; }
.course-top { display: flex; align-items: center; gap: 8px; }
.course-rank {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--g2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.course-name { flex: 1; min-width: 0; font-size: 16px; }
.course-type { flex: none; font-size: 11px; font-weight: 800; color: var(--muted); border: 1px solid var(--gb); border-radius: 999px; padding: 2px 8px; }
.course-meta { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.time-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.time-chip { background: var(--gl); border: 1px solid var(--gb); border-radius: 10px; padding: 6px 9px; display: flex; flex-direction: column; min-width: 86px; }
.chip-time { font-weight: 800; font-size: 15px; }
.chip-spots { font-size: 12px; color: var(--muted); }
.chip-detail { font-size: 11px; color: var(--muted); }
.detail-foot { margin-top: 14px; border-top: 1px solid var(--gb); padding-top: 12px; }
.detail-foot p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.book-link {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px;
  background: var(--g2); color: #fff; font-weight: 800; text-decoration: none;
}

@media (max-width: 380px) {
  .band h1 { font-size: 18px; }
  .band-link { font-size: 14px; padding: 6px 10px; }
  .heat .corner { width: 23%; }
  .cell-count { font-size: 20px; }
}
@media print { body::before { display: none; } }
