/* Mobile first, one light design for every device (no dark mode, see specs/QR-010). Brand: QuéSalió */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/poppins-5.1.0-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/poppins-5.1.0-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/poppins-5.1.0-latin-700.woff2") format("woff2"); }
/* Local fallback with Poppins' metrics, so the swap to Poppins doesn't shift the layout (CLS) */
@font-face { font-family: "Poppins Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 113.73%; ascent-override: 92.33%; descent-override: 30.78%; line-gap-override: 8.79%; }

/* Contrast ratios are in specs/QR-010: the brand green never colors normal-size text (2.2:1 on white) */
:root {
  --brand-blue: #0B4A8B;
  --brand-green: #14C781;
  --brand-gray: #E6EAF0;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #1A2B3C;
  --muted: #5B6B7D;
  --border: var(--brand-gray);
  --accent: var(--brand-blue);
  --on-accent: #FFFFFF;
  --accent-soft: #E8F0F9;
  --accent-line: rgb(11 74 139 / 0.12);
  --green-soft: #E3F8EF;
  --navy: #0A2540;
  --live: #D92D20;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

/* No double-tap zoom on numbers and links; pinch zoom stays (WCAG 1.4.4, specs/QR-027) */
html { touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Poppins", "Poppins Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header: mobile = the installed app's back link or a spacer left, logo centered, the menu button right (specs/QR-061);
   desktop (768px+) = logo left, inline links right. Above the open menu's backdrop (25) and the install banner (20) */
.site-header {
  position: relative;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-bar {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr 96px;
  align-items: center;
  min-height: 64px;
}
.app-back { display: none; }
/* Fixed columns: the back link is display: none in the browser and would otherwise leave its column to the logo */
.header-bar > .brand { grid-column: 2; grid-row: 1; }
.header-bar > .mobile-menu { grid-column: 3; grid-row: 1; }
.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-logo { display: block; width: auto; height: 34px; }
.desktop-nav { display: none; }

.mobile-menu summary, .games-menu summary { list-style: none; cursor: pointer; }
.mobile-menu summary::-webkit-details-marker, .games-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary:focus-visible, .games-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
/* One outlined "☰ Menú" button, 40px tall inside a 44px touch area; open, ✕ on the light blue (specs/QR-061) */
.mobile-menu { justify-self: end; }
.mobile-menu > summary { display: flex; align-items: center; height: 44px; }
.menu-button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--brand-blue);
  border-radius: 10px;
  color: var(--brand-blue);
}
.mobile-menu[open] .menu-button { background: var(--accent-soft); }
.burger-label { font-size: 0.9375rem; font-weight: 600; line-height: 1; }
.burger { display: grid; gap: 4px; }
.burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--brand-blue); transition: transform 0.18s ease, opacity 0.18s ease; }
.mobile-menu[open] .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-menu[open] .burger span:nth-child(2) { opacity: 0; }
.mobile-menu[open] .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .burger span { transition: none; } }
.mobile-menu nav, .games-panel {
  position: absolute;
  z-index: 10;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: 0 8px 16px rgb(10 37 64 / 0.12);
}
/* Its own scroll never chains into the page */
.mobile-menu nav {
  left: 0;
  right: 0;
  top: 100%;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
  overscroll-behavior: contain;
}
/* Hierarchy (specs/QR-061): bold parents, regular children grouped on the light blue, a bar for the current page.
   No link blue: these links act as controls */
.menu-section { border-bottom: 1px solid var(--border); }
.menu-section:last-child { border-bottom: 0; }
.menu-section summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 0; color: var(--text); font-weight: 600; }
.menu-section[open] summary { padding-bottom: 6px; }
.menu-section summary::after { content: "▸"; content: "▸" / ""; }
.menu-section[open] summary::after { content: "▾"; content: "▾" / ""; }
.mobile-menu ul, .games-panel ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu .menu-section ul { margin: 0 0 10px; padding: 2px 12px; border-radius: 8px; background: var(--accent-soft); }
.mobile-menu li a, .games-panel li a { display: block; padding: 10px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.mobile-menu .menu-section li a { border-bottom-color: var(--accent-line); }
.mobile-menu li a.lottery-link, .games-panel li a.lottery-link { display: flex; align-items: center; gap: 12px; }
.mobile-menu li:last-child a, .games-panel li:last-child a { border-bottom: 0; }
.menu-home, .menu-link { display: block; padding: 10px 0; color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--border); }
.menu-home[aria-current="page"], .menu-link[aria-current="page"], .mobile-menu li a[aria-current="page"], .games-panel li a[aria-current="page"] {
  padding-left: 10px;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
/* A menu's link to its index page (specs/QR-045) */
.mobile-menu li a.menu-all, .games-panel li a.menu-all { font-weight: 600; }
.mobile-menu li a.menu-all::after, .games-panel li a.menu-all::after { content: "\00a0›"; content: "\00a0›" / ""; color: var(--accent); font-weight: 700; }

.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
/* The gambling warning reads in the text color, not muted (specs/QR-050) */
.footer-warning strong { color: var(--text); }

/* Page structure */
h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 20px 0 8px;
}
.section-title { font-size: 1.25rem; margin: 28px 0 4px; }
.updated { color: var(--muted); font-size: 0.875rem; margin: 0 0 16px; }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.crumbs li + li::before { content: "›"; margin-right: 4px; }

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.jump a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  text-decoration: none;
  font-size: 0.875rem;
}

/* Headings that are links read as headings: text color and a blue "›" joined to the last word, underline on hover and
   focus. Links on their own line read the same (specs/QR-042). Links inside text keep the default blue underline (specs/QR-026) */
.section-title a, .standalone-link a { color: var(--text); text-decoration: none; text-underline-offset: 4px; }
.section-title a::after, .standalone-link a::after { content: "\00a0›"; content: "\00a0›" / ""; color: var(--accent); font-weight: 700; }
.section-title a:hover, .standalone-link a:hover, .section-title a:focus-visible, .standalone-link a:focus-visible { text-decoration: underline; }

/* Lottery coins (specs/QR-026): the sprite takes no space; sizes match the width/height in partials/coin.ejs */
.coin-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.coin { display: block; flex: none; }
.with-coin { display: flex; align-items: center; gap: 12px; }

/* Draws */
.draw, .overdue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  scroll-margin-top: 16px;
}
.draw-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 1.125rem;
  margin: 0 0 8px;
}
.draw-number { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
/* The card's date and time, quieter than the draw name (specs/QR-052, QR-059) */
.draw-date, .draw-time { color: var(--muted); font-size: 0.9375rem; font-weight: 400; white-space: nowrap; }
.draw-head { margin: 0 0 12px; }
.draw-head strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.draw-pending, .draw-partial { color: var(--muted); margin: 0; }
/* Lottery label, coin and border in the lottery's coin color, so cards of different lotteries tell apart (specs/QR-020, QR-026) */
.draw, .overdue-card { border-left: 4px solid var(--lottery, var(--brand-blue)); }
.draw-lottery { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.draw-dash { font-weight: 600; letter-spacing: 0.1em; }

/* Home heads table: fits a 360 px phone with five draws, so cells stay narrow and names wrap instead of widening it */
.today-heads {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-green);
  border-radius: 12px;
  padding: 12px 10px;
  margin: 12px 0 16px;
}
.today-heads-title { font-size: 1rem; margin: 0 0 8px 4px; }
.today-heads-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.today-heads-table th, .today-heads-table td { padding: 6px 2px; border-bottom: 1px solid var(--border); text-align: center; }
.today-heads-table tbody tr:last-child th, .today-heads-table tbody tr:last-child td { border-bottom: 0; }
.today-heads-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.today-heads-table thead th:first-child { width: 22%; }
.today-heads-table abbr { text-decoration: none; }
.today-heads-table thead a { display: block; min-height: 24px; padding: 4px 0; color: var(--brand-blue); text-underline-offset: 3px; border-radius: 6px; }
.today-heads-table tbody th { text-align: left; font-size: 0.75rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
/* Phones stack the coin above the name so the column stays narrow; 768 px+ puts them inline */
.today-heads-lottery { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 32px; color: var(--text); text-align: center; text-decoration: none; text-underline-offset: 3px; }
.today-heads-lottery:hover span, .today-heads-lottery:focus-visible span { text-decoration: underline; }
.today-heads-table td a { display: block; min-height: 32px; padding: 6px 0; color: var(--brand-blue); font-weight: 700; font-size: 0.9375rem; text-decoration: none; border-radius: 6px; }
.today-heads-table td a:hover { background: var(--green-soft); }
.today-heads-table td .today-heads-pending { color: var(--muted); font-weight: 400; }
/* A waiting lottery's empty cells are not links (specs/QR-028): same box as the linked ones */
.today-heads-table td span.today-heads-pending { display: block; min-height: 32px; padding: 6px 0; font-size: 0.9375rem; }
/* A lottery without draws today (specs/QR-052): one quiet cell, never a blue underlined link */
.today-heads-table td.today-heads-resting { padding: 4px 0; }
.today-heads-table td.today-heads-resting a { padding: 6px 8px; background: var(--bg); color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.today-heads-table td.today-heads-resting a:hover { background: var(--green-soft); color: var(--text); }
.today-heads-table td a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The link to every quiniela (specs/QR-059): one blue control across the table, set apart from the muted header */
.today-heads-table td.today-heads-all { padding: 8px 0 0; border-bottom: 0; }
.today-heads-table td.today-heads-all a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; background: var(--brand-blue); color: var(--on-accent); font-size: 0.9375rem; font-weight: 600; border-radius: 8px; }
/* Keeps its blue on hover, where the other cells turn green-soft: a control, never underlined */
.today-heads-table td.today-heads-all a:hover { background: var(--brand-blue); }
@media (min-width: 768px) {
  .today-heads-table thead th:first-child { width: 34%; }
  .today-heads-lottery { flex-direction: row; gap: 10px; text-align: left; }
  .coin-table { width: 40px; height: 40px; }
  .today-heads-table tbody th { font-size: 0.875rem; }
  .today-heads-table td a { font-size: 1.125rem; }
  .today-heads-table td.today-heads-resting a { font-size: 0.875rem; }
  .today-heads-table td.today-heads-all a { font-size: 1rem; }
}
.draw-partial { margin-bottom: 12px; font-size: 0.875rem; }
/* A provisional reading (specs/QR-054): above the numbers, where the partial note goes, with the pulsing live dot.
   --live is 4.8:1 on white, above the 3:1 of a graphic (WCAG 1.4.11); the dot always comes with the words "en vivo" */
.draw-live { color: var(--muted); margin: 0 0 12px; font-size: 0.875rem; }
.draw-live strong { color: var(--text); }
.live-dot { display: inline-block; width: 8px; height: 8px; margin: 0 6px 0 4px; border-radius: 50%; background: var(--live); vertical-align: 1px; animation: live-pulse 1.6s ease-in-out infinite; }
.draw-live .live-dot { margin-left: 0; }
/* Phone cells have no room for the dot beside four digits: it sits in the cell's corner, back inline from 768 px */
.today-heads-table td a { position: relative; }
.today-heads-table .live-dot { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; margin: 0; }
@media (min-width: 768px) { .today-heads-table .live-dot { position: static; margin: 0 6px 0 4px; } }
@keyframes live-pulse { 50% { opacity: 0.35; transform: scale(0.75); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.numbers {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.numbers th, .numbers td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.numbers thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.numbers tbody th { color: var(--muted); font-weight: 400; width: 12%; }
.numbers td { font-size: 1.125rem; font-weight: 600; width: 38%; }
.numbers tr.first td:first-of-type { background: var(--green-soft); color: var(--brand-blue); border-radius: 6px; }

/* Draw letters (Ciudad): one tile per letter, like the numbers */
.draw-dream { margin: 12px 0 0; color: var(--muted); font-size: 0.875rem; }
.draw-letters { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 0.875rem; }
.letters { display: inline-flex; gap: 4px; }
.letters span {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--brand-blue);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

/* "Cabezas del día": answer-first summary under the H1 */
.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--lottery, var(--brand-green));
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0 16px;
}
.summary-sentence { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; }
.summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.summary-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--brand-blue);
  text-decoration: none;
}
.summary-name { color: var(--text); font-size: 0.875rem; }
.summary-list strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.summary-note { color: var(--muted); font-size: 0.75rem; }
/* Letters page (specs/QR-016) */
.lead { font-size: 1.0625rem; margin: 0 0 16px; }
.summary-title { font-size: 1.125rem; margin: 0 0 4px; }
.letters-sm span { min-width: 22px; padding: 1px 4px; font-size: 0.9375rem; }
.letters-cell { letter-spacing: 0.15em; }
.summary-letters { color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; }

/* Month first-prize table: scrolls inside its wrapper if it ever doesn't fit, so the page never overflows */
.table-scroll { overflow-x: auto; margin: 8px 0 16px; }
.heads-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.heads-table th, .heads-table td { padding: 8px 3px; border-bottom: 1px solid var(--border); text-align: center; font-size: 0.875rem; }
.heads-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.heads-table tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.heads-table td { font-weight: 600; }
.heads-table abbr { text-decoration: none; }
.abbr-full { display: none; }

/* Draw pages (specs/QR-025); links keep the 24 px tap target of WCAG 2.5.8 in a tight table (specs/QR-046) */
.draw-heads-table td a, .draw-heads-table tbody th a { display: block; min-height: 24px; line-height: 24px; }
.draw-page-more { margin: 0 0 8px; }

/* FAQ */
.faq { margin-top: 32px; max-width: 680px; }
.faq-question { font-size: 1rem; margin: 20px 0 4px; }
.faq p { margin: 0; }

/* Ad slots reserve their height so ads never shift the content (CLS) */
.ad {
  min-height: 280px;
  margin: 16px 0;
}

/* Previous/next date bar: big, readable dates and large tap targets */
.daynav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
}
.daynav a, .daynav-current { white-space: nowrap; }
.daynav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  justify-self: start;
}
.daynav a[rel="next"] { justify-self: end; }
.daynav-current {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.125rem;
  font-weight: 700;
}
/* Narrow phones: the current date gets its own row, previous/next share the one below */
@media (max-width: 399px) {
  .daynav { grid-template-columns: 1fr 1fr; }
  .daynav-current { grid-column: 1 / -1; grid-row: 1; }
}
.day-tag {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.day-tag-today { background: var(--brand-green); color: var(--navy); }

/* Collapsed date selector at the top of lottery and date pages */
.date-panel { margin: 8px 0 16px; }
.date-panel summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.date-panel summary::-webkit-details-marker { display: none; }
.date-panel summary::after { content: "▾"; }
.date-panel[open] summary::after { content: "▴"; }
.date-panel summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.date-panel-body { margin-top: 12px; }
.month-link { margin: 16px 0; }

.notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  margin: 8px 0;
}

/* Before today's first result (specs/QR-028): it must stand out from the result cards below */
.waiting-notice { border: 1px solid #BCD2EA; border-left: 5px solid var(--brand-blue); padding: 12px 14px; }
.waiting-notice p { margin: 0; }
.waiting-notice .waiting-lead { display: flex; gap: 8px; align-items: center; color: var(--brand-blue); font-weight: 700; margin-bottom: 8px; }
.waiting-lead svg { flex: none; }
.waiting-times { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 8px; }
.waiting-times li { background: var(--surface); border: 1px solid #BCD2EA; border-radius: 6px; padding: 2px 8px; font-size: 0.875rem; }
.waiting-times b { color: var(--brand-blue); }

.intro { color: var(--muted); }

/* Month calendar: 44px cells keep every day an easy tap target on mobile */
.calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  max-width: 420px;
}
.calendar-head {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  text-align: center;
}
.calendar-head a { padding: 8px; text-decoration: none; font-size: 1.25rem; }
.calendar-title { font-size: 1.0625rem; margin: 0; }
.calendar-title::first-letter { text-transform: uppercase; }
.calendar table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar th { color: var(--muted); font-size: 0.75rem; font-weight: 600; padding: 6px 0; }
.calendar td { text-align: center; padding: 2px; }
.calendar td a, .calendar td span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 8px;
}
.calendar td a { background: var(--green-soft); color: var(--brand-blue); font-weight: 600; text-decoration: none; }
.calendar td span { color: var(--muted); }
.calendar td.today a, .calendar td.today span { outline: 2px solid var(--brand-green); }

.prose { max-width: 680px; }
.prose h2 { font-size: 1.125rem; margin-top: 24px; }

/* Offline note (specs/QR-018): only the service worker unhides it, on cached pages */
.offline-note {
  margin: 0;
  padding: 10px 16px;
  background: var(--accent-soft);
  color: var(--brand-blue);
  font-size: 0.875rem;
  text-align: center;
}

/* Install prompts (specs/QR-018): mobile only; [hidden] must win over their display rules */
.install-banner[hidden], .install-item[hidden], .install-help[hidden] { display: none; }
.install-banner {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--brand-blue);
  color: var(--on-accent);
  box-shadow: 0 -4px 16px rgb(10 37 64 / 0.2);
}
/* Text on its own row: beside the button it squeezed to a narrow column (specs/QR-076) */
.install-text { flex-basis: 100%; margin: 0; font-size: 0.875rem; line-height: 1.35; }
.install-text strong { display: block; }
.install-button {
  flex: 1;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.install-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--on-accent);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.install-banner .install-help { flex-basis: 100%; margin: 0; font-size: 0.875rem; }
.install-item { margin: 4px 0 12px; }
.install-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--brand-blue);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--brand-blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.install-item .install-help { margin: 8px 0 0; color: var(--text); font-size: 0.875rem; }

/* Statistics (specs/QR-029): filters, the 00–99 board and "Mi número". Results first, explanations after */
.stats-results-link { margin: 0 0 16px; font-weight: 600; }
.stats-filters {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stats-filter { display: grid; gap: 6px; min-width: 0; }
.stats-filter-label { margin: 0; color: var(--navy); font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.chip:hover { border-color: var(--brand-blue); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--on-accent); font-weight: 600; }
.chip:focus-visible, .cell:focus-visible, .info:focus-visible { outline: 3px solid var(--brand-green); outline-offset: 2px; }

.stats-layout { display: grid; gap: 20px; }
.stats-card { min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.stats-card-title { margin: 0 0 4px; font-size: 1.125rem; }
.stats-sub { margin: 0 0 10px; color: var(--muted); font-size: 0.875rem; }
.stats-legend { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 0.75rem; }
.stats-ramp {
  flex: 1;
  height: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--brand-blue) 6%, var(--surface)), var(--brand-blue));
}
/* The count is always printed, so color is never the only signal (WCAG 1.4.1); --mix (the blue share, from public/stats.js)
   sets the shade and skips the mid shades where neither text color reaches 4.5:1 */
.board { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.cell {
  display: grid;
  place-content: center;
  aspect-ratio: 1 / 1.08;
  min-width: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--accent-soft);
  background: color-mix(in oklab, var(--brand-blue) var(--mix, 6%), var(--surface));
  color: var(--text);
  font: inherit;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.25s;
}
.cell.is-dark { color: var(--on-accent); }
.cell b { font-size: clamp(0.75rem, 3.4vw, 1rem); }
.cell-value { font-size: clamp(0.5625rem, 2.4vw, 0.6875rem); }
.cell[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--brand-green); }
.stats-even { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--navy); font-size: 0.875rem; }
.stats-even p { margin: 0; }

/* "?" buttons open on tap, since phones have no hover; hidden without JavaScript */
.info {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 2px;
  vertical-align: middle;
  border: 1px solid var(--brand-blue);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-blue);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.info[hidden] { display: none; }
.info[aria-expanded="true"] { background: var(--brand-blue); color: var(--on-accent); }
.info-text { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 0.875rem; }
.stats-even .info-text { background: var(--surface); }

.mine-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.mine-form label { width: 100%; font-size: 0.875rem; font-weight: 600; }
.mine-form input {
  width: 7ch;
  padding: 6px;
  border: 2px solid var(--brand-blue);
  border-radius: 10px;
  color: var(--brand-blue);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.mine-form input:focus-visible { outline: 3px solid var(--brand-green); outline-offset: 2px; }
.mine-form button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; }
.ctx { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 8px; list-style: none; }
.ctx li { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--brand-blue); font-size: 0.75rem; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.fact { min-width: 0; padding: 10px; border-radius: 8px; background: var(--bg); }
.fact p { margin: 0; }
.fact-value { color: var(--navy); font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact-label { color: var(--muted); font-size: 0.75rem; }
.mine-last { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.875rem; }
.mine-last a[hidden] { display: none; }
.mine-subtitle { margin: 16px 0 8px; font-size: 0.9375rem; }
.draw-bars { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.draw-bar { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 2.5em; align-items: center; gap: 8px; font-size: 0.8125rem; }
.bar-track { height: 12px; overflow: hidden; border-radius: 6px; background: var(--bg); }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--brand-blue); }
.bar-value, .month-value { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.month-bars { display: flex; align-items: flex-end; gap: 4px; padding: 0; margin: 0; list-style: none; }
.month-bar { display: grid; flex: 1; justify-items: center; gap: 2px; min-width: 0; font-size: 0.6875rem; }
.month-value { text-align: center; }
.month-track { display: flex; align-items: flex-end; width: 100%; max-width: 24px; height: 80px; }
.month-fill { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--brand-blue); }
.month-label { color: var(--muted); }
/* The atrasados tables (specs/QR-073): eight narrow columns that fit a 360 px phone; the wrapper scrolls only below it */
.groups-card { margin: 0 0 20px; }
.stats-filters-prem { margin-bottom: 12px; }
.ambos-wrap { overflow-x: auto; }
.ambos-table { width: 100%; border-collapse: collapse; text-align: center; font-variant-numeric: tabular-nums; }
.ambos-table th, .ambos-table td { padding: 3px 1px; border-bottom: 1px solid var(--border); text-align: center; }
.ambos-table thead tr:first-child th { padding: 6px 2px; border-left: 2px solid var(--surface); background: var(--brand-blue); color: var(--on-accent); font-size: 0.75rem; font-weight: 600; }
.ambos-sub th { color: var(--muted); font-size: 0.625rem; font-weight: 600; }
.ambos-n { border-left: 2px solid var(--border); }
/* "no salió" breaks into two lines, so the four columns fit a 360 px phone */
.ambos-v { color: var(--muted); font-size: 0.75rem; line-height: 1.15; }
.ambos-table tbody tr:nth-child(odd) td { background: var(--bg); }
.ambos-pick { min-width: 28px; min-height: 32px; padding: 0 2px; border: 0; border-radius: 6px; background: transparent; color: var(--brand-blue); font: inherit; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.ambos-pick:hover { background: var(--accent-soft); }
.ambos-pick:focus-visible { outline: 3px solid var(--brand-green); outline-offset: 1px; }
.group-lines { display: grid; padding: 0; margin: 0; list-style: none; }
.group-lines li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: baseline; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.group-label { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.group-main { color: var(--navy); font-size: 1.375rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.group-note { color: var(--muted); font-size: 0.875rem; }
.group-text { grid-column: 2; font-size: 0.875rem; }
/* A share's bar: the percentages are printed beside it, so color is never the only signal */
.group-share { grid-column: 2; display: flex; height: 10px; overflow: hidden; border-radius: 5px; background: var(--border); }
.group-share-fill { background: var(--brand-blue); }
.stats-view-note { margin: 4px 0 0; color: var(--text); font-size: 0.8125rem; }
@media (max-width: 479px) {
  .group-lines li { grid-template-columns: minmax(0, 1fr); }
  .group-text, .group-share { grid-column: 1; }
}
.groups-howto { margin-top: 12px; font-size: 0.875rem; }
.groups-howto summary { color: var(--brand-blue); font-weight: 600; cursor: pointer; }
.groups-howto p { margin: 6px 0 0; }
.stats-note { max-width: 680px; margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.875rem; }
.stats-note strong { color: var(--text); }
.stats-links { display: grid; gap: 8px; padding: 0; margin: 24px 0 0; list-style: none; font-weight: 600; }

/* Index pages (specs/QR-045) */
.index-list, .draw-index-list { padding: 0; margin: 12px 0 0; list-style: none; }
.index-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.index-list a { font-weight: 600; }
.index-list p { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; }
.draw-index-list li { padding: 6px 0; }
.overdue-card h2 { margin: 0 0 12px; font-size: 1.125rem; }
.overdue-card h3 { margin: 12px 0 6px; font-size: 0.875rem; }
.overdue-card .stats-links { margin-top: 16px; }
.overdue-card section { max-width: 480px; }
.top-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; list-style: none; text-align: center; }
.top-numbers b { display: block; margin-bottom: 4px; padding: 4px 0; background: var(--green-soft); color: var(--brand-blue); border-radius: 6px; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.top-count { color: var(--muted); font-size: 0.75rem; }
.overdue-note-line { margin: 6px 0 0; color: var(--muted); font-size: 0.75rem; }
@media (prefers-reduced-motion: reduce) { .cell { transition: none; } }
@media (min-width: 900px) {
  .stats-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
}

@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .daynav a { font-size: 1rem; padding: 8px 12px; }
  .daynav-current { font-size: 1.25rem; }
  .draw { padding: 20px 24px; }
  .heads-table th, .heads-table td { padding: 8px 6px; font-size: 1rem; }
  .abbr-short { display: none; }
  .abbr-full { display: inline; }
  .ad { min-height: 250px; }
}

@media (min-width: 768px) {
  .header-bar { display: flex; justify-content: space-between; }
  .mobile-menu, .header-spacer { display: none; }
  .install-banner { display: none !important; }
  .brand-logo { height: 38px; }
  /* Five items since the "Juegos" menu (specs/QR-064): a narrower gap below 960 px keeps them on one line at 768 px */
  .desktop-nav { display: flex; align-items: center; gap: 16px; }
  .games-menu { position: relative; }
  .games-menu summary, .nav-link { padding: 10px 4px; color: var(--text); font-weight: 600; white-space: nowrap; }
  .nav-link { text-decoration: none; }
  .nav-link:hover { text-decoration: underline; }
  .games-menu summary::after { content: " ▾"; color: var(--brand-blue); }
  .games-menu[open] summary::after { content: " ▴"; }
  .games-panel { right: 0; top: 100%; width: 320px; margin-top: 8px; padding: 8px 16px 12px; border: 1px solid var(--border); border-radius: 12px; }
  .draws-panel { width: 220px; }
}
@media (min-width: 960px) {
  .desktop-nav { gap: 24px; }
}

/* Phones (specs/QR-061): the installed app has no browser bar, so it gets a back link at the top left. The open menu
   covers the page and the install banner; tapping the backdrop is a click outside, which closes it */
@media (max-width: 767px) {
  :root[data-display="standalone"] .app-back {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--brand-blue);
  }
  .app-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  body:has(.mobile-menu[open])::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgb(10 37 64 / 0.4); }
}

/* Installed app (specs/QR-027, QR-061's data-display): no browser bar, so the header stays as the only navigation.
   scroll-padding keeps every anchor target below it (64px header + 16px gap); last, so it wins over .draw */
:root[data-display="standalone"] { scroll-padding-top: 80px; }
:root[data-display="standalone"] .site-header { position: sticky; top: 0; }
:root[data-display="standalone"] .draw { scroll-margin-top: 0; }

/* Dream page (specs/QR-041): the table stays one column of meanings so it fits 360 px */
.dream-filter { margin: 0 0 16px; }
.dream-filter label { display: block; margin: 0 0 6px; font-weight: 600; }
.dream-filter input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--muted); border-radius: 8px; font: inherit; }
.dream-filter input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dream-count { min-height: 1.5em; margin: 6px 0 0; color: var(--muted); font-size: 0.875rem; }
.dream-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dream-table[hidden] { display: none; }
.dream-table th, .dream-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.dream-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.dream-table tbody th { width: 3em; font-size: 1.125rem; font-weight: 700; }
.dream-table tr:target th, .dream-table tr:target td { background: var(--green-soft); }
.dream-table tr:target th { box-shadow: inset 4px 0 0 var(--brand-blue); padding-left: 10px; }
.dream-name { display: block; font-weight: 600; }
.dream-more { display: block; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.mine-dream { margin: 8px 0 0; font-size: 0.875rem; }

/* The home's sections by draw (specs/QR-039) */
.home-draw { margin: 12px 0; }
.home-draw > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.home-draw > summary::-webkit-details-marker { display: none; }
.home-draw > summary::after { content: "▾"; content: "▾" / ""; flex: none; font-size: 1.75rem; line-height: 1; color: var(--accent); }
.home-draw[open] > summary::after { content: "▴"; content: "▴" / ""; color: var(--on-accent); }
.home-draw > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-draw > summary h2 { margin: 0; font-size: 1rem; }
/* Open, the section is one block: its header joins a box holding its cards, so it can't read as one more closed section */
.home-draw[open] { border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); }
.home-draw[open] > summary { border: 0; border-radius: 7px 7px 0 0; background: var(--accent); color: var(--on-accent); }
.home-draw[open] > .draw { margin-left: 6px; margin-right: 6px; }
.home-draw[open] > :last-child { margin-bottom: 6px; }
.home-draw .draw-lottery a { display: flex; align-items: center; gap: 10px; color: inherit; }
.home-lotteries ul { padding-left: 20px; }
.home-lotteries li { margin: 8px 0; }

/* Widget page (specs/QR-050): each quiniela's preview and its code */
.widget-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 680px; }
/* Each quiniela's code ends with its button: a rule and room before the next title keep the button with its own widget */
.widget-item + .widget-item { margin-top: 32px; border-top: 1px solid var(--border); }
.widget-preview iframe { display: block; }
.widget-label { font-weight: 600; font-size: 0.9375rem; }
.widget-code { width: 100%; box-sizing: border-box; font: 0.8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; resize: vertical; }
.widget-copy { justify-self: start; font: inherit; font-weight: 600; color: var(--on-accent); background: var(--accent); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
.widget-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.widget-points, .widget-steps { margin: 0 0 8px; padding-left: 1.25rem; display: grid; gap: 4px; }
.widget-jump { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 20px 0 8px; }

/* Games other than the quinielas (specs/QR-064): the game's logo next to its name, never instead of it */
.with-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.game-logo { display: block; flex: none; height: auto; }
.lottery-link .game-logo, .game-card-title .game-logo { margin-right: 8px; }

/* "¿Hubo ganadores con 6 aciertos?": the answer first, each line to its card */
.winners { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand-green); border-radius: 12px; padding: 12px 14px; margin: 12px 0 16px; }
.winners-title { font-size: 1rem; margin: 0 0 6px; }
.winners-sentence { margin: 0 0 8px; font-size: 0.9375rem; }
.winners-list { list-style: none; margin: 0; padding: 0; }
.winners-list li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; align-items: baseline; }
.winners-list li:last-child { border-bottom: 0; }
.winners-list a { color: var(--text); font-weight: 600; text-decoration: none; text-underline-offset: 3px; }
.winners-list a:hover, .winners-list a:focus-visible { text-decoration: underline; }
.winners-text { font-weight: 700; }
.winners-won { font-weight: 700; color: var(--brand-blue); }
.winners-detail { color: var(--muted); }

/* Balls: six fit a 360 px phone (6 × 44 + 5 × 8 = 304 px) */
.balls { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 14px; padding: 0; }
.ball { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--brand-blue); font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.ball-empty { background: var(--surface); border: 2px dashed #C3CDD8; color: var(--muted); font-weight: 400; }
.balls-small { gap: 6px; }
.balls-small .ball { width: 36px; height: 36px; font-size: 0.9375rem; }

/* A modality's prizes: "Vacante" spelled out, never a 0 */
.prizes { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.prizes th, .prizes td { padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: right; font-size: 0.9375rem; }
.prizes th:first-child { text-align: left; }
.prizes thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.prizes tbody th { font-weight: 600; }
.prizes td.vacant { font-weight: 700; }
.pot { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 0.875rem; }

.ticket-link { margin: 16px 0; }
.button-link { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 8px; background: var(--brand-blue); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.button-link:hover { background: var(--navy); }
.button-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.next-draw { background: var(--accent-soft); border-radius: 12px; padding: 14px; margin: 16px 0; }
.next-title { font-size: 1rem; margin: 0 0 6px; }
.next-draw p { margin: 0 0 6px; }
.trademark { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8125rem; }
.month-draws-list { list-style: none; margin: 0; padding: 0; }
.month-draws-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.month-draws-numbers { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* The home's "Juegos" section, after the quinielas */
.home-games { margin-top: 28px; }
.game-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--lottery, var(--brand-blue)); border-radius: 12px; padding: 14px; margin: 12px 0; }
.game-card-title { margin: 0 0 4px; font-size: 1.0625rem; }
.game-card-title a { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; text-underline-offset: 3px; }
.game-card-title a:hover span, .game-card-title a:focus-visible span { text-decoration: underline; }
.game-card-waiting { margin: 0 0 6px; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--brand-blue); font-weight: 600; font-size: 0.875rem; }
.game-card-meta { margin: 0 0 8px; color: var(--muted); font-size: 0.875rem; }
.game-card-first { margin: 0 0 4px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.game-card-line { margin: 0 0 12px; font-size: 0.875rem; }
.game-card-more { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: var(--bg); font-weight: 600; text-decoration: none; }
.game-card-more:hover { background: var(--green-soft); }

/* The ticket check (specs/QR-064): 46 checkboxes as 44 px cells; checked shows by fill and a ✓, not color alone.
   With 6 checked, public/ticket.js disables the rest until one is unchecked */
.ticket fieldset { border: 0; margin: 0; padding: 0; }
.ticket legend { font-weight: 600; margin-bottom: 8px; }
.ticket-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ticket-cell { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #C3CDD8; border-radius: 8px; background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.ticket-cell input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ticket-cell:has(input:checked) { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--on-accent); }
.ticket-cell:has(input:checked)::after { content: "✓"; content: "✓" / ""; position: absolute; top: 1px; right: 4px; font-size: 0.6875rem; line-height: 1; }
.ticket-cell:has(input:disabled) { background: var(--bg); border-color: var(--border); color: var(--muted); cursor: not-allowed; }
.ticket-cell input:disabled { cursor: not-allowed; }
.ticket-cell:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ticket-count { margin: 12px 0 0; font-size: 0.9375rem; font-weight: 600; color: var(--brand-blue); }
.ticket-submit { width: 100%; margin: 8px 0 12px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
/* Waiting for the six: muted, its reason in the counter above (4.5:1 text on the gray) */
.ticket-submit:disabled { background: var(--brand-gray); color: var(--muted); cursor: not-allowed; }
.ticket-rows { list-style: none; margin: 0; padding: 0; }
.ticket-rows li { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.ticket-name { font-weight: 600; }
.ticket-name small { display: block; color: var(--muted); font-weight: 400; font-size: 0.75rem; }
.ticket-pays strong { color: var(--brand-blue); }
.ticket-text { color: var(--muted); }
.ticket-rows strong, .ticket-text { display: block; }
