/* Self-hosted Cinzel and Montserrat (SIL OFL 1.1, assets/fonts/OFL-*.txt): variable fonts, latin + latin-ext subsets. */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('assets/fonts/cinzel-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('assets/fonts/cinzel-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('assets/fonts/montserrat-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('assets/fonts/montserrat-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* No background on html: the body gradient must propagate to the whole canvas (else dark bands above and below). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* No double-tap zoom delay on controls; no grey flash on tap. */
button, a, select, .tile { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:root {
  --bg:
    radial-gradient(60% 34% at 10% -6%, rgba(63, 208, 232, 0.13), transparent 70%),
    radial-gradient(55% 30% at 92% -6%, rgba(200, 170, 110, 0.12), transparent 70%),
    radial-gradient(90% 40% at 50% 108%, rgba(63, 208, 232, 0.07), transparent 70%),
    #050811;
  --cyan: #3fd0e8;
  --gold: #c8aa6e;
  --gold-light: #f0e6d2;
  --gold-dark: #785a28;
  --panel: rgba(10, 16, 28, 0.82);
  --panel2: rgba(30, 42, 68, 0.35);
  --border: rgba(200, 170, 110, 0.2);
  --text: #f0e6d2;
  --text-muted: #a0a5b5;
}
body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
}
/* Hextech lattice, only faintly towards the bottom of the screen. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33' fill='none' stroke='%23c8aa6e' stroke-opacity='.09' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 56px 97px;
  -webkit-mask-image: linear-gradient(180deg, transparent 55%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 55%, #000 100%);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}
.app { max-width: 640px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 12px 8px; }
header {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 12px 0 20px;
  position: relative;
}
header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(200, 170, 110, 0.4) 50%, transparent 100%);
}
.logo {
  text-align: center;
}
.logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  color: var(--gold-light);
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(200, 170, 110, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.header-logo-icon {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(200, 170, 110, 0.45));
}
.logo p {
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}
.next-board {
  font-size: 0.78rem; color: var(--text-muted);
  margin-top: 10px; text-align: center;
  letter-spacing: 0.5px; font-variant-numeric: tabular-nums;
}
.puzzle-credit {
  font-size: 0.78rem; color: var(--gold); font-style: italic;
  margin-top: 6px; text-align: center;
  letter-spacing: 0.5px;
}
.lives-row { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; }
.lives-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.lives-pips { display: flex; gap: 8px; }
.pip {
  width: 12px; height: 12px;
  transform: rotate(45deg);
  border: 1.5px solid var(--gold);
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  transition: all .3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.pip.lost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}
.progress-bar { display: flex; gap: 6px; margin-bottom: 18px; }
.progress-seg {
  flex: 1; height: 5px; border-radius: 2px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05); transition: background .3s;
}
.progress-seg.filled {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(200, 170, 110, 0.4);
}
.solved-banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.solved-banners:empty { display: none; }
.group-banner {
  padding: 12px 16px; border-radius: 6px; border: 1px solid; text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: pulse .4s ease;
}
.group-banner .cat {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.group-banner .items {
  font-size: 0.84rem;
  font-weight: 500;
  opacity: .95;
}
.grid-wrap { margin-bottom: 16px; }
.tile-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
@media (max-width: 480px) {
  .tile-grid { gap: 6px; }
  .tile { font-size: 0.72rem; padding: 10px 4px; min-height: 54px; }
}
.tile {
  background: var(--panel2);
  border: 1px solid rgba(200, 170, 110, 0.22);
  border-radius: 6px;
  padding: 14px 6px; text-align: center;
  font-size: 0.84rem; font-weight: 700;
  color: #e4e6eb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer; user-select: none; min-height: 64px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 10px rgba(0, 180, 255, 0.03);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap; overflow: hidden; line-height: 1.2;
}
/* Hover lift only with a real pointer — on touch screens it would stick after a tap. */
@media (hover: hover) {
  .tile:hover {
    border-color: var(--gold);
    background: rgba(200, 170, 110, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4),
                inset 0 0 8px rgba(200, 170, 110, 0.15);
  }
}
.tile:active:not(.selected) { transform: scale(0.97); }
.tile.selected {
  border-color: #f0e6d2;
  background: linear-gradient(135deg, rgba(200, 170, 110, 0.3) 0%, rgba(120, 90, 40, 0.4) 100%);
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 0 20px rgba(200, 170, 110, 0.35),
              inset 0 0 10px rgba(255, 255, 255, 0.08);
  color: #fff;
}
.tile-grid.shake { animation: shake .45s ease; }
.tile-grid.pulse { animation: pulse-grid .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes pulse-grid { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }
.hint-msg {
  text-align: center; font-size: 0.88rem; color: #ffca58;
  min-height: 24px; margin: 10px 0;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 200, 88, 0.2);
}
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }
.btn {
  padding: 11px 32px;
  border-radius: 4px;
  border: 1px solid var(--gold);
  background: linear-gradient(to bottom, #1e2328 0%, #111317 100%);
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: inset 0 0 5px rgba(200, 170, 110, 0.25),
              0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transition: 0.5s;
}
.btn:hover:not(:disabled)::before { left: 100%; }
.btn:hover:not(:disabled) {
  border-color: #f0e6d2;
  background: linear-gradient(to bottom, #2b3138 0%, #161a1e 100%);
  box-shadow: inset 0 0 8px rgba(255, 230, 180, 0.25),
              0 0 15px rgba(200, 170, 110, 0.35);
  color: #fff;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled {
  opacity: 0.3;
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.3);
  background: #0f1115;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary {
  border-color: #4a5060;
  color: var(--text-muted);
  background: transparent;
  box-shadow: none;
}
.btn-secondary:hover:not(:disabled) {
  border-color: #a0a5b5;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: none;
}
.no-puzzle, .result-panel {
  text-align: center; padding: 48px 24px;
  background: rgba(18, 28, 48, 0.15);
  border: 1px solid rgba(200, 170, 110, 0.15);
  border-radius: 8px; margin-top: 24px;
  box-shadow: inset 0 0 20px rgba(0, 180, 255, 0.03);
}
.no-puzzle h2, .result-panel h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem; color: var(--gold-light); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(200, 170, 110, 0.3);
}
.no-puzzle p { color: var(--text-muted); font-weight: 500; }
.emoji-grid {
  font-size: 1.4rem;
  letter-spacing: 4px;
  margin: 20px auto;
  line-height: 1.8;
  font-family: monospace;
  text-align: center;
  padding-left: 4px;
}
.result-actions { display: flex; gap: 12px; justify-content: center; align-items: stretch; flex-wrap: wrap; margin-top: 20px; width: 100%; }
/* Popup buttons side by side: same width and height whatever their label (share vs copy, cancel vs confirm). */
.result-actions .btn {
  flex: 1 1 0; min-width: 0; max-width: 220px; padding-left: 12px; padding-right: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.hidden { display: none !important; }
.overlay {
  position: fixed; inset: 0; background: rgba(1, 5, 10, 0.65); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}
.modal {
  background: #090e18; border: 1px solid rgba(200, 170, 110, 0.22);
  border-top: 3px solid var(--gold); border-radius: 8px;
  max-width: 520px; width: 100%; max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px; position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.85),
              0 0 30px rgba(200, 170, 110, 0.1);
}
#resultOverlay .modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light); margin-bottom: 18px; font-size: 1.3rem;
  letter-spacing: 1px; text-transform: uppercase;
  text-shadow: 0 0 8px rgba(200, 170, 110, 0.25);
}
#resultOverlay .modal h2 {
  text-align: center;
  width: 100%;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; background: none; border: none;
  color: var(--text-muted); font-size: 1.4rem; cursor: pointer;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--gold); }
.guide-section { margin-bottom: 18px; }
.guide-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem; color: var(--gold); margin-bottom: 8px;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.guide-section p, .guide-section li { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.guide-section ul { padding-left: 18px; }
.color-swatch { display: inline-block; width: 15px; height: 15px; border-radius: 3px; vertical-align: middle; margin-right: 8px; border: 1px solid rgba(255,255,255,.25); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: 4px; border: 1px solid rgba(200, 170, 110, 0.2);
  background: rgba(10, 16, 28, 0.6); color: var(--text); font-family: inherit; font-size: 0.88rem;
  transition: all 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--gold);
  background: rgba(18, 28, 48, 0.55);
  outline: none;
  box-shadow: 0 0 10px rgba(200, 170, 110, 0.15);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-error { color: #f55; font-size: 0.82rem; margin: 8px 0; font-weight: 600; }
.success-screen { text-align: center; padding: 24px; }
.success-screen .check { font-size: 3.5rem; margin-bottom: 16px; text-shadow: 0 0 15px rgba(74, 224, 136, 0.3); }
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(60px);
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  background: #0d1527; border: 1px solid var(--gold); color: var(--gold-light);
  padding: 10px 28px; border-radius: 4px; font-size: 0.88rem; font-weight: 600; z-index: 1100;
  opacity: 0; transition: transform .3s ease, opacity .3s ease; pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(200, 170, 110, 0.2);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Laptops with short windows: tighter spacing so the board fits (the board itself scales in grid.css). */
@media (min-width: 521px) and (max-height: 900px) {
  .next-board { margin-top: 8px; }
  .lives-row { margin: 10px 0 8px; }
  .progress-bar { margin-bottom: 10px; }
  .grid-wrap { margin-bottom: 6px; }
  .tile { min-height: clamp(46px, 8vh, 64px); padding: 8px 6px; }
  .hint-msg { min-height: 20px; margin: 4px 0; }
  .actions { margin-top: 6px; }
}
/* Phones: the panel goes edge to edge, controls get finger-sized, inputs stay at 16px so iOS doesn't zoom. */
@media (max-width: 520px) {
  body { background-attachment: scroll; }
  .next-board { margin-top: 8px; }
  .lives-row { margin: 10px 0 8px; }
  .progress-bar { margin-bottom: 10px; }
  .grid-wrap { margin-bottom: 4px; }
  .hint-msg { min-height: 20px; margin: 4px 0; font-size: 0.8rem; }
  .actions { margin-top: 6px; }
  .actions { gap: 8px; }
  .actions .btn { flex: 1; max-width: 220px; padding: 13px 10px; }
  .result-actions .btn { flex: 1 1 140px; padding: 12px 10px; }
  .overlay { padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .modal { padding: 22px 16px 18px; }
  .modal-close {
    top: 4px; right: 4px; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  }
  .form-group input, .form-group textarea { font-size: 16px; }
  .no-puzzle { padding: 32px 16px; }
}

.group-banner.missed {
  border-style: dashed;
  opacity: 0.95;
  box-shadow: 0 0 12px rgba(200, 170, 110, 0.15);
}

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(200, 170, 110, 0.45) rgba(5, 8, 17, 0.6); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(5, 8, 17, 0.6); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gold), var(--gold-dark));
  border-radius: 4px; border: 2px solid rgba(5, 8, 17, 0.6);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
::-webkit-scrollbar-corner { background: transparent; }

/* Grid's drawn icon in the text colour: a 3x3 grid (the ▦ character draws 4x4 in most fonts). */
.icon-grid3 { display: inline-block; width: 0.8em; height: 0.8em; flex-shrink: 0; background: currentColor; }
.icon-grid3 { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M0 0h4v4H0zM5 0h4v4H5zM10 0h4v4h-4zM0 5h4v4H0zM5 5h4v4H5zM10 5h4v4h-4zM0 10h4v4H0zM5 10h4v4H5zM10 10h4v4h-4z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M0 0h4v4H0zM5 0h4v4H5zM10 0h4v4h-4zM0 5h4v4H0zM5 5h4v4H5zM10 5h4v4h-4zM0 10h4v4H0zM5 10h4v4H5zM10 10h4v4h-4z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ==========================================================================
   Page shell (both games): header — logo, game tabs, streak / stats / guide —, the board line (‹ #37 date ›
   and guesses), the game panel and the one-line footer. Phones first; one header row from 760 px.
   ========================================================================== */
button { font-family: inherit; }

/* ---------- Header ---------- */
header.site-header {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0 8px; padding: 0;
}
header.site-header::after { display: none; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0; }  /* shrinks instead of pushing the buttons to a new row */
.brand-icon { width: 32px; height: 32px; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(200, 170, 110, 0.35)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: 'Cinzel', serif; font-weight: 800; font-size: 1.08rem; letter-spacing: 1.2px; line-height: 1.1;
  color: var(--gold-light); white-space: nowrap;
}
/* Subtitle: --text-muted on the background ≈ 7.9:1. */
.brand-tag { font-size: 0.62rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Streak, statistics, guide: icon + a short label under it, at least 44×44 px. */
.header-actions { display: flex; flex-shrink: 0; }
.hbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 44px; min-height: 44px; padding: 2px 3px; border: 0; border-radius: 8px; background: none;
  color: var(--gold-light); cursor: pointer;
}
.hbtn svg { width: 21px; height: 21px; flex-shrink: 0; }
.hbtn-lbl { font-size: 0.56rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.hbtn:hover { background: rgba(200, 170, 110, 0.08); }
.hbtn:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.hbtn-ico { display: flex; align-items: center; gap: 1px; height: 21px; font-weight: 800; font-size: 0.84rem; color: #ffb547; }
.hbtn-streak svg { width: 19px; color: #ff9b3d; }

/* Game tabs: text with a cyan underline; the next mode as a small "coming soon" icon on the right. */
.game-tabs {
  order: 3; flex-basis: 100%; display: flex; align-items: stretch; justify-content: space-evenly; gap: 4px;   /* evenly spread under the header */
  margin-top: 6px; border-bottom: 1px solid var(--border);
}
.game-tab {
  position: relative; display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 12px;
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-decoration: none; white-space: nowrap;
}
.game-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.game-tab:hover { color: var(--gold-light); }
.game-tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.game-tab[aria-current="page"] { color: var(--gold-light); }
.game-tab[aria-current="page"]::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--cyan);
}
/* "new" next to a new game's name: small, bold, cyan (the translated word stays for screen readers). */
.tab-new { align-self: flex-start; margin: 7px 0 0 -3px; font-size: 0.56rem; font-weight: 800; line-height: 1; color: var(--cyan); }
.tab-new::before { content: 'new'; }
.game-tab-soon { margin-left: auto; min-width: 44px; padding: 0; justify-content: center; opacity: 0.55; cursor: default; }
.game-tab-soon:hover { color: var(--text-muted); }

/* ---------- Board line: ‹ #37 date › ……… guesses ---------- */
.board-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; margin: 6px 0; }
.date-nav-wrap { display: flex; align-items: center; min-width: 0; }
.date-nav-btn {
  position: relative; flex-shrink: 0; width: 30px; height: 40px; padding: 0; border: 0; background: none;
  color: var(--gold); font-size: 1.15rem; line-height: 1; cursor: pointer; user-select: none;
}
.date-nav-btn::after { content: ''; position: absolute; inset: 0 -7px; }   /* 44 px wide touch area */
.date-nav-btn:hover:not(:disabled) { color: var(--gold-light); }
.date-nav-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.date-nav-btn:disabled { opacity: 0.3; cursor: default; }
.board-no { font-weight: 800; font-size: 0.9rem; color: var(--cyan); margin-right: 6px; }
.board-no:empty { display: none; }
.date-display { font-size: 0.82rem; font-weight: 600; color: var(--gold-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* The ‹ › arrows stay put whatever the day: site.js fitDateNav sizes the box between them for the longest number
   and date the arrows can reach (in the page's language); "#12 date" sits centred in it. */
.date-box { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 0; }
.board-no { font-variant-numeric: tabular-nums; }
.board-line .grid-status {
  display: flex; align-items: baseline; gap: 5px; margin: 0; flex-shrink: 0;
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; text-transform: none; letter-spacing: 0;
}
.board-line .guesses-left { font-size: 1.1rem; font-weight: 800; color: var(--gold-light); text-shadow: none; }
.tries-max { margin-left: -4px; }
.game-panel:has(#gameArea.hidden) .grid-status { visibility: hidden; }
.game-panel .game-area > .actions { margin-top: 14px; }

/* Guess the Pro / Career Path: the nickname box with a diamond button (a square turned 45°) on its right, sitting in a
   V-shaped notch cut into the box; the button acts like Enter. --h is the box height, --gap the even gap between the
   notch and the diamond. The 1 px frame is the .gp-field background showing around the input (both cut alike). */
.gp-search-row {
  --h: 46px; --gap: 5px; --side: calc(var(--h) * 0.7071);
  display: flex; align-items: center;
}
.gp-field {
  flex: 1; min-width: 0; height: var(--h); padding: 1px; background: rgba(200, 170, 110, 0.35);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--h) / 2) 50%, 100% 100%, 0 100%);
  transition: background 0.2s;
}
.gp-field:has(.search-input:focus) { background: var(--gold); }
.gp-field .search-input {
  display: block; height: 100%; padding: 0 calc(var(--h) / 2 + 10px) 0 14px; border: 0; border-radius: 0;
  background: #0b1120; box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 1.4px) 0, calc(100% - 1.4px - (var(--h) - 2px) / 2) 50%, calc(100% - 1.4px) 100%, 0 100%);
}
.gp-field .search-input:focus { box-shadow: none; }
.gp-submit {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: var(--side); height: var(--side); padding: 0;
  /* Centre of the diamond: the notch tip + its half-width + the gap measured across the 45° edges. */
  margin: 0 calc(var(--h) / 2 - var(--side) / 2) 0 calc(var(--gap) * 1.4142 - var(--side) / 2);
  transform: rotate(45deg);
  border: 1px solid var(--gold); border-radius: 3px; cursor: pointer; color: var(--gold-light);
  background: linear-gradient(135deg, #2a3038 0%, #111317 100%);
  box-shadow: inset 0 0 6px rgba(200, 170, 110, 0.15);
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.gp-submit svg { width: 20px; height: 20px; transform: rotate(-45deg); transition: transform 0.2s; }
.gp-submit:hover {
  border-color: var(--gold-light); color: #fff; background: linear-gradient(135deg, #343b45 0%, #161a1e 100%);
  box-shadow: inset 0 0 8px rgba(255, 230, 180, 0.25), 0 0 14px rgba(200, 170, 110, 0.4);
}
.gp-submit:hover svg { transform: rotate(-45deg) translateX(2px); }
.gp-submit:active { transform: rotate(45deg) scale(0.94); }
.gp-submit:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Footer: one line + language ---------- */
/* Footer at the bottom of the screen: the page is a column at least one screen tall, the game panel stretches
   over the free space (no empty gap between the game and the footer) and the footer sits last. */
body:has(> .site-footer) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:has(> .site-footer) > .app { width: 100%; flex: 1 0 auto; display: flex; flex-direction: column; }
body:has(> .site-footer) > .app > .game-panel { flex: 1 0 auto; }
body:has(> .site-footer) > .site-footer { flex-shrink: 0; margin-top: auto; }
.site-footer {
  display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 640px; margin: 16px auto 0;
  padding: 6px 12px max(16px, env(safe-area-inset-bottom)); font-size: 0.72rem; color: var(--text-muted);
}
.footer-line { display: flex; align-items: center; white-space: nowrap; }
.footer-line > * + *::before { content: '·'; margin: 0 7px; color: var(--gold-dark); }
.footer-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; text-decoration: none; cursor: pointer; }
.footer-link:hover, .footer-link:focus-visible { color: var(--gold-light); text-decoration: underline; outline: none; }
.footer-icons { display: inline-flex; align-items: center; gap: 2px; }
.footer-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 44px; color: var(--text-muted); }
.footer-icon svg { width: 17px; height: 17px; }
.footer-icon:hover, .footer-icon:focus-visible { color: var(--gold-light); outline: none; }
.footer-icon:focus-visible svg { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 3px; }
.lang-wrap { display: inline-flex; align-items: center; gap: 4px; }
.lang-icon { font-size: 0.8rem; }
.lang-select {
  min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--text-muted);
  font: inherit; cursor: pointer;
}
.lang-select:hover { color: var(--gold-light); }
.lang-select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.lang-select option { background: #0d1322; color: var(--text); }
.legal-text { font-size: 0.84rem; line-height: 1.6; color: var(--text-muted); }
.legal-text a { color: var(--cyan); }

/* ---------- Small phones ---------- */
@media (max-width: 374px) {
  .app { padding-left: 10px; padding-right: 10px; }
  .brand { gap: 6px; }
  .brand-icon { width: 28px; height: 28px; }
  .brand-name { font-size: 0.96rem; letter-spacing: 0.8px; }
  .brand-tag { font-size: 0.56rem; }
  .hbtn { padding: 2px 1px; }
  .hbtn-lbl { font-size: 0.52rem; }
  .game-tab { padding: 0 5px; font-size: 0.7rem; gap: 4px; }
  .footer-line > * + *::before { margin: 0 5px; }
}
/* Phones: 16 px in the language list, so iOS doesn't zoom; three game tabs side by side. */
@media (max-width: 520px) {
  .lang-select { font-size: 16px; }
  .game-tabs { gap: 0; }
  .game-tab { padding: 0 7px; gap: 5px; font-size: 0.74rem; }
  .game-tab svg { width: 16px; height: 16px; }
  .tab-new { margin-left: -2px; font-size: 0.5rem; }
}
/* ---------- Wide screens: one header row, the game in a panel ---------- */
@media (min-width: 760px) {
  .app { max-width: 760px; padding-top: clamp(10px, 3vh, 24px); }
  header.site-header { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; }
  .game-tabs { order: 0; margin: 0; border: 0; justify-self: center; }
  .game-tab-soon { margin-left: 0; }
  .brand-icon { width: 40px; height: 40px; }
  .brand-name { font-size: 1.3rem; }
  .game-panel {
    margin-top: 14px; padding: 8px 20px 20px; border: 1px solid var(--border); border-radius: 12px;
    background: rgba(8, 13, 25, 0.55); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    /* Stretches down to the footer (the page shell above), so there is no empty gap under the game. */
  }
}

/* ---------- Streak (progress.js) ---------- */
/* The flame is a counter, not a button. Not played today (or no streak yet): dimmed. */
.hbtn-streak, .hbtn-streak:hover { cursor: default; background: none; }
.hbtn-streak.streak-off .hbtn-ico { color: var(--text-muted); }
.hbtn-streak.streak-off svg { color: var(--text-muted); opacity: 0.7; }
.streak-line { margin-top: 18px; font-size: 0.95rem; font-weight: 700; color: #ffb547; text-align: center; }

/* ---------- First-visit guide (onboarding.js) ---------- */
.onb-overlay { z-index: 950; }
.onb-modal { max-width: 400px; text-align: center; }
.onb-modal h2 { margin: 6px 0 8px; font-size: 1.15rem; }
/* Top row: language on the left, × on the right. */
.onb-top { display: flex; align-items: center; justify-content: space-between; margin: -14px -12px 6px; }
.onb-lang { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 0.8rem; }
.onb-lang select {
  min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 0.82rem; cursor: pointer;
}
.onb-lang select:hover { color: var(--gold-light); }
.onb-lang select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.onb-lang select option { background: #0d1322; color: var(--text); }
.onb-close {
  width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.6rem; line-height: 1;
}
.onb-close:hover, .onb-close:focus-visible { color: var(--gold-light); outline: none; }
@media (max-width: 520px) { .onb-lang select { font-size: 16px; } }
.onb-text { font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); }
.onb-text strong { color: var(--gold-light); }
.onb-dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.onb-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(168, 174, 192, 0.35); }
.onb-dots span.on { background: var(--cyan); }
.onb-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.onb-actions .btn { flex: 1 1 0; max-width: 170px; min-height: 44px; padding-left: 10px; padding-right: 10px; }
.onb-demo-slot:empty { display: none; }
.onb-demo { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 12px; }
.onb-x { color: var(--text-muted); font-size: 1.1rem; }
.onb-cond { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.66rem; font-weight: 800; color: var(--gold-light); text-transform: uppercase; }
.onb-cond img { width: 44px; height: 44px; object-fit: contain; padding: 4px; border-radius: 8px; background: #ece6d6; }
/* The cell: "+", then a name being typed, then the player — on a loop. Without animation only the player shows. */
.onb-cell {
  position: relative; width: 78px; height: 78px; border-radius: 6px; overflow: hidden;
  border: 1px solid rgba(74, 224, 136, 0.7); background: rgba(13, 21, 38, 0.82);
}
.onb-cell > * { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; }
.onb-plus { font-size: 2rem; font-weight: 300; color: var(--gold); }
.onb-typing { font-size: 0.85rem; font-weight: 700; color: var(--gold-light); }
.onb-typing::after { content: '|'; margin-left: 1px; color: var(--cyan); }
.onb-done { opacity: 1; flex-direction: column; justify-content: flex-end; }
.onb-done img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.onb-done b { position: relative; width: 100%; padding: 10px 2px 3px; font-size: 0.68rem; color: #fff; background: linear-gradient(transparent, rgba(5, 8, 17, 0.92) 55%); }
.onb-plus { animation: onb-plus 4.8s infinite; }
.onb-typing { animation: onb-typing 4.8s infinite; }
.onb-done { animation: onb-done 4.8s infinite; }
.onb-cell { animation: onb-border 4.8s infinite; }
@keyframes onb-plus { 0%, 22% { opacity: 1; } 26%, 100% { opacity: 0; } }
@keyframes onb-typing { 0%, 24% { opacity: 0; } 28%, 54% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes onb-done { 0%, 56% { opacity: 0; transform: scale(0.92); } 62%, 96% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes onb-border { 0%, 56% { border-color: rgba(200, 170, 110, 0.3); } 60%, 100% { border-color: rgba(74, 224, 136, 0.7); } }
/* Guess the Pro: a guess row turning over tile by tile (guess.css colours). */
.onb-guess { gap: 5px; }
.onb-who { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-right: 4px; font-size: 0.68rem; font-weight: 800; color: var(--gold-light); }
.onb-who img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; }
.onb-tile.gp-cell { width: 48px; max-height: none; padding: 5px; flex-direction: column; font-size: 0.8rem; color: #fff; }
.onb-tile img { max-width: 100%; max-height: 100%; }
.onb-tile i { font-style: normal; font-size: 0.7rem; color: #ffca58; }
.onb-guess:not(.onb-static) .onb-tile { animation: onb-flip 4.8s infinite both; }
@keyframes onb-flip {
  0% { transform: rotateX(90deg); opacity: 0; }
  10%, 92% { transform: rotateX(0); opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Player counters (live.js) ---------- */
.live-line { margin: -2px 0 8px; text-align: center; font-size: 0.78rem; font-weight: 600; color: var(--cyan); }

/* ---------- Mystery player card (dossier.js; Guess the Pro, Career Path) ---------- */
.dossier {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px;
  width: 340px; max-width: 100%; margin: 4px auto 16px; padding: 12px 22px 12px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: rgba(20, 28, 46, 0.45);
}
.dossier:empty { display: none; }
.dossier-photo {
  position: relative; width: 96px; aspect-ratio: 1; overflow: hidden; border-radius: 8px;
  border: 1px solid rgba(200, 170, 110, 0.35); background: #111a2c;
}
.dossier-open .dossier-photo { border-color: var(--gold); }
.dossier-silhouette { position: absolute; left: 10%; bottom: 0; width: 80%; fill: #2a3650; }
/* The "?" as a small gold badge in the corner of the frame. */
.dossier-q {
  position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  font-family: 'Montserrat', sans-serif; font-size: 0.85rem; font-weight: 800; color: #0a101c;
  background: var(--gold); box-shadow: 0 0 0 2px #111a2c;
}
.dossier-img, .dossier-initials { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.dossier-initials { display: flex; align-items: center; justify-content: center; font-family: 'Cinzel', serif; font-size: 1.8rem; color: var(--gold-light); }
.dossier-body { min-width: 0; }
.dossier-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.dossier-nick {
  margin-top: 2px; font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 800; line-height: 1.2;
  color: var(--gold-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dossier-name { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Censored: the same sample text for every player, blurred beyond reading. The line doesn't clip it (no hard edge
   where the blur meets the box): it gets room to fade out on every side. */
.dossier-nick:has(.censored), .dossier-name:has(.censored) { overflow: visible; }
.censored { display: inline-block; padding: 0 4px; filter: blur(7px); opacity: 0.75; user-select: none; }
.dossier-name .censored { filter: blur(5px); }
/* Room for the blur inside the lines that clip long text: no hard edge where it meets the box. */
.dossier-nick, .dossier-name { padding: 6px 12px; margin-left: -12px; margin-right: -12px; }
.dossier-nick { margin-top: -4px; margin-bottom: -6px; }
.dossier-name { margin-bottom: -6px; }
/* The game just ended: the card turns over (dossier.js swaps the sides while it is edge-on). */
.dossier.flip-out { animation: dossier-flip-out 0.3s ease-in forwards; }
.dossier.flip-in { animation: dossier-flip-in 0.4s ease-out; }
@keyframes dossier-flip-out { from { transform: perspective(900px) rotateY(0); } to { transform: perspective(900px) rotateY(90deg); } }
@keyframes dossier-flip-in {
  from { transform: perspective(900px) rotateY(-90deg); }
  70% { transform: perspective(900px) rotateY(8deg); }
  to { transform: perspective(900px) rotateY(0); }
}
@media (max-width: 520px) {
  .dossier { width: 100%; gap: 14px; margin: 0 0 12px; padding: 10px; }
  .dossier-photo { width: 76px; }
  .dossier-nick { font-size: 1.25rem; }
}

/* ---------- Notice under the games, at the top of the footer (site.js): a small quiet box, not a banner ---------- */
.site-notice {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; max-width: 100%;
  margin: 0 auto 4px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(20, 28, 46, 0.45); font-size: 0.68rem; line-height: 1.35; color: var(--text-muted); text-align: center;
}
.site-notice svg { flex-shrink: 0; width: 12px; height: 12px; opacity: 0.8; }
@media (max-width: 520px) { .site-notice { font-size: 0.64rem; padding: 6px 10px; } }
/* Phones held sideways (wide but short): the notice, the footer line and the language share one row. */
@media (min-width: 600px) and (max-height: 560px) {
  .site-footer { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 14px; max-width: none; padding-top: 4px; }
  .site-footer .site-notice { margin: 0; }
}
/* Phones held upright: the notice, then the footer line (the language is part of it, footer.js; the links and the
   picker keep their 44 px touch height). */
@media (max-width: 520px) and (min-height: 561px) {
  .site-footer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .site-footer .site-notice { margin-bottom: 0; }
  .site-footer .lang-select { padding-right: 0; }
}

/* ==========================================================================
   Result popup (all games): one screen, never scrolled as a whole. The parts keep their natural size; only the
   emoji result shrinks (today.js fitResult: the font steps down to fit, and only as a last resort the emoji block
   alone scrolls). Short screens get tighter spacing.
   ========================================================================== */
#resultOverlay .modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: hidden; padding-bottom: 20px; }
#resultOverlay .modal > * { flex-shrink: 0; }
#resultOverlay .emoji-grid {
  flex-shrink: 1; min-height: 0; max-width: 100%; overflow: hidden; margin: 14px auto;
  font-size: clamp(0.8rem, calc((100dvh - 470px) / (var(--emoji-rows, 3) * 1.8)), 1.4rem);
}
#resultOverlay .emoji-grid.scroll { overflow-y: auto; overscroll-behavior: contain; }
#resultOverlay .result-actions { margin-top: 14px; }
#resultOverlay .streak-line { margin-top: 12px; }
#resultOverlay .grid-countdown { margin-top: 14px; padding-top: 10px; }

/* "Play also today" — the other games and whether they were played today (today.js). */
.play-also { width: 100%; margin-top: 14px; }
.play-also:empty { display: none; }
.play-also-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 6px; }
.play-also-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.play-also-link {
  flex: 1 1 0; min-width: 0; max-width: 220px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 2px 7px; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--gold-light);
  border: 1px solid rgba(200, 170, 110, 0.45); background: rgba(200, 170, 110, 0.07); transition: background .2s, border-color .2s;
}
.play-also-link:hover, .play-also-link:focus-visible { background: rgba(200, 170, 110, 0.15); border-color: var(--gold); outline: none; }
.play-also-link.is-done { border-color: rgba(74, 224, 136, 0.35); background: rgba(74, 224, 136, 0.05); }
.play-also-icon { display: inline-flex; color: var(--gold); flex-shrink: 0; }
.play-also-icon svg { width: 16px; height: 16px; }
.play-also-name { font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.86rem; white-space: nowrap; }
.play-also-done { font-weight: 700; color: #4ae088; font-size: 0.9rem; }
.today-chip {
  flex-shrink: 0; padding: 1px 7px; border-radius: 999px; font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.4px; white-space: nowrap; border: 1px solid currentColor;
}
.today-chip-new { color: var(--cyan); }
.today-chip-started { color: #ffb547; }
.today-chip-done { color: #4ae088; }

/* Phones and short windows: tighter popup. */
@media (max-height: 760px), (max-width: 520px) {
  #resultOverlay .modal { padding: 18px 14px 14px; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  #resultOverlay .modal h2 { margin-bottom: 8px; font-size: 1.1rem; padding: 0 30px; }
  #resultOverlay .result-score { font-size: 1.5rem; line-height: 1.2; }
  #resultOverlay .gp-result-player { margin: 2px 0 6px; gap: 10px; }
  #resultOverlay .gp-result-player .avatar { width: 48px; height: 48px; }
  #resultOverlay .gp-answer-nick { font-size: 1.2rem; }
  #resultOverlay .path-bar-small { --circle: 34px; gap: 12px; margin-bottom: 2px; }
  #resultOverlay .emoji-grid { margin: 8px auto; line-height: 1.6; }
  #resultOverlay .result-actions { margin-top: 8px; gap: 8px; }
  #resultOverlay .result-actions .btn { padding-top: 10px; padding-bottom: 10px; }
  #resultOverlay .streak-line { margin-top: 8px; font-size: 0.85rem; }
  #resultOverlay .grid-countdown { margin-top: 8px; padding-top: 6px; font-size: 0.64rem; }
  #resultOverlay .grid-countdown-time { font-size: 1.2rem; margin-top: 0; }
  .play-also { margin-top: 10px; }
  .play-also-link { padding: 4px 8px; gap: 5px; }
  .play-also-name { font-size: 0.78rem; }
}
@media (max-height: 660px) {
  #resultOverlay .modal { padding-top: 12px; }
  #resultOverlay .grid-countdown { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
  #resultOverlay .play-also-label { margin-bottom: 4px; }
}

/* Phones held sideways (wide, under ~480 px tall): the popup uses the width — result on the left, buttons and links
   on the right — so it still fits one screen. Only if even that doesn't fit, the popup itself scrolls (last resort;
   the emoji block already scrolls first). */
@media (max-height: 480px) and (min-width: 600px) {
  #resultOverlay .modal {
    max-width: 760px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense;
    column-gap: 22px; align-content: start; align-items: center; justify-items: center; overflow-y: auto; padding: 12px 16px;
  }
  #resultOverlay .modal > * { grid-column: 1; }
  #resultOverlay .modal > .modal-close { grid-column: 2; }
  #resultOverlay .result-actions, #resultOverlay .streak-line, #resultOverlay .grid-countdown, #resultOverlay .play-also { grid-column: 2; margin-top: 6px; }
  #resultOverlay .result-actions { grid-row: 1 / span 2; align-self: end; }
  #resultOverlay .modal h2 { font-size: 1rem; margin-bottom: 4px; padding: 0; }
  #resultOverlay .gp-result-player .avatar { width: 40px; height: 40px; }
  #resultOverlay .path-bar-small { --circle: 30px; gap: 8px; }
  #resultOverlay .grid-countdown { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding-top: 4px; }
  #resultOverlay .grid-countdown-time { font-size: 1.05rem; }
  .play-also-label { margin-bottom: 2px; }
}
