: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(170px, 1fr)); gap: 0.8rem; align-items: end; }
.adm-grid .wide { grid-column: 1 / -1; }
.adm-grid .field input, .adm-grid .field select { width: 100%; }
.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); }
.topbar .sound-btn { margin-left: auto; padding: 0.3rem 0.6rem; font-size: 1rem; line-height: 1; }
.topbar .sfx-btn { padding: 0.3rem 0.6rem; font-size: 1rem; line-height: 1; margin-left: 0.3rem; }
.topbar .sound-btn + .auth-nav, .topbar .sfx-btn + .auth-nav { margin-left: 0; }

/* Optional tasks under the find list */
.tray-tasks { flex-basis: 100%; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.35rem; }
.task { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.7rem; border-radius: 999px; background: #2e3a2a; border: 1px solid #4e6a3e; color: #f4ead5; font: 600 0.85rem var(--serif); }
.task .icon { background: #f4ead5; border-radius: 50%; padding: 1px; }
.task.act { cursor: pointer; background: #6a3a1e; border-color: #c9a24a; }
.task.act:hover { background: #8a4a24; }
.task.done { opacity: 0.6; }
.task.locked { opacity: 0.55; border-style: dashed; }
.task.side-note { background: #3a2e4a; border-color: #6a5a8a; }
#collect-count.pop { animation: pop 0.5s; }
.tasks-note { background: rgba(201, 162, 74, 0.15); border-left: 3px solid #c9a24a; padding: 0.4rem 0.7rem; border-radius: 4px; }
.tray { flex-wrap: wrap; }

/* Daily Challenge */
.daily-wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 1rem; }
@media (max-width: 860px) { .daily-wrap { grid-template-columns: 1fr; } }
.daily-card { background: var(--card, #fffaf0); border: 1px solid #e0d2b4; border-radius: 14px; padding: 0.8rem; display: grid; gap: 0.8rem; }
.daily-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.daily-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; }
.daily-thumb > :first-child, .daily-thumb svg, .daily-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.daily-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.2rem 0.4rem; background: rgba(30, 20, 10, 0.65); color: #fff; font: 600 0.75rem var(--serif); }
.daily-info { display: grid; gap: 0.35rem; justify-items: start; }
.daily-board { background: var(--card, #fffaf0); border: 1px solid #e0d2b4; border-radius: 14px; padding: 0.8rem 1rem; }
.daily-board h3, .daily-days h3 { margin: 0 0 0.5rem; }
.score-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.score-table th, .score-table td { padding: 0.25rem 0.4rem; border-bottom: 1px solid #eee2c8; text-align: left; }
.score-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.score-table tr.me td { background: rgba(201, 162, 74, 0.2); font-weight: 700; }
.daily-days { margin-top: 1rem; }
.day-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.day-chip { display: grid; gap: 0.1rem; text-align: left; padding: 0.45rem 0.7rem; border-radius: 10px; border: 1px solid #e0d2b4; background: #fffaf0; cursor: pointer; font: 0.82rem var(--sans, sans-serif); }
.day-chip:hover { border-color: #c9a24a; }
.daily-post { margin: 0.6rem 0; }

/* 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: 0.4rem; }

/* "New" rosette (src/ui/badge.js) on recently added cases and on the game's own header. */
.new-rosette { position: absolute; top: 0.3rem; right: 0.3rem; z-index: 3; pointer-events: none; line-height: 0; }
.new-rosette.brand-new { position: static; display: inline-block; vertical-align: middle; margin-left: 0.4rem; }

/* ---- Dark mode --------------------------------------------------------------------------
   The platform SDK sets data-iht-theme="light|dark" on <html> from the player's choice in the
   site's header (Auto / Light / Dark) and keeps it up to date. index.html sets it early too, so
   there is no light flash and the game also follows the device when run on its own. The play
   screen is already dark; this covers the menus, cards, modals and puzzles. */
[data-iht-theme="dark"] {
  color-scheme: dark;
  --ink: #efe6d8;
  --ink-soft: #bfae96;
  --paper: #15110d;
  --paper-2: #1e1813;
  --card: #241c15;
  --line: #4a3b2c;
  --red: #e5786d;
  --red-dark: #8f2a25;
  --gold: #d6a84a;
  --green: #86c99b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --soft: #2e241b;      /* replaces the light cream panels (#efe3c8) */
  --note: #3a2e1a;      /* replaces the pale yellow notes (#fff3c4, #fff3d6, #ffe9a8) */
}
[data-iht-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.08), transparent 60%),
    var(--paper);
}
[data-iht-theme="dark"] code,
[data-iht-theme="dark"] code.code,
[data-iht-theme="dark"] .tag,
[data-iht-theme="dark"] .pill,
[data-iht-theme="dark"] .topbar nav a.on,
[data-iht-theme="dark"] .topbar nav a:hover,
[data-iht-theme="dark"] .clue-panel,
[data-iht-theme="dark"] .decoder,
[data-iht-theme="dark"] .seq-order,
[data-iht-theme="dark"] .explanation,
[data-iht-theme="dark"] .made { background: var(--soft); color: var(--ink); }
[data-iht-theme="dark"] .topbar { background: rgba(30, 24, 19, 0.88); }
[data-iht-theme="dark"] .btn:hover:not(:disabled) { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
[data-iht-theme="dark"] .btn.primary { background: #a8322d; border-color: #c4453e; color: #fff; }
[data-iht-theme="dark"] .btn.primary:hover:not(:disabled) { background: #8f2a25; }
[data-iht-theme="dark"] .btn.hint { background: #4a3a18; border-color: #b9822b; color: #f3d48a; }
[data-iht-theme="dark"] .btn.light { background: rgba(36, 28, 21, 0.92); color: var(--ink); }
[data-iht-theme="dark"] .field input,
[data-iht-theme="dark"] .field select,
[data-iht-theme="dark"] .adm-toolbar input,
[data-iht-theme="dark"] .adm-toolbar select { background: #1a1510; color: var(--ink); border-color: var(--line); }
[data-iht-theme="dark"] .thumb { background: #2a221a; }
[data-iht-theme="dark"] .stars .dim { color: #5b4a3a; }
[data-iht-theme="dark"] .tag.new,
[data-iht-theme="dark"] .tag.free,
[data-iht-theme="dark"] .pill.ok { background: #1f3a28; color: var(--green); border-color: #2f5a3c; }
[data-iht-theme="dark"] .tag.progress,
[data-iht-theme="dark"] .pill.warn { background: #4a3a18; color: #f3d48a; }
[data-iht-theme="dark"] .pill.bad { background: #4a1f1c; color: #f0a39b; }
[data-iht-theme="dark"] .puzzle-feedback.hint,
[data-iht-theme="dark"] .achv-pill,
[data-iht-theme="dark"] .dropzone.over,
[data-iht-theme="dark"] .autofill,
[data-iht-theme="dark"] .upsell,
[data-iht-theme="dark"] .legal .note,
[data-iht-theme="dark"] .notice { background: var(--note); color: var(--ink); }
[data-iht-theme="dark"] .legal mark { background: #6a5420; color: #fff7e6; }
[data-iht-theme="dark"] .dial-val { background: #1e1813; color: var(--ink); }
[data-iht-theme="dark"] .seg.on { background: var(--gold); color: #1e1813; border-color: var(--gold); }
[data-iht-theme="dark"] .history th, [data-iht-theme="dark"] .history td,
[data-iht-theme="dark"] .adm-table td,
[data-iht-theme="dark"] .score-table th, [data-iht-theme="dark"] .score-table td { border-bottom-color: var(--line); }
[data-iht-theme="dark"] .daily-card,
[data-iht-theme="dark"] .daily-board,
[data-iht-theme="dark"] .day-chip { background: var(--card); border-color: var(--line); color: var(--ink); }
[data-iht-theme="dark"] .lib-card img { background: #2a221a; }
[data-iht-theme="dark"] .olib-img { background: radial-gradient(circle at 50% 40%, #3a2e22, #1e1813); }
[data-iht-theme="dark"] .studio-obj-img { background: repeating-conic-gradient(#3a3a3a 0 25%, #2a2a2a 0 50%) 0 0 / 14px 14px; }
[data-iht-theme="dark"] .studio-obj-img .count { background: var(--gold); color: #1e1813; }
[data-iht-theme="dark"] .l-lock-card::after { background: rgba(36, 28, 21, 0.9); }
[data-iht-theme="dark"] .minimap { background: #e9dcc0; } /* the drawn map keeps its paper look */
