/* ===========================================
   CASEWORKS: MCU — Stylesheet
   Light wood grain desk, modern UI, icon-based menus
   =========================================== */

:root {
    --bg-dark: #1a1a1e;
    --bg-desk: #C4A870;
    --bg-desk-dark: #A88B5E;
    --bg-panel: rgba(255, 255, 255, 0.95);
    --bg-overlay: rgba(0, 0, 0, 0.65);
    --text-primary: #2A2A2E;
    --text-dim: rgba(42, 42, 46, 0.55);
    --text-label: rgba(42, 42, 46, 0.35);
    --accent: #2563EB;
    --accent-dim: rgba(37, 99, 235, 0.08);
    --accent-bright: #3B82F6;
    --border: rgba(0, 0, 0, 0.08);
    --border-med: rgba(0, 0, 0, 0.15);
    --red: #DC2626;
    --green: #16A34A;
    --blue: #2563EB;
    --gold: #D97706;
    --radius: 10px;
    --radius-sm: 6px;
    --font: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100%; overflow: hidden;
    background: var(--bg-dark); color: var(--text-primary);
    font-family: var(--font);
    touch-action: none;
    -webkit-user-select: none; user-select: none;
}

/* ---- Screens ---- */
.screen {
    position: fixed; inset: 0;
    display: none; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 1;
}
.screen.active { display: flex; }

/* ---- Title Screen ---- */
#screen-title {
    background: linear-gradient(170deg, #1a1a1e 0%, #111114 100%);
}
.title-content { text-align: center; }
.title-badge {
    font-size: 0.55rem; letter-spacing: 0.35em; text-transform: uppercase;
    color: var(--gold); opacity: 0.8; margin-bottom: 0.5rem;
    font-weight: 600;
}
.title-content h1 {
    font-size: 3.5rem; letter-spacing: 0.08em; color: #fff;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.title-sub {
    font-size: 0.8rem; opacity: 0.35; letter-spacing: 0.06em; margin-bottom: 2rem;
    color: #fff;
}
.title-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.title-footer {
    margin-top: 2.5rem; font-size: 0.55rem; opacity: 0.15; letter-spacing: 0.06em; color: #fff;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--accent); border: none;
    color: #fff; font-family: var(--font);
    padding: 12px 32px; border-radius: var(--radius); font-size: 0.85rem;
    cursor: pointer; letter-spacing: 0.02em; transition: all 0.2s;
    font-weight: 600; box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: #1D4ED8; box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: transparent; border: 1px solid var(--border-med);
    color: var(--text-dim); font-family: var(--font);
    padding: 10px 24px; border-radius: var(--radius); font-size: 0.8rem;
    cursor: pointer; transition: all 0.2s; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 6px 14px; font-size: 0.75rem; border-radius: var(--radius-sm); }
.btn-close {
    background: none; border: none; color: var(--text-dim); font-size: 1.4rem;
    cursor: pointer; padding: 4px 8px; line-height: 1;
}
.btn-close:hover { color: var(--text-primary); }

/* ---- Partnership Screen ---- */
#screen-partnership {
    background: linear-gradient(170deg, #1a1a1e 0%, #111114 100%);
}
.panel-center {
    background: var(--bg-panel); border: none;
    border-radius: 16px; padding: 28px 32px; max-width: 380px; width: 90%;
    box-shadow: var(--shadow-lg);
}
.panel-center h2 {
    font-size: 1rem; letter-spacing: 0.15em; color: var(--accent);
    margin-bottom: 0.25rem; font-weight: 700;
}
.panel-sub { font-size: 0.75rem; opacity: 0.4; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; font-size: 0.6rem; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--text-dim); margin-bottom: 6px;
    font-weight: 600;
}
.form-group input {
    width: 100%; background: #F8F8FA; border: 1px solid var(--border-med);
    border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-primary);
    font-family: var(--font); font-size: 0.85rem; outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.code-row { display: flex; align-items: center; gap: 8px; }
.code-row input { flex: 1; font-family: var(--font-mono); }
.code-or { font-size: 0.7rem; opacity: 0.3; }

.status-msg { font-size: 0.75rem; color: var(--accent); min-height: 1.2em; }

/* ---- Desk Screen (LIGHT WOOD GRAIN) ---- */
#screen-desk { z-index: 1; }

#desk-surface {
    position: absolute; inset: 0;
    background:
        /* Wood grain texture via CSS */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 3px,
            rgba(139, 109, 66, 0.06) 3px,
            rgba(139, 109, 66, 0.06) 4px
        ),
        repeating-linear-gradient(
            85deg,
            transparent 0px,
            transparent 8px,
            rgba(139, 109, 66, 0.04) 8px,
            rgba(139, 109, 66, 0.04) 10px
        ),
        linear-gradient(180deg,
            #D4B88A 0%,
            #C4A870 20%,
            #BFA268 50%,
            #C4A870 80%,
            #CEAE78 100%
        );
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    padding: 50px 20px 60px;
    align-items: center; justify-items: center;
}

/* Desk objects */
.desk-object {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; padding: 14px 18px; border-radius: 14px;
    border: 1px solid transparent; transition: all 0.25s;
    -webkit-tap-highlight-color: transparent;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}
.desk-object:hover, .desk-object:active {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.obj-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.obj-icon svg { width: 48px; height: 48px; }
.obj-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: rgba(60, 40, 20, 0.7); font-weight: 600;
}
.desk-flavor { opacity: 0.7; }
.desk-flavor:hover { opacity: 1; }

.inbox-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--red); color: #fff; font-size: 0.55rem;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; box-shadow: 0 2px 4px rgba(220,38,38,0.3);
}
.desk-object { position: relative; }

/* Clock */
#desk-clock {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
    text-align: center; z-index: 5; pointer-events: none;
    background: rgba(255,255,255,0.85);
    padding: 6px 16px; border-radius: 20px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}
.clock-time {
    font-size: 1.1rem; color: var(--text-primary); letter-spacing: 0.05em;
    font-family: var(--font-mono); font-weight: 600;
}
.clock-label { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.35; }

/* Partner status */
#partner-status {
    position: fixed; top: 12px; right: 16px; text-align: right; z-index: 5;
    pointer-events: none;
    background: rgba(255,255,255,0.85);
    padding: 6px 14px; border-radius: 12px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}
.partner-label { font-size: 0.45rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.35; font-weight: 600; }
.partner-name { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.partner-activity { font-size: 0.55rem; opacity: 0.35; }

/* Rank HUD */
#rank-hud {
    position: fixed; top: 12px; left: 16px; z-index: 5;
    background: rgba(255,255,255,0.85);
    padding: 6px 14px; border-radius: 12px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
#rank-hud:hover { box-shadow: var(--shadow-md); }
#rank-icon { font-size: 1.2rem; }
#rank-name { font-size: 0.7rem; font-weight: 600; color: var(--text-primary); }
#rank-bar-container {
    width: 50px; height: 4px; background: rgba(0,0,0,0.08);
    border-radius: 2px; overflow: hidden;
}
#rank-bar-fill {
    height: 100%; background: var(--gold);
    border-radius: 2px; transition: width 0.5s ease;
}

/* Activity feed */
#activity-feed {
    position: fixed; top: 44px; right: 12px; width: 200px;
    max-height: 40vh; overflow-y: auto; z-index: 5;
    pointer-events: none;
}
.feed-title {
    font-size: 0.45rem; text-transform: uppercase; letter-spacing: 0.12em;
    opacity: 0.2; margin-bottom: 4px; font-weight: 600;
    color: rgba(60,40,20,0.6);
}
#feed-list { display: flex; flex-direction: column; gap: 2px; }
.feed-entry {
    font-size: 0.55rem; opacity: 0.25; padding: 2px 6px;
    background: rgba(255,255,255,0.4); border-radius: 4px;
    color: rgba(60,40,20,0.8);
}
.feed-entry.self { color: var(--accent); opacity: 0.5; }
.feed-entry.system { color: var(--gold); opacity: 0.6; font-weight: 600; }

/* Desk bottom bar */
#desk-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: center; gap: 8px;
    padding: 10px 16px; z-index: 5;
    pointer-events: none;
}
.bar-btn {
    pointer-events: auto;
    background: rgba(255,255,255,0.9); border: 1px solid var(--border);
    border-radius: 20px; padding: 10px 20px;
    color: var(--text-primary); font-family: var(--font); font-size: 0.75rem;
    cursor: pointer; transition: all 0.2s;
    box-shadow: var(--shadow-sm); font-weight: 500;
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
}
.bar-btn:hover { background: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ---- Overlays ---- */
.overlay {
    position: fixed; inset: 0; z-index: 50;
    display: none; align-items: center; justify-content: center;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
}
.overlay.active { display: flex; }

.overlay-panel {
    background: var(--bg-panel); border: none;
    border-radius: 16px; max-width: 420px; width: 92%;
    max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.overlay-wide { max-width: 560px; }
.overlay-full { max-width: 90vw; max-height: 90vh; width: 90vw; height: 85vh; }

.overlay-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
}
.overlay-header h3 {
    font-size: 0.85rem; letter-spacing: 0.02em; color: var(--text-primary);
    font-weight: 700;
}

.overlay-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    padding: 0 20px;
}
.tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-dim); font-family: var(--font); font-size: 0.7rem;
    padding: 10px 14px; cursor: pointer; letter-spacing: 0.02em;
    text-transform: uppercase; transition: all 0.2s; font-weight: 600;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text-primary); }

.overlay-body {
    padding: 16px 20px; overflow-y: auto; flex: 1;
    font-size: 0.8rem; line-height: 1.6;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Phone contacts ---- */
.contact-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.15s;
    border-radius: var(--radius-sm);
}
.contact-item:hover { background: var(--accent-dim); }
.contact-name { font-size: 0.8rem; color: var(--text-primary); font-weight: 500; }
.contact-dept { font-size: 0.6rem; color: var(--text-dim); }
.contact-locked { opacity: 0.3; pointer-events: none; }

/* ---- Computer / DB ---- */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input {
    flex: 1; background: #F8F8FA; border: 1px solid var(--border-med);
    border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-primary);
    font-family: var(--font-mono); font-size: 0.8rem; outline: none;
}
.search-bar input:focus { border-color: var(--accent); }

.db-result {
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; font-family: var(--font-mono); font-size: 0.75rem;
    line-height: 1.5; background: #FAFAFA;
}
.db-result .field-label { color: var(--text-dim); text-transform: uppercase; font-size: 0.55rem; font-weight: 600; }
.db-result .field-value { color: var(--text-primary); }

/* ---- Evidence Board ---- */
#evidence-board {
    width: 100%; height: 100%; position: relative;
    background:
        linear-gradient(rgba(139,109,66,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139,109,66,0.08) 1px, transparent 1px),
        #FFFFF0;
    background-size: 40px 40px;
    border: 2px solid #8B6914;
    border-radius: var(--radius);
    min-height: 50vh;
}
.board-pin {
    position: absolute; padding: 8px 12px;
    background: #FFFFF5; border: 1px solid var(--border-med);
    border-radius: 4px; font-size: 0.7rem; max-width: 140px;
    cursor: grab; user-select: none;
    box-shadow: var(--shadow-sm); font-weight: 500;
}
.board-pin.suspect { border-left: 3px solid var(--red); }
.board-pin.evidence { border-left: 3px solid var(--blue); }
.board-pin.witness { border-left: 3px solid var(--green); }

/* ---- Inbox ---- */
.inbox-item {
    padding: 14px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
}
.inbox-item:hover { border-color: var(--accent); background: var(--accent-dim); box-shadow: var(--shadow-sm); }
.inbox-item.new { border-left: 3px solid var(--red); }
.inbox-type { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--red); font-weight: 700; }
.inbox-tier { color: var(--gold); }
.inbox-title { font-size: 0.85rem; color: var(--text-primary); margin: 2px 0; font-weight: 600; }
.inbox-summary { font-size: 0.7rem; opacity: 0.4; }
.inbox-tutorial-tag {
    display: inline-block; margin-top: 6px;
    font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em;
    background: var(--green); color: #fff; padding: 2px 8px;
    border-radius: 4px; font-weight: 700;
}
.inbox-section-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-dim); font-weight: 700; margin-bottom: 8px;
    padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

/* ---- Portraits ---- */
.portrait {
    border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border); flex-shrink: 0;
}
.portrait-sm { width: 36px; height: 36px; }
.portrait-card { width: 48px; height: 48px; }
.portrait-call { width: 42px; height: 42px; margin-right: 8px; }
.person-card.has-portrait { display: flex; align-items: flex-start; gap: 10px; }
.person-card-info { flex: 1; min-width: 0; }
.contact-item { display: flex; align-items: center; gap: 8px; }
.dialogue-speaker.has-portrait { display: flex; align-items: center; gap: 8px; }

/* ---- Case Switcher Strip ---- */
#case-switcher {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; overflow-x: auto;
    background: rgba(0,0,0,0.25); border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
}
.switcher-label {
    font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); white-space: nowrap; margin-right: 4px;
}
.switcher-case {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 4px;
    background: var(--card-bg); border: 1px solid var(--border);
    color: var(--text); font-size: 0.65rem; cursor: pointer;
    white-space: nowrap; transition: background 0.15s, border-color 0.15s;
}
.switcher-case:hover { background: var(--card-hover); }
.switcher-case.focused {
    border-color: var(--accent); background: rgba(196,162,101,0.15);
    font-weight: 700;
}
.switcher-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-dim); flex-shrink: 0;
}
.switcher-dot.dot-active { background: var(--green); }
.switcher-dot.dot-charges { background: var(--accent); }

/* ---- Dialogue ---- */
.dialogue-speaker {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent); margin-bottom: 4px; font-weight: 700;
}
.dialogue-text { font-size: 0.8rem; line-height: 1.5; font-style: italic; }

#phone-choices, #dialogue-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.dialogue-choice {
    background: var(--accent-dim); border: 1px solid rgba(37,99,235,0.15);
    border-radius: var(--radius); padding: 10px 14px; cursor: pointer;
    font-family: var(--font); font-size: 0.75rem; color: var(--accent);
    text-align: left; transition: all 0.15s; font-weight: 500;
}
.dialogue-choice:hover { border-color: var(--accent); background: rgba(37,99,235,0.12); }

/* ---- Evidence cards ---- */
.evidence-card {
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; background: #FAFAFA;
}
.ev-status {
    font-size: 0.6rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em;
}
.quality-badge {
    font-size: 0.55rem; text-transform: uppercase; font-weight: 700;
    padding: 1px 6px; border-radius: 3px; letter-spacing: 0.05em;
}
.quality-pristine { background: rgba(22,163,74,0.1); color: var(--green); }
.quality-compromised { background: rgba(217,119,6,0.1); color: var(--gold); }
.quality-inadmissible { background: rgba(220,38,38,0.1); color: var(--red); }

.btn-lab-submit {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent-dim); border: 1px solid rgba(37,99,235,0.15);
    border-radius: var(--radius-sm); padding: 4px 10px;
    font-size: 0.65rem; color: var(--accent); cursor: pointer;
    font-family: var(--font); font-weight: 500; transition: all 0.15s;
}
.btn-lab-submit:hover { background: rgba(37,99,235,0.12); border-color: var(--accent); }
.lab-icon { font-size: 0.7rem; }

/* Person cards */
.person-card {
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; background: #FAFAFA;
}
.suspect-primary { border-left: 3px solid var(--red); background: rgba(220,38,38,0.02); }
.person-tag {
    font-size: 0.5rem; text-transform: uppercase; font-weight: 700;
    padding: 2px 6px; border-radius: 3px; margin-left: 8px;
}
.tag-done { background: rgba(22,163,74,0.1); color: var(--green); }
.tag-pending { background: rgba(0,0,0,0.04); color: var(--text-dim); }
.tag-primary { background: rgba(220,38,38,0.1); color: var(--red); }

.btn-mark-primary {
    background: none; border: 1px solid var(--border-med);
    border-radius: var(--radius-sm); padding: 4px 10px;
    font-size: 0.65rem; color: var(--text-dim); cursor: pointer;
    font-family: var(--font); transition: all 0.15s;
}
.btn-mark-primary:hover { border-color: var(--red); color: var(--red); }

/* Timeline */
.timeline-entry {
    padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.75rem;
}

/* Case status badges */
.case-status-badge {
    margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-sm);
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-charges { background: rgba(37,99,235,0.08); color: var(--accent); }
.status-closed { background: rgba(22,163,74,0.08); color: var(--green); }

/* ---- DA Presentation ---- */
.da-section {}
.da-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); margin-bottom: 8px; font-weight: 700;
}
.da-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 6px; cursor: pointer; transition: all 0.15s;
}
.da-option:hover { border-color: var(--accent); background: var(--accent-dim); }
.da-option input[type="radio"],
.da-option input[type="checkbox"] {
    margin-top: 3px; accent-color: var(--accent);
}
.da-option-body { flex: 1; }
.da-option-name { font-size: 0.8rem; font-weight: 600; }
.da-option-desc { font-size: 0.65rem; opacity: 0.5; margin-top: 2px; }

.verdict-box {
    padding: 16px; border-radius: var(--radius); text-align: center;
}
.verdict-good { background: rgba(22,163,74,0.08); border: 1px solid rgba(22,163,74,0.2); }
.verdict-ok { background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.2); }
.verdict-bad { background: rgba(220,38,38,0.05); border: 1px solid rgba(220,38,38,0.15); }
.verdict-terrible { background: rgba(220,38,38,0.1); border: 1px solid rgba(220,38,38,0.3); }
.verdict-title {
    font-size: 1rem; font-weight: 800; letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.verdict-good .verdict-title { color: var(--green); }
.verdict-ok .verdict-title { color: var(--gold); }
.verdict-bad .verdict-title { color: var(--red); }
.verdict-terrible .verdict-title { color: var(--red); }
.verdict-msg { font-size: 0.75rem; line-height: 1.5; opacity: 0.7; }

/* ---- Post-Charge / Challenges ---- */
.challenge-card {
    padding: 14px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 10px; background: #FAFAFA;
}
.challenge-done { opacity: 0.6; }
.challenge-label { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.challenge-desc { font-size: 0.7rem; opacity: 0.5; }
.challenge-task { font-size: 0.7rem; color: var(--accent); margin-top: 6px; font-weight: 500; }
.challenge-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.btn-challenge {
    background: var(--accent); border: none; color: #fff;
    padding: 6px 14px; border-radius: var(--radius-sm);
    font-size: 0.7rem; cursor: pointer; font-family: var(--font);
    font-weight: 600; transition: all 0.15s;
}
.btn-challenge:hover { background: #1D4ED8; }
.btn-challenge.btn-secondary { background: transparent; border: 1px solid var(--border-med); color: var(--text-dim); }
.btn-weak { background: transparent; border: 1px solid var(--border-med); color: var(--red); }
.challenge-status { font-size: 0.65rem; font-weight: 700; margin-top: 4px; }

/* ---- Rank Profile ---- */
.rank-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    font-size: 0.75rem; opacity: 0.35;
}
.rank-current { background: rgba(217,119,6,0.08); opacity: 1; font-weight: 600; }
.rank-past { opacity: 0.5; }
.rank-row-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.rank-row-title { flex: 1; }
.rank-row-tiers { font-family: var(--font-mono); font-size: 0.65rem; opacity: 0.5; }

.rank-progress-bar {
    width: 100%; height: 6px; background: rgba(0,0,0,0.06);
    border-radius: 3px; overflow: hidden;
}
.rank-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--gold), #F59E0B);
    border-radius: 3px; transition: width 0.5s ease;
}

.stat-row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ---- Notes ---- */
#notes-input {
    width: 100%; min-height: 200px; background: #FAFAFA;
    border: 1px solid var(--border-med); border-radius: var(--radius);
    padding: 12px; color: var(--text-primary); font-family: var(--font);
    font-size: 0.8rem; line-height: 1.6; resize: vertical; outline: none;
}
#notes-input:focus { border-color: var(--accent); }

/* Email items */
.email-item {
    padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer;
    transition: background 0.15s; border-radius: var(--radius-sm);
}
.email-item:hover { background: var(--accent-dim); }
.email-item.unread { border-left: 3px solid var(--accent); font-weight: 500; }
.email-from { font-size: 0.6rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.email-subject { font-size: 0.8rem; color: var(--text-primary); font-weight: 500; }
.email-preview { font-size: 0.7rem; opacity: 0.35; margin-top: 2px; }

/* ---- Toast ---- */
.toast {
    position: fixed; top: 50px; left: 50%; transform: translateX(-50%);
    background: var(--bg-panel); border: 1px solid var(--border-med);
    border-radius: 12px; padding: 10px 20px; font-size: 0.8rem;
    box-shadow: var(--shadow-md); z-index: 60;
    opacity: 0; transition: opacity 0.4s; pointer-events: none;
    max-width: 340px; text-align: center;
}
.toast.show { opacity: 1; }

#tutorial-toast {
    top: 50%; bottom: auto; transform: translate(-50%, -50%);
    border: 1px solid rgba(22,163,74,0.3);
    background: rgba(255,255,255,0.95);
    color: #1a2a1a;
    font-size: 0.8rem; line-height: 1.5;
    backdrop-filter: blur(16px);
    max-width: 340px; padding: 14px 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* ---- Scene Mode ---- */
#screen-scene { background: #111; }
#scene-container { position: absolute; inset: 0; }

#scene-hud {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; z-index: 10;
}
.scene-btn {
    background: rgba(255,255,255,0.9); border: none;
    border-radius: 20px; padding: 10px 20px;
    color: var(--text-primary); font-family: var(--font); font-size: 0.75rem;
    cursor: pointer; box-shadow: var(--shadow-md); font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.15s;
    backdrop-filter: blur(8px);
}
.scene-btn:hover { background: #fff; box-shadow: var(--shadow-lg); }
.scene-btn.active {
    background: var(--accent); color: #fff;
}
.scene-btn svg { width: 20px; height: 20px; }

#scene-evidence-popup {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: var(--bg-panel); border-radius: 16px;
    padding: 16px 20px; width: 90%; max-width: 400px;
    box-shadow: var(--shadow-lg); z-index: 15;
}
#scene-ev-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
#scene-ev-desc { font-size: 0.7rem; opacity: 0.5; margin-bottom: 12px; }
#scene-ev-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
}

.ev-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: #F8F8FA; border: 1px solid var(--border-med);
    border-radius: var(--radius); padding: 10px 14px;
    cursor: pointer; transition: all 0.15s; min-width: 70px;
}
.ev-action-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.ev-action-btn.ev-action-done {
    background: rgba(22,163,74,0.08); border-color: var(--green);
}
.ev-action-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.ev-action-icon svg { width: 32px; height: 32px; }
.ev-action-label { font-size: 0.6rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.ev-action-close {
    border: none; background: transparent;
}
.ev-action-close .ev-action-label { color: var(--red); }

/* ---- Arrest / QTE ---- */
.approach-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 20px 16px;
    background: #F8F8FA; border: 2px solid var(--border-med);
    border-radius: var(--radius); cursor: pointer;
    font-family: var(--font); transition: all 0.2s;
}
.approach-btn:hover {
    border-color: var(--accent); background: var(--accent-dim);
    transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.approach-btn:active { transform: scale(0.97); }

.qte-container {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 20px 0; gap: 16px;
    min-height: 220px; user-select: none;
}
.qte-counter {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-dim); font-weight: 700;
}
.qte-instruction {
    font-size: 1rem; font-weight: 800; letter-spacing: 0.04em;
    text-transform: uppercase; transition: color 0.2s;
}
.qte-arrow {
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--border-med); border-radius: 50%;
    color: var(--text-primary); transition: all 0.25s;
    animation: qte-pulse 0.8s ease-in-out infinite;
}
.qte-arrow svg { width: 60px; height: 60px; }
.qte-arrow.qte-success {
    border-color: var(--green); color: var(--green);
    background: rgba(22,163,74,0.08);
    animation: qte-pop 0.3s ease-out;
}
.qte-arrow.qte-fail {
    border-color: var(--red); color: var(--red);
    background: rgba(220,38,38,0.06);
    animation: qte-shake 0.3s ease-out;
}

@keyframes qte-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
@keyframes qte-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
@keyframes qte-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.qte-timer-bar {
    width: 80%; max-width: 260px; height: 6px;
    background: rgba(0,0,0,0.06); border-radius: 3px;
    overflow: hidden;
}
.qte-timer-fill {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 3px;
    transition: width 1s linear; /* overridden inline */
}

.qte-score-bar {
    width: 80%; max-width: 260px; height: 8px;
    background: rgba(0,0,0,0.06); border-radius: 4px;
    overflow: hidden; margin: 0 auto;
}
.qte-score-fill {
    height: 100%; border-radius: 4px;
    transition: width 0.6s ease-out;
}

/* ---- Settings ---- */
.settings-section {}
.settings-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-dim); margin-bottom: 8px; font-weight: 700;
}

/* Miranda lines */
.miranda-line {
    font-size: 0.8rem; line-height: 1.6;
    padding: 6px 12px; margin-bottom: 4px;
    border-left: 2px solid var(--accent);
    background: var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    animation: miranda-fade 0.4s ease-out;
    font-style: italic; color: var(--text-primary);
}
@keyframes miranda-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .title-content h1 { font-size: 2.2rem; }
    #desk-surface {
        grid-template-columns: repeat(3, 1fr);
        padding: 56px 12px 70px;
        gap: 6px;
    }
    .desk-object {
        padding: 10px 8px; border-radius: 12px;
        background: rgba(255,255,255,0.2);
    }
    .obj-icon { width: 32px; height: 32px; font-size: 1.4rem; }
    .obj-icon svg { width: 32px; height: 32px; }
    .obj-label { font-size: 0.5rem; letter-spacing: 0.08em; }
    .overlay-panel { width: 96%; max-height: 90vh; border-radius: 12px; }
    .overlay-wide { max-width: 96vw; }
    #activity-feed { display: none; }
    #desk-clock { top: 8px; padding: 4px 12px; }
    .clock-time { font-size: 0.9rem; }
    #partner-status { top: 8px; right: 8px; padding: 4px 10px; border-radius: 10px; }
    .partner-name { font-size: 0.65rem; }
    #rank-hud { top: 8px; left: 8px; padding: 4px 10px; border-radius: 10px; }
    #rank-name { font-size: 0.6rem; }
    #rank-bar-container { width: 36px; }
    #desk-bar { gap: 6px; padding: 8px 10px; }
    .bar-btn { padding: 10px 14px; font-size: 0.7rem; border-radius: 16px; }
    #case-switcher { padding: 5px 8px; gap: 4px; }
    .switcher-case { padding: 3px 8px; font-size: 0.6rem; }
    .person-card { padding: 10px; }
    .portrait-sm { width: 30px; height: 30px; }
    .portrait-card { width: 40px; height: 40px; }
    .portrait-call { width: 34px; height: 34px; }
}

@media (max-width: 380px) {
    #desk-surface {
        grid-template-columns: repeat(2, 1fr);
        padding: 52px 8px 68px;
    }
    .desk-object { padding: 8px 6px; }
    .obj-icon { width: 28px; height: 28px; font-size: 1.2rem; }
    .bar-btn { padding: 8px 10px; font-size: 0.65rem; }
    .overlay-panel { width: 98%; }
}

@media (orientation: portrait) and (min-width: 381px) {
    #desk-surface {
        grid-template-columns: repeat(3, 1fr);
    }
}
