/* iGCGames player pages. Loaded after Bootstrap 5.3; overrides its tokens with the season skin. */

@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-Variable.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

/* ---------- tokens: holiday skin is the default ---------- */
:root {
  --snow: #f5f7f2;
  --frost: #dde8e3;
  --frost-deep: #c9d9d3;
  --spruce: #173f37;
  --spruce-soft: #2a5a4f;
  --ink: #1d2b28;
  --ink-soft: #4d5e5a;
  --cranberry: #b3263f;
  --cranberry-deep: #8f1d32;
  --amber: #e8a33a;
  --ribbon-1: rgba(179, 38, 63, .30);
  --ribbon-2: rgba(232, 163, 58, .42);
  --ribbon-3: rgba(102, 160, 186, .40);
  --ribbon-4: rgba(78, 140, 110, .38);
  --ribbon-5: rgba(120, 82, 140, .32);
  --select: rgba(23, 63, 55, .22);
  --radius-tile: 18px;
  --radius-ctl: 10px;
  --serif: "Lora", Georgia, serif;
  --sans: "Poppins", system-ui, sans-serif;

  --bs-body-bg: var(--snow);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--sans);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.55;
  --bs-link-color: var(--cranberry);
  --bs-link-color-rgb: 179, 38, 63;
  --bs-link-hover-color: var(--cranberry-deep);
  --bs-link-hover-color-rgb: 143, 29, 50;
  --bs-border-color: var(--frost-deep);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--ink-soft);
}
:root[data-theme="classic"] {
  --snow: #f4f6fa; --frost: #e1e7f1; --frost-deep: #cbd5e5; --spruce: #1f3358; --spruce-soft: #33497a;
  --ink: #1c2436; --ink-soft: #4f5a70; --cranberry: #c24a1c; --cranberry-deep: #9a3912; --amber: #e3a72f;
  --select: rgba(31, 51, 88, .2);
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--snow); color: var(--ink); font-family: var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { color: var(--ink); }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-soft); }
.small-print { font-size: .875rem; color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.visually-hidden-focusable:focus { position: static !important; }

/* Bootstrap buttons without the theme's gradients. */
.btn { font-weight: 500; border-radius: var(--radius-ctl); background-image: none !important; text-shadow: none; padding: .62rem 1.15rem; }
.btn-primary { --bs-btn-bg: var(--cranberry); --bs-btn-border-color: var(--cranberry); --bs-btn-hover-bg: var(--cranberry-deep);
  --bs-btn-hover-border-color: var(--cranberry-deep); --bs-btn-active-bg: var(--cranberry-deep); --bs-btn-active-border-color: var(--cranberry-deep);
  --bs-btn-disabled-bg: var(--cranberry); --bs-btn-disabled-border-color: var(--cranberry); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-quiet { --bs-btn-bg: transparent; --bs-btn-color: var(--ink); --bs-btn-border-color: var(--frost-deep);
  --bs-btn-hover-bg: var(--frost); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--frost-deep);
  --bs-btn-active-bg: var(--frost-deep); --bs-btn-active-color: var(--ink); }
.btn-snow { --bs-btn-bg: var(--snow); --bs-btn-color: var(--spruce); --bs-btn-border-color: var(--snow);
  --bs-btn-hover-bg: #fff; --bs-btn-hover-color: var(--spruce); --bs-btn-hover-border-color: #fff; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.05rem; }
.form-control, .form-select { border-radius: var(--radius-ctl); border-color: var(--frost-deep); background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--spruce-soft); box-shadow: 0 0 0 .2rem rgba(23, 63, 55, .15); }

/* ---------- header ---------- */
.topbar { padding: 14px 0 10px; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--spruce); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.wordmark:hover { color: var(--spruce); }
.topnav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.topnav a { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; white-space: nowrap; }
.topnav a[aria-current="page"] { background: var(--frost); font-weight: 500; }
.streak-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px;
  background: #fff4df; color: #7a4a06; font-weight: 600; font-size: .9rem; border: 1px solid #f3d9a8; }
.streak-chip svg { width: 15px; height: 15px; }
@media (max-width: 480px) { .topnav a.hide-sm { display: none; } .topnav a { padding: 6px 8px; } .wordmark { font-size: 1.2rem; } }

/* ---------- the advent door: today's puzzle ---------- */
.door { position: relative; overflow: hidden; background: var(--spruce); color: var(--snow); border-radius: var(--radius-tile);
  padding: 22px 22px 24px; margin: 6px 0 28px; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: end; }
.door-day { grid-row: span 2; text-align: center; line-height: 1; padding-right: 18px; border-right: 1px solid rgba(245, 247, 242, .25); }
.door-day .mon { display: block; font-size: 1rem; font-weight: 500; color: #cfe1da; margin-bottom: 4px; }
.door-day .num { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(4.2rem, 17vw, 6.5rem); letter-spacing: -.04em; }
.door-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 5.5vw, 2.1rem); line-height: 1.12; margin: 0; color: var(--snow); }
.door-meta { color: #cfe1da; font-size: .95rem; margin: 2px 0 0; }
.door-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.door-actions .done { color: #fff; font-weight: 500; }
.door .sponsor { grid-column: 1 / -1; margin-top: 12px; font-size: .85rem; color: #cfe1da; }
.door .sponsor a { color: #fff; }
.door .sponsor img { height: 22px; width: auto; vertical-align: middle; margin-right: 6px; border-radius: 4px; background: #fff; }
.door.closed { background: var(--spruce-soft); }
@media (max-width: 420px) { .door { grid-template-columns: 1fr; } .door-day { grid-row: auto; border-right: 0; padding: 0; text-align: left; display: flex; gap: 10px; align-items: baseline; } }

/* Snowfall: a few drifting dots behind the door. Off with reduced motion or the footer toggle. */
.snow-layer { position: absolute; inset: 0; pointer-events: none; }
.snow-layer i { position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55);
  animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(var(--drift, 12px), 280px, 0); } }
:root.no-snow .snow-layer { display: none; }
@media (prefers-reduced-motion: reduce) { .snow-layer { display: none; } }

/* ---------- sections ---------- */
.section { margin: 0 0 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { font-size: .95rem; }
.note { background: #fff; border: 1px solid var(--frost-deep); border-radius: 12px; padding: 14px 16px; }
.empty { color: var(--ink-soft); padding: 8px 0; }

/* Leaderboard rows: a plain ruled list, not cards. */
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--frost); }
.board li:last-child { border-bottom: 0; }
.board .pos { font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; text-align: right; }
.board .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .who small { color: var(--ink-soft); margin-left: 6px; }
.board .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.board li.you { background: #fff4df; border-radius: 8px; }
.board li.top-1 .pos { color: var(--cranberry); }

/* Season calendar: one tile per day, the archive's door. */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar a, .calendar span { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; position: relative; }
.calendar a { background: var(--frost); color: var(--spruce); }
.calendar a:hover { background: var(--frost-deep); }
.calendar a.played::after { content: ""; position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--cranberry); }
.calendar a.today { background: var(--spruce); color: var(--snow); }
.calendar span { background: transparent; border: 1px dashed var(--frost-deep); color: #9fb0ab; }
.calendar-legend { font-size: .85rem; color: var(--ink-soft); margin-top: 8px; }

/* Between seasons: the week's earlier puzzles, and a note about the next season. */
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--frost); }
.recent-list li:last-child { border-bottom: 0; }
.season-note { background: var(--frost); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: .95rem; }

/* Tabs on the boards page */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--frost); font-size: .95rem; }
.tabs a[aria-current="page"] { background: var(--spruce); color: var(--snow); }

/* ---------- play ---------- */
.play-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.play-head h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.35rem, 5vw, 1.8rem); line-height: 1.15; margin: 0; }
.play-head .sub { color: var(--ink-soft); font-size: .92rem; margin: 2px 0 0; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.5rem; color: var(--spruce); min-width: 4.5ch; text-align: right; }
.clock .pen { display: block; font-size: .75rem; font-weight: 500; color: var(--cranberry); }

.board-area { position: relative; width: min(100%, 480px); margin: 0 auto; }
.grid-frame { position: relative; background: var(--frost); border-radius: var(--radius-tile); padding: 6px; touch-action: none; user-select: none; -webkit-user-select: none; }
.grid-cells { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); z-index: 2; aspect-ratio: 1; align-content: start; }
.grid-cells.n10 { grid-template-columns: repeat(10, 1fr); }
.grid-cells button { aspect-ratio: 1; border: 0; background: transparent; padding: 0; font: 600 clamp(1rem, 4.6vw, 1.45rem)/1 var(--sans);
  color: var(--ink); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.grid-cells.n10 button { font-size: clamp(.85rem, 3.7vw, 1.2rem); }
.grid-cells button:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.grid-cells button.anchor { box-shadow: inset 0 0 0 3px var(--spruce); }
.grid-cells button.hinted { box-shadow: inset 0 0 0 3px var(--amber); }
.ribbons { position: absolute; inset: 6px; z-index: 1; pointer-events: none; overflow: visible; }
.ribbons line { stroke-linecap: round; }
.grid-veil { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px; background: var(--spruce); color: var(--snow); border-radius: var(--radius-tile); }
.grid-veil p { margin: 0; color: #cfe1da; max-width: 30ch; }
.grid-veil .veil-title { font-family: var(--serif); font-size: 1.5rem; color: var(--snow); font-weight: 600; }
.grid-veil .veil-note { font-size: .85rem; max-width: 32ch; }
.grid-veil .veil-note a { color: var(--snow); text-decoration: underline; text-underline-offset: 2px; }

.words { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 6px; padding: 0; list-style: none; }
.words button { border: 1px solid var(--frost-deep); background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 13px;
  font: 500 .95rem var(--sans); letter-spacing: .03em; }
.words button[aria-pressed="true"] { border-color: var(--spruce); box-shadow: 0 0 0 2px var(--spruce) inset; }
.words button.found { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); background: var(--frost); border-color: transparent; }
.words button.found[data-c="1"] { text-decoration-color: var(--cranberry); }
.words button.found[data-c="2"] { text-decoration-color: var(--amber); }
.play-tools { display: flex; justify-content: center; gap: 10px; margin: 10px 0 0; }

/* Results */
.result { text-align: center; margin: 4px auto 0; max-width: 520px; }
.result .time { font-family: var(--serif); font-weight: 700; font-size: clamp(3.4rem, 15vw, 5rem); line-height: 1; color: var(--spruce); letter-spacing: -.03em; }
.result .lead { font-size: 1.1rem; margin: 10px 0 4px; }
.result .facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 18px; color: var(--ink-soft); }
.result .facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.result .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.claim { margin: 18px 0 0; background: #fff4df; border: 1px solid #f3d9a8; border-radius: 12px; padding: 14px 16px; }
.badge-new { display: inline-block; margin: 4px; padding: 4px 12px; border-radius: 999px; background: var(--spruce); color: var(--snow); font-size: .9rem; }
.challenge-bar { background: #fff; border: 1px solid var(--frost-deep); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; text-align: center; }

/* Confetti for the finish: small ribbons that fall once. */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.burst i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: drop 1.6s ease-in forwards; }
@keyframes drop { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .burst { display: none; } }

/* Profile, leagues */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-grid div { border: 1px solid var(--frost-deep); border-radius: 12px; padding: 10px 12px; background: #fff; }
.badge-grid div.locked { background: transparent; border-style: dashed; color: #8a9a96; }
.badge-grid strong { display: block; font-size: .95rem; }
.badge-grid span { font-size: .82rem; color: var(--ink-soft); }
.league-list { list-style: none; padding: 0; margin: 0; }
.league-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--frost); }
.league-list li:last-child { border-bottom: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }

/* Footer */
.foot { padding: 26px 0 30px; color: var(--ink-soft); font-size: .88rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.linklike { background: none; border: 0; padding: 0; color: var(--cranberry); text-decoration: underline; font: inherit; }

/* Toast */
.toast-live { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; background: var(--spruce); color: var(--snow);
  padding: 10px 16px; border-radius: 10px; font-size: .95rem; max-width: calc(100vw - 32px); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast-live.show { opacity: 1; }
dialog { border: 0; border-radius: 16px; padding: 22px; max-width: min(92vw, 420px); color: var(--ink); }
dialog::backdrop { background: rgba(23, 63, 55, .45); }

/* Grid ribbons and the live selection (SVG strokes, in cell units) */
.ribbons line { stroke-width: .78; }
.ribbons .r1 { stroke: var(--ribbon-1); } .ribbons .r2 { stroke: var(--ribbon-2); } .ribbons .r3 { stroke: var(--ribbon-3); }
.ribbons .r4 { stroke: var(--ribbon-4); } .ribbons .r5 { stroke: var(--ribbon-5); }
.ribbons .sel { stroke: var(--select); }
.ribbons .miss { stroke: rgba(179, 38, 63, .18); }
.error-page { padding-top: 40px; }
