/* Thanksgiving squares (/thanksgiving2026) — the turkey theme.
   Loads AFTER css/styles.css and css/mnf.css and reuses MNF's furniture (header, game
   card, team banners, digit strips, square numbers, modal). This file only adds the
   autumn palette, the tabs, the prize ladder, the recorded-winner badges and the day
   summary. Points use the football glyph; there is never a currency sign. No new
   keyframes: the live leader reuses .win-cell's pulse from styles.css. */
.tg-page {
  --tg-pumpkin: #d9661f;
  --tg-pumpkin-dk: #b4521a;     /* white text on it clears AA (5.0:1) */
  --tg-cranberry: #9b1b30;
  --tg-gold: #e0a526;
  --tg-brown: #4a2511;
  --tg-cream: #fbf3e4;
  --tg-line: #ecd9bd;
  --tg-paper: #fffaf2;
  /* MNF's own tokens, re-pointed at the harvest palette */
  --mnf-field: #4a2511;
  --mnf-field-2: #c2571a;
  --mnf-chalk: #fbf3e4;
  --mnf-accent: #e0a526;
  --mnf-line: #ecd9bd;
}

/* the faint hand-drawn turkeys behind everything (tail fan, brown body; no emoji) */
body.tg-page {
  background-color: var(--tg-cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cdefs%3E%3Cg id='t' stroke='%234a2511' stroke-width='1.3' stroke-linejoin='round'%3E%3Cellipse rx='4.6' ry='11' transform='rotate(-68) translate(0 -9)' fill='%239b1b30'/%3E%3Cellipse rx='4.6' ry='11' transform='rotate(-34) translate(0 -9.5)' fill='%23e0a526'/%3E%3Cellipse rx='4.6' ry='11' transform='translate(0 -10)' fill='%23d9661f'/%3E%3Cellipse rx='4.6' ry='11' transform='rotate(34) translate(0 -9.5)' fill='%23e0a526'/%3E%3Cellipse rx='4.6' ry='11' transform='rotate(68) translate(0 -9)' fill='%239b1b30'/%3E%3Cellipse cy='3' rx='8.5' ry='7.5' fill='%237a4420'/%3E%3Ccircle cy='-6' r='4.3' fill='%238a5228'/%3E%3Ccircle cx='-1.5' cy='-7' r='.8' fill='%23fbf3e4' stroke='none'/%3E%3Cpath d='M-1.6 -5.2h3.2l-1.6 2.6z' fill='%23e0a526' stroke-width='.6'/%3E%3Cpath d='M1.6 -3.4q2.2 2.4 .2 5' fill='none' stroke='%239b1b30' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M-3 10.2v3.6M3 10.2v3.6' stroke='%23d9661f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/g%3E%3C/defs%3E%3Cg opacity='.13'%3E%3Cuse href='%23t' transform='translate(44 50) rotate(-6)'/%3E%3Cuse href='%23t' transform='translate(134 136) rotate(8) scale(.85)'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* ------------------------------ Header ------------------------------ */
.tg-page .tg-header { background: linear-gradient(135deg, #4a2511 0%, #6e3415 45%, #c2571a 100%); }
.tg-page .tg-header::after { background: none; }
.tg-page .mnf-title-accent { color: #ffe3a3; }
.tg-title-turkey { text-transform: none; }
.tg-page .tg-header .pot-block { background: rgba(43, 20, 8, .45); border-color: rgba(255, 227, 163, .35); }
.tg-page .tg-header .back-link { color: #fde9cf; }

.tg-page .mnf-updated { color: var(--tg-brown); }
.tg-page .mnf-updated.is-delayed { color: #7a2a00; background: #fff0dc; border-color: #f0c48c; }

.tg-page .btn-primary { background: var(--tg-pumpkin-dk); }
.tg-page .btn-primary:hover { background: #9c4515; }
.tg-page .toast { background: var(--tg-brown); }

/* The main column must never size to a child's max-content (the tab grid's fr tracks
   would otherwise push the page past 390px on a phone). */
.tg-main { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------ Tabs ------------------------------ */
.tg-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tg-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; padding: 8px 6px; border-radius: 14px; text-align: center;
  background: #fff; border: 2px solid var(--tg-line); color: var(--tg-brown);
  font-weight: 800; font-size: .86rem; line-height: 1.15; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: background-color .15s ease, border-color .15s ease;
}
.tg-tab:hover { border-color: var(--tg-pumpkin); }
.tg-tab:focus-visible { outline: 3px solid var(--tg-gold); outline-offset: 2px; }
.tg-tab.is-active { background: var(--tg-brown); border-color: var(--tg-brown); color: #fff; }
.tg-tab-label { display: inline-flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 4px; }
.tg-tab-turkey { display: none; }
.tg-tab.is-active .tg-tab-turkey { display: inline; }
.tg-tab-time { font-weight: 700; opacity: .85; }
.tg-tab-sep { opacity: .6; }
.tg-tab-state { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: #6b5440; }
.tg-tab.is-active .tg-tab-state { color: #fde9cf; }
.tg-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8a58c; flex: 0 0 auto; }
.tg-tab-state.is-live .tg-dot { background: #e0402a; box-shadow: 0 0 0 2px rgba(224, 64, 42, .25); }
.tg-tab-state.is-final .tg-dot { background: #1c8a4d; }
.tg-tab-state.is-off .tg-dot { background: var(--tg-cranberry); }
.tg-tab-state.is-live { color: #b0301c; }
.tg-tab-state.is-final { color: #1c6e3f; }
.tg-tab.is-active .tg-tab-state.is-live, .tg-tab.is-active .tg-tab-state.is-final { color: #fde9cf; }

/* ------------------------------ Prize ladder ------------------------------ */
.tg-ladder-card .card-head { padding: 14px 16px 6px; margin: 0; }
.tg-ladder-card h2 { margin: 0; font-size: 1.05rem; }
.tg-ladder-total { font-size: .82rem; font-weight: 800; color: var(--tg-cranberry); }
.tg-ladder { list-style: none; margin: 0; padding: 4px 14px 14px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.tg-rung { position: relative; padding: 9px 12px 10px 14px; border-radius: 12px; background: var(--tg-paper);
  border: 1px solid var(--tg-line); overflow: hidden; }
.tg-rung::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #d9c8ae; }
.tg-rung-head { display: flex; align-items: baseline; gap: 6px; }
.tg-rung-turkey { font-size: .95rem; }
.tg-rung-label b { font-weight: 900; color: var(--tg-brown); }
.tg-rung-label small { font-size: .74rem; color: var(--ink-soft); font-weight: 600; }
.tg-rung-prize { margin-left: auto; font-weight: 900; color: var(--tg-cranberry); white-space: nowrap; }
.tg-rung-body { margin-top: 5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.tg-rung-state { display: inline-block; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; background: #efe6d8; color: #5c4a38; }
.tg-rung-who { font-size: 1rem; font-weight: 800; color: var(--ink); }
.tg-rung-detail { flex-basis: 100%; font-size: .76rem; color: var(--ink-soft); }

.tg-rung.is-live::before { background: var(--tg-pumpkin); }
.tg-rung.is-live { border-color: #f0b98f; background: #fff4ea; }
.tg-rung.is-live .tg-rung-state { background: #fde1cc; color: #8a3a0c; }
.tg-rung.is-confirming::before { background: repeating-linear-gradient(180deg, var(--tg-gold) 0 6px, transparent 6px 10px); }
.tg-rung.is-confirming .tg-rung-state { background: #fff0c7; color: #6b4c00; }
.tg-rung.is-decided::before { background: var(--tg-cranberry); }
.tg-rung.is-decided { border-color: #e2c48a; background: linear-gradient(160deg, #fff8e4, #fff1cf); }
.tg-rung.is-decided .tg-rung-state { background: var(--tg-cranberry); color: #fff; }
.tg-rung.is-checking .tg-rung-state { background: #fff0c7; color: #6b4c00; }
.tg-rung.is-unclaimed::before { background: var(--tg-brown); }
.tg-rung.is-unclaimed .tg-rung-state { background: #ead8c4; color: var(--tg-brown); }
.tg-rung.is-onhold, .tg-rung.is-voided { opacity: .82; }
.tg-rung.is-onhold .tg-rung-state, .tg-rung.is-voided .tg-rung-state { background: #f3dfe3; color: #7a1526; }

/* ------------------------------ Board ------------------------------ */
.tg-page .mnf-corner { font-size: 1.3rem; }
.tg-page .board .win-col { background: rgba(217, 102, 31, .09); }
.tg-page .board .win-row { background: rgba(155, 27, 48, .06); }
/* a RECORDED winner: static gold, with the prize badges stacked in the corner */
.tg-page .board td.tg-won {
  background: linear-gradient(160deg, #fff6dc, #ffe7a8);
  box-shadow: inset 0 0 0 2px #c98a12;
  color: #3d1f0d; font-weight: 800;
}
.tg-page .board td.tg-won .sq-no { color: #8a5d0c; }
.tg-badges { position: absolute; top: 1px; right: 1px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; pointer-events: none; }
.tg-badge { font-size: .5rem; font-weight: 900; letter-spacing: .03em; line-height: 1.3; padding: 0 3px; border-radius: 3px;
  background: var(--tg-cranberry); color: #fff; }
.tg-won-turkey { position: absolute; left: 2px; bottom: 1px; font-size: .66rem; line-height: 1; pointer-events: none; }
/* "confirming" is longer than MNF's flag words: keep it whole (no mid-word break) */
.tg-page .board td.win-cell .tg-lead-flag { color: #6b3a00; letter-spacing: 0; word-break: normal; overflow-wrap: normal; }

/* ------------------------------ Day summary ------------------------------ */
.tg-day-card .card-head { padding: 14px 16px 6px; margin: 0; }
.tg-day-card h2 { margin: 0; font-size: 1.05rem; }
/* styles.css gives .history-table a 460px floor; four columns fit a phone without it */
.tg-page .tg-day-table { min-width: 0; }
.tg-day-table td { vertical-align: top; }
.tg-day-table tr.tg-day-row, .tg-day-table tr.tg-day-group { cursor: pointer; }
.tg-day-table tr.tg-day-row:hover, .tg-day-table tr.tg-day-group:hover { background: #fff4ea; }
.tg-day-table tr.tg-day-group:focus-visible { outline: 2px solid var(--tg-pumpkin); outline-offset: -2px; }
.tg-day-table tr.tg-day-group td { padding-top: 10px; border-top: 2px solid var(--tg-line); background: #fdf3e3; white-space: normal; }
.tg-day-table tr.is-viewing { background: #fff6e8; box-shadow: inset 3px 0 0 var(--tg-pumpkin); }
.tg-day-table tr.tg-day-group.is-viewing td { background: #fde9cf; }
.tg-day-game { font-weight: 900; color: var(--tg-brown); }
.tg-day-when { font-size: .78rem; color: var(--ink-soft); }
.tg-day-prize b { font-size: .72rem; letter-spacing: .03em; }
.tg-day-score, .tg-day-sq { font-variant-numeric: tabular-nums; }
.tg-day-table td.tg-day-who { white-space: normal; min-width: 7.5em; }
.tg-who.is-decided { font-weight: 800; color: var(--ink); }
.tg-who.is-live { font-weight: 700; color: #8a3a0c; }
.tg-who.is-muted { color: var(--ink-soft); }

.tg-winners-h { margin: 8px 16px 8px; font-size: .95rem; color: var(--tg-brown); }
.tg-winners { list-style: none; margin: 0; padding: 0 14px 14px; display: grid; gap: 6px; }
.tg-winner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 12px;
  border-radius: 10px; background: var(--tg-paper); border: 1px solid var(--tg-line); }
.tg-winner-name { font-weight: 800; color: var(--ink); }
.tg-winner-total { margin-left: auto; font-weight: 900; color: var(--tg-cranberry); white-space: nowrap; }
.tg-winner-wins { flex-basis: 100%; font-size: .76rem; color: var(--ink-soft); }
.tg-winners-empty { padding: 8px 2px; color: var(--ink-soft); font-size: .88rem; }

/* ------------------------------ Footer ------------------------------ */
.tg-footer-line { margin: 0 0 4px; font-weight: 800; color: var(--tg-brown); }

/* ------------------------------ Admin extras ------------------------------ */
.tg-prize-fields { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px 10px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tg-prize-fields legend { padding: 0 4px; font-size: .82rem; font-weight: 600; }
.tg-prize-fields label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; font-weight: 700; }
.tg-prize-fields input { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.tg-confirm { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: #fff4e0; border: 1px solid #f0c48c; }
.tg-confirm[hidden], .tg-confirm [hidden] { display: none; }
.tg-skipped { margin: 6px 0 0; padding: 8px 10px 8px 26px; font-size: .8rem; color: #6b4c00; background: #fff8e6;
  border: 1px solid #f2d287; border-radius: var(--radius-sm); }
.tg-skipped[hidden] { display: none; }
.tg-skipped-h { list-style: none; margin-left: -16px; font-weight: 700; }
/* styles.css .field input[type=text] padding (11px 12px) beats the strip's own 2px and clips
   the digits on a phone; and .field is display:block, which stacks a checkbox over its label. */
.tg-page .field .digit-strip-inputs input[type="text"] { padding: 8px 0; }
.tg-page .checkbox-field { display: flex; }
.tg-page .names-edit .nm-digit { background: var(--tg-brown); }
.tg-page .names-edit .nm-top { background: var(--tg-pumpkin-dk); }

/* ------------------------------ Wider screens ------------------------------ */
@media (min-width: 700px) {
  .tg-ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tg-rung-head { flex-wrap: wrap; }
  .tg-winners { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
/* MNF's 88px desktop squares overflow the 980px column by a column; these fit all ten. */
@media (min-width: 900px) {
  .tg-page .board th, .tg-page .board td { width: 78px; min-width: 78px; }
  .tg-page .board th.digit-side, .tg-page .board th.corner { width: 46px; min-width: 46px; }
}

/* ------------------------------ Phones ------------------------------ */
@media (max-width: 599px) {
  .tg-tabs { gap: 6px; }
  .tg-tab { padding: 7px 4px; font-size: .8rem; border-radius: 12px; }
  .tg-tab-label { flex-direction: column; align-items: center; }
  .tg-tab-sep { display: none; }
  .tg-tab-time { font-size: .72rem; }
  .tg-tab-state { font-size: .6rem; letter-spacing: .03em; }
  .tg-day-table { font-size: .76rem; }
  .tg-day-table th, .tg-day-table td { padding: 6px 5px; }
  .tg-page .board td.win-cell .tg-lead-flag { font-size: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tg-tab { transition: none; }
}
