:root {
  --ink: #2e2218;
  --ink-soft: #5b4a3a;
  --paper: #f4ead5;
  --paper-2: #fbf5e8;
  --card: #fffaf0;
  --line: #d8c8a8;
  --red: #a8322d;
  --red-dark: #7d211e;
  --gold: #c99a3a;
  --green: #2f6a46;
  --shadow: 0 10px 30px rgba(46, 34, 24, 0.16);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 154, 58, 0.18), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(168, 50, 45, 0.10), transparent 60%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 0.4em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.2rem; }
a { color: var(--red); }
code { background: #efe3c8; padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.loading { padding: 4rem; text-align: center; font-family: var(--serif); }
.empty { color: var(--ink-soft); font-style: italic; padding: 1rem 0; }

/* buttons */
.btn {
  font: 600 0.95rem var(--sans);
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  display: inline-flex; align-items: center; gap: 0.35rem;
  text-decoration: none;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(46, 34, 24, 0.15); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red-dark); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--red-dark); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.hint { background: #ffe9a8; border-color: #b9822b; }
.btn.small { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn.tiny { padding: 0.15rem 0.6rem; font-size: 0.8rem; }
.btn:focus-visible, .thumb:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 245, 232, 0.85);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font: 700 1.35rem var(--serif); color: var(--ink); text-decoration: none; }
.topbar nav { display: flex; gap: 0.3rem; }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 0.4rem 0.9rem; border-radius: 999px; }
.topbar nav a.on, .topbar nav a:hover { background: #efe3c8; }

.page { max-width: 1240px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 3rem) 4rem; }
section { margin: 2.6rem 0; }
.section-head p { margin: 0 0 1.2rem; color: var(--ink-soft); max-width: 70ch; }
.sub-head { margin-top: 2rem; }

/* hero */
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
}
.hero-art { aspect-ratio: 16 / 10; overflow: hidden; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero-text { padding: 2rem 2rem 2rem 0; }
.hero-text h1 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.hero-text p { color: var(--ink-soft); font-size: 1.05rem; }
.hero-stats { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; color: var(--ink-soft); }
.hero-stats b { font: 700 1.4rem var(--serif); color: var(--red); margin-right: 0.25rem; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero-text { padding: 0 1.4rem 1.6rem; } }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.3rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 0 rgba(46, 34, 24, 0.05); transition: transform 0.15s, box-shadow 0.15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.thumb { all: unset; cursor: pointer; display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #ddd; }
.thumb svg { width: 100%; height: 100%; display: block; transition: transform 0.4s; }
.card:hover .thumb svg { transform: scale(1.04); }
.thumb-badge { position: absolute; left: 10px; top: 10px; background: rgba(46, 34, 24, 0.8); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.02em; }
.card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 700; }
.seed { font-size: 0.8rem; color: var(--ink-soft); }
.status { margin-top: 0.3rem; min-height: 1.6rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.card-actions { margin-top: auto; padding-top: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stars { color: #d99a1e; letter-spacing: 1px; font-size: 1.05rem; }
.stars .dim { color: #d8c8a8; }
.tag { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #efe3c8; text-transform: uppercase; letter-spacing: 0.04em; }
.tag.new { background: #dcefd8; color: var(--green); }
.tag.progress { background: #ffe9a8; color: #7a5520; }

/* generator form */
.gen-form { display: flex; gap: 0.8rem; align-items: end; flex-wrap: wrap; background: var(--card); border: 1px dashed var(--gold); padding: 1rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.3rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select { font: 500 1rem var(--sans); padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-width: 220px; text-transform: none; letter-spacing: 0; }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }

/* play screen */
.play { min-height: 100vh; display: flex; flex-direction: column; background: #20180f; color: #f4ead5; }
.playbar { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem; background: #2e2218; border-bottom: 2px solid #4a3828; flex-wrap: wrap; }
.playbar .btn.ghost { color: #f4ead5; border-color: #8a6a4a; }
.titles { flex: 1; min-width: 160px; }
.adv-title { font: 700 1.1rem var(--serif); }
.scene-title { font-size: 0.85rem; color: #d8c8a8; }
.play-stats { display: flex; gap: 1rem; font-variant-numeric: tabular-nums; color: #e8d6a8; font-size: 0.9rem; }
.play-buttons { display: flex; gap: 0.5rem; }
.play-main { flex: 1; display: flex; gap: 0; min-height: 0; }
.stage-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0.8rem; min-width: 0; }
.stage { position: relative; width: 100%; max-width: calc((100vh - 190px) * 1.6); aspect-ratio: 1200 / 750; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); background: #000; }
.scene-host { position: absolute; inset: 0; }
.scene-host > svg, .scene-canvas { width: 100%; height: 100%; display: block; cursor: crosshair; user-select: none; }
.scene-overlay { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.photo-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #e8d6a8; font: italic 1.2rem var(--serif); background: radial-gradient(circle, #3d2e20, #1a120b); }
.stage.walk .scene-host { animation: walk 0.5s ease-out; }
@keyframes walk { from { opacity: 0.2; transform: scale(1.06); } to { opacity: 1; transform: none; } }
.obj.found { animation: found 0.6s ease-out forwards; }
@keyframes found { to { opacity: 0; } }
.fx-ring { transform-box: fill-box; transform-origin: center; animation: ring 0.75s ease-out forwards; }
.fx-ring.late { animation-delay: 0.1s; opacity: 0; }
@keyframes ring { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.fx-miss { animation: miss 0.7s ease-out forwards; }
@keyframes miss { 0% { opacity: 1; } 100% { opacity: 0; } }
.fx-hint { transform-box: fill-box; transform-origin: center; animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(0.85); opacity: 0.6; } to { transform: scale(1.15); opacity: 1; } }

.tray { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem; background: #2e2218; border-top: 2px solid #4a3828; overflow-x: auto; }
.tray-label { font: 700 0.8rem var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: #c99a3a; }
.tray-items { display: flex; gap: 0.5rem; flex-wrap: wrap; flex: 1; }
.tray-item { display: flex; align-items: center; gap: 0.35rem; background: #3d2e20; border: 1px solid #5b4a3a; border-radius: 999px; padding: 0.2rem 0.75rem 0.2rem 0.3rem; font: 600 0.88rem var(--serif); transition: all 0.3s; }
.tray-item .icon { background: #f4ead5; border-radius: 50%; padding: 2px; }
.tray-item.found { opacity: 0.4; text-decoration: line-through; }
.tray-item.pop { animation: pop 0.5s; }
@keyframes pop { 50% { transform: scale(1.15); background: #c99a3a; } }
.tray-count { font-variant-numeric: tabular-nums; color: #e8d6a8; font-size: 0.9rem; white-space: nowrap; }
.part-slot { width: 40px; height: 40px; border-radius: 10px; border: 2px dashed #6b5a48; display: grid; place-items: center; opacity: 0.35; filter: grayscale(1); }
.part-slot.filled { opacity: 1; filter: none; border-style: solid; border-color: #c99a3a; background: #3d2e20; }

/* expedition navigation */
.nav-layer { position: absolute; inset: 0; pointer-events: none; }
.nav-arrow { pointer-events: auto; position: absolute; display: flex; align-items: center; gap: 0.4rem; background: rgba(32, 24, 15, 0.72); color: #f4ead5; border: 1.5px solid rgba(244, 234, 213, 0.5); border-radius: 999px; padding: 0.4rem 0.9rem; cursor: pointer; font: 600 0.85rem var(--sans); transition: background 0.15s, transform 0.15s; }
.nav-arrow:hover { background: rgba(168, 50, 45, 0.9); }
.nav-arrow.north { top: 12px; left: 50%; transform: translateX(-50%); }
.nav-arrow.south { bottom: 12px; left: 50%; transform: translateX(-50%); }
.nav-arrow.west { left: 12px; top: 50%; transform: translateY(-50%); flex-direction: row; }
.nav-arrow.east { right: 12px; top: 50%; transform: translateY(-50%); flex-direction: row-reverse; }
.nav-arrow.locked { background: rgba(80, 30, 25, 0.8); }
.nav-arrow .arrow { font-size: 1rem; }
.loc-caption { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); background: rgba(32, 24, 15, 0.78); color: #f4ead5; padding: 0.5rem 1rem; border-radius: 10px; font: italic 1rem var(--serif); opacity: 0; transition: opacity 0.6s; pointer-events: none; max-width: 80%; text-align: center; }
.loc-caption.show { opacity: 1; }
.side { width: 250px; background: #2a1f15; border-left: 2px solid #4a3828; padding: 1rem; display: flex; flex-direction: column; gap: 1.2rem; overflow-y: auto; }
.side-title { font: 700 0.75rem var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: #c99a3a; margin-bottom: 0.5rem; }
.side .btn { color: #f4ead5; border-color: #8a6a4a; background: transparent; }
.btn.device { width: 100%; justify-content: flex-start; margin-bottom: 0.4rem; border-radius: 10px; background: #3d2e20 !important; }
.btn.device.solved { opacity: 0.6; }
.minimap { display: block; background: #f4ead5; border-radius: 10px; padding: 4px; max-width: 100%; }
@media (max-width: 900px) { .play-main { flex-direction: column; } .side { width: auto; border-left: none; flex-direction: row; flex-wrap: wrap; } }

/* modal */
#modal-root .modal-backdrop { position: fixed; inset: 0; background: rgba(20, 14, 8, 0.6); display: grid; place-items: center; padding: 1rem; z-index: 50; animation: fade 0.2s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; background: var(--paper-2); color: var(--ink); border-radius: 18px; max-width: 560px; width: 100%; max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); border: 1px solid var(--line); animation: rise 0.25s ease-out; }
.modal.wide { max-width: 860px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal-content { padding: 1.8rem 2rem; }
.modal-content::before { content: ''; display: block; height: 4px; width: 60px; background: var(--gold); border-radius: 4px; margin-bottom: 1rem; }
.modal-x { position: absolute; right: 12px; top: 10px; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink-soft); }
.modal-kicker { font: 700 0.75rem var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--red); margin-bottom: 0.3rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; align-items: center; margin-top: 1.4rem; flex-wrap: wrap; }
.modal-actions .muted { margin-right: auto; }
.lede { font: 1.05rem var(--serif); color: var(--ink-soft); }
.modal .shake, .shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.how { padding-left: 1.2rem; }
.how li { margin: 0.3rem 0; }

.suspect-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.suspect-mini { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.7rem; display: flex; flex-direction: column; font-size: 0.85rem; }
.suspect-mini span { color: var(--ink-soft); }
.accuse-layout { display: grid; grid-template-columns: 1fr 240px; gap: 1rem; }
@media (max-width: 720px) { .accuse-layout { grid-template-columns: 1fr; } }
.suspects { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; }
.suspects.compact { margin-bottom: 1rem; }
.suspect { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.2rem; }
.suspect p { margin: 0.2rem 0 0.5rem; font-size: 0.88rem; color: var(--ink-soft); flex: 1; }
.suspect.cleared { opacity: 0.45; }
.suspect-name { font: 700 1.05rem var(--serif); }
.suspect-role { font-size: 0.8rem; color: var(--gold); font-weight: 700; }
.clue-panel { background: #efe3c8; border-radius: 12px; padding: 0.8rem 1rem; font-size: 0.88rem; }
.clue-panel ul, .clue-list { padding-left: 1.1rem; margin: 0.3rem 0; }
.clue-list li, .clue-panel li { margin: 0.35rem 0; }
.route { font-size: 0.9rem; color: var(--ink-soft); }
.choice-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.btn.option { border-radius: 12px; justify-content: flex-start; text-align: left; padding: 0.7rem 1rem; }
.btn.option.path { font: 600 1.02rem var(--serif); }

/* puzzles */
.puzzle-prompt { font: 1.05rem var(--serif); }
.puzzle-body { margin: 1rem 0; }
.puzzle-feedback { min-height: 1.4rem; font-weight: 600; border-radius: 10px; }
.puzzle-feedback.good { color: var(--green); }
.puzzle-feedback.bad { color: var(--red); }
.puzzle-feedback.hint { background: #fff3c4; padding: 0.5rem 0.8rem; color: #7a5520; }
.dials { display: flex; gap: 0.7rem; justify-content: center; }
.dial { display: flex; flex-direction: column; align-items: center; background: linear-gradient(#e5b448, #b9822b); border: 2px solid var(--ink); border-radius: 14px; padding: 0.4rem; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.dial-btn { border: none; background: none; cursor: pointer; font-size: 1rem; color: var(--ink); padding: 0.2rem 0.6rem; }
.dial-val { font: 700 2rem var(--serif); width: 2.4rem; text-align: center; background: #fbf3dc; border-radius: 8px; border: 1.5px solid var(--ink); font-variant-numeric: tabular-nums; }
.cipher-text { font: 700 1.6rem ui-monospace, 'Courier New', monospace; letter-spacing: 0.25em; text-align: center; background: #2e2218; color: #f4ead5; padding: 0.8rem; border-radius: 10px; word-break: break-word; }
.decoder { margin: 1rem 0; background: #efe3c8; border-radius: 10px; padding: 0.6rem; overflow-x: auto; }
.decoder-head { font-size: 0.85rem; margin-bottom: 0.4rem; }
.alpha-row { display: grid; grid-template-columns: repeat(26, minmax(16px, 1fr)); font: 700 0.85rem ui-monospace, monospace; text-align: center; }
.alpha-row.bottom { color: var(--red); border-top: 1px solid var(--line); }
.field .cipher-input { width: 100%; text-transform: uppercase; letter-spacing: 0.1em; }
.seq-pool { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seq-item { font: 600 0.95rem var(--serif); background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: 0.5rem 0.8rem; cursor: pointer; }
.seq-item.used { opacity: 0.35; }
.seq-order { background: #efe3c8; border-radius: 10px; padding: 0.6rem 0.6rem 0.6rem 2rem; min-height: 3rem; font-family: var(--serif); }
.choice-options { display: flex; flex-direction: column; gap: 0.5rem; }
.levers { display: flex; gap: 1rem; justify-content: center; padding: 1rem 0 5rem; }
.lever { all: unset; cursor: pointer; position: relative; width: 44px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.lever-base { width: 44px; height: 24px; background: #3a3a42; border-radius: 6px; border: 2px solid var(--ink); z-index: 1; }
.lever-arm { position: absolute; bottom: 14px; width: 10px; height: 78px; background: linear-gradient(90deg, #8a8f96, #d5dde3, #8a8f96); border: 2px solid var(--ink); border-radius: 6px; transform-origin: bottom center; transition: transform 0.25s; }
.lever-arm::before { content: ''; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); }
.lever.down .lever-arm { transform: rotate(180deg); }
.lever.up .lever-arm { transform: rotate(0); }
.lever-label { position: absolute; bottom: 4px; font: 700 0.8rem var(--sans); color: #fff; z-index: 2; }
.lever:focus-visible { outline: 3px solid var(--gold); border-radius: 8px; }

/* results */
.result { text-align: center; }
.result .modal-actions { justify-content: center; }
.result-stars .stars { font-size: 2.6rem; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin: 1rem 0; }
.result-grid div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem; display: flex; flex-direction: column; }
.result-grid b { font: 700 1.4rem var(--serif); }
.result-grid span { font-size: 0.78rem; color: var(--ink-soft); }
.explanation { font: 1.02rem var(--serif); text-align: left; background: #efe3c8; padding: 0.9rem 1.1rem; border-radius: 12px; }
.achv-new { margin-top: 1rem; }
.achv-pill { display: inline-block; background: #fff3c4; border: 1px solid var(--gold); border-radius: 999px; padding: 0.3rem 0.9rem; margin: 0.2rem; font-weight: 600; }

/* toasts */
#toasts { position: fixed; right: 1rem; bottom: 5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 60; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--paper-2); color: var(--ink); border-left: 5px solid var(--gold); padding: 0.7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: 0.92rem; animation: rise 0.25s; transition: opacity 0.5s, transform 0.5s; }
.toast.clue { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateX(20px); }

/* progress page */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; }
.tile b { font: 700 1.8rem var(--serif); color: var(--red); }
.tile span { font-size: 0.85rem; color: var(--ink-soft); }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.achv { display: flex; gap: 0.7rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.9rem; opacity: 0.55; }
.achv.on { opacity: 1; border-color: var(--gold); }
.medal { font-size: 1.6rem; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.history { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.history th, .history td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid #efe3c8; white-space: nowrap; }
.history th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.danger-zone { display: flex; gap: 0.6rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.5rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* realistic art */
.photo-thumb { width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 0.4s; }
.card:hover .photo-thumb { transform: scale(1.04); }
.photo-thumb.mood-dusk { filter: sepia(0.25) saturate(1.1) brightness(0.95); }
.photo-thumb.mood-night { filter: brightness(0.6) saturate(0.8) hue-rotate(10deg); }
.hero-art .photo-thumb { min-height: 100%; }
.art-toggle { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; margin: 0.8rem 0 0.2rem; font-size: 0.85rem; color: var(--ink-soft); }
.art-toggle > span { margin-right: 0.3rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
.seg { font: 600 0.85rem var(--sans); border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer; color: var(--ink); text-decoration: none; }
.seg.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg.link { border-style: dashed; }

/* art studio */
.dropzone { border: 2px dashed var(--gold); background: var(--card); border-radius: var(--radius); padding: 1.4rem; text-align: center; transition: background 0.15s; }
.dropzone.over { background: #fff3c4; }
.dropzone .link { color: var(--red); text-decoration: underline; cursor: pointer; }
.tolerance { margin-top: 0.7rem; font-size: 0.85rem; color: var(--ink-soft); }
.studio-status { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; font-size: 0.92rem; }
.studio-log { font-style: italic; color: var(--ink-soft); min-height: 1.2rem; }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.studio-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; }
.studio-card-head { display: flex; justify-content: space-between; align-items: center; }
.studio-thumbs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.studio-thumb { position: relative; width: 112px; height: 70px; border-radius: 8px; background-size: cover; background-position: center; border: 1px solid var(--line); }
.studio-thumb .x { position: absolute; top: 2px; right: 2px; border: none; background: rgba(0,0,0,0.65); color: #fff; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.studio-thumb .badge { position: absolute; bottom: 3px; left: 3px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.65rem; padding: 1px 6px; border-radius: 999px; }
.studio-empty { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; padding: 1.4rem 0; }
.studio-objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
.studio-obj { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; }
.studio-obj.has { border-color: var(--gold); }
.studio-obj-img { position: relative; width: 90px; height: 90px; display: grid; place-items: center; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 14px 14px; border-radius: 8px; }
.studio-obj-img img { max-width: 86px; max-height: 86px; }
.studio-obj-img .count { position: absolute; top: 2px; right: 4px; font-size: 0.7rem; font-weight: 700; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 6px; }
.studio-obj:not(.has) .studio-obj-img svg { opacity: 0.45; }
.studio-obj-name { font: 600 0.85rem var(--serif); display: flex; flex-direction: column; }
.studio-obj-name code { font-size: 0.7rem; }
.studio-obj-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; }

.lib-form { display: flex; gap: 0.7rem; align-items: end; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.lib-form .field.grow { flex: 1; }
.lib-form .field.grow input { width: 100%; }
.lib-key { margin: 0.6rem 0 1rem; color: var(--ink-soft); }
.lib-key input { font: 0.85rem ui-monospace, monospace; padding: 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; }
.lib-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.7rem; margin-bottom: 0.8rem; }
.lib-card { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.lib-card img { width: 100%; height: 140px; object-fit: contain; background: #e9e1cf; }
.lib-card figcaption { padding: 0.4rem 0.6rem; display: flex; flex-direction: column; font-size: 0.8rem; }
.lib-card figcaption b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card figcaption span { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-actions { display: flex; gap: 0.3rem; padding: 0 0.6rem 0.6rem; }
.autofill { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; padding: 0.8rem 1rem; background: #fff3c4; border-radius: 12px; }

/* realistic 3D */
.thumb3d, .thumb3d-wrap, .thumb3d-wrap > svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.card:hover .thumb3d { transform: scale(1.04); transition: transform 0.4s; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(15,8,2,0.45) 100%); }
.olib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem; margin: 1rem 0; }
.olib-card { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.olib-img { aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fffaf0, #e8dcc4); display: grid; place-items: center; }
.olib-card figcaption { padding: 0.45rem 0.6rem; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.8rem; }
.olib-card figcaption b { font-family: var(--serif); font-size: 0.88rem; line-height: 1.2; }
.olib-card figcaption code { font-size: 0.68rem; word-break: break-all; }
.olib-card figcaption span { color: var(--ink-soft); font-size: 0.72rem; }
.olib-img img { max-width: 86%; max-height: 86%; width: auto; height: auto; object-fit: contain; }

/* ---------- website: landing, auth, pricing, account ---------- */
.topbar { gap: 1rem; }
.auth-nav { display: flex; gap: 0.5rem; margin-left: auto; align-items: center; }
.btn.big { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn.light { background: rgba(255, 250, 240, 0.92); }
.btn.wide { width: 100%; justify-content: center; }
.light { color: #fff7e6; }
.eyebrow.light { color: #f3d48a; }
.center { text-align: center; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.row.center { justify-content: center; }
.narrow { max-width: 860px; margin: 0 auto; }
.stack { display: grid; gap: 0.8rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1rem; }
.panel h3 { margin-top: 0; }
.tag.free { background: #dcefdc; color: var(--green); border-color: #a9cfa9; }

.landing-bar { position: sticky; top: 0; z-index: 20; }
.landing { padding: 0; }
.l-hero { min-height: min(78vh, 760px); background-size: cover; background-position: center; display: flex; align-items: center; position: relative; }
.l-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 12, 6, 0.86) 0%, rgba(20, 12, 6, 0.6) 45%, rgba(20, 12, 6, 0.05) 80%); }
.l-hero-inner { position: relative; max-width: 620px; padding: 3rem clamp(1.2rem, 5vw, 4.5rem); color: #fff7e6; }
.l-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.08; color: #fff; margin: 0.4rem 0 1rem; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5); }
.l-hero p { font-size: 1.12rem; line-height: 1.55; }
.l-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1.6rem 0 0.6rem; }
.l-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: #2e2218; color: #f4ead5; text-align: center; padding: 1.3rem 1rem; gap: 1rem; }
.l-strip b { display: block; font: 700 1.8rem var(--serif); color: #f3d48a; }
.l-strip span { font-size: 0.9rem; opacity: 0.85; }
.l-section { max-width: 1140px; margin: 0 auto; padding: 3.5rem 1.2rem 1rem; }
.l-section h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.l-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 1.6rem; }
.l-features article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.l-features img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.l-features h3, .l-features p { padding: 0 1.2rem; }
.l-features p { color: var(--ink-soft); padding-bottom: 1.2rem; }
.l-trial { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.l-trial-art img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.l-locked { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.l-lock-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; }
.l-lock-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; filter: saturate(0.85); }
.l-lock-card > div { padding: 0.8rem 1rem 1rem; }
.l-lock-card h4 { margin: 0.4rem 0 0.2rem; font: 700 1.1rem var(--serif); }
.l-lock-card::after { content: '🔒'; position: absolute; top: 0.6rem; right: 0.7rem; background: rgba(255, 250, 240, 0.9); border-radius: 999px; padding: 0.15rem 0.45rem; }
.l-lock-card.gen { display: flex; align-items: center; background: linear-gradient(135deg, #3d2e20, #6b4a2a); color: #f4ead5; }
.l-lock-card.gen p { color: #e9dcc0; }
.faq { max-width: 760px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1.1rem; margin: 0.6rem 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.site-footer { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; padding: 2.5rem 1rem; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer a { color: var(--ink-soft); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 320px)); gap: 1.4rem; justify-content: center; margin: 1.8rem 0 1rem; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; position: relative; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan.featured { border: 2px solid var(--gold); }
.plan h3 { margin: 0; }
.plan .price { margin: 0.6rem 0 0.2rem; }
.plan .price b { font: 700 2.3rem var(--serif); color: var(--red); }
.plan .price span { color: var(--ink-soft); margin-left: 0.3rem; }
.plan .btn { margin-top: auto; justify-content: center; }
.plan-flag { position: absolute; top: -0.8rem; right: 1rem; background: var(--gold); color: #2e2218; font-weight: 700; font-size: 0.8rem; border-radius: 999px; padding: 0.2rem 0.7rem; }
.ticks { list-style: none; padding: 0; margin: 1rem 0 1.4rem; }
.ticks li { padding: 0.25rem 0 0.25rem 1.6rem; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.auth-page { min-height: 100vh; background-size: cover; background-position: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; position: relative; }
.auth-page::before { content: ''; position: absolute; inset: 0; background: rgba(15, 10, 6, 0.55); }
.auth-page > * { position: relative; }
.brand.light { color: #fff7e6; font: 700 1.4rem var(--serif); text-decoration: none; margin-bottom: 1.2rem; }
.auth-card { background: var(--card); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); padding: 2rem; width: min(420px, 100%); display: grid; gap: 0.9rem; }
.auth-card h1 { font-size: 1.7rem; margin: 0; }
.auth-card .field input { width: 100%; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.9rem; }
.form-error { color: var(--red); font-weight: 600; min-height: 1.2em; }

.card.locked .thumb { filter: saturate(0.75) brightness(0.92); }
.lock-badge { position: absolute; top: 0.6rem; right: 0.6rem; background: rgba(46, 34, 24, 0.85); color: #fff7e6; font-size: 0.8rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; }
.locked-panel { display: flex; gap: 1rem; align-items: center; background: var(--card); border: 1px dashed var(--gold); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.locked-panel > span { font-size: 1.8rem; }
.locked-panel > div { flex: 1; }
.locked-panel p { margin: 0.2rem 0 0; }
.member-banner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #3d2e20, #6b4a2a); color: #f4ead5; border-radius: var(--radius); padding: 1rem 1.4rem; margin: 1rem 0; }
.paywall { text-align: center; padding-top: 1rem; }
.paywall-art { max-width: 560px; margin: 0 auto 1rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 10; }
.paywall-art > * { width: 100%; height: 100%; }
.upsell { background: #fff3d6; border: 1px solid var(--gold); border-radius: 10px; padding: 0.8rem 1rem; margin: 1rem 0; text-align: left; }
.upsell div { margin-top: 0.5rem; }
.legal .note { background: #fff3d6; border: 1px solid var(--gold); border-radius: 8px; padding: 0.5rem 0.8rem; font-size: 0.9rem; }
@media (max-width: 760px) {
  .l-strip { grid-template-columns: repeat(2, 1fr); }
  .l-features, .l-trial { grid-template-columns: 1fr; }
  .topbar nav { display: none; }
  .member-banner, .locked-panel { flex-direction: column; align-items: flex-start; }
}
.landing > section.l-hero, .landing > section.l-strip { margin: 0; }
.l-hero .btn.light { color: var(--ink); }
.tag.free { display: inline-block; margin-top: 0.3rem; }
.member-banner .btn, .locked-panel .btn { white-space: nowrap; }
.panel .stack .btn { justify-self: start; }
.l-lock-card.gen .tag { color: #2e2218; }
.legal h2 { margin-bottom: 0.2rem; }
.legal h3 { margin-top: 1.6rem; }
.legal p, .legal li { line-height: 1.6; }
.legal .caps { font-weight: 600; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.01em; }
.legal mark { background: #ffe58a; padding: 0 0.15rem; border-radius: 3px; }
.renew-note { max-width: 640px; margin: 0 auto 1rem; }

/* ---------- access codes, password-less sign-in, admin console ---------- */
.notice { background: #fff3d6; border: 1px solid var(--gold); border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.9rem; margin: 0.4rem 0; }
.code-note { margin: 1rem auto 0; }
.code-input { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase; }
#redeem .code-input { flex: 1; min-width: 14rem; }
.otp { font: 600 1.6rem ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.4em; text-align: center; width: 100%; }
.admin-console { max-width: 1180px; margin: 0 auto; }
.adm-tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin: 0.6rem 0 1rem; }
.adm-tabs a { padding: 0.55rem 1rem; text-decoration: none; color: var(--ink-soft); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.adm-tabs a.on { color: var(--red); border-bottom-color: var(--red); }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.9rem 1rem; align-items: start; }
.adm-grid .wide { grid-column: 1 / -1; }
.adm-grid .field { min-width: 0; }
.adm-grid .field input, .adm-grid .field select { width: 100%; min-width: 0; height: 2.6rem; padding: 0 0.8rem; font-size: 0.95rem; }
.adm-grid .field > span { min-height: 1.1rem; }
.adm-toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.6rem; }
.adm-toolbar h3 { margin: 0 auto 0 0; }
.adm-toolbar input[type=search] { min-width: 14rem; }
.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.adm-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
.adm-table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid #ece0c6; vertical-align: top; }
.adm-table tr.off td { opacity: 0.6; }
.adm-table td.acts { white-space: nowrap; text-align: right; }
.adm-table td.acts .btn { margin: 0 0 0.25rem 0.25rem; }
code.code { font: 600 0.9rem ui-monospace, 'SF Mono', Menlo, monospace; background: #f1e6cd; padding: 0.15rem 0.4rem; border-radius: 6px; white-space: nowrap; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 99px; background: #e9dec7; color: var(--ink-soft); }
.pill.ok { background: #dcebdc; color: var(--green); }
.pill.warn { background: #f6e6c0; color: #7a5a12; }
.pill.bad { background: #f3d6d3; color: var(--red-dark); }
.made { margin-top: 1rem; background: #f6f0e0; border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; }
.made ul { list-style: none; padding: 0; margin: 0.4rem 0; display: grid; gap: 0.35rem; }
.made li { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.made li code { margin-right: 0.4rem; }
[hidden] { display: none !important; }
.adm-toolbar input, .adm-toolbar select { font: 500 0.9rem var(--sans); padding: 0.4rem 0.7rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }

/* ---------- I've Heard That platform ---------- */
.logo { width: 28px; height: 28px; color: var(--red); flex: none; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand.light .logo { color: #fff; }
.home-hero { min-height: 62vh; background-size: cover; background-position: center; position: relative; display: flex; align-items: flex-end; border-radius: var(--radius); overflow: hidden; }
.home-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,10,6,0.15) 0%, rgba(15,10,6,0.78) 75%); }
.home-hero .hero-inner { position: relative; color: #fff; padding: 3rem clamp(1.2rem, 5vw, 4rem); max-width: 760px; }
.home-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0.2rem 0 0.6rem; }
.home-hero p { font-size: 1.1rem; opacity: 0.92; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 0 rgba(46,34,24,0.05); transition: transform 0.15s, box-shadow 0.15s; }
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.game-art { display: block; aspect-ratio: 16 / 9; background-size: cover; background-position: center; position: relative; }
.game-card.soon .game-art { filter: grayscale(0.4) brightness(0.85); }
.ribbon { position: absolute; top: 0.8rem; left: 0.8rem; background: var(--ink); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 99px; }
.game-body { padding: 1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.game-body h3 { margin: 0; font-size: 1.4rem; }
.game-body p { margin: 0; color: var(--ink-soft); }
.game-body .tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.game-foot { margin-top: auto; padding-top: 0.6rem; display: flex; align-items: center; gap: 0.8rem; justify-content: space-between; }
.membership-strip { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 2rem; }
@media (max-width: 720px) { .membership-strip { grid-template-columns: 1fr; } }
.home-hero .btn.light { background: rgba(255,255,255,0.92); color: var(--ink); border-color: transparent; }
.membership-strip { margin-top: 2.5rem; }
.soon-flag { background: var(--ink) !important; color: #fff !important; }
.plan.soon .price { color: var(--ink-soft); }
.plan.soon .price b, .plan.soon .price span { color: var(--ink-soft); }
.soon-banner { display: inline-block; margin-top: 0.8rem; background: #fff3d6; border: 1px solid var(--gold); border-radius: 99px; padding: 0.4rem 1.1rem; font-size: 0.95rem; }
.contact-form { display: grid; gap: 0.9rem; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; }
.contact-form .field input, .contact-form .field select, .contact-form .field textarea { width: 100%; min-width: 0; }
.contact-form textarea { font: 500 1rem var(--sans); padding: 0.6rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); resize: vertical; text-transform: none; letter-spacing: 0; }
.contact-form textarea:focus { outline: none; border-color: var(--gold); }
.contact-form .btn { justify-self: start; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-done h3 { margin-top: 0; }
code.small-code { font-size: 0.75rem; }
.turnstile-box { min-height: 65px; display: flex; justify-content: center; }
.progress { height: 10px; background: #e9dec7; border-radius: 99px; overflow: hidden; margin: 0.6rem 0 0.3rem; }
.progress .bar { height: 100%; background: var(--red); transition: width 0.2s; }
.up-errors li { color: var(--red-dark); }
.up-warnings li { color: #7a5a12; }
.upload-review ul, .made ul.up-errors, .made ul.up-warnings { display: block; list-style: disc; padding-left: 1.2rem; }
.ok-line { color: var(--green); }
#regs .adm-table td.acts { white-space: normal; min-width: 260px; }
.hint { display: block; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.3rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
.hint.bad { color: var(--red-dark); }
.hint.good { color: var(--green); }
#redeem .code-input { font: 600 1rem ui-monospace, 'SF Mono', Menlo, monospace; padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.adm-grid textarea { font: inherit; padding: 0.6rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); resize: vertical; width: 100%; box-sizing: border-box; }

/* language menu */
.lang-picker { font: inherit; font-size: 0.85rem; padding: 0.25rem 0.5rem; border-radius: 999px; border: 1px solid rgba(0,0,0,0.2); background: transparent; color: inherit; cursor: pointer; }
.topbar .lang-picker { margin-left: auto; margin-right: 0.5rem; }
.topbar .lang-picker + .auth-nav { margin-left: 0; }
.site-footer .lang-picker { margin-left: auto; }

/* ------------------------------------------------ announcements (site/notices.js) */
.site-banner { position: relative; display: flex; align-items: center; background: linear-gradient(90deg, #1f2a3a, #2b3b4f); color: #f6e7c1; border-radius: 99px; margin: 0 0 1rem; overflow: hidden; box-shadow: var(--shadow); }
.banner-track { flex: 1; display: flex; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.banner-run { flex: none; display: flex; align-items: center; gap: 1.4rem; padding: 0.6rem 0.7rem; white-space: nowrap; animation: banner-scroll 38s linear infinite; font: 600 0.95rem var(--serif); letter-spacing: 0.02em; }
.banner-run a, .banner-run span { color: inherit; text-decoration: none; }
.banner-run a:hover { text-decoration: underline; }
.banner-run .sep { color: var(--gold); }
.site-banner:hover .banner-run, .site-banner:focus-within .banner-run { animation-play-state: paused; }
@keyframes banner-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .banner-run { animation: none; } .banner-run[aria-hidden] { display: none; } .banner-track { mask-image: none; } }
.banner-close { flex: none; width: 2.2rem; height: 2.2rem; margin: 0 0.3rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.banner-close:hover, .banner-close:focus-visible { background: rgba(255,255,255,.25); }

.notices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin: 1.6rem 0 0; }
.notices.single { grid-template-columns: minmax(0, 760px); justify-content: center; }
.notice-card { display: grid; grid-template-columns: 42% 1fr; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s ease; }
a.notice-card:hover { transform: translateY(-2px); }
.notice-card img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.notice-body { padding: 1rem 1.3rem; }
.notice-body h3 { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 0.4rem; }
.notice-body p { margin: 0; color: var(--ink-soft); }
.notice-body .notice-note { margin-top: 0.5rem; color: var(--red-dark); font-weight: 600; }
.notice-coming { border-top: 4px solid #2b3b4f; }
.notice-arrived { border-top: 4px solid var(--gold); }
@media (max-width: 560px) { .notice-card { grid-template-columns: 1fr; } }

.new-badge { position: absolute; top: -0.4rem; right: -0.2rem; z-index: 2; pointer-events: none; }
.game-card { overflow: visible; }
.game-card .game-art { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.ann-list { display: grid; gap: 1rem; margin: 1rem 0; }
.ann-card { display: grid; grid-template-columns: 220px 1fr; gap: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; background: var(--paper-2); opacity: .85; }
.ann-card.on { opacity: 1; border-color: var(--green); box-shadow: 0 0 0 2px rgba(47,106,70,.15); }
.ann-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.ann-fields { display: grid; gap: 0.5rem; align-content: start; }
.ann-fields label { display: grid; gap: 0.25rem; }
.ann-fields input[type=text], .ann-fields input:not([type]) { width: 100%; }
.ann-switch { display: flex !important; align-items: center; gap: 0.5rem; font-size: 1.1rem; }
.ann-switch input { width: 1.2rem; height: 1.2rem; }
.ann-foot { display: flex; align-items: center; gap: 1rem; }
@media (max-width: 640px) { .ann-card { grid-template-columns: 1fr; } }

/* ------------------------------------------------ friends (site/friends.js) */
.friend-list { list-style: none; padding: 0; margin: 0.4rem 0; display: grid; gap: 0.35rem; }
.friend-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); flex-wrap: wrap; }
.friend-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.3rem; margin: 0.5rem 0 1rem; }
.friend-checks label { display: flex; gap: 0.45rem; align-items: center; }
main.page > .iht-mp-bar { border-radius: 14px; margin: 0 0 1rem; padding: 0.6rem 1rem; }
#add-friend input, #group-form input[name=name] { padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; min-width: 220px; background: #fff; }
.switch-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
.switch-row input, .push-prefs input { width: 1.15rem; height: 1.15rem; }
.push-prefs { display: grid; gap: 0.4rem; margin: 0.5rem 0 0 1.7rem; justify-items: start; }
.push-prefs label { display: flex; gap: 0.5rem; align-items: center; }
/* Which game the big picture comes from (lower right of the home banner). */
.hero-credit { position: absolute; right: 1rem; bottom: 1rem; z-index: 1; max-width: calc(100% - 2rem); background: rgba(15,10,6,0.55); color: #fff; padding: 0.4rem 0.9rem; border-radius: 99px; font-size: 0.88rem; text-decoration: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-credit:hover, .hero-credit:focus-visible { background: rgba(15,10,6,0.8); }
@media (max-width: 640px) { .home-hero .hero-inner { padding-bottom: 3.6rem; } }
.mp-fields { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem 0.8rem; }
.mp-fields legend { font-weight: 600; padding: 0 0.3rem; }
.mp-modes { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.mp-modes label, .mp-range label { display: inline-flex; gap: 0.4rem; align-items: center; }
.mp-range { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 0.3rem; }
.mp-range input { width: 4.5rem; }
.warn-text { color: var(--red-dark); }
.mp-fields label, .mp-fields .small { text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 500; color: var(--ink); }
.mp-fields .small { font-size: 0.85rem; font-weight: 400; color: var(--ink-soft); }
.mp-fields input[type=radio] { width: auto; height: auto; padding: 0; margin: 0; box-shadow: none; }
.mp-fields input[type=number] { width: 5rem; padding: 0.35rem 0.5rem; }
.friend-results:empty { display: none; }
.friend-results { margin-top: 0.6rem; max-width: 520px; }
.letter-bar { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; margin-top: 0.7rem; }
.letter-bar .letter { min-width: 2rem; height: 2rem; padding: 0 0.45rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 600 0.85rem var(--sans); cursor: pointer; color: var(--ink); }
.letter-bar .letter:hover, .letter-bar .letter:focus-visible { border-color: var(--gold); }
.letter-bar .letter[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.friend-results { max-height: 420px; overflow: auto; }

/* ------------------------------------------------ dark mode (sdk/theme.js; header menu) */
.theme-picker { font: inherit; font-size: 0.85rem; padding: 0.25rem 0.5rem; border-radius: 999px; border: 1px solid rgba(0,0,0,0.2); background: transparent; color: inherit; cursor: pointer; margin-right: 0.5rem; }
[data-theme="dark"] .lang-picker, [data-theme="dark"] .theme-picker { border-color: var(--line); background: transparent; }
[data-theme="dark"] .lang-picker option, [data-theme="dark"] .theme-picker option { background: var(--card); color: var(--ink); }
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #efe6d8;
  --ink-soft: #bfb19f;
  --paper: #15110d;
  --paper-2: #1e1914;
  --card: #241d17;
  --line: #43382c;
  --red: #ef857b; /* text and links on the dark background (buttons keep #a8322d) */
  --red-dark: #e48a83;
  --gold: #d6aa52;
  --green: #6dbb8c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 154, 58, 0.10), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(168, 50, 45, 0.10), transparent 60%),
    var(--paper);
}
[data-theme="dark"] .btn.primary { background: #a8322d; border-color: #c4463f; color: #fff; }
[data-theme="dark"] .btn.primary:hover:not(:disabled) { background: #8f2925; }
[data-theme="dark"] .btn:hover:not(:disabled) { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .topbar nav a.on, [data-theme="dark"] .topbar nav a:hover { background: #2e261e; }
/* Fields and light boxes that used fixed light colours */
[data-theme="dark"] input:not([type=checkbox]):not([type=radio]), [data-theme="dark"] select, [data-theme="dark"] textarea,
[data-theme="dark"] .field input, [data-theme="dark"] .field select, [data-theme="dark"] .adm-toolbar input, [data-theme="dark"] .adm-toolbar select,
[data-theme="dark"] .contact-form textarea, [data-theme="dark"] #redeem .code-input, [data-theme="dark"] #add-friend input,
[data-theme="dark"] #group-form input[name=name], [data-theme="dark"] .letter-bar .letter { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .letter-bar .letter[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .upsell, [data-theme="dark"] .legal .note, [data-theme="dark"] .notice, [data-theme="dark"] .soon-banner,
[data-theme="dark"] .autofill, [data-theme="dark"] .achv-pill, [data-theme="dark"] .puzzle-feedback.hint, [data-theme="dark"] .dropzone.over,
[data-theme="dark"] .tag.progress, [data-theme="dark"] .btn.hint { background: #3a2f1c; color: var(--ink); border-color: #6b5527; }
[data-theme="dark"] .legal mark { background: #5c4a17; color: var(--ink); }
[data-theme="dark"] code.code, [data-theme="dark"] .made { background: #2d251d; color: var(--ink); }
[data-theme="dark"] .pill.warn { background: #3d3216; color: #e8c877; }
[data-theme="dark"] .pill.bad { background: #3f1f1c; color: #f0a39c; }
[data-theme="dark"] .ribbon, [data-theme="dark"] .soon-flag, [data-theme="dark"] .seg.on, [data-theme="dark"] .studio-obj-img .count { background: #efe6d8 !important; color: #15110d !important; }
[data-theme="dark"] .friend-list li { background: var(--paper-2); }
[data-theme="dark"] .notice-card, [data-theme="dark"] .ann-card { background: var(--card); }
[data-theme="dark"] .site-banner { background: linear-gradient(90deg, #0f1620, #1c2633); }
[data-theme="dark"] .tray-item .icon, [data-theme="dark"] .minimap { background: #2d251d; }
[data-theme="dark"] .olib-img { background: radial-gradient(circle at 50% 40%, #3a3026, #1e1914); }
[data-theme="dark"] .studio-obj-img { background: repeating-conic-gradient(#2a241d 0 25%, #1e1914 0 50%) 0 0 / 14px 14px; }
[data-theme="dark"] .topbar { background: rgba(21, 17, 13, 0.88); }
[data-theme="dark"] code { background: #2d251d; color: var(--ink); }
[data-theme="dark"] .tag, [data-theme="dark"] .pill { background: #2e261e; color: var(--ink-soft); border-color: var(--line); }
[data-theme="dark"] .tag.new, [data-theme="dark"] .tag.free, [data-theme="dark"] .pill.ok { background: #1c3324; color: #8fd3aa; border-color: #2f5a3d; }
[data-theme="dark"] .btn.light { background: rgba(36, 29, 23, 0.9); color: var(--ink); border-color: var(--ink-soft); }

/* ------------------------------------------------ favourites (site/favorites.js) */
.game-card { position: relative; }
.game-card[hidden] { display: none !important; }
.fav-btn { position: absolute; top: 0.6rem; left: 0.6rem; z-index: 3; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(20, 14, 10, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: transform 0.12s, background 0.15s; }
.fav-btn svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: #fff; stroke-width: 2; }
.fav-btn:hover, .fav-btn:focus-visible { background: rgba(20, 14, 10, 0.8); transform: scale(1.08); }
.fav-btn.on svg { fill: #e0443c; stroke: #e0443c; }
.fav-btn.on { animation: fav-pop 0.3s ease; }
@keyframes fav-pop { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .fav-btn.on { animation: none; } }
.games-filter { display: flex; justify-content: center; gap: 0.4rem; margin: 0 0 1.2rem; }
.games-filter button { font: 600 0.95rem var(--sans); padding: 0.45rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.games-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.games-filter .n { font-weight: 500; opacity: 0.75; }

/* ---- Admin dashboard ---------------------------------------------------------------------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.dash-head p { margin: 0; }
.dash-range { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.dash-tile { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.dash-tile span { font: 700 0.72rem var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.dash-tile b { font: 700 1.9rem var(--serif, Georgia, serif); line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-tile small { color: var(--ink-soft); font-size: 0.8rem; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; align-items: center; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.6rem; }
.dash-legend i, .dash-key i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }
.k-guest { background: #e0a43a; } .k-free { background: #3d8fb8; } .k-member { background: #a8322d; } .k-signup { background: #2f8a55; }
.dash-chart { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; height: 220px; align-items: end; padding-bottom: 1.4rem; position: relative; }
.dash-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.dash-stack { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 3px 3px 0 0; overflow: hidden; }
.dash-stack span { display: block; width: 100%; }
.dash-col:hover .dash-stack { filter: brightness(1.12); }
.dash-col small { position: absolute; bottom: -1.3rem; left: 50%; transform: translateX(-50%); font-size: 0.68rem; color: var(--ink-soft); white-space: nowrap; }
.dash-col em { position: absolute; left: 50%; transform: translate(-50%, -0.2rem); font: 700 0.62rem var(--sans); font-style: normal; color: #fff; border-radius: 999px; padding: 0 0.3rem; }
.dash-bar { height: 6px; background: color-mix(in srgb, var(--line) 60%, transparent); border-radius: 999px; overflow: hidden; margin-top: 0.3rem; min-width: 60px; }
.dash-bar span { display: block; height: 100%; background: var(--gold, #c99a3a); border-radius: 999px; }
.dash-games td, .dash-games th { vertical-align: middle; }
.dash-games .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-rank { color: var(--ink-soft); font-weight: 700; width: 1.5rem; }
.dash-often { display: flex; height: 12px; width: 120px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--line) 50%, transparent); }
.dash-often span { height: 100%; }
.o1 { background: #d9c7a6; } .o2 { background: #e0a43a; } .o3 { background: #c86a2a; } .o4 { background: #8a2a20; }
.dash-key { white-space: nowrap; margin-left: 0.3rem; }
.dash-countries { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.4rem 1.6rem; }
.dash-countries li { display: grid; grid-template-columns: 11rem 1fr 3rem; align-items: center; gap: 0.6rem; font-size: 0.92rem; }
.dash-countries li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-countries li .dash-bar { margin: 0; }
.dash-countries b { text-align: right; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .o1 { background: #6b5a40; }
[data-theme="dark"] .adm-table td, [data-theme="dark"] .adm-table th { border-bottom-color: var(--line); }
.dash-cc { white-space: nowrap; margin-right: 0.6rem; display: inline-block; }
.pop-rank { position: absolute; top: 0.6rem; left: 3.3rem; z-index: 3; font: 800 0.85rem var(--sans); color: #fff; background: linear-gradient(135deg, #e0782a, #b8321e); border-radius: 999px; padding: 0.3rem 0.65rem; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
/* Dashboard: time of day */
.dash-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 160px; align-items: end; padding-bottom: 1.3rem; }
.dash-hours .dash-col small { font-size: 0.62rem; }
.dash-heat { display: grid; grid-template-columns: 2.6rem repeat(24, 1fr); gap: 2px; margin-top: 1rem; font-size: 0.68rem; color: var(--ink-soft); }
.dash-heat i { aspect-ratio: 1.6; border-radius: 3px; background: #a8322d; }
.dash-heat b { font-weight: 600; align-self: center; }
.dash-heat span { text-align: center; }
.dash-split { display: grid; grid-template-columns: 1fr; gap: 0.4rem; }

.dash-cities li { grid-template-columns: 13rem 1fr 4.5rem; }
.dash-cities b small { font-weight: 500; }

/* Admin → Team */
.adm-role { margin: -0.2rem 0 0.3rem; color: var(--ink-soft); }
.pill.role { background: #e6ddf3; color: #4b2f7a; }
[data-theme="dark"] .pill.role { background: #3a2f4f; color: #d9c8f5; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.role-card { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; background: var(--paper, transparent); }
.role-card h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.role-card p { margin: 0 0 0.4rem; }
.role-card ul { margin: 0; padding-left: 1.1rem; }
.game-picks { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.4rem; }
.game-picks label { display: inline-flex; gap: 0.35rem; align-items: center; font-size: 0.92rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.field-label { font: 700 0.75rem var(--sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.link-copy { flex: 1; min-width: 260px; font: 500 0.85rem ui-monospace, Menlo, monospace; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }

/* Game cards: More info, and the game's details window */
.game-btns { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.game-foot { flex-wrap: wrap; }
.info-btn { white-space: nowrap; }
.game-info { max-width: 900px; padding: 0; overflow-x: hidden; }
.game-info .modal-x { z-index: 2; background: rgba(20, 14, 10, 0.55); color: #fff; border-radius: 50%; width: 2.2rem; height: 2.2rem; line-height: 1; font-size: 1.4rem; }
.gi-gallery { background: #15110d; }
.gi-main { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: min(44vh, 400px); object-fit: cover; border-radius: 18px 18px 0 0; }
.gi-thumbs { display: flex; gap: 0.4rem; padding: 0.5rem; overflow-x: auto; }
.gi-thumb { flex: 0 0 auto; width: 96px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; opacity: 0.7; }
.gi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gi-thumb.on, .gi-thumb:hover { opacity: 1; border-color: var(--gold); }
.gi-thumb:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.game-info h2 { margin: 0.2rem 0 0.4rem; }
.game-info .modal-actions { justify-content: flex-start; margin-top: 1rem; }
.game-info h2 .pill { vertical-align: middle; font-size: 0.75rem; }
.gi-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem 1.4rem; margin: 1.2rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.gi-facts dt { font: 700 0.72rem var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.gi-facts dd { margin: 0.15rem 0 0; }
@media (max-width: 600px) { .game-info .modal-content { padding: 1.2rem; } }

/* Genres on the home page */
.genre-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; margin: -0.4rem 0 1.2rem; }
.genre-bar button { font: 600 0.85rem var(--sans); padding: 0.32rem 0.85rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); cursor: pointer; }
.genre-bar button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1e1813; }
.genre-bar .n { font-weight: 500; opacity: 0.75; }
.genre-bar .group-toggle { margin-left: 0.6rem; border-style: dashed; }
.genre-bar .group-toggle[aria-pressed="true"] { border-style: solid; background: var(--ink); border-color: var(--ink); color: var(--paper); }
.genre-head { grid-column: 1 / -1; margin: 0.8rem 0 -0.4rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); font-size: 1.25rem; }
.genre-head:first-child { margin-top: 0; }

/* Admin → System */
.sys-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; margin-bottom: 0.8rem; }
.sys-check { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; }
.sys-check.ok b { color: var(--green); }
.sys-check.bad { border-color: var(--red); }
.sys-check.bad b { color: var(--red); }
.rep-quote { margin: 0.4rem 0; padding: 0.4rem 0.7rem; border-left: 3px solid var(--line); background: var(--soft, rgba(0,0,0,0.04)); font-size: 0.92rem; }

/* Continue playing, and Your games on the Account page */
.continue-row h2 { font-size: 1.5rem; margin-bottom: 0.8rem; }
.continue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.8rem; }
.continue-card { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.continue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.continue-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.continue-art { flex: 0 0 72px; height: 48px; border-radius: 8px; background-size: cover; background-position: center; }
.continue-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.continue-text b { overflow-wrap: anywhere; line-height: 1.25; }
.my-games { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.my-games li { padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.my-games li:last-child { border-bottom: 0; }

/* Star ratings */
.card-related { margin: 0.2rem 0 0; color: var(--muted, #6b5a48); }
.card-related a { font-weight: 600; }
.card-rating { margin: 0.2rem 0 0; font-weight: 600; color: var(--ink); }
.card-rating span[aria-hidden] { color: #d99a1e; }
.gi-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0.8rem 0 0; }
.gi-avg { font-weight: 700; }
.gi-avg span[aria-hidden] { color: #d99a1e; }
.gi-stars { display: inline-flex; gap: 0.1rem; }
.gi-stars button { border: 0; background: none; font-size: 1.6rem; line-height: 1; padding: 0.1rem; cursor: pointer; color: var(--line); }
.gi-stars button.on { color: #d99a1e; }
.gi-stars:hover button { color: #d99a1e; }
.gi-stars button:hover ~ button { color: var(--line); }
.gi-stars button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; border-radius: 4px; }

/* /g/<game> pages (worker/pages.js) */
.skip-link { position: absolute; left: -999px; top: 0.5rem; z-index: 100; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; border-radius: 8px; }
.skip-link:focus { left: 0.5rem; }
.game-page { min-height: 100vh; display: flex; flex-direction: column; }
.gp-top { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.gp-brand { font: 700 1.3rem var(--serif, Georgia, serif); color: var(--ink); text-decoration: none; }
.gp-main { max-width: 980px; width: 100%; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; flex: 1; }
.gp-hero { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); }
.gp-kicker { font: 700 0.78rem var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin: 1.2rem 0 0.3rem; }
.gp-body h1 { margin: 0 0 0.3rem; font-size: clamp(2rem, 5vw, 3rem); }
.gp-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1.2rem 0; }
.gp-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem; }
.gp-shots img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.gp-foot { text-align: center; padding: 1.2rem; border-top: 1px solid var(--line); color: var(--ink-soft); }

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

/* Accessibility: visible keyboard focus everywhere, and less motion for people who ask for it */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
#email-panel input { flex: 1; min-width: 220px; font: 500 1rem var(--sans); padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.gp-body h2 { margin-top: 2rem; }
#email-panel textarea { width: 100%; font: 500 0.95rem var(--sans); padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); margin: 0.5rem 0; }
#email-panel .stack input { width: 100%; }
.steps { display: flex; gap: 1.2rem; padding-left: 1.2rem; margin: 0.4rem 0 0.6rem; }
.steps li { color: var(--ink-soft); }
.steps li.now { color: var(--ink); font-weight: 700; }
.steps li.done { color: var(--green); }

/* Admin → Newsletter editor */
.nl-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.5rem; margin: 0.6rem 0 1rem; }
.nl-tpl { text-align: left; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.8rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; font: inherit; }
.nl-tpl.on { border-color: var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.nl-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 1000px) { .nl-split { grid-template-columns: 1fr; } }
.nl-form textarea { width: 100%; font: 500 0.95rem var(--sans); padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.nl-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.4rem; max-height: 220px; overflow-y: auto; padding: 0.2rem; }
.nl-pic { padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--soft, #efe3c8); cursor: pointer; aspect-ratio: 16 / 10; overflow: hidden; font: 600 0.72rem var(--sans); color: var(--ink-soft); }
.nl-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nl-pic.on { border-color: var(--red); }
.nl-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.4rem; }
.nl-game { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 0.85rem; text-transform: none; letter-spacing: 0; }
.nl-game img { width: 44px; height: 28px; object-fit: cover; border-radius: 4px; }
.nl-game.on { border-color: var(--red); }
.nl-game input { margin: 0; }
.nl-preview { position: sticky; top: 80px; }
.nl-frame-wrap { background: #e9dfca; border-radius: 12px; padding: 10px; display: flex; justify-content: center; }
.nl-frame-wrap iframe { width: 100%; height: 640px; border: 0; background: #f4ead5; border-radius: 8px; transition: width 0.2s; }
.nl-frame-wrap.phone iframe { width: 375px; }
.seg-group { display: inline-flex; gap: 0.3rem; }

/* ---------------------------------------------------------------- player choices (Account → Player choices) */
html[data-iht-text="large"] { font-size: 112.5%; }
html[data-iht-text="larger"] { font-size: 125%; }
html[data-iht-motion="reduce"] *, html[data-iht-motion="reduce"] *::before, html[data-iht-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* Colour-blind-friendly: vermilion and blue instead of red and green */
html[data-iht-cb] { --red: #b04a00; --red-dark: #8a3a00; --green: #0b5fa5; }
html[data-iht-cb][data-theme="dark"] { --red: #f2a463; --red-dark: #f0b07a; --green: #7db8f0; }
html[data-iht-cb] .pill.ok { background: #dbe8f6; }
html[data-iht-cb] .pill.bad { background: #f8e2cf; color: #8a3a00; }
.prefs-form { display: grid; gap: 0.7rem; }
.prefs-form select, .prefs-form input[type=range] { margin-left: 0.4rem; vertical-align: middle; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--red); text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- home: today strip */
.today-strip { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.today-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.today-card { display: grid; gap: 0.25rem; align-content: end; min-height: 130px; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--card) center/cover no-repeat; border: 1px solid var(--line); color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.today-card b { font: 700 1.25rem var(--serif); }
.today-card.daily { color: #fff; border: 0; }
.today-card.daily::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,14,10,.15), rgba(20,14,10,.85)); }
.today-card.daily > * { position: relative; }
.today-card:hover, .today-card:focus-visible { transform: translateY(-2px); }
.today-card.pick { background: linear-gradient(135deg, var(--paper-2), var(--card)); }
.eyebrow { font: 700 0.75rem var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }

/* seasonal themes (seasons and nature only) */
.theme-winter, .theme-snow { background: linear-gradient(135deg, #e8f1f8, #c9dced); color: #1f3347; }
.theme-spring, .theme-blossom { background: linear-gradient(135deg, #f6eef3, #e3f0dc); color: #3b2a35; }
.theme-summer, .theme-ocean { background: linear-gradient(135deg, #fdf3d6, #cfe9ef); color: #2e3a22; }
.theme-autumn, .theme-leaves { background: linear-gradient(135deg, #f8e3cc, #ecd2b0); color: #4a2a12; }
.theme-rain { background: linear-gradient(135deg, #dfe6ec, #c3ced8); color: #23313d; }
.theme-stars { background: linear-gradient(135deg, #1d2440, #36305a); color: #f3eedd; }
.theme-forest, .theme-mountains { background: linear-gradient(135deg, #dfe9dc, #c5d4c2); color: #23361f; }

/* ---------------------------------------------------------------- daily challenge page */
.daily-hero { border-radius: 18px; background: #2b2119 center/cover no-repeat; color: #fff; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.daily-hero-inner { padding: 4.5rem 1.6rem 1.4rem; background: linear-gradient(180deg, rgba(20,14,10,0) 0%, rgba(20,14,10,.88) 55%); }
.daily-hero h3 { font-size: 2rem; margin: 0.2rem 0; color: #fff; }
.daily-hero .tag { background: rgba(255,255,255,.18); color: #fff; }
.daily-hero .btn.light, .daily-hero .btn.ghost { color: #fff; border-color: #fff; background: transparent; }
.daily-done, .daily-run { background: rgba(255,255,255,.12); padding: 0.6rem 0.8rem; border-radius: 10px; }
.tabular { font-variant-numeric: tabular-nums; }
.daily-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; align-items: center; text-align: center; }
.daily-stats > div { display: grid; gap: 0.1rem; }
.big-num { font: 700 1.8rem var(--serif); }
.board { list-style: none; padding: 0; margin: 0.4rem 0; }
.board li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 0.5rem; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); align-items: center; }
.board li.you { background: rgba(201,154,58,.18); border-radius: 8px; font-weight: 700; }
.board .rank { text-align: center; font-weight: 700; }
.board .val { font-variant-numeric: tabular-nums; font-weight: 700; }
.seg-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.6rem; }
.seg-row .sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 0.4rem; }
.events { display: grid; gap: 0.8rem; }
.event-card { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; padding: 1rem; border-radius: var(--radius); }
.event-card h4 { margin: 0 0 0.2rem; font: 700 1.15rem var(--serif); }
.event-ico { font-size: 2.2rem; line-height: 1; }
.meter { height: 0.55rem; border-radius: 99px; background: rgba(0,0,0,.12); overflow: hidden; margin-top: 0.4rem; }
.meter span { display: block; height: 100%; background: var(--red); border-radius: 99px; }
ul.plain { list-style: none; padding: 0; margin: 0.4rem 0; display: grid; gap: 0.35rem; }

/* ---------------------------------------------------------------- badges and profiles */
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; }
.badge-tile { display: grid; gap: 0.2rem; justify-items: center; text-align: center; padding: 0.9rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.badge-tile.locked { border-style: dashed; background: transparent; }
.badge-tile.locked .badge-ico { filter: grayscale(1); opacity: 0.6; }
.badge-ico { font-size: 2.2rem; line-height: 1.1; }

/* ---------------------------------------------------------------- What's new and help */
.wn-item { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.wn-item img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; }
.wn-ico { font-size: 2.4rem; text-align: center; }
.wn-item h3 { margin: 0.1rem 0 0.3rem; }
.wn-body, .help-text { white-space: pre-wrap; }
.help-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 1rem; }
.help-games { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.help-games a { display: grid; gap: 0.3rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.help-games img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; }
@media (max-width: 560px) { .wn-item { grid-template-columns: 1fr; } .wn-item img { width: 100%; height: 140px; } }

/* ---------------------------------------------------------------- welcome */
.welcome { padding: 1.6rem 1.8rem; }
.welcome h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip { font: 600 0.95rem var(--sans); border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 0.45rem 0.9rem; cursor: pointer; }
.chip[aria-checked="true"] { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.welcome-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; }
.wp { display: grid; gap: 0.25rem; text-decoration: none; color: var(--ink); }
.wp img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; }

/* ---------------------------------------------------------------- admin bits */
.ab-v { display: grid; gap: 0.4rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; }
.ab-result { border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; margin-bottom: 0.8rem; }
.help-edit { border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
.cl-list li, .fb-notes li { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
.adm-tabs { overflow-x: auto; scrollbar-width: thin; }
.adm-tabs a { white-space: nowrap; }
.event-card .muted, .today-card[class*="theme-"] .muted { color: inherit; opacity: 0.8; }
.ab-v { min-width: min(100%, 320px); }
.ab-v input { width: 100%; box-sizing: border-box; }

/* ---------------------------------------------------------------- Admin → Item names */
.it-tools { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; margin-bottom: 0.8rem; }
.it-tools .grow { flex: 1 1 240px; }
.it-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
.it-card { display: grid; gap: 0.25rem; align-content: start; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem; cursor: pointer; }
.it-card:hover, .it-card:focus-visible { border-color: var(--ink); }
.it-card code { font-size: 0.72rem; color: var(--ink-soft); word-break: break-all; }
.it-flags { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.it-img { position: relative; display: grid; place-items: center; aspect-ratio: 1; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23f1ece2'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23f1ece2'/%3E%3C/svg%3E"); border-radius: 8px; overflow: hidden; }
.it-img img { max-width: 92%; max-height: 92%; object-fit: contain; }
.it-img.big { width: 150px; flex: none; }
.it-img.huge { width: 100%; max-width: 320px; }
.it-tint { position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.it-tint.inline { position: static; display: inline-block; vertical-align: middle; width: 14px; height: 14px; }
.it-groups { display: grid; gap: 0.8rem; }
.it-group { display: flex; gap: 1rem; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; }
.it-group ul, .it-same ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; }
.it-edit { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; gap: 1.4rem; align-items: start; }
.it-form { display: grid; gap: 0.6rem; }
.it-same { margin-top: 1rem; }
@media (max-width: 640px) { .it-edit { grid-template-columns: 1fr; } }
.disp-desc { display: grid; gap: 0.4rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; }
.disp-desc label { display: grid; gap: 0.2rem; }

/* ---------------------------------------------------------------- Admin → Game content */
.gc-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }
.gc-game { display: grid; gap: 0.3rem; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem; cursor: pointer; }
.gc-game:hover, .gc-game:focus-visible { border-color: var(--ink); }
.gc-cover { aspect-ratio: 16/9; border-radius: 8px; background: var(--paper-2) center/cover no-repeat; }
.gc-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.gc-head img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.gc-head h3 { margin: 0; }
.gc-head > div { flex: 1; }
.gc-parts { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.gc-parts a { padding: 0.45rem 0.9rem; text-decoration: none; color: var(--ink-soft); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.gc-parts a.on { color: var(--red); border-bottom-color: var(--red); }
.gc-form { display: grid; gap: 0.7rem; max-width: 820px; }
.gc-form textarea, .gc-form input { width: 100%; box-sizing: border-box; }
.tr-note { margin-left: 0.6rem; align-self: center; }
.modal-content.it-edit::before { grid-column: 1 / -1; }
.gc-form textarea, .it-form input { font: inherit; }
.tm-content summary { cursor: pointer; }
.tm-matrix select { font: inherit; padding: 0.2rem 0.3rem; }
.tm-matrix td:first-child { font-weight: 600; }

/* ---------------------------------------------------------------- Free play */
.fp-modes { display: grid; gap: 0.5rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.9rem; }
.fp-opt { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; padding: 0.4rem; border-radius: 8px; cursor: pointer; }
.fp-opt:has(input:checked) { background: rgba(201,154,58,.15); }
.fp-opt span { display: grid; gap: 0.2rem; }
.fp-opt input[type=number] { width: 4.5rem; font: inherit; padding: 0.15rem 0.3rem; }
.fp-why { margin-bottom: 1rem; }
.gc-form label.check { display: flex; gap: 0.5rem; align-items: flex-start; text-align: left; }
.plan.free-plan { border-style: dashed; }
.plan.free-plan .btn { margin-top: auto; }
.membership-page { max-width: 1040px; }
.membership-page .section-head p, .membership-page .fp-why { max-width: 760px; margin-left: auto; margin-right: auto; }
.plans:has(.free-plan) { grid-template-columns: repeat(auto-fit, minmax(250px, 310px)); }

/* ---------------------------------------------------------------- Admin → Team: who */
.tm-who { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; display: grid; gap: 0.6rem; }
.tm-who .seg { display: flex; flex-wrap: wrap; gap: 1rem; }
.tm-who input[type=search] { width: 100%; font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; }
.tm-results { display: grid; gap: 0.25rem; max-height: 280px; overflow: auto; }
.tm-person { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; text-align: left; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card, transparent); color: inherit; font: inherit; cursor: pointer; }
.tm-person:hover, .tm-person:focus-visible { border-color: var(--accent, #c99a3a); }

/* ---------------------------------------------------------------- Terms and Privacy boxes */
.legal-boxes { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; display: grid; gap: 0.45rem; margin: 0; }
.legal-update h2 { margin-top: 0; }

/* Related games (Admin → Games → Edit): plain checkboxes, not the big text-field style. */
.related-games { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; }
.related-games .related-picks { gap: 0.5rem 1.4rem; }
.related-games .related-picks label { white-space: nowrap; cursor: pointer; }
.field .related-picks input[type=checkbox], .adm-grid .field .related-picks input[type=checkbox],
[data-theme="dark"] .field .related-picks input[type=checkbox] {
  width: 1.05rem; height: 1.05rem; min-width: 0; padding: 0; margin: 0; flex: none; border-radius: 3px; accent-color: var(--gold); background: none;
}

/* ---------------------------------------------------------------- Logo (site/img/brand/, logo kit) */
.brand .logo-img { height: 52px; width: auto; display: block; }
.brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark { display: block; }
.brand.light .logo-img { height: 72px; }
@media (max-width: 640px) { .brand .logo-img { height: 40px; } }

/* Checkboxes and radio buttons inside form fields: always normal size (the text-box style of
   .field input must never apply to them; Admin → Newsletter games, Related games, ...). */
.field input[type=checkbox], .field input[type=radio],
.adm-grid .field input[type=checkbox], .adm-grid .field input[type=radio],
[data-theme="dark"] .field input[type=checkbox], [data-theme="dark"] .field input[type=radio],
[data-theme="dark"] .adm-grid .field input[type=checkbox], [data-theme="dark"] .adm-grid .field input[type=radio] {
  width: 1.05rem; height: 1.05rem; min-width: 0; min-height: 0; padding: 0; margin: 0; flex: none;
  border-radius: 3px; background: none; accent-color: var(--gold); box-shadow: none;
}

/* Friend requests waiting: a number on the Friends button. */
.friends-btn { position: relative; }
.count-badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; margin-left: 0.4rem; padding: 0 0.3rem; border-radius: 999px; background: var(--red); color: #fff; font: 700 0.72rem/1 var(--sans); }

/* The home page's plain list of games, for search engines (worker/pages.js homePage); the app replaces it at once. */
.seo-static { max-width: 760px; margin: 2rem auto; padding: 0 1.2rem; font-family: var(--sans); color: var(--ink); }
.seo-static h1 { font: 700 1.8rem var(--serif); }

/* Admin → Dashboard: online now */
.dash-online .online-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.dash-online h3 { margin: 0; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #2e9e4f; box-shadow: 0 0 0 4px rgba(46,158,79,.2); }
.online-parts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0.6rem 0 0.4rem; }
.online-games { display: flex; flex-wrap: wrap; gap: 0.35rem; }
