/* 
   КОМИССАР ИИ: ЗОЛОТАЯ ВЕРСИЯ (HARD RESET) 
   v100 - Centering Guaranteed
*/

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=EB+Garamond:wght@400;600&family=Courier+Prime&display=swap');

:root {
    --paper: #f2ede4;
    --paper-dark: #e6dfd1;
    --ink: #1a1a1a;
    --accent: #8b0000;
}

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

html, body {
    width: 100%; height: 100%;
    background: #0d0d0d;
    overflow: hidden;
    font-family: 'EB Garamond', serif;
}

/* ГЛАВНОЕ: АБСОЛЮТНАЯ ЦЕНТРОВКА */
#main-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* ЭТО ДЕРЖИТ ЦЕНТР */
    width: 98vw;
    height: 98vh;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 100px rgba(0,0,0,1);
    border: 2px solid var(--ink);
    z-index: 100;
}

@media (min-width: 1024px) {
    #main-container {
        width: 90vw;
        height: 85vh;
        max-width: 1300px;
        min-height: 700px;
    }
}

/* ШАПКА */
#game-header {
    height: 70px;
    background: var(--paper-dark);
    border-bottom: 2px solid var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    flex-shrink: 0;
}

#logo-section .rank { font-family: 'Courier Prime', monospace; font-size: 0.8rem; letter-spacing: 3px; color: var(--accent); }
#logo-section .title { font-family: 'Playfair Display', serif; font-size: 1.5rem; }

#brief-btn {
    background: var(--ink); color: var(--paper); border: none;
    padding: 10px 20px; font-family: 'Courier Prime', monospace; cursor: pointer;
}

/* МАКЕТ ГЕЙМПЛЕЯ */
#game-layout { flex: 1; display: flex; overflow: hidden; }

.tab-content { flex: 1; height: 100%; overflow-y: auto; display: none; padding: 30px; flex-direction: column; }
.tab-content.active { display: flex !important; }

@media (min-width: 1024px) {
    .tab-content { display: flex !important; border-right: 1px solid rgba(0,0,0,0.1); }
    #npc-info { width: 320px; flex-shrink: 0; }
    #player-panel { flex: 1; border-right: 1px solid var(--ink); }
    #evidence-board { width: 350px; flex-shrink: 0; border-right: none; }
}

/* ПОРТРЕТ */
#portrait-frame { 
    width: 100%; aspect-ratio: 1; 
    border: 12px solid #fff; 
    box-shadow: 5px 5px 20px rgba(0,0,0,0.3); 
    background-size: cover; background-position: center;
    margin-bottom: 20px;
}

/* ДИАЛОГИ */
#dialogue-history { flex: 1; overflow-y: auto; padding-right: 10px; display: flex; flex-direction: column; gap: 15px; }
.message { padding: 15px; font-size: 1.1rem; line-height: 1.4; border-bottom: 1px solid rgba(0,0,0,0.05); }
.message.player { font-family: 'Courier Prime', monospace; color: #444; }
.message.npc { background: #fff; box-shadow: 2px 2px 0 rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.1); }

/* ИНПУТ */
#input-area { display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid var(--ink); }
#player-input { flex: 1; padding: 15px; border: 1px solid var(--ink); background: #fff; font-family: 'Courier Prime', monospace; resize: none; }
#send-btn { background: var(--ink); color: #fff; border: none; padding: 0 25px; cursor: pointer; }

/* УЛИКИ И ТАБЫ */
.sub-tabs { display: flex; margin-bottom: 15px; border: 1px solid var(--ink); }
.sub-tab { flex: 1; padding: 10px; background: var(--paper-dark); border: none; cursor: pointer; font-family: 'Courier Prime', monospace; }
.sub-tab.active { background: var(--ink); color: #fff; }

.sub-tab-content { display: none; flex-direction: column; height: 100%; }
.sub-tab-content.active { display: flex !important; }

.check-item { 
    padding: 12px; background: #fff; border: 1px solid var(--ink); margin-bottom: 8px; 
    cursor: pointer; font-family: 'Courier Prime', monospace; 
}
.check-item:hover { background: var(--paper-dark); }

/* МОДАЛКИ */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal.hidden { display: none !important; }
.modal-content { 
    background: var(--paper); padding: 40px; border: 2px solid var(--ink); 
    max-width: 600px; width: 90%; 
    box-shadow: 15px 15px 0 rgba(0,0,0,0.5);
}

.primary-btn { width: 100%; padding: 15px; background: var(--accent); color: #fff; border: none; cursor: pointer; font-size: 1.1rem; }

/* МОБИЛЬНОЕ МЕНЮ */
#mobile-nav { height: 60px; background: var(--ink); display: flex; }
@media (min-width: 1024px) { #mobile-nav { display: none; } }
.nav-tab { flex: 1; color: #777; background: none; border: none; font-size: 0.7rem; }
.nav-tab.active { color: #fff; border-top: 3px solid var(--accent); }

#suspect-switcher { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; }
.suspect-card { width: 50px; height: 50px; border: 2px solid var(--ink); cursor: pointer; background-size: cover; flex-shrink: 0; }
.suspect-card.active { border-color: var(--accent); outline: 2px solid var(--accent); }
