/* ==============================================================================
   CLAVE OCULTA - SISTEMA DE DISEÑO ULTRA RESPONSIVO (MÓVIL, PC Y TV)
   Diseñado para mantener la máxima información siempre visible en pantalla
   ============================================================================== */

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

:root {
    /* Paleta Modo Claro */
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-solid: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.92);
    --bg-muted: #f1f5f9;
    --border-color: #e2e8f0;
    --border-card: rgba(226, 232, 240, 0.9);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent: #d97706; /* Ámbar detective */
    --accent-hover: #b45309;
    --accent-glow: rgba(217, 119, 6, 0.2);
    
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-bg: rgba(220, 38, 38, 0.1);
    
    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-typewriter: 'Courier Prime', 'Special Elite', monospace;
    --font-handwriting: 'Caveat', cursive, serif;

    /* Dimensiones fluidas base */
    --nav-height: 64px;
    --content-max-w: 1200px;
    --font-scale: 1;
}

/* Paleta Modo Oscuro */
[data-theme="dark"],
.dark {
    --bg-body: #090a0f;
    --bg-card: rgba(18, 20, 29, 0.88);
    --bg-card-solid: #12141d;
    --bg-header: rgba(9, 10, 15, 0.92);
    --bg-muted: #1c202e;
    --border-color: #272c3d;
    --border-card: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-glow: rgba(245, 158, 11, 0.25);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}

/* ==============================================================================
   ESCALADO INTELIGENTE PARA TV Y PANTALLAS ULTRA ANCHAS (>= 1440px / 4K)
   ============================================================================== */
@media (min-width: 1440px) {
    :root {
        --content-max-w: 1600px;
        --nav-height: 72px;
        --font-scale: 1.08;
    }
}

@media (min-width: 1920px) {
    :root {
        --content-max-w: 1850px;
        --nav-height: 76px;
        --font-scale: 1.15;
    }
}

@media (min-width: 2560px) {
    /* 4K TV / Ultra High Resolution */
    :root {
        --content-max-w: 2300px;
        --nav-height: 86px;
        --font-scale: 1.35;
    }
}

/* Reset y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: calc(16px * var(--font-scale));
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Gradiente de fondo cinemático */
body::before {
    content: '';
    position: fixed;
    top: -15%;
    left: 20%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* Header & Barra Superior */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: var(--content-max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-icon {
    font-size: 1.35rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #ea580c 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #c2410c 100%);
    box-shadow: 0 6px 18px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-muted);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-sm {
    padding: 0.38rem 0.75rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-muted);
}

/* Selector de Idioma Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--bg-muted);
}

.flag-icon {
    width: 17px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 135px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 0.35rem;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 1000;
}

.lang-menu.show {
    display: flex;
    animation: fadeIn 0.18s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
}

.lang-option:hover {
    background: var(--bg-muted);
}

.lang-option.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 700;
}

/* Botón de Tema */
.theme-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    color: var(--text-primary);
    background: var(--bg-muted);
}

/* Layout Principal con Contenedor Fluido */
.main-content {
    flex: 1;
    max-width: var(--content-max-w);
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

/* Cards & Glassmorphism */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

/* ==============================================================================
   1. HERO SECTION (100% VISIBLE EN PANTALLA PARA MÓVIL, PC Y TV)
   ============================================================================== */
.hero-wrapper {
    min-height: calc(100vh - var(--nav-height) - 60px);
    min-height: calc(100dvh - var(--nav-height) - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem 0;
}

.hero-section {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.08;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-tagline {
    font-size: clamp(1.15rem, 2.5vw, 1.7rem);
    color: var(--accent);
    font-weight: 700;
}

.hero-desc {
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 680px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 0.85rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Stats rápidas del juego visibles en pantalla */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stat-box {
    text-align: center;
}

.stat-number {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    font-weight: 900;
    color: var(--text-primary);
    font-family: var(--font-typewriter);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==============================================================================
   2. FORMULARIOS DE ALTA DENSIDAD (CREATE.HTML 100% VISIBLE)
   ============================================================================== */
.compact-form-container {
    max-width: 960px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.95rem;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
}

/* Grids adaptativos de información densa */
.grid-form-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Explore Grid: 1 col móvil, 2 tablet, 3 PC, 4-5 en TV grande */
.grid-explore {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

@media (min-width: 1600px) {
    .grid-explore {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 2200px) {
    .grid-explore {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ==============================================================================
   3. CASE DASHBOARD (MULTI-PANEL EN PC/TV, TABS EN MÓVIL)
   Permite ver la mayoría de la información al mismo tiempo en pantalla grande
   ============================================================================== */
.case-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* En PC y TV se despliega como mesa de trabajo de 2 columnas independientes */
@media (min-width: 1024px) {
    .case-dashboard {
        display: grid;
        grid-template-columns: 340px 1fr;
        align-items: start;
        gap: 1.75rem;
    }

    .case-sidebar {
        position: sticky;
        top: calc(var(--nav-height) + 1.5rem);
        max-height: calc(100vh - var(--nav-height) - 3rem);
        overflow-y: auto;
        padding-right: 0.5rem;
    }
}

@media (min-width: 1600px) {
    .case-dashboard {
        grid-template-columns: 420px 1fr;
        gap: 2rem;
    }
}

.case-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.case-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Pestañas de Navegación */
.case-tabs {
    display: flex;
    gap: 0.35rem;
    background: var(--bg-muted);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    padding: 0.55rem 0.95rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--bg-card-solid);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Documento Policial Vintage */
.police-dossier {
    background: #fdfbf7;
    color: #1e293b;
    border: 2px solid #334155;
    padding: clamp(1.2rem, 3vw, 2.2rem);
    border-radius: 4px;
    font-family: var(--font-typewriter);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
}

[data-theme="dark"] .police-dossier {
    background: #14171f;
    color: #e2e8f0;
    border-color: #475569;
}

.dossier-stamp {
    position: absolute;
    top: 14px;
    right: 20px;
    border: 3px solid #dc2626;
    color: #dc2626;
    padding: 0.25rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    transform: rotate(6deg);
    letter-spacing: 0.1em;
    user-select: none;
    opacity: 0.85;
}

.dossier-title {
    font-family: var(--font-typewriter);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    text-align: center;
    border-bottom: 2px solid currentColor;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.08em;
}

/* Tarjetas de Sospechosos Densas */
.suspect-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.suspect-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.suspect-img-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-muted);
}

.suspect-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.evidence-marker {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-family: var(--font-typewriter);
    font-weight: 900;
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

/* Barra de Progreso Cinemática */
.progress-card {
    max-width: 580px;
    margin: 2rem auto;
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-xl);
}

.progress-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.2rem auto;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 1.2rem 0 0.6rem 0;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    width: 15%;
    background: linear-gradient(90deg, var(--accent) 0%, #ea580c 50%, var(--danger) 100%);
    border-radius: var(--radius-full);
    transition: width 0.35s ease;
}

/* Modal de Acusación */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    padding: 1.8rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Footer Compacto */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

/* Animaciones */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* ==============================================================================
   AJUSTES ESPECÍFICOS PARA PANTALLAS MÓVILES (< 768px)
   ============================================================================== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.85rem;
    }
    .main-content {
        padding: 1rem 0.85rem;
    }
    .card {
        padding: 1.15rem;
        border-radius: var(--radius-md);
    }
    .btn-lg {
        width: 100%;
    }
    .case-header {
        flex-direction: column;
        align-items: stretch;
    }
    .case-header > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .hero-stats {
        gap: 0.5rem;
    }
}
