:root {
    --bg: #000;
    --bg-2: #111;
    --paper: #fff;
    --ink: #000;
    --accent: #ffe609;
    --muted: #9a9a9a;
    --line: rgba(255, 230, 9, 0.4);
    --ok: #3d8f63;
    --bad: #c45c4a;
    --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    color: var(--paper);
    font-family: Outfit, system-ui, sans-serif;
    line-height: 1.45;
}
html { background-color: #000; overflow-x: hidden; }
body {
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #000;
    background-image: var(--page-bg);
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: auto min(100dvh, 56.25vw);
    pointer-events: none;
}
.page:has(.intro-stage) {
    width: min(1560px, 100%);
    padding: 8px 12px 12px;
}
.intro-stage { margin: 0; }
.intro-frame {
    position: relative;
    width: min(100%, calc((100dvh - 250px) * 16 / 9));
    margin-inline: auto;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 230, 9, 0.35);
}
.intro-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.intro-start {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.38);
}
.intro-stage.is-playing .intro-start,
.intro-start[hidden] { display: none; }
.intro-play {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 12px 22px 12px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #000;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 36px rgba(255, 230, 9, 0.28);
}
.intro-play-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #000;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    padding-left: 3px;
}
.intro-skip {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
.masthead {
    position: relative;
    min-width: 0;
    max-width: 100%;
    background: #000;
    border-bottom: 2px solid var(--accent);
}
.masthead img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    object-position: center;
    background: #000;
}
.masthead .lang-switch {
    position: absolute;
    top: 12px;
    left: 12px;
    margin: 0;
    z-index: 2;
}
.page {
    width: min(760px, 100%);
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 16px 16px 24px;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-wrap: break-word;
}
.play, .chrome, .quiz, .quiz-list, .dossier, .gallery, .sms, .panel, .videos {
    max-width: 100%;
    min-width: 0;
}
h1, h2, .hero h1, .chrome h1 {
    font-family: Outfit, system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 24px 0 10px; color: var(--accent); }
.kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.68rem;
    color: var(--accent);
    margin: 0 0 6px;
}
.muted { color: var(--muted); }
.lede, .fiction, .hint { color: #cfcfcf; }
.lede { font-size: 1.15rem; line-height: 1.5; }
.intro-copy {
    line-height: 1.65;
    margin: 0 0 1.15rem;
}
.hint { font-size: 0.85rem; margin: 8px 0 12px; }
.panel, .notebook, .email, .sms, .end-card, .quiz, .dossier {
    background: var(--paper);
    color: var(--ink);
    border-radius: 18px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid #e8e8e8;
}
.hero { padding: 20px 4px 8px; text-align: center; }
.agent-gate h1 {
    font-size: clamp(1.55rem, 4.6vw, 2.15rem);
    margin: 0 0 14px;
}
.agent-gate .lede {
    max-width: 38rem;
    margin: 0 auto 12px;
}
.codes-label {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: #cfcfcf;
}
.agent-codes {
    margin: 4px 0 16px;
    font-size: clamp(1.15rem, 3vw, 1.45rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
}
.agent-codes span {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    padding: 0 0.15em;
}
.secret-label {
    display: block;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-weight: 700;
}
.agent-gate .fiction {
    text-align: center;
    font-size: 0.78rem;
    margin: 18px auto 0;
    max-width: 36rem;
}
.lang-switch { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.lang-switch a {
    color: var(--paper);
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.55);
}
.lang-switch a.is-on { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.field, .stack label { display: block; margin: 12px 0; font-size: 0.9rem; }
input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    margin-top: 6px;
    padding: 14px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
}
input:focus, select:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}
.join input.join-code, .join input.agent-code, .gate input[type="text"] {
    letter-spacing: 0.18em;
    font-weight: 700;
    text-align: center;
    font-size: 1.25rem;
}
.join input.agent-code { font-size: 1.6rem; }
.join input.agent-code::placeholder {
    letter-spacing: 0.01em;
    font-weight: 500;
    font-size: 1rem;
    color: #9a9a9a;
}
.btn, button.btn, a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.wide { width: 100%; margin-top: 12px; }
.text-btn {
    background: none;
    border: 0;
    color: var(--accent);
    font: inherit;
    padding: 8px;
    cursor: pointer;
}
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.slots { border: 0; padding: 0; margin: 16px 0 8px; }
.slots legend { padding: 0; font-size: 0.9rem; }
.slot-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    border-radius: 16px;
    background: #fff;
    border: 2px solid #e5e5e5;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
}
.slot-card input { position: absolute; opacity: 0; pointer-events: none; }
.slot-card:has(input:checked), .slot-card:has(input:focus-visible) {
    border-color: var(--ink);
    outline: 3px solid var(--accent);
    background: var(--accent);
}
.site-footer {
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
    padding: 12px 16px calc(16px + var(--safe));
}
.site-footer a {
    color: #fff;
    font-weight: 600;
}
.heart {
    width: 14px;
    height: 14px;
    color: #ff4d6a;
    vertical-align: -2px;
}
.chrome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.72);
}
.chrome h1 { margin: 0; font-size: 1.1rem; }
.chrome-id { display: flex; align-items: center; gap: 10px; }
.badge {
    background: var(--accent);
    color: var(--ink);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 999px;
}
.progress {
    display: flex;
    gap: 4px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    padding: 4px 0 16px;
    scrollbar-width: none;
}
.progress::-webkit-scrollbar { display: none; }
.pip {
    flex: 1 1 0;
    min-width: 0;
    height: 6px;
    border-radius: 99px;
    background: #2a2a2a;
}
.pip i {
    display: none;
}
.pip.is-done { background: #8a7a00; }
.pip.is-now { background: var(--accent); min-width: 0; height: auto; padding: 6px 8px; }
.pip.is-now i {
    display: block;
    font-style: normal;
    font-size: 0.68rem;
    text-align: center;
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}
.flash {
    padding: 12px 14px;
    border-radius: 14px;
    margin: 8px 0 14px;
    font-weight: 600;
}
.flash.ok { background: #d8f0e2; color: #215c3c; }
.flash.error { background: #f8d8d2; color: #7a2d22; }
.dossier summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    gap: 2px;
    position: relative;
    padding-right: 28px;
}
.dossier summary::-webkit-details-marker { display: none; }
.dossier summary::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}
.dossier[open] summary::after {
    top: 22px;
    transform: rotate(225deg);
}
.dossier em { font-style: normal; color: var(--muted); font-size: 0.9rem; }
.dossier-hint {
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b5d00;
}
.dossier-hint .when-open { display: none; }
.dossier[open] .dossier-hint .when-open { display: inline; }
.dossier[open] .dossier-hint .when-closed { display: none; }
.dossier dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
}
.dossier dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.dossier dd { margin: 0; font-weight: 600; }
.callout {
    background: #fff;
    border: 1px solid #e6e6e6;
    color: #111;
    padding: 16px 18px;
    border-radius: 14px;
    font-size: 1.05rem;
    line-height: 1.55;
    font-weight: 650;
}
.evidence { margin: 16px 0 4px; }
.evidence > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.evidence > summary::marker,
.evidence > summary::-webkit-details-marker { content: ''; display: none; }
.evidence > summary::after {
    content: '';
    width: 9px;
    height: 9px;
    flex: none;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateX(-2px) rotate(-45deg);
    transition: transform 0.18s ease;
}
.evidence[open] > summary::after {
    transform: translateY(-2px) rotate(45deg);
}
.evidence .gallery,
.evidence .sms { margin-top: 12px; }
.evidence .zoom,
.doc-gallery .zoom { background: #fff; }
.evidence .zoom img,
.doc-gallery .zoom img {
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #fff;
}
.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.zoom {
    padding: 0;
    border: 0;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    min-height: 120px;
}
.zoom img { width: 100%; height: 140px; object-fit: cover; }
.videos { display: grid; gap: 12px; }
.video-frame { border-radius: 14px; overflow: hidden; background: #000; }
.video-frame iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.sms header { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.sms p {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 16px;
    margin: 6px 0;
}
.sms .them { background: #ececec; }
.sms .me { background: var(--accent); color: var(--ink); margin-left: auto; }
.email-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.email-subject { font-weight: 700; margin: 6px 0; }
.notebook { font-family: Fraunces, Georgia, serif; }
.notebook p { margin: 0 0 10px; border-bottom: 1px dashed #ddd; padding-bottom: 8px; }
.quiz-list { list-style: none; padding: 0; margin: 0; }
.quiz { margin: 10px 0; scroll-margin-top: 88px; }
.quiz-head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }
.quiz-prompt { font-weight: 650; margin: 0 0 10px; }
.quiz.is-wait { padding: 10px 16px; opacity: 0.55; }
.quiz.is-done details > summary {
    cursor: pointer;
    list-style: none;
    margin: 0;
}
.quiz.is-done details > summary::-webkit-details-marker { display: none; }
.quiz.is-done details > summary::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg) translateY(-2px);
    vertical-align: middle;
}
.quiz.is-done details[open] > summary::after {
    transform: rotate(225deg) translateY(-2px);
}
.quiz.is-done details > form { margin-top: 12px; }
.quiz .flash { margin-top: 10px; }
.choice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f6f6f6;
    margin: 6px 0;
    cursor: pointer;
}
.choice:has(input:checked), .choice.is-answer { outline: 2px solid var(--ink); background: var(--accent); }
.quiz.is-done .choice { cursor: default; }
.quiz.is-done input[type="text"]:disabled,
.quiz.is-done input[type="number"]:disabled,
.quiz.is-done select:disabled { background: var(--accent); color: var(--ink); font-weight: 700; }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suspect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suspect-card {
    display: grid;
    gap: 6px;
    align-content: start;
    text-align: left;
    padding: 10px;
    border: 0;
    border-radius: 18px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}
.suspect-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    background: #ececec;
}
.suspect-name { font-weight: 700; }
.suspect-role { color: var(--muted); font-size: 0.85rem; }
.dock {
    scroll-margin-top: 24px;
    position: static;
    z-index: auto;
    padding: 8px 0 12px;
    background: none;
    border-top: 0;
}
.dock .gate, .dock form, .end-card { max-width: 760px; margin: 0 auto; }
.dock .gate, .codes {
    background: var(--paper);
    color: var(--ink);
    border-radius: 18px;
    padding: 16px;
}
.between-codes { margin: 22px 0 8px; text-align: center; }
.between-codes form { margin-top: 16px; }
.share-label { font-weight: 700; margin: 0 0 4px; color: var(--accent); text-align: center; }
.dock .hint { text-align: center; }
.code-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0; }
.chip {
    min-width: 88px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 0;
    background: var(--accent);
    color: var(--ink);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
}
.empty, .end-card { text-align: center; padding: 28px 18px; }
.back-link { text-align: center; margin-top: 18px; }
.search-actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}
.search-actions form { margin: 0; }
.search-actions .btn.wide { margin-top: 0; }
.end-card p { line-height: 1.7; }
.admin-link { text-align: center; margin-top: 28px; }
.admin-link a { color: var(--muted); }
.table-wrap { max-width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--paper); color: var(--ink); border-radius: 16px; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid #e8e8e8; }
.log { font-size: 0.85rem; color: #cfcfcf; padding-left: 18px; }
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 48px 8px 24px;
    touch-action: none;
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
    position: absolute;
    z-index: 1;
    inset: 64px 56px 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox.is-zoomed img { cursor: grab; }
.lightbox.is-panning img { cursor: grabbing; }
.lightbox-close, .lightbox-nav {
    position: absolute;
    z-index: 2;
    background: rgba(255, 230, 9, 0.18);
    color: #fff;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
}
.lightbox-close { top: 12px; right: 12px; }
.lightbox-zoom {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    gap: 8px;
}
.lightbox-zoom button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: rgba(0, 0, 0, 0.72);
    color: var(--accent);
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.lightbox-zoom button:disabled {
    opacity: 0.35;
    cursor: default;
}
.lightbox-download {
    position: absolute;
    top: 14px;
    left: 12px;
    z-index: 2;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: rgba(0, 0, 0, 0.72);
    color: var(--accent);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }
.lightbox-count { position: absolute; z-index: 2; bottom: 10px; color: #cfcfcf; font-size: 0.85rem; }
.gallery-solo { grid-template-columns: 1fr; }
.gallery-solo .zoom img {
    height: auto;
    max-height: none;
    object-fit: contain;
}
@media (min-width: 720px) {
    .gallery { grid-template-columns: repeat(3, 1fr); }
    .gallery-solo { grid-template-columns: 1fr; }
    .dossier dl { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 719px) {
    body::before {
        background-size: auto min(52vh, 56.25vw);
    }
    .masthead .lang-switch {
        position: static;
        justify-content: flex-end;
        padding: 8px 12px 10px;
        background: #000;
    }
}
