@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --df-gold:      #d4a843;
    --df-gold-dark: #8a6820;
    --df-sepia:     #c8aa82;
    --df-bg:        #0e0c07;
    --df-bg2:       #1a1408;
    --df-card:      rgba(26, 20, 8, 0.95);
    --df-border:    rgba(212,168,67,0.2);
    --df-text:      #e0d5c0;
    --df-muted:     #8a7a60;
    --df-shadow:    0 24px 60px rgba(0,0,0,0.7);
    --df-radius:    18px;
    --df-font:      'Outfit', sans-serif;
    --df-typewriter:'Special Elite', cursive;
    --df-clue-glow: rgba(212,168,67,0.55);
}

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

body {
    font-family: var(--df-font);
    background: var(--df-bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(212,168,67,0.06) 0, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(91,175,224,0.04) 0, transparent 50%);
    min-height: 100vh;
    color: var(--df-text);
}

/* ── Vignette overlay ────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.df-wrapper {
    max-width: 900px;
    width: 95%;
    margin: 32px auto 0;
    background: var(--df-card);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius);
    box-shadow: var(--df-shadow);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: dfSlideUp 0.7s cubic-bezier(0.2,0.8,0.2,1) both;
}

@keyframes dfSlideUp {
    from { opacity:0; transform:translateY(32px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ── Header ──────────────────────────────────────────────── */
.df-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--df-border);
    background: linear-gradient(135deg, rgba(212,168,67,0.05) 0%, transparent 100%);
}

.df-header h1 {
    font-family: var(--df-typewriter);
    font-size: clamp(1rem, 4vw, 1.6rem);
    color: var(--df-gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(212,168,67,0.4);
}

.ms-back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--df-sepia);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.ms-back-btn:hover { opacity: 1; }

/* ── Case Select ─────────────────────────────────────────── */
.df-case-select { padding: 28px 24px 32px; }

.df-intro-text {
    font-family: var(--df-typewriter);
    color: var(--df-sepia);
    text-align: center;
    margin-bottom: 24px;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.df-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.df-case-card {
    touch-action: manipulation;
    background: rgba(212,168,67,0.04);
    border: 1px solid var(--df-border);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}
.df-case-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212,168,67,0.06) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s;
}
.df-case-card:hover::before { opacity: 1; }
.df-case-card:hover { border-color: rgba(212,168,67,0.45); transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); }

.df-case-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}
.df-case-card.solved { border-color: rgba(91,224,168,0.3); }
.df-case-card.solved::after {
    content: '';
    position: absolute;
    top: 12px; right: 12px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #5be0a8;
    box-shadow: 0 0 8px #5be0a8;
}

.df-case-number {
    font-family: var(--df-typewriter);
    font-size: 0.7rem;
    color: var(--df-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.7;
}

.df-case-card h3 {
    font-size: 1rem;
    color: var(--df-text);
    margin-bottom: 8px;
    font-weight: 600;
}

.df-case-desc {
    font-size: 0.8rem;
    color: var(--df-muted);
    line-height: 1.5;
}

.df-case-lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 1.5rem;
    opacity: 0.5;
}

/* ── Game Area ───────────────────────────────────────────── */
.df-game-area { display: block; }
.df-game-area.hidden { display: none; }
.df-case-select.hidden { display: none; }

/* ── Top Bar ─────────────────────────────────────────────── */
.df-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--df-border);
    background: rgba(0,0,0,0.3);
    flex-wrap: wrap;
    gap: 10px;
}

.df-case-info { display: flex; flex-direction: column; gap: 2px; }
.df-case-num {
    font-family: var(--df-typewriter);
    font-size: 0.7rem;
    color: var(--df-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.df-case-name {
    font-size: 0.95rem;
    color: var(--df-text);
    font-weight: 600;
}

.df-top-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}
.df-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--df-sepia);
}
.df-stat svg { flex-shrink: 0; }

.df-hint-btn {
    background: rgba(212,168,67,0.1);
    border: 1px solid rgba(212,168,67,0.3);
    color: var(--df-gold);
    border-radius: 8px;
    padding: 5px 12px;
    font-family: var(--df-font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.df-hint-btn:hover { background: rgba(212,168,67,0.2); }
.df-hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.df-hint-left { font-size: 0.8rem; color: var(--df-muted); }

/* ── Scene ───────────────────────────────────────────────── */
.df-scene-container {
    position: relative;
    width: 100%;
    min-height: 160px;
}

.df-scene {
    position: relative;
    width: 100%;
    min-height: 160px;
    overflow: hidden;
    cursor: crosshair;
}

/* Vignette — noir depth */
.df-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, transparent 28%, rgba(0,0,0,0.48) 100%);
    pointer-events: none;
    z-index: 7;
}

/* Scanlines — vintage film feel */
.df-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px, transparent 2px,
        rgba(0,0,0,0.032) 2px, rgba(0,0,0,0.032) 3px
    );
    pointer-events: none;
    z-index: 8;
}

.df-scene-instructions {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--df-border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.78rem;
    color: var(--df-sepia);
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* Hotspot clues — invisible by default, appear on hover/touch */
.df-clue-hotspot {
    position: absolute;
    width: 44px; height: 44px;
    cursor: zoom-in;
    z-index: 10;
    border-radius: 50%;
    transition: transform 0.18s ease;
}
.df-clue-hotspot:hover,
.df-clue-hotspot:active { transform: scale(1.1); }

/* The reveal ring — hidden until hover */
.df-clue-hotspot::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--df-gold);
    box-shadow:
        0 0 14px rgba(212,168,67,0.55),
        0 0 30px rgba(212,168,67,0.18),
        inset 0 0 10px rgba(212,168,67,0.12);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.df-clue-hotspot:hover::before,
.df-clue-hotspot:active::before {
    opacity: 1;
    transform: scale(1);
    animation: dfHoverPulse 2s ease-in-out infinite;
}
.df-clue-hotspot.found::before {
    opacity: 1;
    transform: scale(1);
    animation: none;
    border-color: #5be0a8;
    box-shadow:
        0 0 12px rgba(91,224,168,0.5),
        0 0 26px rgba(91,224,168,0.15);
}

@keyframes dfHoverPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(212,168,67,0.5), inset 0 0 8px rgba(212,168,67,0.1);
    }
    50% {
        box-shadow: 0 0 24px rgba(212,168,67,0.8), 0 0 44px rgba(212,168,67,0.25), inset 0 0 12px rgba(212,168,67,0.18);
    }
}

.df-clue-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: transparent;
    transition: background 0.22s ease;
}
.df-clue-hotspot:hover .df-clue-inner,
.df-clue-hotspot:active .df-clue-inner {
    background: rgba(212,168,67,0.14);
}
.df-clue-hotspot.found .df-clue-inner {
    background: rgba(91,224,168,0.16);
}

/* Clue label — revealed after finding */
.df-clue-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14,12,7,0.96);
    border: 1px solid rgba(212,168,67,0.35);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.74rem;
    color: var(--df-gold);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s;
    z-index: 20;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
}
.df-clue-hotspot.found .df-clue-tooltip { opacity: 1; }

/* Scene objects (furniture, items) */
.df-scene-obj {
    position: absolute;
    pointer-events: none;
}

/* ── Deduction Panel ─────────────────────────────────────── */
.df-deduction-panel {
    padding: 24px;
    border-top: 1px solid var(--df-border);
    background: rgba(0,0,0,0.2);
}
.df-deduction-panel.hidden { display: none; }

.df-deduction-panel h3 {
    font-family: var(--df-typewriter);
    font-size: 1rem;
    color: var(--df-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.df-deduction-hint {
    font-size: 0.82rem;
    color: var(--df-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.df-suspects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.df-suspect-card {
    background: rgba(212,168,67,0.04);
    border: 1px solid rgba(212,168,67,0.15);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.df-suspect-card:hover { border-color: rgba(212,168,67,0.4); background: rgba(212,168,67,0.08); }
.df-suspect-card.eliminated {
    opacity: 0.45;
    text-decoration: line-through;
    cursor: default;
}
.df-suspect-card.selected {
    border-color: var(--df-gold);
    background: rgba(212,168,67,0.12);
    box-shadow: 0 0 16px rgba(212,168,67,0.2);
}

.df-suspect-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    margin-bottom: 10px;
    overflow: hidden;
    background: rgba(212,168,67,0.1);
    border: 1.5px solid rgba(212,168,67,0.2);
}

.df-suspect-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--df-text);
    margin-bottom: 4px;
}

.df-suspect-alibi {
    font-size: 0.75rem;
    color: var(--df-muted);
    line-height: 1.45;
}

.df-alibi-crossed { text-decoration: line-through; color: #e84560; opacity: 0.6; }

.df-accuse-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background: linear-gradient(135deg, #8a6820 0%, var(--df-gold) 100%);
    border: none;
    border-radius: 12px;
    padding: 13px 24px;
    color: #0e0c07;
    font-family: var(--df-font);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--df-typewriter);
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(212,168,67,0.25);
}
.df-accuse-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(212,168,67,0.4); }
.df-accuse-btn.hidden { display: none; }

/* ── Clue Log (side) ─────────────────────────────────────── */
.df-clue-log {
    padding: 16px 20px;
    border-top: 1px solid var(--df-border);
    background: rgba(212,168,67,0.02);
}
.df-clue-log h4 {
    font-family: var(--df-typewriter);
    font-size: 0.75rem;
    color: var(--df-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.8;
}
.df-clue-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.df-clue-entry {
    background: rgba(212,168,67,0.08);
    border: 1px solid rgba(212,168,67,0.2);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: var(--df-sepia);
    animation: dfFadeIn 0.4s ease;
}
@keyframes dfFadeIn { from { opacity:0; transform:scale(0.8); } to { opacity:1; transform:scale(1); } }

/* ── Modals ──────────────────────────────────────────────── */
.df-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 4, 2, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 16px;
    backdrop-filter: blur(6px);
}
.df-modal.hidden { display: none; }

.df-modal-content {
    background: linear-gradient(160deg, rgba(26,20,8,0.99) 0%, rgba(14,12,7,0.99) 100%);
    border: 1px solid var(--df-border);
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: var(--df-shadow);
    animation: dfModalIn 0.35s cubic-bezier(0.2,0.8,0.2,1) both;
    position: relative;
    overflow: hidden;
}

/* Paper grain overlay */
.df-modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.6;
    border-radius: inherit;
}

@keyframes dfModalIn {
    from { opacity:0; transform:scale(0.88) translateY(20px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
}

.df-modal-badge { margin-bottom: -4px; }

.df-modal-content h2 {
    font-family: var(--df-typewriter);
    font-size: clamp(0.85rem, 3.5vw, 1.2rem);
    color: var(--df-gold);
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.df-modal-subtitle {
    font-size: 0.88rem;
    color: var(--df-muted);
    text-align: center;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.df-name-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--df-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--df-text);
    font-family: var(--df-font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    position: relative;
    z-index: 1;
}
.df-name-input:focus { border-color: var(--df-gold); }
.df-name-input::placeholder { color: #5a4a30; }

.df-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--df-gold-dark) 0%, var(--df-gold) 100%);
    border: none;
    border-radius: 12px;
    padding: 13px 24px;
    color: #0e0c07;
    font-family: var(--df-typewriter);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(212,168,67,0.2);
    position: relative; z-index: 1;
}
.df-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(212,168,67,0.4); }
.df-btn-primary:active { transform: translateY(0); }

.df-btn-secondary {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--df-border);
    border-radius: 12px;
    padding: 11px 24px;
    color: var(--df-sepia);
    font-family: var(--df-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    position: relative; z-index: 1;
}
.df-btn-secondary:hover { background: rgba(255,255,255,0.08); }
.df-btn-secondary.hidden { display: none; }

.df-btn-ghost {
    color: var(--df-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    position: relative; z-index: 1;
}
.df-btn-ghost:hover { color: var(--df-sepia); }

/* Result icon */
.df-result-icon { font-size: 2.5rem; line-height: 1; }
.df-victory-icon { margin-bottom: -4px; }

/* Result stats */
.df-result-stats {
    width: 100%;
    background: rgba(212,168,67,0.04);
    border: 1px solid rgba(212,168,67,0.1);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative; z-index: 1;
}
.df-result-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--df-muted);
}
.df-result-row strong { color: var(--df-gold); }
.df-modal-victory h2 { color: var(--df-gold); }

/* ── Briefing Modal ──────────────────────────────────────── */
.df-modal-briefing { max-width: 500px; }
.df-briefing-folder { margin-bottom: -4px; }
.df-briefing-label {
    font-family: var(--df-typewriter);
    font-size: 0.7rem;
    color: var(--df-gold);
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
    position: relative; z-index: 1;
}
.df-briefing-text {
    font-size: 0.88rem;
    color: var(--df-sepia);
    line-height: 1.7;
    text-align: left;
    font-family: var(--df-typewriter);
    background: rgba(212,168,67,0.04);
    border: 1px solid rgba(212,168,67,0.1);
    border-left: 3px solid rgba(212,168,67,0.4);
    border-radius: 6px;
    padding: 14px 16px;
    position: relative; z-index: 1;
    width: 100%;
}

/* ── Deduction header with interrogation counter ─────────── */
.df-deduction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.df-deduction-header h3 { margin-bottom: 0; }

.df-interrogations-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--df-muted);
    background: rgba(212,168,67,0.06);
    border: 1px solid rgba(212,168,67,0.15);
    border-radius: 20px;
    padding: 4px 10px;
}
.df-interrogations-counter span:first-of-type {
    color: var(--df-gold);
    font-weight: 700;
    font-size: 0.85rem;
}
.df-interrogations-counter.exhausted { opacity: 0.45; }

/* ── Interrogate button on suspect card ──────────────────── */
.df-interrogate-btn {
    margin-top: 8px;
    width: 100%;
    background: rgba(212,168,67,0.06);
    border: 1px solid rgba(212,168,67,0.25);
    border-radius: 8px;
    padding: 5px 10px;
    color: var(--df-gold);
    font-family: var(--df-typewriter);
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}
.df-interrogate-btn:hover:not(:disabled) { background: rgba(212,168,67,0.15); }
.df-interrogate-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Interrogation Modal ─────────────────────────────────── */
.df-interrogation-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    position: relative; z-index: 1;
}
.df-suspect-avatar-lg {
    width: 64px; height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(212,168,67,0.1);
    border: 2px solid rgba(212,168,67,0.3);
}
.df-interrogation-label {
    font-family: var(--df-typewriter);
    font-size: 0.65rem;
    color: var(--df-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}
.df-interrogation-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--df-text);
}
.df-interrogation-text {
    font-size: 0.88rem;
    color: var(--df-sepia);
    line-height: 1.7;
    text-align: left;
    font-family: var(--df-typewriter);
    background: rgba(212,168,67,0.04);
    border: 1px solid rgba(212,168,67,0.1);
    border-left: 3px solid rgba(212,168,67,0.4);
    border-radius: 6px;
    padding: 14px 16px;
    position: relative; z-index: 1;
    width: 100%;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 560px) {
    .df-wrapper { border-radius: 12px; margin: 12px auto 0; }
    .df-modal-content { padding: 26px 18px; }
    .df-header { padding: 14px 14px 12px; }
    .ms-back-btn { font-size: 0.75rem; left: 10px; }
    .df-top-bar { padding: 10px 14px; }
    .df-deduction-panel { padding: 18px 14px; }
    .df-suspects-list { grid-template-columns: 1fr 1fr; }
    .df-case-select { padding: 20px 14px 24px; }
}
