/* sucky.life — public site: an adventure log */

:root {
    --bg1: #14102a;
    --bg2: #241a3f;
    --accent: #a78bfa;
    --accent2: #f0abfc;
    --ink: #f4f1fa;
    --ink-dim: rgba(244, 241, 250, 0.72);
    --ink-faint: rgba(244, 241, 250, 0.45);
    --line: rgba(255, 255, 255, 0.12);
    --card: rgba(255, 255, 255, 0.05);
    --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --measure: 40rem;
}

[data-mood="ember"] { --bg1: #2a1010; --bg2: #3f1f1a; --accent: #fb923c; --accent2: #f87171; }
[data-mood="sea"]   { --bg1: #0b1f2e; --bg2: #123a4a; --accent: #38bdf8; --accent2: #2dd4bf; }
[data-mood="moss"]  { --bg1: #0f2016; --bg2: #1c3524; --accent: #86efac; --accent2: #bef264; }
[data-mood="neon"]  { --bg1: #12061f; --bg2: #2a0a3f; --accent: #f472b6; --accent2: #22d3ee; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg1); }

body {
    font-family: var(--sans);
    background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%) fixed, var(--bg1);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 100000;
    background: #fff; color: #000; padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* ---------- Stage: a 16:9 canvas covering its box, so hotspots stay glued to the artwork ---------- */

.stage { position: relative; overflow: hidden; isolation: isolate; }
.hero { --stage-h: 100svh; height: 100vh; height: 100svh; min-height: 32rem; }
.chapter-stage { --stage-h: 72svh; height: 72vh; height: 72svh; min-height: 24rem; }

.stage-frame {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: max(100vw, calc(var(--stage-h) * 16 / 9));
    aspect-ratio: 16 / 9;
}
.stage-art { width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(10, 6, 24, 0.55) 100%),
        linear-gradient(to bottom, rgba(10, 6, 24, 0.25), rgba(10, 6, 24, 0.7));
}
.chapter-stage .hero-shade { background: linear-gradient(to bottom, rgba(10, 6, 24, 0.35) 0%, rgba(10, 6, 24, 0.1) 40%, var(--bg1) 100%); }

/* ---------- Hero ---------- */

.hero-content {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2rem 1.25rem; pointer-events: none;
}
.hero-content > * { pointer-events: auto; }
.hero-eyebrow {
    font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--ink-dim); margin-bottom: 1.5rem;
}
.hero-title {
    font-family: var(--serif); font-weight: 600; font-style: italic;
    font-size: clamp(2.2rem, 6.5vw, 5rem); line-height: 1.08; letter-spacing: -0.02em;
    max-width: 18ch; margin-bottom: 2.5rem; text-wrap: balance;
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.45);
}

.screech-button {
    padding: 1.2rem 2.6rem; font-size: 1.1rem; font-weight: 600; cursor: pointer;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: #190f2e; border: none; border-radius: 999px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 0 0 0 var(--accent);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
.screech-button:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4), 0 0 0 8px rgba(167, 139, 250, 0.18); }
.screech-button:disabled { opacity: 0.6; cursor: progress; }

.audio-controls { margin-top: 1.5rem; display: flex; gap: 0.75rem; justify-content: center; }
.control-btn {
    width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); transition: background 0.2s, transform 0.2s;
}
.control-btn:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.08); }

.screech-line {
    margin-top: 1.25rem; min-height: 1.6em; font-family: var(--serif); font-style: italic;
    font-size: 1.15rem; color: var(--ink-dim); opacity: 0; transition: opacity 0.4s;
}
.screech-line.show { opacity: 1; }

.scroll-cue {
    position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 3;
    color: var(--ink-dim); text-decoration: none; font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase;
    animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

.tears { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

.screech-flash { position: absolute; inset: 0; z-index: 2; background: #fff; opacity: 0; pointer-events: none; }
.hero.is-screeching .stage-frame { animation: shake 0.5s linear 2; }
.hero.is-screeching .screech-flash { animation: flash 0.5s ease-out 1; }
@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%); }
    20% { transform: translate(calc(-50% - 7px), calc(-50% + 3px)); }
    40% { transform: translate(calc(-50% + 6px), calc(-50% - 4px)); }
    60% { transform: translate(calc(-50% - 4px), calc(-50% - 2px)); }
    80% { transform: translate(calc(-50% + 4px), calc(-50% + 4px)); }
}
@keyframes flash { 0% { opacity: 0.55; } 100% { opacity: 0; } }

/* ---------- Egg hotspots ---------- */

.egg-hotspot {
    --near: 0;
    position: absolute; z-index: 5; width: 64px; height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 50%; border: 2px solid transparent; cursor: pointer;
    background: radial-gradient(circle, rgba(255, 255, 255, calc(0.03 + var(--near) * 0.3)) 0%, transparent 70%);
    box-shadow: 0 0 calc(var(--near) * 26px) calc(var(--near) * 6px) rgba(240, 171, 252, calc(var(--near) * 0.65));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.egg-icon { font-size: 1.6rem; opacity: 0; transition: opacity 0.4s, transform 0.4s; transform: scale(0.6); }
.egg-hotspot:hover, .egg-hotspot:focus-visible { transform: translate(-50%, -50%) scale(1.15); border-color: rgba(255, 255, 255, 0.4); }
.egg-hotspot:hover .egg-icon, .egg-hotspot:focus-visible .egg-icon { opacity: 0.8; transform: scale(1); }
.egg-hotspot.is-found { border-color: rgba(134, 239, 172, 0.55); background: rgba(134, 239, 172, 0.12); }
.egg-hotspot.is-found .egg-icon { opacity: 1; transform: scale(1); }
.egg-hotspot.is-hinted { animation: hint-pulse 1.1s ease-in-out 5; }
@keyframes hint-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 171, 252, 0.8); border-color: rgba(240, 171, 252, 0.9); }
    50% { box-shadow: 0 0 0 28px rgba(240, 171, 252, 0); border-color: rgba(240, 171, 252, 0.2); }
}

.egg-tooltip {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 0.4rem;
    background: rgba(0, 0, 0, 0.88); padding: 0.4rem 0.8rem; border-radius: 8px;
    font-size: 0.8rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.egg-hotspot:hover .egg-tooltip, .egg-hotspot:focus-visible .egg-tooltip { opacity: 1; }
.egg-hotspot:not(.is-found) .egg-tooltip { display: none; } /* don't spoil the surprise until found */

.egg-dock {
    position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 900;
    display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.4rem 0.35rem 0.9rem;
    background: rgba(10, 6, 24, 0.72); backdrop-filter: blur(12px);
    border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem;
}
.dock-btn {
    background: rgba(255, 255, 255, 0.12); border: none; border-radius: 999px; cursor: pointer;
    padding: 0.35rem 0.9rem; font-size: 0.85rem; transition: background 0.2s;
}
.dock-btn:hover { background: rgba(255, 255, 255, 0.24); }
.egg-dock.is-complete .egg-count { color: #86efac; }

.toast {
    position: fixed; left: 50%; bottom: 4.5rem; transform: translate(-50%, 20px); z-index: 1000;
    max-width: min(32rem, 90vw); padding: 0.8rem 1.3rem; border-radius: 14px; text-align: center;
    background: rgba(10, 6, 24, 0.92); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast a { color: var(--accent2); }

/* ---------- Dialogs (egg modal + lightbox) ---------- */

dialog { color: var(--ink); border: none; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(5, 3, 14, 0.85); backdrop-filter: blur(10px); }

.egg-modal {
    margin: auto; width: min(800px, 94vw); max-height: 90vh; overflow-y: auto;
    background: linear-gradient(160deg, var(--bg2), var(--bg1)); border: 1px solid var(--line);
    border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.egg-modal[open] { animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close {
    position: absolute; top: 0.9rem; right: 0.9rem; z-index: 2; width: 40px; height: 40px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12); font-size: 1.5rem; cursor: pointer; transition: background 0.2s, transform 0.3s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.25); transform: rotate(90deg); }

.modal-content { padding: 3rem; }
.modal-found { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: #86efac; margin-bottom: 0.75rem; }
.modal-title { font-family: var(--serif); font-size: 2rem; margin-bottom: 0.75rem; }
.modal-caption { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-dim); margin-bottom: 1.75rem; }
.modal-media { margin-bottom: 1.75rem; border-radius: 12px; overflow: hidden; }
.modal-media img, .modal-media video { width: 100%; height: auto; }
.modal-audio { width: 100%; margin-bottom: 1.75rem; }
.modal-body { color: var(--ink-dim); line-height: 1.7; }
.modal-body p, .modal-body ul, .modal-body ol { margin-bottom: 1rem; }
.modal-body ul, .modal-body ol { padding-left: 1.4rem; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-link { margin-top: 1.5rem; font-size: 0.9rem; }

.embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lightbox {
    inset: 0; width: 100vw; height: 100vh; margin: 0;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { max-width: 92vw; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 6px; margin: 0 auto; }
.lightbox figcaption { margin-top: 0.75rem; color: var(--ink-dim); font-family: var(--serif); font-style: italic; }
.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; border: none; cursor: pointer;
    background: rgba(255, 255, 255, 0.08); font-size: 2.2rem; border-radius: 10px;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lb-prev { left: 1rem; } .lb-next { right: 1rem; }
.lb-nav[hidden] { display: none; }

/* ---------- The log (home) ---------- */

.log { max-width: 62rem; margin: 0 auto; padding: 6rem 1.25rem 4rem; }
.log-intro { max-width: var(--measure); margin: 0 auto 5rem; text-align: center; }
.log-intro h2 { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.25rem; }
.log-intro .prose { font-size: 1.15rem; }
.log-empty { text-align: center; color: var(--ink-dim); font-family: var(--serif); font-style: italic; }

.timeline { list-style: none; position: relative; padding-left: 2.25rem; }
.timeline::before {
    content: ''; position: absolute; left: 0.55rem; top: 0.5rem; bottom: 0.5rem; width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent) 8%, var(--accent) 92%, transparent); opacity: 0.45;
}
.tl-item { position: relative; margin-bottom: 2.5rem; }
.tl-node {
    position: absolute; left: -2.25rem; top: 1.6rem; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 5px rgba(167, 139, 250, 0.18), 0 0 20px var(--accent);
}
.tl-card {
    display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: 0; overflow: hidden; text-decoration: none; color: inherit;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(8px);
    transition: transform 0.3s, border-color 0.3s, background 0.3s;
}
.tl-card:not(:has(.tl-cover)) { grid-template-columns: 1fr; }
.tl-card:hover { transform: translateY(-4px); border-color: var(--accent); background: rgba(255, 255, 255, 0.08); }
.tl-cover { display: block; min-height: 11rem; overflow: hidden; }
.tl-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.tl-card:hover .tl-cover img { transform: scale(1.06); }
.tl-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.5rem 1.6rem; }
.tl-meta { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent2); }
.tl-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; font-weight: 600; }
.tl-summary { color: var(--ink-dim); line-height: 1.55; }
.tl-foot { margin-top: auto; font-size: 0.8rem; color: var(--ink-faint); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Chapter page ---------- */

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 800; padding: 0.9rem 1.25rem; pointer-events: none; }
.back-link {
    pointer-events: auto; display: inline-block; text-decoration: none; color: var(--ink); font-size: 0.85rem;
    padding: 0.4rem 0.9rem; border-radius: 999px; background: rgba(10, 6, 24, 0.55); backdrop-filter: blur(10px); border: 1px solid var(--line);
}
.back-link:hover { background: rgba(10, 6, 24, 0.85); }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1001; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.draft-banner { position: relative; z-index: 1002; background: #b45309; color: #fff; text-align: center; padding: 0.5rem 1rem; font-size: 0.9rem; }
.draft-banner a { color: #fff; }

.chapter-title-block { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; max-width: 54rem; margin: 0 auto; padding: 0 1.25rem 2.5rem; pointer-events: none; }
.chapter-kicker { font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent2); margin-bottom: 0.75rem; }
.chapter-title-block h1 { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.chapter-meta { margin-top: 1rem; color: var(--ink-dim); font-size: 0.9rem; }
.chapter-meta .cast { display: block; margin-top: 0.25rem; color: var(--ink-faint); }

.story { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1.25rem 3rem; font-family: var(--serif); }
.story-summary { font-size: 1.3rem; font-style: italic; color: var(--ink-dim); line-height: 1.5; margin-bottom: 3rem; padding-left: 1.1rem; border-left: 3px solid var(--accent); }
.block { margin-bottom: 1.75rem; }

.prose { font-family: var(--serif); font-size: 1.2rem; line-height: 1.78; color: rgba(244, 241, 250, 0.9); }
.prose p { margin-bottom: 1.35em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.7rem; margin: 2em 0 0.7em; line-height: 1.25; }
.prose h3 { font-size: 1.3rem; margin: 1.6em 0 0.6em; color: var(--accent2); }
.prose ul { margin: 0 0 1.35em 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote { margin: 1.6em 0; padding-left: 1.2rem; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink-dim); }
.prose blockquote p { margin-bottom: 0; }
.prose strong { color: #fff; }
.prose .scene-break { text-align: center; letter-spacing: 1em; color: var(--accent); margin: 2.4em 0; }
.prose-first > p:first-child::first-letter {
    float: left; font-size: 4.6em; line-height: 0.82; padding: 0.08em 0.12em 0 0; font-weight: 600; color: var(--accent2);
}

.figure { margin-left: 0; margin-right: 0; }
.figure img, .figure video { width: 100%; height: auto; border-radius: 12px; }
.figure-wide { width: min(58rem, calc(100vw - 2.5rem)); margin-left: 50%; transform: translateX(-50%); }
.figure-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.figure-full img { border-radius: 0; }
.figure audio, .figure video { width: 100%; }
figcaption { margin-top: 0.7rem; font-size: 0.95rem; font-style: italic; color: var(--ink-faint); text-align: center; line-height: 1.5; }

.zoomable { display: block; width: 100%; padding: 0; border: none; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; }
.zoomable img { transition: transform 0.5s; }
.zoomable:hover img { transform: scale(1.025); }

.gallery { width: min(58rem, calc(100vw - 2.5rem)); margin-left: 50%; transform: translateX(-50%); }
.gallery-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(2, 1fr); }
.gallery-grid .zoomable { aspect-ratio: 4 / 3; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }
.gallery-1 .gallery-grid { grid-template-columns: 1fr; }
.gallery-1 .zoomable { aspect-ratio: auto; }
.gallery-3 .gallery-grid .zoomable:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
.gallery-5 .gallery-grid .zoomable:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
.gallery-6 .gallery-grid, .gallery-4 .gallery-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
    .gallery-6 .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.pullquote { margin: 3rem 0; padding: 0 0.5rem; text-align: center; }
.pullquote p { font-size: clamp(1.5rem, 4vw, 2rem); font-style: italic; line-height: 1.35; color: #fff; text-wrap: balance; }
.pullquote p::before { content: '“'; display: block; font-size: 3.5rem; line-height: 0.6; color: var(--accent); }
.pullquote footer { margin-top: 1rem; font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }

.divider { text-align: center; margin: 3rem 0; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent2); display: flex; align-items: center; gap: 1rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.story-end { text-align: center; margin-top: 4rem; font-family: var(--sans); }
.story-end-mark { font-size: 1.5rem; color: var(--accent); margin-bottom: 1.5rem; }
.react-btn {
    cursor: pointer; padding: 0.7rem 1.4rem; margin: 0 0.3rem; border-radius: 999px; font-size: 1rem;
    background: var(--card); border: 1px solid var(--line); transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.react-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.react-btn.is-active { background: rgba(167, 139, 250, 0.2); border-color: var(--accent); }
.react-btn.ghost { background: transparent; }

.chapter-nav { max-width: 62rem; margin: 0 auto; padding: 1rem 1.25rem 4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chapter-nav-link {
    display: flex; flex-direction: column; gap: 0.35rem; padding: 1.2rem 1.4rem; text-decoration: none; color: inherit;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.25s, transform 0.25s;
}
.chapter-nav-link:hover { border-color: var(--accent); transform: translateY(-3px); }
.chapter-nav-link small { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent2); }
.chapter-nav-link span { font-family: var(--serif); font-size: 1.2rem; }
.chapter-nav-link.next { text-align: right; grid-column: 2; }

.site-footer { text-align: center; padding: 2rem 1rem 5rem; color: var(--ink-faint); font-size: 0.85rem; border-top: 1px solid var(--line); }
.missing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; padding: 2rem; font-family: var(--serif); }

/* ---------- Password gate ---------- */

.gate-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.gate-card { background: var(--card); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid var(--line); padding: 3rem; max-width: 400px; width: 90%; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
.gate-title { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 1.25rem; text-align: center; }
.gate-form { display: flex; flex-direction: column; gap: 1rem; }
.gate-input { padding: 0.75rem 1rem; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); border-radius: 10px; color: #fff; font-size: 1rem; }
.gate-input:focus { outline: none; border-color: var(--accent); }
.gate-button { padding: 0.75rem 1.5rem; background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; border-radius: 10px; color: #190f2e; font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s; }
.gate-button:hover { transform: translateY(-2px); }
.gate-error { color: #ff8e8e; text-align: center; font-size: 0.9rem; }

/* ---------- Placement tool (admin) ---------- */

.placing .stage { cursor: crosshair; }
.placing .egg-hotspot { pointer-events: none; }
.place-marker {
    position: absolute; z-index: 9; width: 56px; height: 56px; transform: translate(-50%, -50%); pointer-events: none;
    border: 3px solid var(--accent2); border-radius: 50%; background: rgba(240, 171, 252, 0.28);
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 0 24px rgba(240, 171, 252, 0.7);
}
.place-ghost {
    position: absolute; z-index: 8; width: 44px; height: 44px; transform: translate(-50%, -50%);
    border: 2px dashed rgba(255, 130, 130, 0.8); border-radius: 50%; background: rgba(255, 107, 107, 0.15);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.place-ghost span { position: absolute; bottom: 100%; margin-bottom: 4px; background: rgba(0, 0, 0, 0.85); padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.7rem; white-space: nowrap; }
.safe-zone { position: absolute; z-index: 7; top: 0; bottom: 0; left: 50%; width: calc(var(--stage-h) * 9 / 16 * 1.0); max-width: 100%; transform: translateX(-50%); border-left: 1px dashed rgba(255, 255, 255, 0.35); border-right: 1px dashed rgba(255, 255, 255, 0.35); pointer-events: none; }
.safe-zone::after { content: 'always visible on phones'; position: absolute; top: 0.4rem; left: 50%; transform: translateX(-50%); font-size: 0.7rem; background: rgba(0, 0, 0, 0.6); padding: 0.1rem 0.5rem; border-radius: 6px; white-space: nowrap; }
.place-bar {
    position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem 1.25rem;
    padding: 0.75rem 1.5rem; max-width: 94vw; background: rgba(10, 6, 24, 0.92); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 24px;
}
.place-bar button, .place-bar a { cursor: pointer; padding: 0.45rem 1.1rem; border: none; border-radius: 999px; font-weight: 600; text-decoration: none; font-size: 0.9rem; background: rgba(255, 255, 255, 0.14); color: #fff; }
.place-bar .primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #190f2e; }
.place-bar code { color: var(--ink-dim); font-size: 0.85rem; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .tl-card { grid-template-columns: 1fr; }
    .tl-cover { min-height: 0; aspect-ratio: 16 / 9; }
    .timeline { padding-left: 1.6rem; }
    .tl-node { left: -1.6rem; }
    .timeline::before { left: 0.2rem; }
    .modal-content { padding: 2.25rem 1.25rem 1.5rem; }
    .modal-title { font-size: 1.55rem; }
    .prose { font-size: 1.1rem; }
    .chapter-nav { grid-template-columns: 1fr; }
    .chapter-nav-link.next { grid-column: 1; text-align: left; }
    .egg-hotspot { width: 56px; height: 56px; }
    .lb-nav { width: 40px; height: 60px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
    .tears { display: none; }
}
