:root {
    --win-bg: #050505;
    --win-gray: #c0c0c0;
    --win-blue: #4a0000; 
    --win-border-light: #dfdfdf;
    --win-border-dark: #404040;
}

body {
    background-color: var(--win-bg);
    background-image: url("../images/personnages/hamsterskelett.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
    background-attachment: fixed;
    font-family: "MS Sans Serif", "Tahoma", sans-serif;
    margin: 0;
    overflow: hidden;
    height: 100vh;
    image-rendering: pixelated;
    color: #ccc;
}

/* Shutdown */
#shutdown-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: black;
    z-index: 9999;
    display: none;
    color: #800000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    padding: 20px;
}

.glitch-text {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px #ff0000;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    50% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Scanlines */
.pixel-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.08), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.08));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 999;
}

/* Win95 Base */
.win95-outset {
    border: 2px solid;
    border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
    background-color: var(--win-gray);
    color: black;
}

.win95-inset {
    border: 2px solid;
    border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
    background: #fff;
    padding: 5px;
    color: black;
}

.window {
    position: absolute;
    z-index: 10;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.9);
    display: none; 
}

.title-bar {
    background: linear-gradient(90deg, var(--win-blue), #000000);
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    font-weight: bold;
    font-size: 12px;
}

.title-bar-controls button {
    width: 16px; height: 14px; font-size: 10px; line-height: 1; padding: 0; margin-left: 2px;
    background-color: var(--win-gray); border: 1px solid;
    border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
    color: black;
}

.window-body {
    padding: 8px;
    max-height: 600px;
    overflow-y: auto;
    font-size: 13px;
}

/* Desktop */
.desktop-icon {
    width: 90px; margin: 15px; text-align: center; color: white; font-size: 11px; cursor: pointer; text-shadow: 2px 2px 2px black;
}

.sticky-note {
    position: absolute; top: 20px; right: 20px;
    width: 150px; background: #ffff88; padding: 10px;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.5);
    color: #333; font-family: 'Comic Sans MS', cursive;
    transform: rotate(2deg); z-index: 5; border: 1px solid #ddd;
}

/* Taskbar */
.taskbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 35px; background-color: var(--win-gray);
    border-top: 2px solid var(--win-border-light);
    display: flex; align-items: center; padding: 2px 5px; z-index: 1000;
}

.start-button {
    font-weight: bold; display: flex; align-items: center; gap: 5px;
    padding: 2px 8px; border: 2px solid;
    border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
    color: black; cursor: pointer;
}

.start-menu {
    position: absolute; bottom: 35px; left: 0; width: 200px;
    background: var(--win-gray); border: 2px solid;
    border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
    display: none; flex-direction: column; z-index: 1001;
}

.start-menu-item { padding: 5px 10px; font-size: 12px; cursor: pointer; color: black; }
.start-menu-item:hover { background: var(--win-blue); color: white; }

.clock {
    margin-left: auto; border: 2px solid;
    border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
    padding: 2px 10px; font-size: 12px; color: black;
}

.taskbar-windows {
    display: flex; gap: 3px; margin-left: 8px;
    flex: 1; overflow-x: auto; overflow-y: hidden;
}
.taskbar-win-btn {
    padding: 2px 8px; font-size: 10px; max-width: 140px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border: 2px solid;
    border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
    background: var(--win-gray); color: black; cursor: pointer;
}
.taskbar-win-btn:hover { background: #d0d0d0; }

/* Stress Bar */
.blood-text { color: #800000; font-weight: bold; }

.stress-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    width: 200px; z-index: 1000; text-align: center;
}
.stress-bar-outer { width: 100%; height: 15px; background: #444; border: 2px solid var(--win-border-light); }
#stress-bar-inner { width: 0%; height: 100%; background: #f00; transition: width 0.3s; }
.heart-icon { display: inline-block; color: red; animation: heart-beat 1s infinite; }
@keyframes heart-beat { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Browser */
.browser-toolbar { display: flex; gap: 5px; padding: 4px; border-bottom: 1px solid #888; }
.browser-btn { padding: 2px 8px; font-size: 10px; border: 1px solid #888; background: #eee; }
.history-sidebar { width: 140px; border-right: 2px solid var(--win-border-dark); background: #d4d0c8; font-size: 11px; padding: 5px; }
.history-item { padding: 4px; cursor: pointer; color: blue; text-decoration: underline; margin-bottom: 8px; display: block; }
.history-item:hover { color: red; }

/* Files */
.file-icon { display: flex; flex-direction: column; align-items: center; width: 80px; cursor: pointer; padding: 5px; }
.file-icon:hover { background: rgba(0,0,128,0.1); outline: 1px dotted black; }

/* Radar */
#radar-canvas { background: #001100; border: 2px solid #004400; display: block; margin: 0 auto; }
.radar-status { color: #0f0; font-family: monospace; font-size: 10px; text-align: center; margin-top: 5px; }

/* Misc */
.emergency { animation: blink 0.5s infinite; color: red; font-weight: bold; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }

#password-dialog { width: 280px; top: 50%; left: 50%; transform: translate(-50%, -50%); display: none; }

/* Dossier Police */
.police-folder {
    background: #d4ac0d; border-radius: 0 15px 5px 5px;
    padding: 25px 15px 15px 15px; position: relative;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5); margin-top: 15px;
}
.folder-tab {
    position: absolute; top: -15px; left: 0; width: 120px; height: 15px;
    background: #d4ac0d; border-radius: 5px 15px 0 0;
    font-size: 9px; padding-left: 10px; color: rgba(0,0,0,0.5); font-weight: bold;
}
.report-paper {
    background: #fdfdfd; box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    padding: 30px; height: 100%; overflow-y: auto;
    font-family: 'Courier New', Courier, monospace; color: #1a1a1a; border: 1px solid #ccc;
}
.stamp {
    border: 3px solid #8b0000; color: #8b0000; font-weight: bold;
    display: inline-block; padding: 5px; transform: rotate(-10deg);
    opacity: 0.8; text-transform: uppercase;
}

/* Phone / Visiophone */
.phone-contact { padding: 8px; border-bottom: 1px solid #ccc; cursor: pointer; }
.phone-contact:hover { background: #eee; }

.visiophone-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999; display: none;
}

.visiophone-container {
    position: fixed; bottom: 50px; left: 50%; transform: translateX(-50%);
    width: 95%; max-width: 850px;
    background: #2c2c2c; border: 6px solid #1a1a1a; border-top: 4px solid #444; border-left: 4px solid #444;
    padding: 15px; display: none; flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8); z-index: 2000;
}

.phone-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; background: #1a1a1a; padding: 5px 10px; border: 2px inset #333;
}

.led { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.led-red { background: #600; box-shadow: 0 0 5px #f00; animation: blink 1s infinite; }
.led-green { background: #060; }
.led-active { background: #0f0; box-shadow: 0 0 8px #0f0; }

.visiophone-main {
    display: flex; gap: 20px;
    background: #2a3d2a; border: 8px solid #1a1a1a; padding: 20px; position: relative;
}
.visiophone-main.reversed { flex-direction: row-reverse; }
.visiophone-main::after {
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.1) 50%);
    background-size: 100% 2px; pointer-events: none;
}

.mobile-rotate-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    color: #ffffff;
    z-index: 9999;
    padding: 20px;
    text-align: center;
}

.mobile-rotate-panel {
    max-width: 420px;
    width: 100%;
    border: 2px solid #5c5cff;
    background: rgba(10, 10, 10, 0.98);
    padding: 28px 24px;
    border-radius: 18px;
    box-shadow: 0 0 45px rgba(0, 0, 0, 0.65);
}

.mobile-rotate-title {
    font-size: 1.5rem;
    margin-bottom: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.mobile-rotate-text {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 22px;
    color: #d1d1ff;
}

.mobile-rotate-button {
    background: #5c5cff;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mobile-rotate-button:hover {
    background: #7f8dff;
}

.phone-portrait {
    width: 140px;
    height: 140px;
    border: 4px solid #1a1a1a;
    background: #000;
    flex-shrink: 0;
    /* on retire le filtre sépia, ça rend pas trop bien */
    /* filter: sepia(1) hue-rotate(60deg) contrast(1.5); */
    image-rendering: pixelated;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.phone-portrait img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }

.phone-content {
    flex: 1; font-family: 'Courier New', Courier, monospace;
    color: #82b382; text-shadow: 0 0 5px rgba(130,179,130,0.5);
}
.phone-name { font-size: 14px; font-weight: bold; margin-bottom: 10px; border-bottom: 1px solid #82b382; padding-bottom: 5px; }
.phone-text { font-size: 18px; line-height: 1.3; min-height: 4em; }

.phone-footer { margin-top: 15px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.phone-choice-btn {
    background: #1a1a1a; border: 2px outset #444; color: #888;
    padding: 8px 15px; font-size: 12px; cursor: pointer; text-transform: uppercase;
}
.phone-choice-btn:hover { background: #333; color: #fff; border-style: inset; }
.phone-hangup-btn {
    background: #1a1a1a; border: 2px outset #444; color: #600;
    padding: 8px 15px; font-size: 12px; cursor: pointer; text-transform: uppercase;
    letter-spacing: 2px;
}
.phone-hangup-btn:hover { background: #300; color: #f00; border-style: inset; }

/* Dialogue / Interrogatoire */
.chat-container {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: "Lucida Console", "Monaco", monospace;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}
.chat-header {
    background: #1a1a1a;
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    font-weight: bold;
    font-size: 10px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.status-dot {
    width: 6px; height: 6px;
    background: #fff; border-radius: 50%;
    opacity: 0.8; animation: status-blink 1.5s infinite;
}
@keyframes status-blink {
    0% { opacity: 0.2; } 50% { opacity: 0.8; } 100% { opacity: 0.2; }
}
.chat-body {
    flex: 1; display: flex; padding: 20px; overflow: hidden; background: #080808;
}
.chat-avatar-container { position: relative; margin-right: 20px; flex-shrink: 0; align-self: flex-start; }
    .chat-avatar {
        width: 100px;
        height: 100px;
        border: 1px solid #333;
        background: #000;
        image-rendering: pixelated;
        /* filter: grayscale(1) contrast(1.2); */
        padding: 2px;
    }
.teeth-collect-btn {
    position: absolute; bottom: -8px; right: -8px;
    width: 28px; height: 28px; font-size: 16px;
    background: #1a1a1a; border: 1px solid #444;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; padding: 0; line-height: 1;
}
.teeth-collect-btn:hover { background: #333; border-color: #888; transform: scale(1.15); }
.chat-bubble {
    flex: 1; font-size: 12px; line-height: 1.6; color: #d1d1d1;
    overflow-y: auto; max-height: 200px;
}
.chat-bubble::-webkit-scrollbar { width: 8px; }
.chat-bubble::-webkit-scrollbar-track { background: #111; }
.chat-bubble::-webkit-scrollbar-thumb { background: #444; border: 1px solid #222; }
.chat-bubble::-webkit-scrollbar-thumb:hover { background: #666; }
.chat-options {
    background: #111; border-top: 1px solid #222;
    padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.chat-option-btn {
    background: transparent; color: #777; border: 1px solid transparent;
    text-align: left; padding: 5px 10px; cursor: pointer;
    font-size: 10px; transition: all 0.2s; text-transform: uppercase;
}
.chat-option-btn:hover { background: #1a1a1a; color: #fff; padding-left: 15px; }
.interrogate-link {
    color: #0000ee; text-decoration: underline; cursor: pointer;
    font-size: 11px; margin-top: 20px; display: block;
}

/* Habitants / Lieux */
.habitant-lieu {
    padding: 10px; border-bottom: 2px solid #ddd; font-size: 11px;
}
.habitant-lieu:last-child { border-bottom: none; }
.lieu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.lieu-nom { font-weight: bold; font-size: 12px; color: #1a1a1a; }
.lieu-status { font-size: 10px; padding: 1px 6px; border-radius: 2px; }
.lieu-occupe { background: #c8f7c8; color: #060; }
.lieu-vide { background: #f7c8c8; color: #600; }
.lieu-adresse { font-size: 9px; color: #666; font-style: italic; margin-bottom: 4px; }
.lieu-description { font-size: 10px; color: #444; margin-bottom: 4px; }
.lieu-residents { font-size: 10px; color: #333; font-weight: bold; margin-bottom: 6px; }
.lieu-visit-btn {
    padding: 3px 10px; font-size: 10px; cursor: pointer;
    border: 2px solid;
    border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
    background: var(--win-gray); color: black;
}
.lieu-visit-btn:disabled {
    opacity: 0.5; cursor: not-allowed; color: #888;
}
.lieu-visit-btn:not(:disabled):hover { background: #d0d0d0; }

/* Exploration de Scènes */
.explore-viewport {
    display: flex;
    justify-content: center;
    align-items: center;
}
.explore-viewport .scene {
    max-height: 100%;
    width: auto;
}
.explore-viewport .scene img:first-child {
    max-height: 50vh;
    width: auto;
    display: block;
}
.explore-msg {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 80%;
    max-width: 500px;
    pointer-events: none;
}
.explore-msg-paper {
    background: #e3d2b3;
    background-image: url("https://www.transparenttextures.com/patterns/parchment.png");
    color: #2c1e11;
    padding: 20px 25px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.8), inset 0 0 40px rgba(139,69,19,0.2);
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 12px;
    line-height: 1.5;
    clip-path: polygon(1% 2%, 99% 1%, 100% 5%, 98% 96%, 95% 100%, 50% 98%, 5% 99%, 0% 95%, 2% 8%);
    border: 1px solid #bc9d7a;
    transform: rotate(-0.5deg);
}
.explore-msg-paper::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 12px solid transparent;
    border-image: radial-gradient(circle, transparent 65%, rgba(48, 24, 8, 0.4) 100%) 30;
    pointer-events: none;
}
.explore-confirm {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}
.explore-confirm-box {
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
    padding: 15px 25px;
    text-align: center;
    color: black;
    font-family: "MS Sans Serif", "Tahoma", sans-serif;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
}

/* Flèches de navigation entre pièces */
.explore-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 150;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.2s;
}
.explore-nav-arrow:hover {
    background: rgba(74,0,0,0.8);
    border-color: rgba(255,255,255,0.4);
}
.explore-nav-right { right: 0; border-radius: 4px 0 0 4px; }
.explore-nav-left { left: 0; border-radius: 0 4px 4px 0; }
.explore-nav-arrow-icon {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 8px rgba(255,80,80,0.6);
}
.explore-nav-arrow-label {
    font-size: 8px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: "MS Sans Serif", "Tahoma", sans-serif;
    white-space: nowrap;
}
.explore-nav-arrow:hover .explore-nav-arrow-icon { color: #ff6666; }
.explore-nav-arrow:hover .explore-nav-arrow-label { color: #fff; }

/* Mobile */
@media (max-width: 768px) {
    body { overflow-y: auto; height: auto; min-height: 100vh; background-size: 80%; }
    .window { max-width: 92vw !important; width: 92vw !important; left: 4vw !important; font-size: 11px; }
    .window-body { padding: 5px; max-height: 45vh; font-size: 11px; }
    .title-bar { font-size: 10px; padding: 2px 4px; }
    .desktop-icon { width: 65px; margin: 8px; font-size: 9px; }
    .desktop-icon div[style*="font-size: 32px"] { font-size: 24px !important; }
    .sticky-note { width: 110px; padding: 6px; font-size: 9px; top: 10px; right: 10px; }
    .stress-container { width: 140px; top: 10px; }
    .stress-bar-outer { height: 10px; }
    .taskbar { height: 30px; }
    .start-button { font-size: 10px; padding: 1px 5px; }
    .clock { font-size: 10px; padding: 1px 6px; }
    .start-menu { width: 160px; bottom: 30px; }
    .start-menu-item { font-size: 10px; padding: 4px 8px; }
    .flex.h-80 { height: 200px; }
    .history-sidebar { width: 100px; font-size: 9px; padding: 3px; }
    .history-item { font-size: 9px; margin-bottom: 5px; padding: 2px; }
    .browser-toolbar { padding: 2px; gap: 2px; }
    .browser-btn { font-size: 8px; padding: 1px 4px; }
    #radar-canvas { width: 200px; height: 200px; }
    .file-icon { width: 65px; }
    .file-icon .text-2xl { font-size: 1.2rem; }
    .file-icon .text-\[10px\] { font-size: 8px; }
    .grid.grid-cols-4 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    #call-screen { height: 350px; bottom: 30px; }
    #call-text { font-size: 14px; min-height: 80px; }
    .visiophone-container { width: 98%; padding: 8px; bottom: 35px; }
    .visiophone-main { flex-direction: column; gap: 10px; padding: 10px; }
    .phone-portrait { width: 80px; height: 80px; margin: 0 auto; }
    .phone-text { font-size: 14px; }
    .phone-footer { flex-direction: column; }
    .phone-choice-btn, .phone-hangup-btn { font-size: 10px; padding: 6px 10px; }
    .calling-box { padding: 20px; }
    .report-paper { height: 250px; padding: 15px; font-size: 11px; }
    .police-folder { padding: 20px 10px 10px 10px; }
}

/* Large screens */
@media (min-width: 1400px) {
    #win-casefile { width: 700px !important; }
}
@media (min-width: 1800px) {
    #win-casefile { width: 850px !important; }
}

.text-\[13px\], .text-\[11px\] {
    font-weight: bolder;
}