* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* === PWA SPLASH SCREEN === */
#splash-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: #08080c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.4s ease;
}
#splash-screen p {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    letter-spacing: 6px;
    color: #d4a843;
}

/* === PWA STANDALONE ADJUSTMENTS === */
@media (display-mode: standalone) {
    body { padding-top: env(safe-area-inset-top); }
}
html {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

:root {
    --bg-dark: #08080c;
    --bg-panel: #0f0f16;
    --bg-card: #161622;
    --bg-hover: #1e1e2e;
    --bg-modal: #12121c;
    --text-primary: #e8e6e3;
    --text-secondary: #9a9a9a;
    --text-dim: #555;
    --accent-gold: #d4a843;
    --accent-red: #c44d4d;
    --accent-blue: #4d7cc4;
    --accent-green: #4daa6d;
    --accent-purple: #8b5cf6;
    --border: #252530;
    --border-light: #333345;
    --shadow: rgba(0, 0, 0, 0.6);
    --glow-gold: rgba(212, 168, 67, 0.3);
    --glow-red: rgba(196, 77, 77, 0.3);
    --glow-blue: rgba(77, 124, 196, 0.3);
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}
/* Allow text selection in dialogue/evidence descriptions */
.dialogue-box, .examine-description, .verdict-text, .verdict-details,
.typewriter-container, .evidence-info p, .timeline-event p {
    -webkit-user-select: text;
    user-select: text;
}

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* === SCREENS === */
.screen {
    display: none;
    animation: screenIn 0.5s ease;
}
.screen.active { display: block; }

@keyframes screenIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
@keyframes glow {
    0%, 100% { box-shadow: 0 0 8px var(--glow-gold); }
    50% { box-shadow: 0 0 25px var(--glow-gold), 0 0 50px rgba(212, 168, 67, 0.15); }
}
@keyframes evidenceCollect {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes shine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* === TITLE === */
.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    text-align: center;
}
.title-badge {
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 4px 14px;
    border-radius: 2px;
    margin-bottom: 20px;
    opacity: 0.8;
}
.game-title {
    font-size: 4.5rem;
    letter-spacing: 10px;
    color: var(--accent-gold);
    text-shadow: 0 0 40px rgba(212, 168, 67, 0.25);
    margin-bottom: 10px;
    font-weight: normal;
}
.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 5px;
    margin-bottom: 60px;
    font-style: italic;
}
.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* === BUTTONS === */
.btn {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: var(--accent-gold);
    color: #0a0a0f;
    font-weight: bold;
}
.btn-primary:hover {
    background: #e0b84e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow-gold);
}
.btn-glow { animation: glow 3s infinite; }
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.btn-back {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-size: 0.85rem;
}
.btn-back:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}
.btn-nav {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 18px 24px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    text-align: left;
    letter-spacing: 0;
    text-transform: none;
}
.btn-nav:hover {
    background: var(--bg-hover);
    border-color: var(--accent-gold);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--accent-gold);
}
.btn-nav .nav-icon { font-size: 1.5rem; flex-shrink: 0; }
.btn-nav .nav-text small { color: var(--text-secondary); font-size: 0.8rem; }
.btn-trial { border-color: var(--accent-red); }
.btn-trial:hover {
    border-color: var(--accent-red);
    box-shadow: -4px 0 0 var(--accent-red), 0 0 20px var(--glow-red);
}
.btn-present-evidence {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.2s;
    margin-top: 10px;
}
.btn-present-evidence:hover {
    background: #5a8ad4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow-blue);
}

/* === PANELS === */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    max-width: 750px;
    margin: 40px auto;
}
.panel h2 { color: var(--accent-gold); margin-bottom: 20px; letter-spacing: 2px; }

/* === HOW TO PLAY === */
.howto-content { margin: 20px 0 30px; }
.howto-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease backwards;
}
.howto-step:nth-child(1) { animation-delay: 0.1s; }
.howto-step:nth-child(2) { animation-delay: 0.2s; }
.howto-step:nth-child(3) { animation-delay: 0.3s; }
.howto-step:nth-child(4) { animation-delay: 0.4s; }
.howto-step:nth-child(5) { animation-delay: 0.5s; }
.step-num {
    background: var(--accent-gold);
    color: var(--bg-dark);
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 0.8rem; flex-shrink: 0;
}

/* === INTRO === */
.intro-panel { max-width: 800px; }
.case-file-header { position: relative; margin-bottom: 20px; }
.stamp {
    position: absolute; top: -10px; right: 0;
    color: var(--accent-red); border: 2px solid var(--accent-red);
    padding: 4px 12px; font-size: 0.75rem; letter-spacing: 3px;
    transform: rotate(3deg); opacity: 0.8;
}
.typewriter-container {
    font-size: 0.95rem; line-height: 1.8;
    color: var(--text-secondary); min-height: 200px;
}
.typewriter-container .typed-line { margin-bottom: 6px; animation: fadeIn 0.3s ease; }
.typewriter-container .highlight { color: var(--accent-gold); font-weight: bold; }
.typewriter-container .victim-name { color: var(--accent-red); font-size: 1.1rem; }

/* === HUB === */
.hub-header { text-align: center; margin-bottom: 25px; padding: 20px; }
.hub-header h2 { color: var(--accent-gold); letter-spacing: 3px; margin-bottom: 20px; }
.hub-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
}
.hub-nav .btn-trial { grid-column: 1 / -1; }

/* === PROGRESS PANEL === */
.progress-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 auto;
    max-width: 700px;
}
.progress-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}
.progress-label { font-size: 0.7rem; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 8px; }
.progress-bar {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.progress-fill {
    height: 100%;
    background: var(--accent-green);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}
.progress-fill-gold { background: var(--accent-gold); }
.progress-text { font-size: 0.85rem; color: var(--text-primary); font-weight: bold; }

/* === SCREEN HEADER === */
.screen-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.screen-header h2 { color: var(--accent-gold); letter-spacing: 2px; }
.scene-instruction {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* === CRIME SCENE === */
.crime-scene-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16/10;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.crime-scene-container svg {
    width: 100%;
    height: 100%;
}
.scene-object {
    cursor: pointer;
    transition: all 0.2s ease;
}
.scene-object:hover {
    filter: brightness(1.4) drop-shadow(0 0 8px var(--accent-gold));
}
.scene-object .hover-label {
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.scene-object:hover .hover-label {
    opacity: 1;
}
.scene-object.collected {
    opacity: 0.4;
    cursor: default;
}
.scene-object.collected:hover {
    filter: none;
}

/* === LOCATION SCENES === */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.location-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}
.location-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow);
}
.location-card h3 { color: var(--text-primary); margin-bottom: 8px; }
.location-card p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.4; }
.location-card .clue-badge {
    position: absolute; top: 12px; right: 12px;
    background: var(--accent-gold); color: var(--bg-dark);
    font-size: 0.7rem; padding: 3px 8px; border-radius: 10px; font-weight: bold;
}
.location-card.complete { border-color: var(--accent-green); opacity: 0.7; }
.location-card.complete::after {
    content: 'SEARCHED'; position: absolute; top: 12px; right: 12px;
    color: var(--accent-green); font-size: 0.7rem; letter-spacing: 1px;
}
.location-scene-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    min-height: 400px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.location-scene-container svg { width: 100%; height: 100%; }

/* === SUSPECTS === */
.suspects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}
.suspect-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 18px;
}
.suspect-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow);
}
.suspect-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: bold; flex-shrink: 0;
    border: 2px solid var(--border);
    position: relative;
}
.suspect-avatar svg { width: 100%; height: 100%; border-radius: 50%; }
.suspect-card-info h3 { color: var(--text-primary); font-size: 1rem; margin-bottom: 4px; }
.suspect-card-info p { color: var(--text-secondary); font-size: 0.8rem; }
.suspect-card-info .suspect-status {
    font-size: 0.7rem;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}
.status-not-questioned { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.status-questioned { background: rgba(77,170,109,0.1); color: var(--accent-green); }
.status-contradicted { background: rgba(196,77,77,0.1); color: var(--accent-red); }

/* === INTERROGATION === */
.interrogation-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    min-height: 500px;
}
.suspect-profile-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.suspect-profile-panel .portrait-large {
    width: 120px; height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
}
.suspect-profile-panel .portrait-large svg { width: 100%; height: 100%; }
.suspect-profile-panel h3 { color: var(--text-primary); margin-bottom: 5px; }
.suspect-profile-panel .role { color: var(--text-secondary); font-size: 0.85rem; font-style: italic; margin-bottom: 15px; }
.suspect-profile-panel .profile-details { text-align: left; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.suspect-profile-panel .profile-details strong { color: var(--text-primary); }

.dialogue-area { display: flex; flex-direction: column; }
.dialogue-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    min-height: 140px;
    margin-bottom: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
    animation: fadeIn 0.3s ease;
}
.dialogue-box .speaker {
    color: var(--accent-gold); font-style: normal; font-weight: bold;
    display: block; margin-bottom: 8px; font-size: 0.85rem; letter-spacing: 1px;
}
.dialogue-box .contradiction {
    color: var(--accent-red); font-weight: bold; font-style: normal;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
    animation: popIn 0.4s ease;
}
.question-options { display: flex; flex-direction: column; gap: 8px; }
.question-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
}
.question-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    padding-left: 22px;
}
.question-btn.asked { opacity: 0.5; border-color: var(--accent-green); }
.question-btn.challenge { border-color: var(--accent-red); color: var(--accent-red); }
.question-btn.challenge:hover { background: rgba(196,77,77,0.08); }

/* === EVIDENCE BOARD === */
.evidence-filter {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: 'Georgia', serif;
    transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.evidence-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding-top: 10px;
}
.evidence-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    animation: popIn 0.4s ease backwards;
}
.evidence-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
}
.evidence-card .evidence-illustration {
    height: 120px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.evidence-card .evidence-illustration svg {
    width: 80%;
    height: 80%;
}
.evidence-card .evidence-info {
    padding: 14px;
}
.evidence-card .evidence-type-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-blue);
    margin-bottom: 6px;
    display: block;
}
.evidence-card .evidence-info h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.evidence-card .evidence-info .evidence-location {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 6px;
}
.evidence-card .evidence-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}
.evidence-card .suspect-link-badge {
    margin-top: 8px;
    padding: 3px 8px;
    background: rgba(196,77,77,0.1);
    color: var(--accent-red);
    font-size: 0.7rem;
    border-radius: 8px;
    display: inline-block;
}
.no-evidence {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 20px;
    font-style: italic;
    grid-column: 1 / -1;
}

/* === TIMELINE === */
.timeline-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-left: 60px;
}
.timeline-container::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-event {
    position: relative;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    animation: slideIn 0.4s ease backwards;
}
.timeline-event::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg-dark);
}
.timeline-event.has-evidence::before {
    background: var(--accent-gold);
    box-shadow: 0 0 8px var(--glow-gold);
}
.timeline-event.critical::before {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--glow-red);
}
.timeline-event .time-label {
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.timeline-event h4 { color: var(--text-primary); font-size: 0.95rem; margin-bottom: 4px; }
.timeline-event p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.4; }
.timeline-event .evidence-tag {
    margin-top: 8px;
    display: inline-block;
    padding: 2px 8px;
    background: rgba(212,168,67,0.1);
    color: var(--accent-gold);
    font-size: 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(212,168,67,0.3);
}
.timeline-locked {
    color: var(--text-dim);
    font-style: italic;
    text-align: center;
    padding: 40px;
}

/* === MODAL === */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
}
.modal-content {
    position: relative;
    background: var(--bg-modal);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: popIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* Examine Modal */
.examine-modal {
    text-align: center;
}
.examine-illustration {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.examine-illustration svg { width: 80%; height: 80%; }
.examine-modal h3 {
    color: var(--accent-gold);
    font-size: 1.2rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.examine-modal .examine-location {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 15px;
}
.examine-modal .examine-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    text-align: left;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.examine-modal .examine-analysis {
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 20px;
}
.btn-collect {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.btn-collect:hover {
    background: #5dbb7d;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(77,170,109,0.4);
}
.btn-collect:disabled {
    background: var(--text-dim);
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* Present Evidence Modal */
.present-modal { max-width: 700px; }
.present-modal h3 {
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}
.present-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.present-evidence-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.present-evidence-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}
.present-evidence-item .mini-illustration {
    width: 50px; height: 50px;
    margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
}
.present-evidence-item .mini-illustration svg { width: 100%; height: 100%; }
.present-evidence-item h5 { color: var(--text-primary); font-size: 0.8rem; margin-bottom: 3px; }
.present-evidence-item p { color: var(--text-dim); font-size: 0.7rem; }

/* === TRIAL === */
.trial-container { max-width: 750px; margin: 0 auto; }
.trial-header {
    text-align: center;
    padding: 30px;
    border-bottom: 2px solid var(--accent-red);
    margin-bottom: 25px;
}
.courtroom-scene {
    height: 100px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.trial-header h2 { color: var(--accent-red); letter-spacing: 3px; font-size: 1.4rem; }
.trial-phase { padding: 20px 0; }
.trial-phase h3 { color: var(--accent-gold); margin-bottom: 15px; letter-spacing: 1px; }
.trial-phase > p { color: var(--text-secondary); margin-bottom: 15px; font-size: 0.9rem; }
.trial-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.trial-option {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    text-align: left;
}
.trial-option:hover { border-color: var(--accent-gold); background: var(--bg-hover); }
.trial-option.selected {
    border-color: var(--accent-gold);
    background: rgba(212,168,67,0.08);
    box-shadow: 0 0 12px rgba(212,168,67,0.15);
}
.trial-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.trial-evidence-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.trial-evidence-item:hover { border-color: var(--accent-blue); }
.trial-evidence-item.selected {
    border-color: var(--accent-green);
    background: rgba(77,170,109,0.08);
}
.trial-evidence-item .mini-illust { width: 40px; height: 40px; margin: 0 auto 6px; }
.trial-evidence-item .mini-illust svg { width: 100%; height: 100%; }
.trial-evidence-item h5 { color: var(--text-primary); font-size: 0.8rem; }
.trial-evidence-item p { color: var(--text-dim); font-size: 0.7rem; }

.trial-reaction {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    animation: popIn 0.3s ease;
}
.trial-reaction.correct { border-color: var(--accent-green); }
.trial-reaction.wrong { border-color: var(--accent-red); }
.trial-reaction .reaction-speaker { color: var(--accent-gold); font-weight: bold; font-size: 0.85rem; margin-bottom: 4px; }
.trial-reaction p { color: var(--text-secondary); font-style: italic; }

.btn-submit-trial {
    background: var(--accent-red);
    color: white;
    font-size: 1rem;
    padding: 14px 36px;
    border: none; border-radius: 6px;
    cursor: pointer; font-family: 'Georgia', serif;
    letter-spacing: 1px; transition: all 0.2s;
}
.btn-submit-trial:hover {
    background: #d45555;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow-red);
}

/* === VERDICT === */
.verdict-container { text-align: center; padding: 50px 20px; max-width: 650px; margin: 0 auto; }
.verdict-container h2 { font-size: 2rem; letter-spacing: 3px; margin-bottom: 20px; }
.verdict-container .verdict-text { font-size: 1rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 30px; }
.verdict-perfect h2 { color: var(--accent-gold); }
.verdict-correct h2 { color: var(--accent-green); }
.verdict-wrong h2 { color: var(--accent-red); }
.verdict-inconclusive h2 { color: var(--text-secondary); }
.verdict-details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}
.verdict-details h4 { color: var(--accent-gold); margin-bottom: 10px; }
.verdict-details p { color: var(--text-secondary); margin-bottom: 6px; font-size: 0.9rem; }

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    border: 1px solid var(--accent-gold);
    padding: 14px 28px;
    border-radius: 8px;
    color: var(--accent-gold);
    font-family: 'Georgia', serif;
    z-index: 2000;
    animation: slideUp 0.3s ease;
    box-shadow: 0 8px 30px var(--shadow);
    font-size: 0.9rem;
}
.toast.hidden { display: none; }
.toast.toast-success { border-color: var(--accent-green); color: var(--accent-green); }
.toast.toast-error { border-color: var(--accent-red); color: var(--accent-red); }

/* === UTILITY === */
.hidden { display: none !important; }

/* === RESPONSIVE: TABLET === */
@media (max-width: 768px) {
    .game-title { font-size: 2.5rem; letter-spacing: 4px; }
    .hub-nav { grid-template-columns: 1fr; }
    .progress-panel { grid-template-columns: repeat(2, 1fr); }
    .interrogation-layout { grid-template-columns: 1fr; }
    .panel { padding: 25px; margin: 20px 10px; }
    .evidence-board { grid-template-columns: 1fr 1fr; }
    .evidence-filter { flex-wrap: wrap; }
    #game-container { padding: 10px; }
    .screen-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .crime-scene-container { aspect-ratio: 4/3; }
    .modal-content { width: 95%; padding: 20px; max-height: 90vh; }
    .examine-illustration { width: 150px; height: 150px; }
    .trial-evidence-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* === RESPONSIVE: PHONE === */
@media (max-width: 500px) {
    #game-container { padding: 8px; }
    .game-title { font-size: 2rem; letter-spacing: 2px; }
    .subtitle { font-size: 0.9rem; letter-spacing: 3px; margin-bottom: 40px; }
    .title-badge { font-size: 0.65rem; }
    .title-content { min-height: 75vh; }

    .hub-header h2 { font-size: 1.1rem; }
    .progress-panel { grid-template-columns: 1fr 1fr; gap: 8px; }
    .progress-item { padding: 8px; }
    .progress-label { font-size: 0.6rem; }
    .progress-text { font-size: 0.75rem; }

    .btn-nav { padding: 14px 16px; font-size: 0.9rem; }
    .btn-nav .nav-icon { font-size: 1.2rem; }
    .btn-nav .nav-text small { font-size: 0.7rem; }
    .btn { padding: 12px 20px; font-size: 0.9rem; }

    .screen-header h2 { font-size: 1rem; }
    .screen-header { padding-bottom: 10px; margin-bottom: 15px; }
    .scene-instruction { font-size: 0.8rem; margin-bottom: 12px; }

    .crime-scene-container { aspect-ratio: 3/4; min-height: 400px; border-radius: 6px; }
    .location-scene-container { min-height: 300px; border-radius: 6px; }

    .locations-grid { grid-template-columns: 1fr; gap: 10px; }
    .location-card { padding: 14px; }
    .location-card h3 { font-size: 0.95rem; }

    .evidence-board { grid-template-columns: 1fr; gap: 12px; }
    .evidence-card .evidence-illustration { height: 100px; }
    .evidence-card .evidence-info { padding: 10px; }
    .evidence-card .evidence-info h4 { font-size: 0.85rem; }
    .evidence-filter { gap: 5px; margin-left: 0; width: 100%; justify-content: flex-start; }
    .filter-btn { padding: 4px 8px; font-size: 0.7rem; }

    .suspects-grid { grid-template-columns: 1fr; gap: 10px; }
    .suspect-card { padding: 14px; gap: 12px; }
    .suspect-avatar { width: 50px; height: 50px; }

    .interrogation-layout { gap: 15px; }
    .suspect-profile-panel { padding: 15px; }
    .suspect-profile-panel .portrait-large { width: 80px; height: 80px; }
    .suspect-profile-panel h3 { font-size: 0.95rem; }
    .suspect-profile-panel .profile-details { font-size: 0.75rem; }
    .dialogue-box { padding: 14px; min-height: 100px; font-size: 0.9rem; }
    .question-btn { padding: 10px 12px; font-size: 0.85rem; }
    .btn-present-evidence { font-size: 0.8rem; padding: 10px 14px; }

    .timeline-container { padding-left: 45px; }
    .timeline-container::before { left: 20px; }
    .timeline-event { padding: 12px 14px; margin-bottom: 20px; }
    .timeline-event::before { left: -30px; width: 10px; height: 10px; }
    .timeline-event .time-label { font-size: 0.7rem; }
    .timeline-event h4 { font-size: 0.85rem; }
    .timeline-event p { font-size: 0.8rem; }

    .trial-container { padding: 0; }
    .trial-header { padding: 20px 10px; }
    .trial-header h2 { font-size: 1.1rem; letter-spacing: 2px; }
    .courtroom-scene { height: 70px; }
    .courtroom-scene svg { width: 280px; height: 70px; }
    .trial-phase h3 { font-size: 1rem; }
    .trial-option { padding: 12px 14px; font-size: 0.85rem; }
    .trial-evidence-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .trial-evidence-item { padding: 8px; }
    .trial-evidence-item h5 { font-size: 0.7rem; }
    .trial-reaction { padding: 12px; }
    .btn-submit-trial { font-size: 0.9rem; padding: 12px 24px; }

    .modal-content { width: 96%; padding: 16px; border-radius: 10px; }
    .examine-illustration { width: 130px; height: 130px; }
    .examine-modal h3 { font-size: 1rem; }
    .examine-modal .examine-description { font-size: 0.85rem; padding: 12px; }
    .btn-collect { padding: 12px 20px; font-size: 0.9rem; }

    .present-modal { padding: 16px; }
    .present-evidence-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .present-evidence-item { padding: 10px; }
    .present-evidence-item .mini-illustration { width: 40px; height: 40px; }
    .present-evidence-item h5 { font-size: 0.75rem; }

    .verdict-container { padding: 30px 15px; }
    .verdict-container h2 { font-size: 1.4rem; letter-spacing: 2px; }
    .verdict-container .verdict-text { font-size: 0.9rem; }
    .verdict-details { padding: 14px; }
    .verdict-details p { font-size: 0.8rem; }

    .panel { padding: 18px; margin: 15px 5px; }
    .panel h2 { font-size: 1.1rem; }
    .howto-step p { font-size: 0.85rem; }

    .toast { padding: 10px 18px; font-size: 0.8rem; bottom: 20px; max-width: 90vw; }

    .intro-panel { padding: 20px 15px; }
    .typewriter-container { font-size: 0.85rem; line-height: 1.7; }
    .stamp { font-size: 0.65rem; padding: 3px 8px; }
}

/* === RESPONSIVE: VERY SMALL PHONE === */
@media (max-width: 360px) {
    .game-title { font-size: 1.7rem; }
    .progress-panel { grid-template-columns: 1fr; }
    .present-evidence-grid { grid-template-columns: 1fr; }
    .trial-evidence-grid { grid-template-columns: 1fr; }
    .evidence-filter { justify-content: center; }
}

/* Touch-friendly: larger tap targets on mobile */
@media (hover: none) and (pointer: coarse) {
    .question-btn { min-height: 48px; }
    .trial-option { min-height: 48px; }
    .btn { min-height: 44px; }
    .filter-btn { min-height: 36px; padding: 8px 12px; }
    .location-card { min-height: 60px; }
    .suspect-card { min-height: 60px; }
    .scene-object { cursor: default; }
    .scene-object .hover-label { opacity: 1; }
}
