/* ───────────────────────────────────────────────────────────────
   ROAD TRIP GAMES 🚗  (owned by games.js)
   Everything is prefixed .rtg-  · dark + light themes · 390px → desktop
   Nothing animates while idle: only one-shot transitions on taps.
   ─────────────────────────────────────────────────────────────── */
.rtg-app, .rtg-modal {
  --rtg-ctl: rgba(255, 255, 255, 0.06);
  --rtg-ctl-hover: rgba(255, 255, 255, 0.12);
  --rtg-solid: #1b1f35;
  --rtg-paper: #232845;
  --rtg-ink: #f8fafc;
  --rtg-line: rgba(255, 255, 255, 0.14);
  --rtg-tap: 48px;
  --rtg-radius: 22px;
  --rtg-hue: #8b5cf6;
}
[data-theme="light"] .rtg-app, [data-theme="light"] .rtg-modal {
  --rtg-ctl: #ffffff;
  --rtg-ctl-hover: rgba(99, 102, 241, 0.08);
  --rtg-solid: #ffffff;
  --rtg-paper: #ffffff;
  --rtg-ink: #0f172a;
  --rtg-line: rgba(15, 23, 42, 0.14);
}
.rtg-app { min-width: 0; position: relative; color: var(--text-main); font-family: var(--font-body); }
.rtg-app *, .rtg-modal *, .rtg-app *::before, .rtg-app *::after, .rtg-modal *::before, .rtg-modal *::after { box-sizing: border-box; }
.rtg-app button, .rtg-modal button { font-family: var(--font-display); color: inherit; -webkit-tap-highlight-color: transparent; }
.rtg-app :focus-visible, .rtg-modal :focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
.rtg-app [hidden], .rtg-modal [hidden] { display: none !important; }
.rtg-app h3, .rtg-app h4, .rtg-modal h3 { font-family: var(--font-display); margin: 0; }
.rtg-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rtg-muted { color: var(--text-muted); font-size: 0.9rem; }
.rtg-tip { color: var(--text-muted); font-size: 0.9rem; line-height: 1.45; margin: 10px 0 0; }
.rtg-empty { text-align: center; padding: 30px 16px; border-radius: 20px; border: 2px dashed var(--border-color); color: var(--text-muted); font-family: var(--font-display); }
.rtg-loading { padding: 40px; text-align: center; color: var(--text-muted); font-family: var(--font-display); font-size: 1.2rem; }

/* ── Buttons & controls ──────────────────────────────────────── */
.rtg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--rtg-tap, 48px); padding: 8px 16px; border-radius: 16px;
  border: 1px solid var(--border-color); background: var(--rtg-ctl);
  font-size: 0.98rem; font-weight: 600; cursor: pointer; line-height: 1.15; text-align: center;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.rtg-btn:hover:not(:disabled) { background: var(--rtg-ctl-hover); border-color: var(--primary); }
.rtg-btn:active:not(:disabled) { transform: scale(0.96); }
.rtg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.rtg-btn.on { border-color: var(--primary); background: rgba(139, 92, 246, 0.18); }
.rtg-btn.rtg-primary { background: var(--grad-main); color: #fff !important; border-color: transparent; box-shadow: 0 8px 20px var(--primary-glow); }
.rtg-btn.rtg-primary:hover:not(:disabled) { background: var(--grad-main); box-shadow: 0 10px 26px var(--primary-glow); }
.rtg-btn.rtg-big { min-height: 58px; padding: 12px 24px; font-size: 1.12rem; border-radius: 18px; }
.rtg-btn.rtg-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.rtg-icon {
  display: inline-grid; place-items: center; width: var(--rtg-tap, 48px); height: var(--rtg-tap, 48px); flex: 0 0 auto;
  border-radius: 14px; border: 1px solid var(--border-color); background: var(--rtg-ctl);
  font-size: 1.2rem; font-weight: 700; cursor: pointer; transition: transform 0.15s, background 0.2s;
}
.rtg-icon:hover:not(:disabled) { background: var(--rtg-ctl-hover); }
.rtg-icon:active:not(:disabled) { transform: scale(0.92); }
.rtg-icon:disabled { opacity: 0.35; cursor: not-allowed; }
.rtg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; min-width: 0; }
.rtg-row.rtg-center { justify-content: center; }
.rtg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; min-width: 0; }
.rtg-seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 18px;
  background: var(--rtg-ctl); border: 1px solid var(--border-color); min-width: 0; max-width: 100%;
}
.rtg-seg-btn {
  flex: 1 1 auto; min-height: 42px; padding: 6px 12px; border-radius: 14px; border: none; background: transparent;
  font-size: 0.92rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.rtg-seg-btn:hover { background: var(--rtg-ctl-hover); }
.rtg-seg-btn.active { background: var(--grad-main); color: #fff !important; box-shadow: 0 4px 12px var(--primary-glow); }
.rtg-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rtg-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 7px 14px;
  border-radius: 999px; border: 1px solid var(--border-color); background: var(--rtg-ctl);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.rtg-chip:hover { border-color: var(--primary); }
.rtg-chip:active { transform: scale(0.95); }
.rtg-chip.active { background: var(--primary); color: #fff; border-color: transparent; }
.rtg-chip-emo { font-size: 1.25rem; padding: 6px 12px; }
.rtg-stepper { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border-radius: 18px; background: var(--rtg-ctl); border: 1px solid var(--border-color); }
.rtg-stepper .rtg-icon { width: 42px; height: 42px; border: none; background: transparent; }
.rtg-stepper span { display: flex; flex-direction: column; align-items: center; min-width: 64px; line-height: 1.1; font-family: var(--font-display); }
.rtg-stepper small { color: var(--text-muted); font-size: 0.75rem; }
.rtg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rtg-tab {
  flex: 1 1 auto; min-height: 46px; padding: 8px 14px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--border-color); background: var(--rtg-ctl); font-weight: 700; font-size: 0.95rem;
}
.rtg-tab.active { border-color: var(--pc, var(--primary)); background: color-mix(in srgb, var(--pc, var(--primary)) 18%, transparent); }
.rtg-tabs-big .rtg-tab { min-height: 52px; font-size: 1rem; }
.rtg-progress { display: block; height: 10px; border-radius: 99px; background: var(--border-color); overflow: hidden; }
.rtg-progress i { display: block; height: 100%; background: var(--grad-main); border-radius: inherit; transition: width 0.4s; }
.rtg-input {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--border-color);
  background: var(--rtg-solid); color: var(--text-main); font-family: var(--font-display); font-size: 1.1rem; outline: none;
}
.rtg-input:focus { border-color: var(--primary); }
.rtg-err { color: var(--danger); font-weight: 600; margin: 8px 0 0; }
.rtg-status { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: 6px 0 12px; min-height: 1.5em; }
.rtg-score { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 4px 0 8px; }
.rtg-pl {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-family: var(--font-display); font-weight: 600;
  border: 2px solid transparent; background: color-mix(in srgb, var(--pc) 14%, transparent); transition: border-color 0.2s, transform 0.2s;
}
.rtg-pl b { font-size: 1.15rem; }
.rtg-pl.active { border-color: var(--pc); transform: scale(1.05); }

/* ── Hub ─────────────────────────────────────────────────────── */
.rtg-hub { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rtg-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 22px 24px 34px; border-radius: 28px; color: #fff;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 45%, #ec4899 100%);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.28);
}
.rtg-hero-text h3 { font-size: clamp(1.35rem, 3.4vw, 2rem); line-height: 1.15; margin: 4px 0 6px; }
.rtg-hero-text p { opacity: 0.92; font-size: 0.98rem; line-height: 1.4; margin: 0; max-width: 520px; }
.rtg-kicker { display: inline-block; font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); }
.rtg-hero-stats { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 18px; border-radius: 20px; background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(4px); text-align: center; min-width: 120px; }
.rtg-hero-stats b { font-family: var(--font-display); font-size: 1.7rem; }
.rtg-hero-stats small { font-size: 0.8rem; opacity: 0.9; }
.rtg-shelf { font-size: 1.2rem; letter-spacing: 2px; margin-top: 4px; }
.rtg-shelf-empty { font-size: 0.72rem; letter-spacing: 0; opacity: 0.9; }
.rtg-hero-road { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: rgba(15, 23, 42, 0.35); }
.rtg-hero-road::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 22px, transparent 22px 44px); }
.rtg-hero-car { position: absolute; bottom: 3px; left: 8%; font-size: 1.5rem; transform: scaleX(-1); animation: rtgDriveIn 1.6s cubic-bezier(.2, .8, .2, 1) 1; }
@keyframes rtgDriveIn { from { left: -10%; } to { left: 8%; } }

.rtg-continue { display: flex; flex-direction: column; gap: 10px; }
.rtg-cont-h { font-size: 1.1rem; }
.rtg-cont-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rtg-cont {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 64px; border-radius: 18px; cursor: pointer; text-align: left;
  border: 1px solid color-mix(in srgb, var(--rtg-hue) 45%, transparent); background: color-mix(in srgb, var(--rtg-hue) 14%, var(--bg-card));
  transition: transform 0.15s;
}
.rtg-cont:hover { transform: translateY(-2px); }
.rtg-cont-emo { font-size: 1.8rem; }
.rtg-cont b { display: block; font-size: 1rem; }
.rtg-cont small { display: block; font-family: var(--font-body); color: var(--text-muted); font-size: 0.82rem; }
.rtg-ages { display: flex; flex-wrap: wrap; gap: 8px; }
.rtg-age {
  min-height: 46px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--border-color); background: var(--rtg-ctl);
  font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: all 0.15s;
}
.rtg-age small { font-family: var(--font-body); font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.rtg-age.active { background: var(--grad-main); color: #fff; border-color: transparent; }
.rtg-age.active small { color: rgba(255, 255, 255, 0.85); }
.rtg-group { display: flex; flex-direction: column; gap: 10px; }
.rtg-group-head h3 { font-size: 1.3rem; }
.rtg-group-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.rtg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rtg-card {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center;
  padding: 14px 16px; min-height: 104px; border-radius: var(--rtg-radius); text-align: left; cursor: pointer;
  border: 1px solid var(--border-color); background: var(--bg-card);
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.rtg-card:hover { transform: translateY(-3px); border-color: var(--rtg-hue); background: var(--bg-card-hover); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16); }
.rtg-card:active { transform: scale(0.98); }
.rtg-card-emo {
  grid-row: 1 / 3; width: 64px; height: 64px; display: grid; place-items: center; font-size: 2.1rem; border-radius: 18px;
  background: color-mix(in srgb, var(--rtg-hue) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rtg-hue) 35%, transparent);
}
.rtg-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 54px; }
.rtg-card-body b { font-size: 1.12rem; }
.rtg-card-body small { font-family: var(--font-body); color: var(--text-muted); font-size: 0.86rem; line-height: 1.3; }
.rtg-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.rtg-tag { font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--rtg-ctl); border: 1px solid var(--border-color); color: var(--text-muted); }
.rtg-tag-together { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.35); color: var(--success); }
.rtg-card-stars { position: absolute; top: 12px; right: 12px; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.rtg-new { color: var(--rtg-hue); }
.rtg-foot { text-align: center; color: var(--text-faint); font-size: 0.85rem; margin: 6px 0 10px; }

/* ── Game shell ──────────────────────────────────────────────── */
.rtg-game { min-width: 0; }
.rtg-gbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-width: 0; }
.rtg-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 46px; padding: 6px 16px 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-color); background: var(--rtg-ctl); font-weight: 700; font-size: 0.98rem; flex: 0 0 auto;
}
.rtg-back span { font-size: 1.4rem; line-height: 1; }
.rtg-back:hover { border-color: var(--primary); }
.rtg-gtitle { flex: 1 1 auto; min-width: 0; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtg-gstars { flex: 0 0 auto; font-family: var(--font-display); font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(250, 204, 21, 0.16); color: var(--text-main); }

/* ── Modals ──────────────────────────────────────────────────── */
.rtg-modal {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 20, 0.62); backdrop-filter: blur(3px); animation: rtgFade 0.2s ease-out 1;
  color: var(--text-main); font-family: var(--font-body);
}
@keyframes rtgFade { from { opacity: 0; } }
.rtg-dialog {
  position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; text-align: center;
  padding: 24px 22px 20px; border-radius: 28px; background: var(--rtg-paper); border: 1px solid var(--border-color);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); animation: rtgPop 0.32s cubic-bezier(.2, 1.4, .4, 1) 1;
}
.rtg-dialog h3 { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; margin: 4px 0 6px; }
.rtg-dialog p { color: var(--text-muted); margin: 6px 0; line-height: 1.4; }
.rtg-dialog .rtg-input { margin: 10px 0 2px; text-align: center; }
@keyframes rtgPop { from { transform: scale(0.8); opacity: 0; } }
.rtg-cel-emo { font-size: 3.6rem; line-height: 1.1; }
.rtg-cel-stars { display: flex; justify-content: center; gap: 6px; font-size: 2rem; margin: 8px 0 2px; }
.rtg-cel-stars span { animation: rtgStar 0.5s cubic-bezier(.2, 1.6, .4, 1) both 1; }
.rtg-cel-stars span:nth-child(2) { animation-delay: 0.15s; }
.rtg-cel-stars span:nth-child(3) { animation-delay: 0.3s; }
@keyframes rtgStar { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.rtg-dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.rtg-dlg-actions .rtg-btn { flex: 1 1 140px; }
.rtg-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.rtg-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation-name: rtgConfetti; animation-timing-function: cubic-bezier(.25, .5, .5, 1); animation-iteration-count: 1; animation-fill-mode: forwards; }
@keyframes rtgConfetti { to { top: 105%; transform: rotate(720deg) translateX(40px); opacity: 0.6; } }
.rtg-sheet-wrap { align-items: end; }
.rtg-dialog.rtg-sheet { width: min(720px, 100%); text-align: left; padding: 18px; }
.rtg-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rtg-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.rtg-choice {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; min-height: 88px; border-radius: 18px; cursor: pointer; text-align: center;
  border: 2px solid var(--border-color); background: var(--rtg-ctl); font-weight: 600; font-size: 0.95rem; transition: transform 0.15s, border-color 0.2s;
}
.rtg-choice:hover { border-color: var(--primary); transform: translateY(-2px); }
.rtg-choice.active { border-color: var(--primary); background: rgba(139, 92, 246, 0.16); }
.rtg-choice-emo { font-size: 1.9rem; line-height: 1.1; }
.rtg-choice small { font-family: var(--font-body); color: var(--text-muted); font-size: 0.78rem; }
@media (prefers-reduced-motion: reduce) {
  .rtg-modal, .rtg-dialog, .rtg-cel-stars span, .rtg-hero-car { animation: none !important; }
  .rtg-app *, .rtg-modal * { transition-duration: 0.01s !important; }
}

/* ── On-screen keyboard ──────────────────────────────────────── */
.rtg-kb { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.rtg-kb-row { display: flex; justify-content: center; gap: 5px; }
.rtg-key {
  flex: 1 1 0; max-width: 46px; min-width: 0; height: 50px; border-radius: 10px; border: 1px solid var(--border-color);
  background: var(--rtg-solid); font-size: 1.12rem; font-weight: 700; cursor: pointer; padding: 0;
  box-shadow: 0 2px 0 var(--border-color); transition: transform 0.08s, background 0.15s;
}
.rtg-key:active:not(:disabled) { transform: translateY(2px); box-shadow: none; background: var(--rtg-ctl-hover); }
.rtg-key-wide { flex: 1.6 1 0; max-width: 72px; }
.rtg-key.hit { background: var(--success); color: #fff; border-color: transparent; }
.rtg-key.miss { opacity: 0.3; }
.rtg-key:disabled { cursor: default; }

/* ── Word Search ─────────────────────────────────────────────── */
.rtg-ws-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.rtg-ws-boardwrap { display: flex; justify-content: center; min-width: 0; }
.rtg-ws-board {
  position: relative; container-type: inline-size; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  width: min(100%, 640px, max(260px, calc(100dvh - 190px))); aspect-ratio: 1 / 1; padding: 0;
  border-radius: 20px; background: var(--rtg-paper); border: 1px solid var(--border-color); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; overflow: hidden;
}
.rtg-ws-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.rtg-ws-line { stroke-width: 0.74; stroke-linecap: round; opacity: 0.42; }
.rtg-ws-sel { stroke: var(--primary); stroke-width: 0.8; stroke-linecap: round; opacity: 0.35; }
.rtg-ws-cell {
  position: relative; z-index: 1; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  font-size: calc(100cqw / var(--n) * 0.56); line-height: 1; color: var(--rtg-ink); pointer-events: none;
}
.rtg-ws-cell.found { color: var(--rtg-ink); }
.rtg-ws-cell.anchor::before, .rtg-ws-cell.cursor::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; z-index: -1; }
.rtg-ws-cell.anchor::before { background: color-mix(in srgb, var(--primary) 45%, transparent); }
.rtg-ws-cell.cursor::before { box-shadow: inset 0 0 0 3px var(--secondary); }
.rtg-ws-cell.rtg-hint::before { content: ''; position: absolute; inset: 6%; border-radius: 50%; z-index: -1; background: rgba(250, 204, 21, 0.55); animation: rtgHint 0.9s ease-in-out 4; }
@keyframes rtgHint { 50% { transform: scale(1.25); background: rgba(250, 204, 21, 0.9); } }
.rtg-shake { animation: rtgShake 0.3s 1; }
@keyframes rtgShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rtg-ws-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rtg-ws-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.1rem; }
.rtg-timer { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.rtg-ws-words { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rtg-ws-words li {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-family: var(--font-display); font-weight: 600;
  border: 1px solid var(--border-color); background: var(--rtg-ctl); font-size: 0.95rem; letter-spacing: 0.04em; transition: all 0.25s;
}
.rtg-ws-words li.done { background: color-mix(in srgb, var(--wc) 25%, transparent); border-color: var(--wc); }
.rtg-ws-words li.done .rtg-ws-w { text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.75; }
.rtg-ws-pic { font-size: 1.15rem; }
.rtg-ws-pics { display: grid !important; grid-template-columns: repeat(2, 1fr); }
.rtg-ws-pics li { flex-direction: column; border-radius: 18px; padding: 10px; font-size: 1.15rem; }
.rtg-ws-pics .rtg-ws-pic { font-size: 2.3rem; }

/* ── Crossword ───────────────────────────────────────────────── */
.rtg-cw-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 18px; align-items: start; }
.rtg-cw-play { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.rtg-cw-board {
  container-type: inline-size; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 2px;
  width: min(100%, calc(var(--cols) * 46px), max(200px, calc((100dvh - 380px) * var(--cols) / var(--rows))));
  aspect-ratio: var(--cols) / var(--rows);
}
.rtg-cw-x { display: block; }
.rtg-cw-cell {
  position: relative; display: grid; place-items: center; padding: 0; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--rtg-line); background: var(--rtg-paper); color: var(--rtg-ink); min-width: 0; min-height: 0;
  transition: background 0.15s;
}
.rtg-cw-cell i { position: absolute; top: 1px; left: 3px; font-style: normal; font-family: var(--font-body); font-weight: 700; font-size: calc(100cqw / var(--cols) * 0.22); line-height: 1; color: var(--text-muted); }
.rtg-cw-cell b { font-size: calc(100cqw / var(--cols) * 0.5); line-height: 1; font-weight: 700; }
.rtg-cw-cell.inword { background: color-mix(in srgb, #38bdf8 22%, var(--rtg-paper)); }
.rtg-cw-cell.sel { background: color-mix(in srgb, #facc15 30%, var(--rtg-paper)); border-color: #facc15; box-shadow: inset 0 0 0 2px #facc15; }
.rtg-cw-cell.right b { color: #16a34a; }
.rtg-cw-cell.wrong b { color: var(--danger); }
.rtg-cw-cell.wrong { box-shadow: inset 0 0 0 2px var(--danger); }
.rtg-cw-cell.revealed b { color: #7c3aed; }
.rtg-cw-cluebar { display: flex; align-items: stretch; gap: 6px; width: 100%; margin-top: 12px; }
.rtg-cw-clue {
  flex: 1 1 auto; min-width: 0; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 16px; cursor: pointer; text-align: left;
  border: 1px solid rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.14); font-size: 1rem;
}
.rtg-cw-cn { flex: 0 0 auto; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; padding: 3px 8px; border-radius: 8px; background: #0ea5e9; color: #fff; }
.rtg-cw-cpic { font-size: 1.8rem; line-height: 1; }
.rtg-cw-ct { font-family: var(--font-body); font-weight: 600; line-height: 1.3; min-width: 0; }
.rtg-cw-ct small { color: var(--text-muted); font-weight: 400; }
.rtg-little .rtg-cw-cpic { font-size: 2.6rem; }
.rtg-cw-tools { justify-content: center; }
.rtg-cw-tools .rtg-btn { min-height: 44px; padding: 6px 12px; font-size: 0.9rem; }
.rtg-cw-clues { display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 200px); overflow: auto; padding-right: 4px; }
.rtg-cw-clues h4 { font-size: 1.05rem; margin-bottom: 6px; }
.rtg-cw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rtg-cw-list button {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 10px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid transparent; background: transparent; font-size: 0.95rem;
}
.rtg-cw-list button:hover { background: var(--rtg-ctl); }
.rtg-cw-list button.active { border-color: #0ea5e9; background: rgba(56, 189, 248, 0.14); }
.rtg-cw-list button.done .rtg-cw-t { opacity: 0.55; text-decoration: line-through; }
.rtg-cw-n { flex: 0 0 auto; min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--rtg-ctl); border: 1px solid var(--border-color); font-size: 0.85rem; font-weight: 700; }
.rtg-cw-pic { font-size: 1.4rem; }
.rtg-cw-t { font-family: var(--font-body); line-height: 1.3; }
.rtg-cw-t small { color: var(--text-muted); }

/* ── Sudoku ──────────────────────────────────────────────────── */
.rtg-sd-wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: center; }
.rtg-sd-side { flex: 1 1 260px; max-width: 360px; min-width: 0; }
.rtg-sd-board {
  display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 520px, max(240px, calc(100dvh - 300px))); aspect-ratio: 1 / 1;
  border: 3px solid var(--rtg-ink); border-radius: 14px; overflow: hidden; background: var(--rtg-paper); container-type: inline-size; margin: 0; flex: 0 0 auto;
}
.rtg-sd-cell {
  display: grid; place-items: center; padding: 0; border: none; border-right: 1px solid var(--rtg-line); border-bottom: 1px solid var(--rtg-line);
  background: var(--rtg-paper); color: #2563eb; font-size: calc(100cqw / var(--n) * 0.55); font-weight: 700; cursor: pointer; min-width: 0;
}
[data-theme="dark"] .rtg-sd-cell, .rtg-sd-cell { color: #60a5fa; }
[data-theme="light"] .rtg-sd-cell { color: #2563eb; }
.rtg-sd-cell.given { color: var(--rtg-ink); background: color-mix(in srgb, var(--rtg-ink) 10%, var(--rtg-paper)); }
.rtg-sd-cell.bR { border-right: 3px solid var(--rtg-ink); }
.rtg-sd-cell.bB { border-bottom: 3px solid var(--rtg-ink); }
.rtg-sd-cell.peer { background: color-mix(in srgb, #38bdf8 12%, var(--rtg-paper)); }
.rtg-sd-cell.same { background: color-mix(in srgb, #a855f7 22%, var(--rtg-paper)); }
.rtg-sd-cell.sel { background: color-mix(in srgb, #facc15 28%, var(--rtg-paper)); box-shadow: inset 0 0 0 3px #facc15; }
.rtg-sd-cell.wrong { color: var(--danger) !important; background: color-mix(in srgb, #ef4444 16%, var(--rtg-paper)); }
.rtg-sd-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rtg-sd-4 ~ .rtg-sd-side .rtg-sd-pad, .rtg-sd-6 ~ .rtg-sd-side .rtg-sd-pad { grid-template-columns: repeat(4, 1fr); }
.rtg-sd-key {
  min-height: 58px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--rtg-solid); cursor: pointer;
  font-size: 1.9rem; font-weight: 700; box-shadow: 0 3px 0 var(--border-color); transition: transform 0.08s;
}
.rtg-sd-key:active { transform: translateY(2px); box-shadow: none; }
.rtg-sd-key.full { opacity: 0.35; }
.rtg-sd-erase { font-size: 1.3rem; }

/* ── Mazes ───────────────────────────────────────────────────── */
.rtg-mz-stage { display: flex; justify-content: center; min-width: 0; }
.rtg-mz-canvas { display: block; border-radius: 18px; background: var(--rtg-paper); border: 1px solid var(--border-color); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15); touch-action: none; max-width: 100%; }
.rtg-mz-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; }
.rtg-dpad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 44px); gap: 4px; }
.rtg-dpad .rtg-icon { width: 52px; height: 44px; }
.rtg-dpad [data-d="up"] { grid-column: 2; grid-row: 1; }
.rtg-dpad [data-d="left"] { grid-column: 1; grid-row: 2; }
.rtg-dpad [data-d="right"] { grid-column: 3; grid-row: 2; }
.rtg-dpad [data-d="down"] { grid-column: 2; grid-row: 3; }

/* ── Word Guess ──────────────────────────────────────────────── */
.rtg-wg-main { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 18px; align-items: center; }
.rtg-wg-stage { position: relative; border-radius: 24px; background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 70%, #dcfce7 100%); overflow: hidden; }
[data-theme="dark"] .rtg-wg-stage { background: linear-gradient(180deg, #1e3a8a 0%, #3b5bab 70%, #365314 100%); }
.rtg-wg-scene { display: block; width: 100%; height: auto; max-height: 46dvh; }
.rtg-wg-ground { fill: #4ade80; }
.rtg-wg-ride { transition: transform 0.8s cubic-bezier(.3, 1.3, .5, 1); }
.rtg-wg-scene.won .rtg-wg-ride { transition: transform 1.8s ease-in; }
.rtg-bal { transform-box: fill-box; transform-origin: center; transition: transform 0.35s, opacity 0.35s; }
.rtg-bal.popped { transform: scale(1.5); opacity: 0; }
.rtg-bal-str { fill: none; stroke: rgba(15, 23, 42, 0.45); stroke-width: 1.5; }
.rtg-wg-basket { fill: #b45309; }
.rtg-wg-left { position: absolute; top: 10px; right: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: #0f172a; font-family: var(--font-display); font-weight: 700; }
.rtg-wg-cat { font-family: var(--font-display); font-size: 1.05rem; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.rtg-wg-pic { font-size: 2.6rem; line-height: 1; }
.rtg-wg-word { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.rtg-wg-word span {
  width: clamp(28px, 8vw, 44px); height: clamp(38px, 10vw, 54px); display: grid; place-items: center; border-bottom: 4px solid var(--text-muted);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 5vw, 2rem);
}
.rtg-wg-word span.on { border-color: var(--success); animation: rtgPop 0.3s 1; }
.rtg-wg-word span.miss { color: #f87171; border-color: #f87171; }
.rtg-wg-end { text-align: center; font-family: var(--font-display); font-size: 1.15rem; margin: 10px 0; }

/* ── Memory ──────────────────────────────────────────────────── */
.rtg-mm-status { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-family: var(--font-display); margin-bottom: 12px; }
.rtg-mm-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 10px; width: min(100%, calc(var(--cols) * 130px), max(280px, calc((100dvh - 250px) * var(--cols) / 4.4))); margin: 0 auto; }
.rtg-mm-card { aspect-ratio: 1 / 1; padding: 0; border: none; background: transparent; cursor: pointer; perspective: 600px; min-width: 0; }
.rtg-mm-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.35s; }
.rtg-mm-card.up .rtg-mm-in { transform: rotateY(180deg); }
.rtg-mm-back, .rtg-mm-front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rtg-mm-back { background: var(--grad-main); color: rgba(255, 255, 255, 0.85); font-size: clamp(1rem, 4vw, 1.8rem); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18); background-image: radial-gradient(rgba(255, 255, 255, 0.22) 2px, transparent 2px), var(--grad-main); background-size: 14px 14px, 100% 100%; }
.rtg-mm-front { transform: rotateY(180deg); background: var(--rtg-paper); border: 2px solid var(--border-color); font-size: clamp(1.6rem, 7vw, 3rem); }
.rtg-mm-card.matched .rtg-mm-front { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 40%, transparent); }
.rtg-mm-card:disabled { cursor: default; }

/* ── Bingo ───────────────────────────────────────────────────── */
.rtg-bingo-badge { margin-left: 6px; font-size: 0.7rem; padding: 2px 6px; border-radius: 999px; background: var(--pc); color: #fff; }
.rtg-bingo-card { width: min(100%, 620px); margin: 0 auto; padding: 12px; border-radius: 26px; background: var(--pc); box-shadow: 0 14px 30px color-mix(in srgb, var(--pc) 40%, transparent); }
.rtg-bingo-head { display: grid; grid-template-columns: repeat(var(--n), 1fr); text-align: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 6vw, 2.2rem); margin-bottom: 6px; }
.rtg-bingo-title { grid-column: 1 / -1; font-size: 1.2rem; }
.rtg-bingo-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; }
.rtg-bingo-cell {
  position: relative; aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px;
  border-radius: 14px; border: none; background: var(--rtg-paper); color: var(--rtg-ink); cursor: pointer; min-width: 0; overflow: hidden;
  transition: transform 0.12s;
}
.rtg-bingo-cell:active { transform: scale(0.94); }
.rtg-bingo-emo { font-size: clamp(1.5rem, 7vw, 2.6rem); line-height: 1; }
.rtg-bingo-lbl { font-family: var(--font-body); font-weight: 600; font-size: clamp(0.6rem, 2.2vw, 0.85rem); line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
[style*="--n:3"] .rtg-bingo-emo { font-size: clamp(2.2rem, 11vw, 3.4rem); }
[style*="--n:3"] .rtg-bingo-lbl { font-size: clamp(0.8rem, 3.4vw, 1rem); }
.rtg-bingo-cell.marked::after {
  content: '✓'; position: absolute; inset: 8%; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: clamp(1.4rem, 6vw, 2.4rem); font-weight: 700;
  background: color-mix(in srgb, var(--pc) 70%, transparent); animation: rtgStamp 0.25s cubic-bezier(.2, 1.6, .4, 1) 1;
}
.rtg-bingo-cell.free::after { content: ''; background: transparent; }
.rtg-bingo-cell.free { background: #fef3c7; color: #92400e; }
@keyframes rtgStamp { from { transform: scale(1.6); opacity: 0; } }

/* ── License plates ──────────────────────────────────────────── */
.rtg-pl-top { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 16px; margin-bottom: 14px; }
.rtg-pl-count { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); }
.rtg-pl-count b { font-size: 2.4rem; line-height: 1; }
.rtg-pl-sub { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; color: var(--text-muted); font-family: var(--font-display); }
.rtg-pl-top .rtg-progress { grid-column: 1 / -1; }
.rtg-pl-maps { display: flex; flex-direction: column; gap: 10px; padding: 12px; max-width: 620px; margin: 0 auto; border-radius: 22px; background: var(--bg-card); border: 1px solid var(--border-color); }
.rtg-pl-map { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.rtg-pl-ca { grid-template-rows: repeat(2, auto); padding-bottom: 8px; border-bottom: 2px dashed var(--border-color); }
.rtg-pl-tile {
  aspect-ratio: 1 / 1; min-width: 0; padding: 0; border-radius: 6px; cursor: pointer; font-size: clamp(0.55rem, 2.2vw, 0.9rem); font-weight: 700;
  border: 1px solid var(--border-color); background: var(--rtg-ctl); color: var(--text-muted); transition: background 0.2s, transform 0.12s;
}
.rtg-pl-tile.ca { border-style: dashed; }
.rtg-pl-tile:active { transform: scale(0.9); }
.rtg-pl-tile.got { background: #0ea5e9; color: #fff; border-color: transparent; }
.rtg-pl-tile.ca.got { background: #ef4444; }
.rtg-pl-listhead { margin: 14px 0 6px; }
.rtg-pl-list h4 { margin: 12px 0 6px; font-size: 1.05rem; }
.rtg-pl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.rtg-pl-item {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 10px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--border-color); background: var(--rtg-ctl); font-size: 0.98rem;
}
.rtg-pl-item.got { border-color: var(--success); background: rgba(16, 185, 129, 0.14); }
.rtg-pl-ab { flex: 0 0 auto; width: 40px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: #fff; color: #1e3a8a; border: 2px solid #1e3a8a; font-size: 0.8rem; }
.rtg-pl-name { flex: 1 1 auto; min-width: 0; font-family: var(--font-body); font-weight: 600; }

/* ── I Spy / Talk cards (shared big card) ────────────────────── */
.rtg-spy-card, .rtg-talk-card {
  width: min(100%, 560px); margin: 0 auto; padding: 22px 20px; border-radius: 28px; text-align: center;
  background: var(--rtg-paper); border: 1px solid var(--border-color); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}
.rtg-spy-card h3, .rtg-talk-card h3 { font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.2; margin: 4px 0; }
.rtg-spy-lead { color: var(--text-muted); font-family: var(--font-display); font-weight: 600; margin: 6px 0; }
.rtg-spy-swatch { width: 110px; height: 110px; margin: 0 auto 8px; border-radius: 50%; border: 4px solid var(--border-color); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.rtg-spy-color { color: var(--sc); text-shadow: 0 0 1px var(--text-main); }
.rtg-spy-letter { width: 110px; height: 110px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 28px; background: var(--grad-main); color: #fff; font-family: var(--font-display); font-size: 4rem; font-weight: 700; }
.rtg-spy-letter.big { width: 140px; height: 140px; font-size: 5.4rem; }
.rtg-spy-emo { font-size: 4rem; line-height: 1.1; }
.rtg-hunt-head { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 6px; }
.rtg-hunt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.rtg-hunt-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 8px; border-radius: 18px; cursor: pointer;
  border: 2px solid var(--border-color); background: var(--rtg-ctl); font-weight: 600; font-size: 0.92rem;
}
.rtg-hunt-emo { font-size: 2.4rem; }
.rtg-hunt-item.got { border-color: var(--success); background: rgba(16, 185, 129, 0.16); }
.rtg-hunt-item.got::after { content: '✓'; position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: #fff; font-size: 0.95rem; }
.rtg-abc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; margin: 16px auto 0; max-width: 560px; }
.rtg-abc-grid span { aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: 10px; font-family: var(--font-display); font-weight: 700; background: var(--rtg-ctl); border: 1px solid var(--border-color); color: var(--text-faint); }
.rtg-abc-grid span.got { background: var(--success); color: #fff; border-color: transparent; }
.rtg-abc-grid span.skip { background: var(--text-faint); color: #fff; }
.rtg-abc-grid span.now { border: 3px solid var(--primary); color: var(--text-main); }
.rtg-wyr { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin: 12px 0; }
.rtg-wyr-opt {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px 12px; min-height: 140px; border-radius: 22px; cursor: pointer;
  border: 2px solid var(--border-color); font-size: 1.15rem; font-weight: 700; line-height: 1.25; transition: transform 0.12s;
}
.rtg-wyr-opt:first-child { background: rgba(236, 72, 153, 0.14); border-color: rgba(236, 72, 153, 0.4); }
.rtg-wyr-opt:last-child { background: rgba(14, 165, 233, 0.14); border-color: rgba(14, 165, 233, 0.4); }
.rtg-wyr-opt:active { transform: scale(0.96); }
.rtg-wyr-opt b { font-size: 0.85rem; color: var(--text-muted); }
.rtg-wyr-or { align-self: center; font-family: var(--font-display); font-weight: 700; color: var(--text-muted); }
.rtg-q-secret {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(100%, 260px); margin: 8px auto; padding: 16px; border-radius: 22px; cursor: pointer;
  border: 3px dashed var(--border-color); background: var(--rtg-ctl);
}
.rtg-q-secret.show { border-style: solid; border-color: var(--primary); }
.rtg-q-secret b { font-size: 1.3rem; }
.rtg-q-secret small { font-family: var(--font-body); color: var(--text-muted); }
.rtg-q-emo { font-size: 3rem; line-height: 1.1; }
.rtg-q-count { display: flex; align-items: baseline; justify-content: center; gap: 8px; font-family: var(--font-display); margin-top: 6px; }
.rtg-q-count b { font-size: 2.4rem; }
.rtg-talk-q { font-size: clamp(1.3rem, 4.6vw, 1.8rem) !important; }
.rtg-n5 { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.rtg-n5-dot { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--rtg-ctl); font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.rtg-n5-dot.on { background: var(--grad-main); color: #fff; border-color: transparent; }

/* ── Silly Stories ───────────────────────────────────────────── */
.rtg-st-progress { display: flex; gap: 5px; justify-content: center; margin-bottom: 12px; }
.rtg-st-progress i { width: 26px; height: 8px; border-radius: 99px; background: var(--border-color); }
.rtg-st-progress i.done { background: var(--success); }
.rtg-st-progress i.now { background: var(--primary); }
.rtg-st-ask .rtg-input { margin-top: 10px; text-align: center; }
.rtg-st-sug { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.rtg-st-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.rtg-st-story { width: min(100%, 680px); margin: 0 auto 12px; padding: 22px; border-radius: 26px; background: var(--rtg-paper); border: 1px solid var(--border-color); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12); }
.rtg-st-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1.8rem; }
.rtg-st-title h3 { flex: 1 1 auto; font-size: 1.35rem; }
.rtg-st-story p { font-size: 1.18rem; line-height: 1.7; margin: 0; }
.rtg-st-word { background: color-mix(in srgb, #f97316 25%, transparent); color: inherit; padding: 1px 6px; border-radius: 8px; font-family: var(--font-display); font-weight: 700; }

/* ── Trip tracker ────────────────────────────────────────────── */
.rtg-trip-setup { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.rtg-trip-setup .rtg-input { text-align: center; }
.rtg-trip-head h3 { font-size: 1.35rem; }
.rtg-trip-head p { color: var(--text-muted); margin: 4px 0 0; }
.rtg-trip-road { position: relative; margin: 12px 0; padding: 6px; border-radius: 24px; background: linear-gradient(180deg, rgba(56, 189, 248, 0.15), rgba(34, 197, 94, 0.18)); border: 1px solid var(--border-color); }
.rtg-trip-road svg { display: block; width: 100%; height: auto; }
.rtg-trip-path-bg { fill: none; stroke: #475569; stroke-width: 34; stroke-linecap: round; }
.rtg-trip-path { fill: none; stroke: #facc15; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.rtg-trip-car { transition: x 0.8s ease, y 0.8s ease; }
.rtg-trip-pct { position: absolute; top: 10px; left: 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; padding: 2px 12px; border-radius: 999px; background: var(--rtg-paper); }
.rtg-trip-bubble { width: min(100%, 560px); margin: 12px auto 0; padding: 14px 18px; border-radius: 22px; text-align: center; font-family: var(--font-display); font-size: 1.1rem; background: rgba(250, 204, 21, 0.18); border: 2px solid rgba(250, 204, 21, 0.5); }
.rtg-trip-ms { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.rtg-trip-ms h4 { font-size: 1.05rem; margin-bottom: 4px; }
.rtg-trip-ms .rtg-row { flex-wrap: nowrap; }
.rtg-trip-ms .rtg-row .rtg-input { flex: 1 1 auto; min-width: 0; }
.rtg-trip-m {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 14px; border-radius: 16px; cursor: pointer; text-align: left;
  border: 2px solid var(--border-color); background: var(--rtg-ctl); font-size: 1rem; font-weight: 600;
}
.rtg-trip-m.done { border-color: var(--success); background: rgba(16, 185, 129, 0.14); }
.rtg-trip-me { font-size: 1.6rem; }
.rtg-trip-m > span:nth-child(2) { flex: 1 1 auto; }
.rtg-trip-mt { font-family: var(--font-body); color: var(--text-muted); font-size: 0.85rem; }

/* ── Tic-tac-toe ─────────────────────────────────────────────── */
.rtg-sets { margin-top: 0; margin-bottom: 8px; }
.rtg-sets .rtg-chip { font-size: 0.95rem; }
.rtg-ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 420px, max(240px, calc(100dvh - 330px))); margin: 0 auto; }
.rtg-ttt-cell {
  aspect-ratio: 1 / 1; border-radius: 22px; border: 2px solid var(--border-color); background: var(--rtg-paper); cursor: pointer;
  font-size: clamp(2.4rem, 13vw, 4.4rem); line-height: 1; display: grid; place-items: center; padding: 0; transition: background 0.15s, transform 0.12s;
}
.rtg-ttt-cell:hover:not([aria-disabled]) { background: var(--rtg-ctl-hover); }
.rtg-ttt-cell span { animation: rtgPop 0.28s cubic-bezier(.2, 1.5, .4, 1) 1; }
.rtg-ttt-cell.win { background: rgba(250, 204, 21, 0.35); border-color: #eab308; }
.rtg-ttt-cell[aria-disabled] { cursor: default; }

/* ── Connect four ────────────────────────────────────────────── */
.rtg-c4-board { position: relative; width: min(100%, 560px, max(260px, calc((100dvh - 300px) * 7 / 6))); margin: 0 auto; padding: 8px; border-radius: 22px; background: #2563eb; box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35); }
.rtg-c4-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rtg-c4-hole { aspect-ratio: 1 / 1; border-radius: 50%; background: #1e3a8a; overflow: hidden; display: block; position: relative; }
[data-theme="light"] .rtg-c4-hole { background: #dbeafe; }
.rtg-c4-hole i { position: absolute; inset: 6%; border-radius: 50%; display: block; }
.rtg-c4-hole i.d1 { background: radial-gradient(circle at 35% 30%, #fda4af, #e11d48 60%); }
.rtg-c4-hole i.d2 { background: radial-gradient(circle at 35% 30%, #fef08a, #eab308 60%); }
.rtg-c4-hole i.drop { animation: rtgDrop 0.45s cubic-bezier(.4, 0, .6, 1.3) 1; }
@keyframes rtgDrop { from { transform: translateY(calc(-110% * (var(--row) + 1) - 60%)); } }
.rtg-c4-hole i.win { box-shadow: 0 0 0 4px #fff, 0 0 18px #fff; }
.rtg-c4-cols { position: absolute; inset: 8px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rtg-c4-col { border: none; background: transparent; cursor: pointer; border-radius: 14px; padding: 0; }
.rtg-c4-col:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.rtg-c4-col:disabled { cursor: default; }

/* ── Dots & boxes ────────────────────────────────────────────── */
.rtg-db-board { display: block; width: min(100%, 520px, max(260px, calc(100dvh - 330px))); margin: 0 auto; touch-action: manipulation; }
.rtg-db-dot { fill: var(--text-main); }
.rtg-db-line { cursor: pointer; outline: none; }
.rtg-db-line .hit { stroke: transparent; stroke-width: 34; stroke-linecap: round; }
.rtg-db-line .vis { stroke: var(--border-color); stroke-width: 9; stroke-linecap: round; transition: stroke 0.2s; }
.rtg-db-board.t1 .rtg-db-line:not(.on):hover .vis, .rtg-db-board.t1 .rtg-db-line:not(.on):focus-visible .vis { stroke: color-mix(in srgb, #ec4899 55%, transparent); }
.rtg-db-board.t2 .rtg-db-line:not(.on):hover .vis, .rtg-db-board.t2 .rtg-db-line:not(.on):focus-visible .vis { stroke: color-mix(in srgb, #3b82f6 55%, transparent); }
.rtg-db-line.on { cursor: default; }
.rtg-db-line.on.p1 .vis { stroke: #ec4899; }
.rtg-db-line.on.p2 .vis { stroke: #3b82f6; }
.rtg-db-box.p1 { fill: rgba(236, 72, 153, 0.25); }
.rtg-db-box.p2 { fill: rgba(59, 130, 246, 0.25); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* inside a game the game bar already says where you are */
  #games-section:has(.rtg-game) > .view-header { display: none !important; }
  .rtg-ws-main, .rtg-cw-main, .rtg-sd-wrap, .rtg-wg-main { grid-template-columns: minmax(0, 1fr); }
  .rtg-cw-clues { max-height: none; overflow: visible; }
  .rtg-wg-stage { max-width: 380px; width: 100%; margin: 0 auto; }
  .rtg-sd-side { flex-basis: 100%; max-width: 520px; }
}
@media (max-width: 600px) {
  .rtg-app, .rtg-modal { --rtg-tap: 46px; }
  .rtg-hero { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 30px; border-radius: 22px; }
  .rtg-hero-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px 12px; }
  .rtg-hero-stats b { font-size: 1.3rem; }
  .rtg-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .rtg-card { grid-template-columns: 56px minmax(0, 1fr); min-height: 92px; padding: 12px; }
  .rtg-card-emo { width: 56px; height: 56px; font-size: 1.8rem; }
  .rtg-age { padding: 6px 12px; font-size: 0.88rem; }
  .rtg-gtitle { font-size: 1.1rem; }
  .rtg-back { padding: 4px 12px 4px 8px; }
  .rtg-toolbar { gap: 6px; }
  .rtg-toolbar > .rtg-seg { flex: 1 1 100%; order: 5; }
  .rtg-seg-btn { font-size: 0.84rem; padding: 6px 8px; min-height: 40px; }
  .rtg-toolbar > .rtg-btn { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; font-size: 0.92rem; }
  .rtg-key { height: 46px; font-size: 1rem; border-radius: 8px; }
  .rtg-kb-row { gap: 4px; }
  .rtg-cw-cell { border-width: 1px; border-radius: 4px; }
  .rtg-cw-board { gap: 1px; }
  .rtg-cw-clue { font-size: 0.92rem; padding: 6px 10px; }
  .rtg-wyr { grid-template-columns: minmax(0, 1fr); }
  .rtg-wyr-opt { min-height: 96px; }
  .rtg-spy-card, .rtg-talk-card { padding: 18px 14px; }
  .rtg-pl-items { grid-template-columns: minmax(0, 1fr); }
  .rtg-pl-maps { padding: 8px; }
  .rtg-pl-map { gap: 2px; }
  .rtg-pl-tile { border-radius: 4px; }
  .rtg-mm-grid { gap: 6px; }
  .rtg-bingo-card { padding: 8px; border-radius: 20px; }
  .rtg-bingo-grid { gap: 4px; }
  .rtg-bingo-cell { border-radius: 10px; }
  .rtg-dialog { padding: 20px 16px 16px; border-radius: 24px; }
  .rtg-choices { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .rtg-choice { min-height: 80px; font-size: 0.85rem; }
  .rtg-st-story { padding: 16px; }
  .rtg-st-story p { font-size: 1.08rem; }
}
/* Phones held sideways: put the board next to the controls */
@media (orientation: landscape) and (max-height: 540px) {
  .rtg-app, .rtg-modal { --rtg-tap: 40px; }
  .rtg-gbar { margin-bottom: 6px; }
  .rtg-back { min-height: 38px; }
  .rtg-gtitle { font-size: 1.05rem; }
  .rtg-gstars { padding: 3px 10px; }
  .rtg-toolbar { margin-bottom: 8px; gap: 6px; }
  .rtg-toolbar > .rtg-seg { flex: 0 1 auto; order: 0; padding: 2px; }
  .rtg-seg-btn { min-height: 36px; font-size: 0.82rem; padding: 4px 10px; }
  .rtg-toolbar > .rtg-btn { flex: 0 0 auto; min-height: 40px; font-size: 0.85rem; }
  .rtg-ws-main { grid-template-columns: auto minmax(0, 1fr); }
  .rtg-ws-board { width: calc(100dvh - 80px); min-width: 220px; }
  .rtg-key { height: 40px; }
  .rtg-cw-main { grid-template-columns: minmax(0, 1fr); }
  .rtg-cw-play { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 14px; align-items: start; }
  .rtg-cw-board { grid-row: 1 / 4; width: min(calc((100dvh - 110px) * var(--cols) / var(--rows)), 52vw); }
  .rtg-cw-cluebar { margin-top: 0; }
  .rtg-sd-wrap { flex-wrap: nowrap; }
  .rtg-sd-side { flex-basis: auto; }
  .rtg-sd-board { width: calc(100dvh - 120px); min-width: 220px; }
  .rtg-wg-main { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
  .rtg-wg-scene { max-height: 60dvh; }
  .rtg-mz-canvas { max-height: calc(100dvh - 100px); }
  .rtg-ttt-board { width: min(calc(100dvh - 150px), 360px); }
  .rtg-c4-board { width: min(calc((100dvh - 150px) * 7 / 6), 520px); }
  .rtg-db-board { width: min(calc(100dvh - 140px), 420px); }
  .rtg-mm-grid { width: min(100%, calc((100dvh - 130px) * var(--cols) / 4.2)); }
}
