/* styles for The Last Witness
   organized by scene â€” intro, introduction, white room, memory, choice, ending */

html {
    font-size: clamp(13px, 1.15vw, 17px);
}

   @font-face {
    font-family: 'Handwrite';
    src: url('handwrite.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='11' cy='11' r='8.5' fill='none' stroke='rgba(0,0,0,0.45)' stroke-width='3.5'/%3E%3Cline x1='17' y1='17' x2='25.5' y2='25.5' stroke='rgba(0,0,0,0.45)' stroke-width='4.5' stroke-linecap='round'/%3E%3Ccircle cx='11' cy='11' r='8' fill='rgba(200,169,110,0.15)' stroke='%23c8a96e' stroke-width='2'/%3E%3Ccircle cx='8' cy='8' r='1.8' fill='rgba(255,255,255,0.38)'/%3E%3Cline x1='17' y1='17' x2='25' y2='25' stroke='%23c8a96e' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 11 11, crosshair !important;
}

body {
    background: #0a0a0a;
    color: #e8dcc8;
    font-family: 'Handwrite', 'Georgia', serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='11' cy='11' r='8.5' fill='none' stroke='rgba(0,0,0,0.45)' stroke-width='3.5'/%3E%3Cline x1='17' y1='17' x2='25.5' y2='25.5' stroke='rgba(0,0,0,0.45)' stroke-width='4.5' stroke-linecap='round'/%3E%3Ccircle cx='11' cy='11' r='8' fill='rgba(200,169,110,0.15)' stroke='%23c8a96e' stroke-width='2'/%3E%3Ccircle cx='8' cy='8' r='1.8' fill='rgba(255,255,255,0.38)'/%3E%3Cline x1='17' y1='17' x2='25' y2='25' stroke='%23c8a96e' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 11 11, crosshair;
}

/* animated grain overlay — sits above everything, pointer-events off */
body::before {
    content: '';
    position: fixed;
    inset: -50%;
    z-index: 9999;
    pointer-events: none;
    width: 200%;
    height: 200%;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: grain-shift 0.85s steps(2) infinite;
}

@keyframes grain-shift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(5%, 8%); }
    50%  { transform: translate(-7%, 3%); }
    75%  { transform: translate(9%, -5%); }
    100% { transform: translate(0, 0); }
}

/* every scene sits stacked on top of each other, only the active one shows */
.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.scene.active {
    opacity: 1;
    pointer-events: all;
}

.scene-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}


/* quick hide class â€” used all over the place in game.js */
.hidden {
    display: none !important;
}

/* â”€â”€ 01 Â· INTRO â€” the title card â”€â”€ */
#scene-intro .scene-bg {
    background-color: #0e0c0a;
    background-image: url('asset/intro.png');
    filter: brightness(0.5);
}

.intro-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.game-eyebrow {
    font-size: 0.7em;
    letter-spacing: 0.6em;
    color: #b89772;
    text-transform: uppercase;
    margin-bottom: 1.2em;
}

.game-title {
    font-size: 4.8em;
    letter-spacing: 0.12em;
    color: #c8a96e;
    text-transform: uppercase;
    text-shadow: 0 0 80px rgba(200, 169, 110, 0.3);
    line-height: 1.05;
    opacity: 0;
    animation: fadeUp 1.6s ease 0.4s forwards;
}

.start-btn {
    margin-top: 3.8em;
    padding: 0.9em 3.4em;
    background: transparent;
    border: 1px solid rgba(200, 169, 110, 0.4);
    color: #c8a96e;
    font-family: 'Handwrite', 'Georgia', serif;
    font-size: 0.82em;
    letter-spacing: 0.45em;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.35s;
    opacity: 0;
    animation: fadeUp 1s ease 1.4s forwards;
    border-radius: 4px;
}

.start-btn:hover {
    background: rgba(200, 169, 110, 0.07);
    border-color: #c8a96e;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* â”€â”€ 02 Â· INTRODUCTION â”€â”€ */
#scene-introduction .scene-bg {
    background-image: url('asset/intro.png');
    filter: brightness(0.3) saturate(0.5);
}

.introduction-body {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 12vw;
    max-width: 900px;
}

.introduction-page-num {
    font-size: 0.65em;
    letter-spacing: 0.55em;
    color: #e9b357;
    text-transform: uppercase;
    margin-bottom: 2em;
}

.introduction-page {
    background-color: rgba(95, 95, 95, 0.65);
    padding: 1.25em 1.5em 1.5em;
    border-radius: 1em;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    max-height: 82vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.introduction-page::-webkit-scrollbar {
    display: none;
}

.introduction-title {
    font-size: 1.55em;
    color: #ffffff;
    letter-spacing: 0.06em;
    line-height: 1.3;
    margin-bottom: 1em;
    font-weight: normal;
}

.introduction-text {
    font-size: 1.1em;
    color: #dad6d1;
    line-height: 1.75;
    white-space: pre-line;
}

.introduction-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25em;
    padding-top: 0;
    gap: 0.75em;
}

.introduction-nav.introduction-nav-first-only {
    justify-content: flex-end;
}

.introduction-nav.introduction-nav-first-only .introduction-nav-prev {
    display: none !important;
}

.introduction-nav-btn {
    margin: 0;
    padding: 0.35em 0.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 0;
    color: #c8a96e;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.08em;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0.9;
    transition: color 0.2s, opacity 0.2s;
}

.introduction-nav-btn:hover:not(:disabled) {
    color: #e9c97a;
    opacity: 1;
}

.introduction-nav-btn:disabled {
    opacity: 0.22;
    cursor: not-allowed;
}

.introduction-nav-next {
    animation: introduction-next-glow 2.1s ease-in-out infinite;
}

.introduction-nav-next:hover:not(:disabled) {
    animation-play-state: paused;
}

.introduction-nav-next.introduction-nav-finish {
    letter-spacing: 0.1em;
}

@keyframes introduction-next-glow {
    0%, 100% {
        color: #c8a96e;
        opacity: 0.9;
        text-shadow: 0 0 0 rgba(233, 201, 122, 0);
    }
    50% {
        color: #f2d591;
        opacity: 1;
        text-shadow: 0 0 10px rgba(233, 201, 122, 0.5);
    }
}

.introduction-keyboard-hint {
    font-size: 0.58em;
    letter-spacing: 0.35em;
    color: rgba(200, 169, 110, 0.38);
    text-transform: uppercase;
    text-align: right;
    margin-top: 0.55em;
}

.intro-scroll-hint {
    position: sticky;
    bottom: 0.6em;
    font-size: 0.6em;
    letter-spacing: 0.4em;
    color: rgba(200, 169, 110, 0.75);
    text-transform: uppercase;
    text-align: center;
    margin-top: 0.5em;
    pointer-events: none;
    animation: intro-scroll-pulse 1.8s ease-in-out infinite;
}

@keyframes intro-scroll-pulse {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50%       { opacity: 1;   transform: translateY(3px); }
}

/* â”€â”€ 03 Â· WHITE ROOM â”€â”€ */
#scene-investigation .scene-bg {
    background-color: #d8d4ce;
    background-image: url('asset/investigator.png');
    filter: none;
}

.investigation-ui {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.top-bar {
    padding: 1.6em 2.4em;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.1em;
}

.location-label {
    font-size: 0.67em;
    letter-spacing: 0.5em;
    color: #5a4a38;
    text-transform: uppercase;
    margin-bottom: 0.3em;
}

.case-name {
    font-size: 1.2em;
    color: #c8a96e;
    letter-spacing: 0.08em;
}

/* speaker row — just the label now */
.dialogue-panel-top {
    margin-bottom: 0.5em;
}

.dialogue-panel-top .dialogue-speaker {
    margin-bottom: 0;
}

/* case file wrapper — absolutely pinned inside the textbox, scales with panel height */
.case-file-wrapper {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35em;
    margin-left: 4.5em;
    margin-bottom: -1.5em;
    width: fit-content;
}

.case-file-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transform-origin: center;
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
    line-height: 0;
}

.case-file-btn-image {
    display: block;
    width: clamp(44px, 3.8vw, 62px);
    height: auto;
}

.case-file-btn:hover {
    transform: scale(1.25);
    filter: brightness(1.15);
}

.case-file-btn:active,
.case-file-btn.is-open {
    transform: scale(1.25);
    filter: brightness(1.1);
}

/* locked state — dim, not openable but still intercepts clicks so they don't pass through */
.case-file-btn.locked {
    opacity: 0.25;
    filter: grayscale(0.55);
    cursor: default;
}

/* hint glow — pulses when "Feel free to pick them up" line is shown */
@keyframes folderHintGlow {
    0%, 100% { opacity: 0.28; filter: grayscale(0.55); }
    50%       { opacity: 0.85; filter: grayscale(0) brightness(1.2) drop-shadow(0 0 12px rgba(220,40,40,0.85)); }
}

.case-file-btn.hint-pulse {
    animation: folderHintGlow 1.8s ease-in-out infinite;
}

/* scan hint label below the folder */
.case-file-scan-hint {
    display: block;
    text-align: center;
    font-size: 0.5em;
    letter-spacing: 0.22em;
    color: #6a5640;
    text-transform: uppercase;
    line-height: 1.7;
    opacity: 0;
    transition: opacity 0.45s;
    pointer-events: none;
}

.case-file-scan-hint.show {
    opacity: 1;
    animation: scanHintPulse 2s ease-in-out infinite;
}

@keyframes scanHintPulse {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 1; }
}

@keyframes folderUnlockFlash {
    0%   { opacity: 0.28; filter: grayscale(0.55); }
    35%  { opacity: 1;    filter: brightness(1.9) saturate(1.3) drop-shadow(0 0 14px rgba(200, 169, 110, 0.85)); }
    70%  { filter: brightness(1.1) drop-shadow(0 0 5px rgba(200, 169, 110, 0.35)); }
    100% { opacity: 1;    filter: brightness(1); }
}

.conn-status {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding-top: 0.35em;
}


.conn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2a1a10;
    transition: all 0.4s;
}

.conn-dot.on {
    background: #6a9a6a;
    box-shadow: 0 0 4px #6a9a6a;
}

.conn-text {
    font-size: 0.6em;
    letter-spacing: 0.3em;
    color: #2a1a10;
    text-transform: uppercase;
}

.inv-spacer {
    flex: 1;
}

/* investigator dialogue panel */
.inv-dialogue {
    width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.inv-dialogue.visible {
    opacity: 1;
    transform: translateY(0);
}

.inv-dialogue .dialogue-panel {
    background: url('asset/textbox.png') center / 100% 100% no-repeat;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    margin: 0 0.8em 0.8em;
    width: calc(100% - 2.4em);
    min-height: 33vh;
    padding: 5.5em 5.2em 2.8em 6em;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.inv-dialogue .dialogue-panel .dialogue-hint {
    margin-top: auto;
    padding-top: 0.6em;
}

.inv-dialogue .dialogue-panel .dialogue-speaker {
    color: #5a4a38;
}

.inv-dialogue .dialogue-panel .dialogue-text {
    color: #2f2f2f;
}

.inv-dialogue .dialogue-panel .dialogue-hint {
    color: #6f6253;
}

.inv-choice-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.45em;
    margin-top: 1.1em;
    padding-top: 0.9em;
    border-top: 1px solid rgba(90, 74, 56, 0.18);
}

.inv-choice-prompt {
    font-size: 0.9em;
    color: #5a4a38;
    letter-spacing: 0.04em;
    margin-bottom: 0.1em;
}

.inv-choice-btn {
    display: block;
    width: 100%;
    padding: 0.65em 1em 0.65em 1.1em;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.5;
    text-align: left;
    color: #3a2a18;
    background: rgba(255, 253, 248, 0.55);
    border: none;
    border-left: 2px solid rgba(90, 74, 56, 0.28);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, padding-left 0.18s;
    letter-spacing: 0.01em;
}

.inv-choice-btn:hover {
    background: rgba(255, 253, 248, 0.82);
    border-left-color: rgba(90, 74, 56, 0.55);
    padding-left: 1.45em;
}

.dialogue-panel {
    position: relative;
    width: 100%;
    padding: 2em 4.5em 1.8em;
    background: rgba(8, 6, 4, 0.78);
    border-top: 1px solid rgba(200, 169, 110, 0.08);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    cursor: pointer;
}

.dialogue-speaker {
    font-size: 0.92em;
    letter-spacing: 0.55em;
    color: #c8a96e;
    text-transform: uppercase;
    margin-bottom: 0.6em;
}

.dialogue-text {
    font-size: 1.46em;
    line-height: 1.72;
    color: #ddd0bc;
    min-height: 2em;
    text-shadow: 0 0 18px rgba(220, 200, 170, 0.12);
}

.dialogue-hint {
    display: block;
    text-align: left;
    font-size: 0.7em;
    letter-spacing: 0.32em;
    color: #4a3828;
    text-transform: uppercase;
    margin-top: 1.2em;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.dialogue-hint.show {
    opacity: 1;
    animation: blink 2.4s ease-in-out infinite;
}

.dialogue-hint.dim {
    opacity: 0;
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}


/* dev panel â€” bottom left, for testing without hardware */
.dev-obj-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 5;
    transition: filter 0.2s ease;
}

.dev-obj-visual.glow {
    filter: drop-shadow(0 0 12px rgba(255, 220, 120, 0.9));
}

.dev-obj-hit {
    position: absolute;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 15;
    outline: none;
}

/* â”€â”€ MEMORY OVERLAY â”€â”€ */

/* â”€â”€ 04 Â· CHOICE â”€â”€ */
#scene-choice .scene-bg {
    background-color: #060606;
    background-image: url('asset/investigator.png');
    filter: brightness(0.2) saturate(0.25);
}

.choice-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3em;
}

.choice-eyebrow {
    font-size: 0.65em;
    letter-spacing: 0.65em;
    color: #3a2e1e;
    text-transform: uppercase;
    margin-bottom: 1.4em;
}

.choice-question {
    font-size: 1.55em;
    color: #e8dcc8;
    letter-spacing: 0.04em;
    line-height: 1.6;
    max-width: 500px;
    margin-bottom: 3em;
}

.choice-buttons {
    display: flex;
    gap: 1.8em;
}

.choice-btn {
    padding: 1em 2.8em;
    background: transparent;
    font-family: 'Handwrite', 'Georgia', serif;
    font-size: 0.8em;
    letter-spacing: 0.4em;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    border-radius: 4px;
}

.choice-btn.comply {
    border: 1px solid rgba(200, 169, 110, 0.4);
    color: #c8a96e;
}

.choice-btn.comply:hover {
    background: rgba(200, 169, 110, 0.07);
    border-color: #c8a96e;
}

.choice-btn.resist {
    border: 1px solid rgba(140, 140, 140, 0.25);
    color: #787878;
}

.choice-btn.resist:hover {
    border-color: #aaa;
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
}

.choice-subtext {
    font-size: 0.65em;
    color: #2a2018;
    letter-spacing: 0.3em;
    margin-top: 2.5em;
    text-transform: uppercase;
}

/* -- 05 · ENDINGS -- */
#scene-ending-comply,
#scene-ending-resist {
    overflow-y: auto;
}

#scene-ending-comply .scene-bg,
#scene-ending-resist .scene-bg {
    background-image: url('asset/intro.png');
    filter: brightness(0.5);
    position: fixed;
}

.ending-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 8vh 8vw 7vh;
    gap: 2.5em;
}

.ending-testimony {
    max-width: 560px;
    width: 100%;
    text-align: center;
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.ending-testimony.dismissed {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* cinematic truth lines — typed out on intro.png before the report */
.truth-lines {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    margin-bottom: 1.8em;
    text-align: left;
    width: 100%;
    max-width: 560px;
}

.truth-line {
    font-size: 1.65em;
    color: rgba(252, 244, 225, 0.95);
    line-height: 2.0;
    letter-spacing: 0.03em;
    opacity: 0;
    animation: lineAppear 0.5s ease forwards;
    text-shadow: 0 1px 12px rgba(0,0,0,0.7), 0 0 32px rgba(0,0,0,0.45);
    transition: color 0.8s ease, text-shadow 0.8s ease, opacity 0.8s ease;
}

.truth-line.current {
    color: rgba(255, 250, 235, 1);
    text-shadow: 0 0 22px rgba(230, 210, 160, 0.3), 0 1px 12px rgba(0,0,0,0.7);
}

.truth-line.dimmed {
    color: rgba(252, 244, 225, 0.3);
    text-shadow: none;
}

/* ending title fades in after truth lines finish */
.ending-title {
    font-size: 1.55em;
    color: #c8a96e;
    letter-spacing: 0.14em;
    margin-bottom: 1.8em;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.9s ease;
}

.ending-title.visible {
    opacity: 1;
}

#scene-ending-resist .ending-title {
    color: #6a7a8a;
}

.ending-lines {
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    width: 100%;
}

.ending-line {
    font-size: 1.38em;
    color: #f0e8d8;
    line-height: 1.95;
    letter-spacing: 0.03em;
    opacity: 0;
    animation: lineAppear 0.6s ease forwards;
}

.ending-line:nth-child(3n) {
    margin-bottom: 0.5em;
}

@keyframes lineAppear {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* reveal button — appears after testimony, triggers case report */
.reveal-btn {
    display: block;
    margin-top: 2.2em;
    padding: 0.78em 2.4em;
    background: transparent;
    border: 1px solid rgba(200, 169, 110, 0.55);
    color: rgba(230, 210, 165, 0.95);
    font-family: 'Handwrite', 'Georgia', serif;
    font-size: 0.82em;
    letter-spacing: 0.28em;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 3px;
    opacity: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
    transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.reveal-btn:hover {
    border-color: rgba(200, 169, 110, 0.9);
    color: rgba(220, 196, 145, 1);
    background: rgba(200, 169, 110, 0.07);
}

@keyframes revealPulse {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 20px rgba(200, 169, 110, 0.3), 0 0 6px rgba(200, 169, 110, 0.18); }
}


/* -- ENDING REPORT — full paper pinned to wall -- */
.ending-report {
    position: relative;
    width: min(620px, 88vw);
    overflow: visible; /* lets the pin stick out above */

    /* aged paper — layered gradients simulate wrinkles, stains, folds */
    background-color: #eedfc0;
    background-image:
        /* horizontal crease line roughly 40% down */
        linear-gradient(180deg,
            transparent 39%,
            rgba(140,100,40,0.07) 39.5%,
            rgba(255,255,255,0.06) 40%,
            transparent 40.5%
        ),
        /* diagonal shadow wrinkle */
        linear-gradient(157deg,
            transparent 58%,
            rgba(0,0,0,0.035) 59%,
            transparent 60.5%
        ),
        /* second faint wrinkle */
        linear-gradient(171deg,
            transparent 72%,
            rgba(0,0,0,0.025) 73%,
            transparent 74%
        ),
        /* top-left worn corner */
        radial-gradient(ellipse at 0% 0%, rgba(120,80,20,0.14) 0%, transparent 55%),
        /* bottom-right corner darkening */
        radial-gradient(ellipse at 100% 100%, rgba(110,70,20,0.1) 0%, transparent 50%),
        /* overall aged paper gradient */
        linear-gradient(145deg, #f5e8c8 0%, #e8d5a8 35%, #f0e0b8 65%, #e2cc9a 100%);

    border: none;
    border-radius: 1px;

    /* paper pinned to wall: tight shadow at top (pin point), long drooping shadow below */
    box-shadow:
        0 1px 2px rgba(0,0,0,0.08),
        1px 5px 14px rgba(0,0,0,0.28),
        4px 16px 40px rgba(0,0,0,0.26),
        10px 32px 70px rgba(0,0,0,0.2),
        inset 0 2px 12px rgba(0,0,0,0.06),
        inset 4px 0 10px rgba(0,0,0,0.03),
        inset -4px 0 10px rgba(0,0,0,0.03);

    /* slight tilt — rotates from the pin point at top-center */
    transform: rotate(-1.8deg) translateY(22px);
    transform-origin: 50% 0%;

    padding: 3em 3.2em 2.8em;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82em;
    color: #1a1208;
    line-height: 1.65;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.85s ease, transform 1s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.ending-report.revealed {
    opacity: 1;
    transform: rotate(-1.8deg) translateY(0);
    pointer-events: all;
}

/* thumbtack pin — absolutely positioned above the paper */
.report-pin {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #e87878 0%, #a02020 52%, #5c0808 100%);
    box-shadow:
        0 3px 8px rgba(0,0,0,0.7),
        0 0 0 2px rgba(60,8,8,0.45),
        inset 0 1px 3px rgba(255,200,200,0.38);
    z-index: 10;
}

/* pin highlight (specular glint) */
.report-pin::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 6px;
    width: 5px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,230,230,0.55);
    transform: rotate(-20deg);
}

.report-title {
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-align: center;
    padding-bottom: 0.55em;
    border-bottom: 1px solid rgba(100, 70, 30, 0.3);
    margin-bottom: 0.5em;
    color: #1a0e06;
}

.report-subtitle {
    font-size: 0.88em;
    text-align: center;
    color: #5a4228;
    letter-spacing: 0.04em;
    margin-bottom: 0.3em;
}

.report-meta {
    font-size: 0.85em;
    color: #5a4228;
    margin-bottom: 0.8em;
    display: flex;
    flex-direction: column;
    gap: 0.1em;
}

.report-divider {
    border-top: 1px solid rgba(100, 70, 30, 0.25);
    margin: 0.8em 0;
}

.report-section {
    margin-bottom: 0.7em;
}

.report-section-title {
    font-size: 0.88em;
    font-weight: bold;
    letter-spacing: 0.12em;
    color: #1e1206;
    margin-bottom: 0.3em;
}

.report-row {
    display: flex;
    gap: 0.6em;
    font-size: 0.94em;
    color: #261a0c;
    margin-bottom: 0.18em;
    line-height: 1.5;
}

.report-row .check   { color: #2d6e2d; font-weight: bold; }
.report-row .cross   { color: #8b1a1a; font-weight: bold; }
.report-row .unknown { color: #6a5220; }

.report-text {
    font-size: 0.94em;
    color: #261a0c;
    line-height: 1.6;
    white-space: pre-line;
}

.report-conclusion-lines {
    display: flex;
    flex-direction: column;
    gap: 0.08em;
}

.report-conclusion-line {
    font-size: 0.96em;
    color: #2a1a0a;
    line-height: 1.75;
    font-style: italic;
    letter-spacing: 0.01em;
}

.report-stamp-wrap {
    text-align: center;
    margin-top: 1.4em;
    padding-top: 0.4em;
}

/* worn rubber-stamp look: slightly rough border, faded opacity */
.report-stamp {
    display: inline-block;
    padding: 0.45em 1.3em;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 0.16em;
    border: 3px solid;
    background: transparent;
    font-family: 'Handwrite', 'Georgia', serif;
    transform: rotate(-5deg);
    line-height: 1.4;
    text-align: center;
    opacity: 0.78;
    filter: blur(0.35px);
    cursor: pointer;
    transition: opacity 0.25s, filter 0.25s, transform 0.25s;
}

.report-stamp:hover {
    opacity: 1;
    filter: blur(0px);
    transform: rotate(-5deg) scale(1.06);
}

.stamp-closed {
    color: #8b1212;
    border-color: #8b1212;
    text-shadow: 1px 1px 0 rgba(139,18,18,0.18);
}

.stamp-open {
    color: #1e3d5c;
    border-color: #1e3d5c;
    text-shadow: 1px 1px 0 rgba(30,61,92,0.18);
}

/* â”€â”€ MEMORY OVERLAY â”€â”€ */
.memory-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    cursor: pointer;
}

.memory-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.memory-overlay-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

/* warm sepia wash + vignette */
.memory-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: none;
    pointer-events: none;
}

.memory-overlay-close {
    position: absolute;
    top: 1.4em;
    right: 1.6em;
    z-index: 20;
    background: transparent;
    border: none;
    color: #1a1a1a;
    font-family: 'Handwrite', 'Georgia', serif;
    font-size: 1em;
    cursor: pointer;
    transition: color 0.25s;
    padding: 0.3em 0.5em;
}

.memory-overlay-close:hover {
    color: rgba(232, 220, 200, 0.75);
}

.memory-overlay-content {
    position: absolute;
    z-index: 10;
    left: 14vw;
    top: 50%;
    transform: translateY(-50%);
    max-width: 480px;
}

.memory-overlay-time {
    font-size: 0.6em;
    letter-spacing: 0.7em;
    color: #1a1a1a;
    text-transform: uppercase;
    margin-bottom: 1.4em;
}

.memory-overlay-lines {
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    min-height: 8em;
}

.memory-overlay-line {
    font-size: 1.38em;
    color: #1a1a1a;
    line-height: 1.9;
    letter-spacing: 0.03em;
    opacity: 0;
    animation: lineAppear 0.6s ease forwards;
    transition: color 0.8s ease, opacity 0.8s ease;
}

.memory-overlay-line.current {
    color: #1a1a1a;
}

.memory-overlay-line.dimmed {
    color: rgba(26, 26, 26, 0.3);
}

.memory-overlay-line:nth-child(3n) {
    margin-bottom: 0.6em;
}

.memory-overlay-hint {
    display: block;
    font-size: 0.6em;
    letter-spacing: 0.5em;
    color: #1a1a1a;
    text-transform: uppercase;
    margin-top: 2em;
    opacity: 0;
    transition: opacity 0.4s;
    animation: blink 2.2s ease-in-out infinite;
}

.memory-overlay-hint.show {
    opacity: 1;
}

.case-file-modal {
    position: fixed;
    inset: 0;
    z-index: 640;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2em;
}

.case-file-panel {
    position: relative;
    width: min(900px, 90vw);
    height: min(620px, 84vh);
    overflow: hidden;
    z-index: 650;
    background: url('asset/documentary.png') center / cover no-repeat;
    border: 1px solid rgba(200, 169, 110, 0.25);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.case-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85em 1em 0.65em;
    border-bottom: 1px solid rgba(200, 169, 110, 0.18);
}

.case-file-title {
    font-size: 0.64em;
    letter-spacing: 0.35em;
    color: #c8a96e;
    text-transform: uppercase;
}

.case-file-close {
    background: transparent;
    border: none;
    color: rgba(232, 220, 200, 0.6);
    cursor: pointer;
    font-size: 0.95em;
    padding: 0.2em 0.4em;
}

.case-file-close:hover {
    color: rgba(232, 220, 200, 0.95);
}

.case-file-list {
    position: relative;
    display: block;
    padding: 0.8em;
    height: 100%;
    overflow: hidden;
}

.case-file-stage {
    position: relative;
    width: 100%;
    height: 100%;
}

.case-file-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.2em;
    object-fit: contain;
    border: none;
    pointer-events: none;
}

.case-file-hitbox {
    position: absolute;
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* â”€â”€ GLOBAL OVERLAYS â”€â”€ */
.fade-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 900;
    transition: opacity 0.8s ease;
}

.fade-overlay.active {
    opacity: 1;
    pointer-events: all;
}

