/* ──────────────────────────────────────────────────────────────────────
   The Wonga Cup · Live Scorecard styles
   Extends styles.css. Loaded only on scorecard.html.
   ────────────────────────────────────────────────────────────────────── */

.sc-body { background: var(--canvas-2); }

/* ── back link — scorecard masthead is always solid so ink colours work ── */
.back-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  transition: color .2s;
}
.back-link:hover { color: var(--ink); }

/* ── editorial page header — light cream band bridging masthead → scoring ── */
.sc-page-header {
  background: var(--canvas);
  border-bottom: 1px solid var(--rule-strong);
  padding: 100px 32px 36px; /* top: masthead height + breathing room */
  color: var(--ink);
}
.sc-page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.sc-page-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.sc-page-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.sc-page-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

/* ──────────────────────────────────────────────────────────────────────
   TALLY HERO — the live scoreboard
   ────────────────────────────────────────────────────────────────────── */
.sc-tally {
  background: var(--ink);
  color: var(--canvas);
  padding: 36px 0 28px;
  border-top: none;
}
.sc-tally + section { border-top: 1px solid var(--rule); }

.tally-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tally-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(239,231,211,0.75);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 0 currentColor;
  animation: livePulse 2.4s infinite;
  display: inline-block;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(208,74,54,0.6); }
  60% { box-shadow: 0 0 0 10px rgba(208,74,54,0); }
  100% { box-shadow: 0 0 0 0 rgba(208,74,54,0); }
}
.tally-actions {
  display: flex;
  gap: 10px;
}
.ghost-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  background: transparent;
  color: var(--canvas);
  border: 1px solid rgba(239,231,211,0.4);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.ghost-btn:hover { background: var(--canvas); color: var(--ink); border-color: var(--canvas); }
.ghost-btn--danger:hover { background: var(--hot); color: var(--canvas); border-color: var(--hot); }

/* main board */
.tally-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 12px 0 24px;
}
.side-block {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: baseline;
}
.side-block--right { direction: rtl; }
.side-block--right > * { direction: ltr; }
.side-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-block--right .side-label { align-items: flex-end; }
.side-name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1;
  color: var(--canvas);
}
.side-cap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(239,231,211,0.6);
}
.side-score {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(4.5rem, 9vw, 7.5rem);
  line-height: 0.9;
  color: var(--canvas);
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}
.side-of {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(239,231,211,0.5);
  align-self: end;
  padding-bottom: 0.6em;
}
.vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
}
.vs > span:first-child {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5rem;
  color: rgba(239,231,211,0.55);
  line-height: 1;
}
.vs-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(239,231,211,0.5);
}

/* day pills */
.tally-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid rgba(239,231,211,0.15);
  border-bottom: 1px solid rgba(239,231,211,0.15);
}
.day-pill {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-right: 1px solid rgba(239,231,211,0.15);
  transition: background .2s;
}
.day-pill:last-child { border-right: none; }
.dp-day {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--canvas);
  line-height: 1;
}
.dp-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(239,231,211,0.55);
  flex: 1;
}
.dp-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.4rem;
  font-feature-settings: "tnum";
  color: var(--canvas);
}
.dp-score i { font-style: normal; color: rgba(239,231,211,0.4); font-size: 1.05rem; }
.dp-score b { font-weight: 500; min-width: 1.2em; text-align: center; }
.day-pill--leading-a .dp-score b:first-child { color: var(--accent-2); }
.day-pill--leading-b .dp-score b:last-child { color: var(--accent-2); }

.tally-foot {
  padding-top: 16px;
  font-family: var(--body);
  font-size: 0.95rem;
  color: rgba(239,231,211,0.7);
  letter-spacing: -0.005em;
}

@media (max-width: 780px) {
  .tally-board { grid-template-columns: 1fr; gap: 16px; }
  .side-block { grid-template-columns: 1fr auto auto; }
  .side-block--right { direction: ltr; }
  .vs { flex-direction: row; padding: 8px 0; border-top: 1px solid rgba(239,231,211,0.15); border-bottom: 1px solid rgba(239,231,211,0.15); justify-content: center; gap: 14px; }
  .side-score { font-size: 5rem; }
  .tally-breakdown { grid-template-columns: 1fr; }
  .day-pill { border-right: none; border-bottom: 1px solid rgba(239,231,211,0.15); }
  .day-pill:last-child { border-bottom: none; }
}

/* ──────────────────────────────────────────────────────────────────────
   SIDES EDITOR
   ────────────────────────────────────────────────────────────────────── */
.sc-sides {
  background: var(--canvas);
  padding: 56px 0 64px;
}
.section-head--compact { margin-bottom: 32px; }
.section-head--compact .meta { border-top: 1px solid var(--rule-strong); padding-top: 10px; }

.sides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.side-edit {
  border: 1px solid var(--rule-strong);
  padding: 22px 22px 8px;
  background: var(--canvas);
  border-radius: 4px;
}
.side-edit-head {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}
.input-name, .input-cap {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 1px dashed transparent;
  transition: border-color .2s;
  width: 100%;
}
.input-name:focus, .input-cap:focus { border-bottom-color: var(--accent); }
.input-cap { font-size: 1.1rem; color: var(--ink-2); }
.input-name::placeholder, .input-cap::placeholder { color: var(--ink-mute); opacity: 0.6; }

.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.player-list li:last-child { border-bottom: none; }
.player-list .pn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.player-list input {
  font-family: var(--body);
  font-size: 1rem;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  padding: 6px 0;
  width: 100%;
  border-bottom: 1px dashed transparent;
}
.player-list input:focus { border-bottom-color: var(--accent); }
.player-list input::placeholder { color: var(--ink-mute); opacity: 0.4; }

@media (max-width: 720px) {
  .sides-grid { grid-template-columns: 1fr; }
  .side-edit-head { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────────────
   DAY SECTIONS
   ────────────────────────────────────────────────────────────────────── */
.sc-day { padding: 64px 0; background: var(--canvas); }
.sc-day.alt { background: var(--canvas-2); }
.sc-day + .sc-day { border-top: 1px solid var(--rule); }

/* ── Day I · match play ── */
.match-list {
  border-top: 1px solid var(--rule-strong);
}
.match {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.match-label {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.ml-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.ml-name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  color: var(--ink);
  line-height: 1;
}
.match--decided .ml-name { color: var(--ink); }

.match-toggle {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--canvas);
}
.match-toggle button {
  font-family: var(--body);
  font-size: 0.9rem;
  padding: 10px 18px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.1;
  min-width: 120px;
  transition: background .15s, color .15s;
}
.match-toggle button:last-child { border-right: 0; }
.match-toggle button:hover { background: var(--canvas-2); color: var(--ink); }
.match-toggle .rt-pts {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.match-toggle button.is-active {
  background: var(--ink);
  color: var(--canvas);
}
.match-toggle button.is-active .rt-pts { color: rgba(239,231,211,0.65); }

@media (max-width: 720px) {
  .match { grid-template-columns: 1fr; gap: 12px; }
  .match-toggle { width: 100%; }
  .match-toggle button { flex: 1; min-width: 0; padding: 10px 8px; }
  .match-toggle .rt-lab { font-size: 0.82rem; }
}

/* ── Day II · hole grid ── */
.hole-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
}
.hole {
  background: var(--canvas);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  position: relative;
  transition: background .2s;
}
.hole-num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum";
}
.hole-buttons {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  overflow: hidden;
}
.hole-buttons button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink-2);
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hole-buttons button:last-child { border-right: 0; }
.hole-buttons button:hover { background: var(--canvas-2); }
.hole-buttons button.is-active { background: var(--ink); color: var(--canvas); }

.hole--a { background: oklch(0.94 0.04 100 / 0.5); }
.hole--b { background: oklch(0.92 0.04 60 / 0.4); }
.hole--halved { background: var(--canvas-2); }
.hole--a .hole-num,
.hole--b .hole-num { color: var(--ink); }

.hole-foot {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule-strong);
  background: var(--canvas);
}
.hf-stat {
  padding: 14px 16px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hf-stat:last-child { border-right: none; }
.hf-stat .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.hf-stat .v {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.9rem;
  font-feature-settings: "tnum";
  line-height: 1;
}

@media (max-width: 900px) {
  .hole-grid { grid-template-columns: repeat(3, 1fr); }
  .hole-foot { grid-template-columns: repeat(2, 1fr); }
  .hf-stat:nth-child(2n) { border-right: none; }
  .hf-stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 480px) {
  .hole-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Day III · Stableford ── */
.stableford-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--rule-strong);
  padding-top: 24px;
}
.sb-side {
  border: 1px solid var(--rule-strong);
  background: var(--canvas);
  padding: 0 22px 8px;
  border-radius: 4px;
}
.sb-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--rule);
}
.sb-name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1;
}
.sb-total {
  font-family: var(--display);
  font-style: italic;
  font-size: 2.2rem;
  font-feature-settings: "tnum";
  line-height: 1;
}
.sb-total i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.04em; margin-left: 6px; }

.sb-list { list-style: none; padding: 0; margin: 0; }
.sb-row {
  display: grid;
  grid-template-columns: 32px 1fr 70px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.sb-row:last-child { border-bottom: none; }
.sb-pn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
}
.sb-player {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
}
.sb-input {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.3rem;
  font-feature-settings: "tnum";
  background: var(--canvas-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: center;
  padding: 6px 8px;
  color: var(--ink);
  outline: 0;
  transition: border-color .2s, background .2s;
}
.sb-input:focus { border-color: var(--accent); background: var(--canvas); }
.sb-input::placeholder { color: var(--ink-mute); opacity: 0.5; }
/* hide number spinner */
.sb-input::-webkit-outer-spin-button,
.sb-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sb-input { -moz-appearance: textfield; }

.sb-verdict {
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.3;
  border-radius: 4px;
}

@media (max-width: 760px) {
  .stableford-grid { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────────────
   HONOURS GRID
   ────────────────────────────────────────────────────────────────────── */
.honours-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
}
.hon {
  background: var(--canvas);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: text;
}
.hk {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.hon input {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2rem;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--rule);
  outline: 0;
  padding: 4px 0;
  color: var(--ink);
}
.hon input:focus { border-bottom-color: var(--accent); border-bottom-style: solid; }
.hon input::placeholder { color: var(--ink-mute); opacity: 0.5; font-style: italic; }

@media (max-width: 900px) { .honours-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .honours-grid { grid-template-columns: 1fr; } }

/* ──────────────────────────────────────────────────────────────────────
   MINIMAL FOOTER on scorecard
   ────────────────────────────────────────────────────────────────────── */
.foot--minimal { padding: 28px 0 24px; }
.foot--minimal .colophon { margin-top: 0; padding-top: 0; border-top: none; }
.foot--minimal .colophon a { color: var(--ink-mute); }
.foot--minimal .colophon a:hover { color: var(--ink); }
