/* CLUBE DOS DETETIVES - GAMEPLAY NOIR V4
   Ajustes: Menu Mobile Integrado
*/

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Abril+Fatface&family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&family=Courier+Prime&display=swap');

:root {
    --wood-dark: #1a120b;
    --paper-aged: #e3dac9;
    --paper-light: #fdfbf7;
    --ink-color: #1a1a1a;
    --red-marker: #b30000;
    --gold-accent: #c5a059;
    --shadow-hard: 5px 5px 15px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #0a0a0a;
    font-family: 'Old Standard TT', serif;
    color: #333;
    overflow-x: hidden;
}

/* === FUNDO E CABEÇALHO === */
.desk-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.8)),
        url('https://www.transparenttextures.com/patterns/wood-pattern.png'),
        #2a1b0e; 
    background-blend-mode: multiply;
    z-index: -2;
    background-size: cover;
}

header {
    position: fixed;
    top: 0; left: 0; width: 100%; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px;
    background: #111;
    border-bottom: 2px solid var(--gold-accent);
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
}

.logo-area img { height: 45px; filter: sepia(100%) contrast(120%); }

.nav-links { display: flex; align-items: center; }
.nav-links a {
    color: var(--paper-aged);
    text-decoration: none;
    font-family: 'Special Elite', monospace;
    margin-left: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--red-marker); }

.btn-login-header {
    border: 1px solid var(--paper-aged);
    padding: 5px 15px;
    border-radius: 4px;
    margin-left: 20px;
}
.btn-login-header:hover {
    background: var(--paper-aged);
    color: #111 !important;
}

/* === MENU MOBILE (COPIADO DO NOIR-STYLE) === */
.mobile-menu-toggle {
    display: none; /* Escondido no Desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1250;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--gold-accent);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background-color: var(--red-marker);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -8px);
    background-color: var(--red-marker);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.98);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    text-align: center;
}

.mobile-nav-links li {
    margin: 25px 0;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.mobile-menu-overlay.active .mobile-nav-links li {
    transform: translateY(0);
    opacity: 1;
}

/* Delay em cascata */
.mobile-menu-overlay.active .mobile-nav-links li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-overlay.active .mobile-nav-links li:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu-overlay.active .mobile-nav-links li:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu-overlay.active .mobile-nav-links li:nth-child(4) { transition-delay: 0.4s; }

.mobile-nav-links a {
    font-family: 'Abril Fatface', cursive;
    font-size: 2rem;
    color: #e3dac9;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.mobile-nav-links a:hover { color: var(--red-marker); }


/* === MANUAL DE INSTRUÇÕES === */
.instructions-panel {
    max-width: 1000px;
    margin: 130px auto 60px;
    padding: 20px;
    background-color: #fffbe6;
    border: 1px solid #d4c997;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;
    font-family: 'Courier New', monospace;
    color: #444;
    transform: rotate(0.5deg);
}

.instructions-panel::before {
    content: "";
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    width: 100px; height: 20px;
    background: rgba(0,0,0,0.2);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    border-radius: 2px;
}

.instructions-title {
    font-family: 'Special Elite', cursive;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 2px dashed #aaa;
    padding-bottom: 10px;
    margin-bottom: 10px;
    color: #222;
    text-transform: uppercase;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.instructions-list li {
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    padding-left: 20px;
}
.instructions-list li::before {
    content: "•";
    position: absolute; left: 0; top: 0;
    color: var(--red-marker);
    font-size: 1.5rem;
    line-height: 1rem;
}
.highlight { color: var(--red-marker); font-weight: bold; }

/* === ÁREA DE JOGO === */
.game-container {
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 700px;
}

.case-file-wrapper {
    background-color: var(--paper-aged);
    padding: 10px;
    border-radius: 2px;
    box-shadow: 10px 15px 40px rgba(0,0,0,0.8);
    transform: rotate(-0.5deg);
    display: flex;
    flex-direction: column;
    height: 650px;
    position: relative;
    border: 1px solid #bba;
}

.case-file-wrapper::before {
    content: "DEMO - CASO #001";
    position: absolute;
    top: -35px; left: 20px;
    background: var(--paper-aged);
    padding: 5px 20px;
    border-radius: 10px 10px 0 0;
    font-family: 'Special Elite', monospace;
    color: var(--red-marker);
    font-weight: bold;
    border: 1px solid #bba;
    border-bottom: none;
}

.paper-clip {
    position: absolute;
    top: -15px; right: 30px;
    width: 40px; height: 70px;
    border: 4px solid #666;
    border-radius: 20px;
    z-index: 10;
}

.story-paper {
    background: var(--paper-light);
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Courier Prime', monospace;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    position: relative;
    background-image: linear-gradient(#e8e8e8 1px, transparent 1px);
    background-size: 100% 1.8rem;
    line-height: 1.8rem;
}

.story-paper::-webkit-scrollbar { width: 8px; }
.story-paper::-webkit-scrollbar-track { background: #f1f1f1; }
.story-paper::-webkit-scrollbar-thumb { background: #c0b090; border-radius: 4px; }

.msg {
    margin-bottom: 20px;
    max-width: 90%;
    position: relative;
    padding: 10px 15px;
}
.msg.ai { background: transparent; border-left: 4px solid #333; color: #222; }
.msg.ai strong { font-weight: 900; color: #000; }
.msg.user {
    margin-left: auto;
    background: #fff9c4;
    color: #333;
    font-family: 'Special Elite', monospace;
    transform: rotate(1deg);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    max-width: 80%;
    border: none;
}

/* --- ABAS DA MESA --- */
.desk-interface {
    margin-top: 15px;
    background: #2c1e12;
    padding: 10px;
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
    border: 1px solid #4a3b2a;
    position: relative;
    z-index: 20;
}

.desk-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: -1px;
    padding-left: 10px;
}

.tab-btn {
    background: #1a120b;
    color: #888;
    border: 1px solid #3e2723;
    border-bottom: none;
    padding: 8px 15px;
    font-family: 'Special Elite', monospace;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    top: 0;
}
.tab-btn:hover { color: #ccc; background: #251a10; }

.tab-btn.active {
    background: #3e2723;
    color: var(--gold-accent);
    border-top: 2px solid var(--red-marker);
    padding-bottom: 10px;
    font-weight: bold;
    top: -2px;
}

.tab-content {
    background: #3e2723;
    padding: 0;
    border: 1px solid #4a3b2a;
    max-height: 0;
    overflow: hidden;
    color: #dcdcdc;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.tab-content.active {
    max-height: 300px;
    padding: 15px;
    overflow-y: auto;
}

/* Itens */
.item-grid { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 5px; }
.desk-item {
    background: #1a120b; border: 1px solid #555; padding: 8px; min-width: 80px;
    text-align: center; border-radius: 4px; cursor: help; transition: transform 0.2s;
}
.desk-item:hover { transform: translateY(-3px); border-color: var(--gold-accent); }
.desk-item img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.desk-item span { display: block; font-size: 0.7rem; margin-top: 5px; color: #aaa; font-family: 'Courier New'; }

/* Suspeitos */
.suspect-row { display: flex; gap: 15px; overflow-x: auto; padding: 5px; }
.mini-polaroid {
    background: #fff;
    padding: 8px 8px 25px 8px;
    color: #000;
    width: 140px;
    flex-shrink: 0;
    text-align: center;
    transform: rotate(-1deg);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.mini-polaroid:hover { transform: scale(1.05) rotate(0deg); z-index: 10; }

.photo-placeholder {
    width: 100%;
    height: 80px;
    background: #ddd;
    border: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: #555;
    text-transform: uppercase;
    padding: 5px;
    margin-bottom: 8px;
    background-image: repeating-linear-gradient(45deg, #ccc 0, #ccc 1px, transparent 0, transparent 50%);
    background-size: 10px 10px;
}
.suspect-name { font-size: 0.9rem; font-family: 'Special Elite'; font-weight: bold; margin-bottom: 5px; border-bottom: 1px solid #eee; }
.suspect-desc { font-size: 0.7rem; font-family: 'Arial', sans-serif; color: #444; line-height: 1.2; text-align: left; }

/* Notas */
#player-notes {
    width: 100%; height: 80px; background: #fffbe6; color: #333;
    font-family: 'Courier New', monospace; padding: 10px; border: none;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2); resize: none;
}

/* --- INPUT AREA --- */
.composer {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#userInput {
    flex: 1;
    background: #111;
    color: #e3dac9;
    border: 1px solid #555;
    padding: 15px;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    border-radius: 2px;
    min-width: 0;
}
#userInput:focus { outline: 1px solid var(--gold-accent); }

#sendBtn {
    background: var(--red-marker);
    color: #fff;
    border: none;
    padding: 0 25px;
    font-family: 'Special Elite';
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
#sendBtn:hover { background: #8b0000; }
#sendBtn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- CTA --- */
.cta-register-section {
    max-width: 1000px;
    margin: 0 auto 60px;
    background: #111;
    border: 1px solid #333;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    text-align: center;
    color: #e3dac9;
}
.cta-register-section::after {
    content: "";
    position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px dashed #444;
    pointer-events: none;
}
.cta-title { font-family: 'Abril Fatface', cursive; font-size: 2.5rem; color: var(--gold-accent); margin-bottom: 20px; }

.cta-features {
    display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 30px;
}
.feature-item {
    flex: 1; min-width: 200px; background: #1a1a1a; padding: 20px;
    border-radius: 4px; border: 1px solid #333;
}
.feature-item i { font-size: 2rem; color: var(--red-marker); margin-bottom: 10px; }
.feature-item h4 { font-family: 'Special Elite'; margin-bottom: 5px; color: #fff; }
.feature-item p { font-size: 0.9rem; color: #888; }

.btn-cta-big {
    display: inline-block; background: var(--red-marker); color: #fff;
    font-family: 'Special Elite'; font-size: 1.5rem; padding: 15px 40px;
    text-decoration: none; border-radius: 2px;
    transition: transform 0.2s, box-shadow 0.2s; border: 2px solid #fff;
}
.btn-cta-big:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(179, 0, 0, 0.5); color: #fff; }

/* --- MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000; display: none;
    justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.modal-case-file {
    background: #fdfbf7; padding: 40px; max-width: 500px; width: 90%;
    text-align: center; position: relative; transform: rotate(1deg);
    box-shadow: 0 0 50px rgba(0,0,0,1); border: 1px solid #999;
}
.stamp-closed {
    position: absolute; top: 20px; right: 20px; border: 4px solid var(--red-marker);
    color: var(--red-marker); font-family: 'Special Elite'; font-size: 2rem;
    padding: 5px 10px; transform: rotate(-20deg); font-weight: bold; opacity: 0.8;
}
.btn-register {
    display: block; width: 100%; background: #111; color: #fff; padding: 15px;
    text-decoration: none; font-family: 'Special Elite'; font-size: 1.2rem;
    margin-top: 20px; border: 2px solid var(--gold-accent); transition: all 0.3s;
}
.btn-register:hover { background: var(--red-marker); border-color: var(--red-marker); }

/* Loader */
.loader { text-align: center; padding: 20px; color: #666; font-style: italic; }

/* Mobile Adjustments */
@media (max-width: 768px) {
    header { padding: 10px 20px; }
    
    /* MENU MOBILE FIX */
    .nav-links { display: none; } /* Esconde links desktop */
    .mobile-menu-toggle { display: flex; } /* Mostra botão hamburger */
    
    .instructions-panel { margin-top: 90px; width: 95%; margin-left: auto; margin-right: auto; }
    .instructions-list { grid-template-columns: 1fr; }
    
    .case-file-wrapper { height: auto; min-height: 500px; transform: none; }
    .story-paper { height: 350px; }
    .cta-features { flex-direction: column; }
    
    .composer { flex-direction: column; gap: 5px; }
    #userInput { width: 100%; font-size: 16px; }
    #sendBtn { width: 100%; padding: 15px; }
    
    .btn-cta-big { font-size: 1.2rem; width: 100%; padding: 15px; }
}