/* ========================================
   NOIR DETECTIVE GAME AESTHETIC
   1940s/50s Film Noir Style
   ======================================== */

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

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

body {
    font-family: 'Courier Prime', monospace;
    background: #1a1a1a url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%231a1a1a" width="100" height="100"/><circle cx="50" cy="50" r="1" fill="%23333" opacity="0.5"/></svg>');
    color: #d4af37;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   HOME BUTTON
   ======================================== */

.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    padding: 0.8rem 1.5rem;
    background: #8b0000;
    color: #f5deb3;
    text-decoration: none;
    border-radius: 0;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Courier Prime', monospace;
}

.home-button:hover {
    transform: translateY(-2px);
    background: #a01010;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* ========================================
   MAIN GAME CONTAINER
   ======================================== */

.noir-container {
    min-height: 100vh;
    padding: 40px;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    position: relative;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
}

.noir-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 0, 0, 0.15) 3px
        );
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   PANELS
   ======================================== */

.noir-panel {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #d4af37;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(212, 175, 55, 0.1),
        -5px 5px 15px rgba(0, 0, 0, 0.9);
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.noir-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 2px,
            rgba(212, 175, 55, 0.03) 2px,
            rgba(212, 175, 55, 0.03) 4px
        );
    pointer-events: none;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #d4af37;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid #8b0000;
    padding-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* ========================================
   TIMER
   ======================================== */

.timer-container {
    background: #0a0a0a;
    border: 2px solid #8b0000;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.timer-label {
    font-size: 0.9rem;
    color: #b8860b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.timer-display {
    font-family: 'Courier Prime', monospace;
    font-size: 2.5rem;
    color: #8b0000;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

.timer-display.warning {
    color: #ff4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================================
   CASE FILE
   ======================================== */

.case-file {
    background: #f5deb3;
    border: 2px dashed #333;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.case-file::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 30px;
    height: 20px;
    background: #8b7355;
    border: 1px solid #654321;
}

.case-file-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #8b0000;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.case-file-content {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.evidence-tag {
    display: inline-block;
    background: #8b0000;
    color: #f5deb3;
    padding: 0.3rem 0.6rem;
    margin: 0.2rem;
    font-size: 0.8rem;
    border: 1px solid #d4af37;
}

/* ========================================
   CENTER PANEL - INVESTIGATION
   ======================================== */

.investigation-panel {
    display: flex;
    flex-direction: column;
}

.conversation-area {
    flex: 1;
    background: #0a0a0a;
    border: 2px solid #d4af37;
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow-y: auto;
    max-height: 500px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
}

.conversation-area::-webkit-scrollbar {
    width: 8px;
}

.conversation-area::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
}

.conversation-area::-webkit-scrollbar-thumb {
    background: #8b0000;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

.message {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-left: 3px solid #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.message.detective {
    color: #d4af37;
    border-left-color: #d4af37;
}

.message.suspect {
    color: #b8860b;
    border-left-color: #8b0000;
}

.message-label {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.message-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ========================================
   INPUT AREA
   ======================================== */

.input-section {
    display: flex;
    gap: 1rem;
}

.input-field {
    flex: 1;
    background: #f5deb3;
    border: 2px solid #d4af37;
    color: #000;
    padding: 0.8rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-field:focus {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    border-color: #8b0000;
}

.input-field::placeholder {
    color: #999;
}

.send-button,
.accuse-button {
    background: #8b0000;
    border: 2px solid #d4af37;
    color: #f5deb3;
    padding: 0.8rem 1.5rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.send-button:hover,
.accuse-button:hover {
    background: #a01010;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.accuse-button {
    background: #654321;
}

.accuse-button:hover {
    background: #8b5a2b;
}

/* ========================================
   RIGHT PANEL - SUSPECTS
   ======================================== */

.suspects-panel {
    max-height: 600px;
    overflow-y: auto;
}

.suspect-card {
    background: #2a2a2a;
    border: 2px solid #d4af37;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suspect-card:hover {
    background: #333;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.suspect-card.selected {
    background: #8b0000;
    border-color: #8b0000;
}

.suspect-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #d4af37;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.suspect-detail {
    color: #b8860b;
    font-size: 0.85rem;
    margin: 0.3rem 0;
}

.suspect-detail strong {
    color: #d4af37;
}

/* ========================================
   ACCUSATION MODAL
   ======================================== */

.accusation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.accusation-modal.hidden {
    display: none;
}

.accusation-box {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #d4af37;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3);
    text-align: center;
}

.accusation-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #d4af37;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.accusation-question {
    color: #b8860b;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.accusation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.suspect-option {
    background: #8b0000;
    border: 2px solid #d4af37;
    color: #f5deb3;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Courier Prime', monospace;
}

.suspect-option:hover {
    background: #a01010;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* ========================================
   RESULT SCREEN
   ======================================== */

.result-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
}

.result-screen.hidden {
    display: none;
}

.result-box {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #d4af37;
    padding: 3rem;
    max-width: 700px;
    width: 90%;
    box-shadow: 
        0 0 50px rgba(212, 175, 55, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(212, 175, 55, 0.1);
    text-align: center;
    position: relative;
}

.result-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

.result-box.victory {
    border-color: #d4af37;
    box-shadow: 
        0 0 50px rgba(212, 175, 55, 0.5),
        inset 0 0 20px rgba(212, 175, 55, 0.1),
        0 0 100px rgba(212, 175, 55, 0.2);
}

.result-box.defeat {
    border-color: #8b0000;
    box-shadow: 
        0 0 50px rgba(139, 0, 0, 0.5),
        inset 0 0 20px rgba(139, 0, 0, 0.1),
        0 0 100px rgba(139, 0, 0, 0.2);
}

.result-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.result-box.victory .result-title {
    color: #d4af37;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(212, 175, 55, 0.4);
}

.result-box.defeat .result-title {
    color: #8b0000;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(139, 0, 0, 0.3);
}

.result-content {
    color: #b8860b;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.result-button {
    background: #8b0000;
    border: 2px solid #d4af37;
    color: #f5deb3;
    padding: 1rem 2rem;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.result-button:hover {
    background: #a01010;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* ========================================
   GAME COMPLETION SCREEN
   ======================================== */

.killer-info {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid #d4af37;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: left;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.killer-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.killer-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.killer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.killer-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 0.75rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.killer-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #f5deb3;
    display: block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
}

.killer-role {
    font-family: 'Courier Prime', monospace;
    font-size: 0.95rem;
    color: #b8860b;
    margin-top: 0.25rem;
    font-style: italic;
    letter-spacing: 1px;
}

.killer-motive {
    font-family: 'Courier Prime', monospace;
    font-size: 1.05rem;
    color: #b8860b;
    line-height: 1.8;
}

.killer-time {
    font-family: 'Courier Prime', monospace;
    font-size: 1.5rem;
    color: #d4af37;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.case-message {
    color: #b8860b;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    font-family: 'Courier Prime', monospace;
    margin-top: 1rem;
}

/* ========================================
   INSTRUCTIONS MODAL
   ======================================== */

.instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 7000;
}

.instructions-modal.hidden {
    display: none;
}

.instructions-box {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #d4af37;
    padding: 3rem;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3);
}

.instructions-header {
    border-bottom: 2px solid #8b0000;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.instructions-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.instructions-subtitle {
    color: #b8860b;
    font-size: 1rem;
    letter-spacing: 2px;
}

.instructions-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 1rem;
}

.instruction-section {
    margin-bottom: 2rem;
}

.instruction-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #d4af37;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.instruction-section p {
    color: #b8860b;
    line-height: 1.7;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.instruction-list {
    list-style: none;
    padding-left: 0;
}

.instruction-list li {
    color: #b8860b;
    margin-bottom: 0.6rem;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
    font-size: 0.95rem;
}

.instruction-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #d4af37;
    font-weight: bold;
}

.instruction-highlight {
    color: #d4af37;
    font-weight: 700;
}

.timer-info {
    background: #0a0a0a;
    border-left: 3px solid #8b0000;
    padding: 1rem;
    margin: 1rem 0;
    color: #b8860b;
}

.timer-info strong {
    color: #d4af37;
}

.instructions-footer {
    border-top: 2px solid #8b0000;
    margin-top: 2rem;
    padding-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.begin-button {
    flex: 1;
    background: #d4af37;
    border: 2px solid #d4af37;
    color: #000;
    padding: 1rem 2rem;
    font-family: 'Courier Prime', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.begin-button:hover {
    background: #f5deb3;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
}

.instructions-content::-webkit-scrollbar {
    width: 8px;
}

.instructions-content::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
}

.instructions-content::-webkit-scrollbar-thumb {
    background: #8b0000;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .noir-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .noir-container {
        gap: 1rem;
        padding: 10px;
    }

    .noir-panel {
        padding: 1rem;
    }

    .panel-title {
        font-size: 1.3rem;
    }

    .timer-display {
        font-size: 1.8rem;
    }

    .conversation-area {
        max-height: 300px;
    }

    .accusation-grid {
        grid-template-columns: 1fr 1fr;
    }
}
