/* Papeles Para Todos - Styles */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Special+Elite&family=VT323&display=swap');

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

:root {
    --color-primary: #1e3a5f;       /* Azul pasaporte */
    --color-secondary: #d4af37;     /* Dorado sello */
    --color-bg: #1a1a24;
    --color-bg-light: #23232f;
    --color-desk: #3a2f22;          /* Madera escritorio */
    --color-paper: #f5ead2;         /* Papel amarillento */
    --color-paper-ink: #2b2216;
    --color-paper-shadow: rgba(0, 0, 0, 0.35);
    --color-text: #f1f0e6;
    --color-text-muted: #9a9688;
    --color-stamp-approve: #1b5e20;
    --color-stamp-reject: #b71c1c;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-success: #4CAF50;
}

body {
    font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
    background:
        radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 100%),
        linear-gradient(135deg, #2b2217 0%, #3a2f22 50%, #1c170f 100%);
    min-height: 100vh;
    color: var(--color-text);
    overflow-x: hidden;
    touch-action: manipulation;
}

/* ===== START SCREEN ===== */
#start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c1a2a 0%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.start-content {
    background: rgba(0, 0, 0, 0.45);
    padding: 40px 30px;
    border-radius: 16px;
    border: 3px solid var(--color-secondary);
    text-align: center;
    max-width: 90%;
    width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.start-content h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.6rem;
    color: #fff;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.start-subtitle {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 1.05rem;
    color: var(--color-secondary);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.start-icon {
    font-size: 4rem;
    margin: 20px 0;
}

.start-desc {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    margin-bottom: 25px;
}

#start-btn {
    background: linear-gradient(180deg, var(--color-secondary) 0%, #a8881d 100%);
    color: #1a1a2e;
    border: none;
    font-family: 'Press Start 2P', cursive;
    padding: 18px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 4px 0 #7a6215;
    transition: all 0.15s ease;
}

#start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #7a6215; }
#start-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a6215; }

.start-note {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    margin-top: 20px;
}

.back-to-menu {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
}

.back-to-menu:hover { color: #fff; }

/* ===== GAME SCREEN ===== */
#game-screen {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
    padding-bottom: 80px;
}

/* ===== HUD ===== */
#hud {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    background: rgba(0,0,0,0.55);
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 18px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.hud-cell {
    text-align: center;
    padding: 4px;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.hud-cell:last-child { border-right: none; }

.hud-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.48rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.hud-value {
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 1.35rem;
    color: var(--color-text);
    font-weight: 700;
}

.hud-value.hud-good { color: var(--color-success); }
.hud-value.hud-bad { color: var(--color-danger); }

.hud-legend {
    display: grid;
    gap: 6px;
    margin: -4px 0 18px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.hud-legend strong {
    color: var(--color-secondary);
    font-weight: 700;
}

.strike {
    display: inline-block;
    color: rgba(255,255,255,0.2);
    font-size: 1rem;
    margin: 0 2px;
}
.strike.strike-filled { color: var(--color-stamp-reject); }

#save-indicator {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: rgba(27, 94, 32, 0.85);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 300;
}
#save-indicator.show { opacity: 1; }

/* ===== ESTACIÓN DE INSPECCIÓN ===== */
#estacion {
    position: relative;
    min-height: 400px;
}

.estacion-vacia {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.docs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* PASAPORTE */
.pasaporte {
    background: linear-gradient(180deg, #15335a 0%, #0e2646 100%);
    border: 3px solid var(--color-secondary);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 6px 20px var(--color-paper-shadow);
    color: #fff;
    position: relative;
}

.pasaporte::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.pasaporte-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-secondary);
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.4);
}

.pasaporte-body {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.pasaporte-foto {
    font-size: 3.8rem;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--color-secondary);
    border-radius: 4px;
    width: 90px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: grayscale(0.25) contrast(1.1);
}

.pasaporte-data {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-family: 'Special Elite', 'Courier New', monospace;
}

.pasaporte-campo {
    display: flex;
    flex-direction: column;
    border-bottom: 1px dotted rgba(255,255,255,0.2);
    padding-bottom: 3px;
}

.pasaporte-campo span {
    font-size: 0.55rem;
    font-family: 'Press Start 2P', cursive;
    color: var(--color-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.pasaporte-campo strong {
    font-size: 0.95rem;
    color: #fff;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.visado-ok { color: #81c784 !important; }
.visado-ko { color: #ff8a80 !important; }

/* FICHA POLICIAL */
.ficha {
    background: var(--color-paper);
    color: var(--color-paper-ink);
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 6px 20px var(--color-paper-shadow);
    position: relative;
    font-family: 'Special Elite', 'Courier New', monospace;
    transform: rotate(-0.5deg);
}

.ficha::before {
    content: 'CONFIDENCIAL';
    position: absolute;
    top: 10px;
    right: -20px;
    background: var(--color-stamp-reject);
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 3px 30px;
    transform: rotate(8deg);
    letter-spacing: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.ficha-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--color-stamp-reject);
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-paper-ink);
}

.ficha-body {
    font-size: 0.95rem;
    line-height: 1.5;
}

.ficha-reclamado {
    background: rgba(183, 28, 28, 0.15);
    border: 1.5px solid var(--color-stamp-reject);
    color: var(--color-stamp-reject);
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.ficha-section { margin-bottom: 12px; }

.ficha-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.48rem;
    color: var(--color-stamp-reject);
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.ficha-antecedentes {
    list-style: none;
    padding-left: 5px;
}

.ficha-antecedentes li {
    padding: 3px 0;
    font-size: 0.9rem;
}

.ficha-antecedentes li.limpio {
    color: #558b2f;
    font-style: italic;
}

.ficha-estrellas {
    color: var(--color-stamp-reject);
    font-size: 1.3rem;
    letter-spacing: 4px;
}

.ficha-flavor {
    font-style: italic;
    border-left: 3px solid var(--color-paper-ink);
    padding: 6px 10px;
    margin-top: 10px;
    color: #5a4632;
    font-size: 0.88rem;
}

/* ===== EXPEDIENTE AMPLIADO ===== */
.expediente-ampliado {
    margin: 0 0 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    overflow: hidden;
}

.expediente-ampliado summary {
    padding: 12px 16px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-secondary);
    letter-spacing: 1px;
    list-style: none;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.expediente-ampliado summary::-webkit-details-marker { display: none; }

.expediente-ampliado summary::after {
    content: '▾';
    margin-left: auto;
    transition: transform 0.2s;
}

.expediente-ampliado[open] summary::after {
    transform: rotate(180deg);
}

.expediente-ampliado summary:hover {
    background: rgba(212, 175, 55, 0.08);
}

.expediente-content {
    padding: 14px 16px 18px;
    border-top: 1px dashed rgba(212, 175, 55, 0.25);
    font-family: 'Special Elite', 'Courier New', monospace;
}

.exp-row {
    padding: 8px 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--color-text);
}

.exp-row:last-of-type { border-bottom: none; }

.exp-row strong {
    color: var(--color-secondary);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.52rem;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.exp-list {
    list-style: none;
    padding-left: 8px;
    margin: 4px 0 0;
}

.exp-list li {
    padding: 3px 0 3px 14px;
    position: relative;
    font-size: 0.9rem;
}

.exp-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--color-secondary);
}

.exp-vacio {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 10px 0;
}

.btn-inconsistencia {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 10px 14px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.58rem;
    letter-spacing: 1px;
    background: rgba(183, 28, 28, 0.15);
    color: #ff8a80;
    border: 2px dashed rgba(183, 28, 28, 0.6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-inconsistencia:hover {
    background: rgba(183, 28, 28, 0.25);
    color: #fff;
}

.btn-inconsistencia.active {
    background: rgba(183, 28, 28, 0.45);
    color: #fff;
    border-style: solid;
    border-color: var(--color-stamp-reject);
    box-shadow: 0 0 12px rgba(183, 28, 28, 0.45);
}

.exp-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
}

/* ===== BOTONES SELLO ===== */
.sello-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.sello-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    padding: 20px 15px;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 2px;
    color: #fff;
}

.sello-btn--aprobar {
    background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
    box-shadow: 0 5px 0 #0e3d10;
    border-color: #81c784;
}

.sello-btn--aprobar:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #0e3d10;
}

.sello-btn--aprobar:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #0e3d10;
}

.sello-btn--rechazar {
    background: linear-gradient(180deg, #c62828 0%, #b71c1c 100%);
    box-shadow: 0 5px 0 #7f0000;
    border-color: #ef9a9a;
}

.sello-btn--rechazar:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #7f0000;
}

.sello-btn--rechazar:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #7f0000;
}

/* ===== ANIMACIÓN DEL SELLO ===== */
.sello-animado {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(2) rotate(-8deg);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    padding: 15px 30px;
    border: 5px double;
    letter-spacing: 3px;
    pointer-events: none;
    animation: stamp-down 0.45s cubic-bezier(0.3, 1.4, 0.7, 1) forwards;
    z-index: 50;
    text-transform: uppercase;
    opacity: 0;
}

.sello-aprobar {
    color: var(--color-stamp-approve);
    border-color: var(--color-stamp-approve);
    background: rgba(27, 94, 32, 0.08);
}

.sello-rechazar {
    color: var(--color-stamp-reject);
    border-color: var(--color-stamp-reject);
    background: rgba(183, 28, 28, 0.08);
}

@keyframes stamp-down {
    0% {
        transform: translate(-50%, -50%) scale(3.5) rotate(-15deg);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    60% {
        transform: translate(-50%, -50%) scale(0.95) rotate(-6deg);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.05) rotate(-8deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(-8deg);
        opacity: 0.9;
    }
}

/* ===== FEEDBACK ===== */
.feedback {
    margin-top: 18px;
    padding: 12px;
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    border-left: 4px solid var(--color-secondary);
    min-height: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback.visible { opacity: 1; }

.feedback-score {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.feedback-score.good { color: var(--color-success); }
.feedback-score.bad { color: var(--color-danger); }

.feedback-cumplidas,
.feedback-infracciones,
.feedback-neutral {
    font-size: 0.88rem;
    line-height: 1.4;
    margin-top: 4px;
    color: var(--color-text-muted);
}

.feedback-cumplidas { color: #a5d6a7; }
.feedback-infracciones { color: #ef9a9a; }
.feedback-neutral { color: #ffe082; }

.feedback-continuar {
    display: block;
    margin: 14px auto 2px;
    padding: 10px 22px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.82rem;
    letter-spacing: 1px;
    color: #fff;
    background: var(--color-secondary);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease;
    animation: feedback-pulse 1.4s ease-in-out infinite;
}

.feedback-continuar:hover,
.feedback-continuar:focus {
    background: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    outline: none;
}

.feedback-continuar:active {
    transform: translateY(1px);
}

@keyframes feedback-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.35); }
    50%      { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

/* ===== MODALES ===== */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal.active { display: flex; }

/* ===== DESAYUNO (puramente narrativo) ===== */
.desayuno-emoji {
    font-size: 3.2rem;
    text-align: center;
    margin-bottom: 10px;
}
.desayuno-titulo {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    color: #fff;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 18px;
}
.desayuno-texto {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 1rem;
    color: rgba(255,255,255,0.92);
    line-height: 1.6;
    text-align: justify;
    padding: 16px;
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
    margin-bottom: 20px;
}

.modal-content {
    background: linear-gradient(180deg, #2a3042 0%, #1a1f2e 100%);
    border: 3px solid var(--color-secondary);
    border-radius: 12px;
    padding: 28px;
    max-width: 95%;
    width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

/* ===== BOLETÍN ===== */
.boletin-codigo {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--color-secondary);
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 5px;
}

.boletin-fecha {
    text-align: center;
    font-family: 'Special Elite', 'Courier New', monospace;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.boletin-titulo {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: #fff;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 10px;
}

.boletin-ministro {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
}

.boletin-flavor {
    font-style: italic;
    text-align: center;
    color: rgba(255,255,255,0.8);
    padding: 10px;
    margin-bottom: 18px;
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
    font-size: 0.95rem;
    line-height: 1.5;
}

.boletin-section {
    margin-bottom: 18px;
}

.boletin-section h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--color-primary);
}

.boletin-section--oficiosa h3 {
    color: var(--color-warning);
    border-bottom-color: var(--color-warning);
}

.boletin-reglas {
    list-style: none;
    padding: 0;
}

.boletin-reglas li {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.04);
    border-left: 3px solid var(--color-primary);
    border-radius: 3px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.regla-oficiosa {
    border-left-color: var(--color-warning) !important;
    background: rgba(243, 156, 18, 0.08) !important;
}

.regla-bonus {
    display: inline-block;
    background: var(--color-stamp-approve);
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 6px;
    letter-spacing: 1px;
}

.boletin-cupo {
    padding: 12px;
    background: rgba(212, 175, 55, 0.1);
    border: 1.5px dashed var(--color-secondary);
    border-radius: 6px;
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.boletin-cupo-pen {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-danger);
}

.boletin-cupo-note {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.boletin-sin-cupo,
.boletin-aviso-mecanica {
    padding: 12px 14px;
    background: rgba(30, 58, 95, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    text-align: center;
    font-size: 0.88rem;
    margin-bottom: 18px;
    line-height: 1.45;
}

/* ===== BOTONES GRANDES ===== */
.btn-grande {
    font-family: 'Press Start 2P', cursive;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    background: linear-gradient(180deg, var(--color-secondary) 0%, #a8881d 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 0 #7a6215;
    transition: all 0.15s ease;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: block;
    letter-spacing: 1px;
}

.btn-grande:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #7a6215; }
.btn-grande:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a6215; }

.btn-secundario {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
    box-shadow: 0 4px 0 rgba(0,0,0,0.4) !important;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secundario:hover { box-shadow: 0 6px 0 rgba(0,0,0,0.4) !important; }

/* ===== FIN JORNADA ===== */
#finjornada-body h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1rem;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.fj-stats {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.fj-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
}

.fj-row:last-child { border-bottom: none; }

.fj-row span { color: var(--color-text-muted); }
.fj-row strong { color: #fff; font-weight: 700; }
.fj-row strong.good { color: var(--color-success); }
.fj-row strong.bad { color: var(--color-danger); }

.fj-row.fj-total {
    border-top: 2px solid var(--color-secondary);
    margin-top: 6px;
    padding-top: 12px;
}

.fj-row.fj-total strong {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    color: var(--color-secondary);
}

.fj-penalizacion {
    background: rgba(183, 28, 28, 0.15);
    border: 1px solid var(--color-stamp-reject);
    color: #ff8a80;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    margin: 10px 0;
    font-size: 0.9rem;
}

.fj-mvp-notice {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 18px;
    padding: 8px;
    border-top: 1px dashed rgba(255,255,255,0.15);
    border-bottom: 1px dashed rgba(255,255,255,0.15);
}

.fj-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.despido-titulo {
    color: var(--color-stamp-reject) !important;
    text-align: center;
}

.despido-desc {
    text-align: center;
    color: var(--color-text);
    font-size: 0.95rem;
    margin-bottom: 18px;
    line-height: 1.5;
    padding: 12px;
    background: rgba(183, 28, 28, 0.15);
    border-radius: 6px;
}

.rating-box {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(30, 58, 95, 0.15) 100%);
    border: 2px solid var(--color-secondary);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    margin-bottom: 20px;
}

.rating-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: var(--color-secondary);
    letter-spacing: 2px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.rating-desc {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.5;
}

.rating-icon {
    font-size: 3.2rem;
    margin-bottom: 8px;
    line-height: 1;
}

.rating-quote {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212, 175, 55, 0.35);
    font-style: italic;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ===== LOGROS TOAST ===== */
#logros-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.logro-toast {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2340 100%);
    border: 2px solid var(--color-secondary);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 20px rgba(212, 175, 55, 0.2);
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: auto;
}

.logro-toast.visible {
    opacity: 1;
    transform: translateX(0);
}

.logro-toast-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.logro-toast-body {
    flex: 1;
    min-width: 0;
}

.logro-toast-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--color-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.logro-toast-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.logro-toast-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
}

/* ===== ENDGAME LOGROS GRID ===== */
.endgame-logros {
    margin-bottom: 20px;
    padding: 14px;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    border-left: 3px solid var(--color-secondary);
}

.endgame-logros h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--color-secondary);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.endgame-logros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px;
}

.endgame-logro {
    background: rgba(212, 175, 55, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: #fff;
}

.endgame-logro span {
    margin-right: 4px;
}

/* ===== EVENT MODAL (imprevistos entre jornadas) ===== */
.event-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-warning);
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
}

.event-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    color: #fff;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 15px;
}

.event-description {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.55;
    text-align: center;
    margin-bottom: 22px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    font-style: italic;
}

.event-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-option {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

.event-option:hover,
.event-option:focus-visible {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--color-secondary);
    outline: none;
    transform: translateX(3px);
}

.event-option-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.event-option-effect {
    font-size: 0.85rem;
    color: var(--color-secondary);
    font-family: 'Special Elite', monospace;
}

/* ===== BOTÓN DE PAUSA ===== */
.pausa-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--color-secondary);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    z-index: 200;
    transition: all 0.2s ease;
    line-height: 1;
    font-family: 'Press Start 2P', cursive;
}
.pausa-btn:hover {
    background: rgba(30, 58, 95, 0.85);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* ===== BOTÓN CONSULTA BOLETÍN ===== */
.boletin-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    background: rgba(20, 40, 70, 0.9);
    border: 2px solid var(--color-secondary);
    color: var(--color-secondary);
    height: 46px;
    width: auto;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 200;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Press Start 2P', cursive;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
    white-space: nowrap;
}

.boletin-btn-icon {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.boletin-btn-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    line-height: 1;
    letter-spacing: 1px;
    color: var(--color-secondary);
    position: relative;
    top: 1px;
}

.boletin-btn:hover {
    background: rgba(30, 58, 95, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.45);
}

@keyframes boletin-pulse-ring {
    0%   { box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3), 0 0 0 0   rgba(212, 175, 55, 0.65); }
    70%  { box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3), 0 0 0 12px rgba(212, 175, 55, 0);    }
    100% { box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3), 0 0 0 0   rgba(212, 175, 55, 0);    }
}

.boletin-btn--pulse {
    animation: boletin-pulse-ring 1.1s ease-out 3;
}

/* ===== BOTÓN PELIGRO (nueva partida) ===== */
.btn-peligro {
    background: linear-gradient(180deg, #c62828 0%, #8e1b1b 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 0 #5a0f0f !important;
}
.btn-peligro:hover { box-shadow: 0 6px 0 #5a0f0f !important; }

/* ===== BOTÓN KO-FI ===== */
.btn-kofi {
    background: linear-gradient(180deg, #ff5f5f 0%, #c41e3a 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 0 #7f0e1e !important;
}
.btn-kofi:hover { box-shadow: 0 6px 0 #7f0e1e !important; }

/* ===== MODAL PAUSA ===== */
.pause-content {
    text-align: center;
    max-width: 420px;
}
.pause-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--color-secondary);
    margin-bottom: 22px;
    letter-spacing: 2px;
}
.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pause-audio-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.audio-control-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 10px;
}
.audio-label {
    text-align: left;
    letter-spacing: 1px;
    font-size: 0.72rem;
    text-transform: uppercase;
}
.audio-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--color-secondary);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    width: 100%;
    padding: 0;
    margin: 0;
}
.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 18px;
    background: var(--color-secondary);
    border: 2px solid #1a1a1a;
    border-radius: 0;
    cursor: pointer;
}
.audio-slider::-moz-range-thumb {
    width: 14px;
    height: 18px;
    background: var(--color-secondary);
    border: 2px solid #1a1a1a;
    border-radius: 0;
    cursor: pointer;
}
.audio-slider:focus {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35);
}
.btn-small {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    padding: 8px 12px;
    border: 2px solid var(--color-secondary);
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-small:hover { background: rgba(30, 58, 95, 0.6); }
.btn-small[aria-pressed="true"] {
    opacity: 0.5;
    border-color: rgba(212, 175, 55, 0.5);
}

/* ===== MODAL AYUDA ===== */
.help-content {
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
}
.help-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 18px;
    letter-spacing: 1.5px;
}
.help-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}
.help-section summary {
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    min-height: 44px;
}
.help-section summary::-webkit-details-marker { display: none; }
.help-section summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}
.help-section[open] summary::after { transform: rotate(90deg); }
.help-section summary:hover,
.help-section summary:focus-visible {
    background: rgba(212, 175, 55, 0.08);
    outline: none;
}
.help-section-body {
    padding: 10px 14px 14px;
    font-size: 0.92rem;
    color: var(--color-text);
    line-height: 1.55;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.help-section-body p { margin-bottom: 8px; }
.help-resource-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.help-resource-row:last-child { border-bottom: none; }
.help-resource-row span:first-child {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.help-content .btn-grande {
    margin-top: 16px;
}

/* ===== MODAL CONFIRMACIÓN ===== */
.confirm-content {
    text-align: center;
    max-width: 420px;
}
.confirm-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--color-danger);
    margin-bottom: 16px;
    letter-spacing: 1.5px;
}
.confirm-content p {
    margin-bottom: 20px;
    color: var(--color-text);
    line-height: 1.5;
    font-size: 0.95rem;
}
.confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 680px) {
    #game-screen {
        padding-top: 65px; /* espacio para el botón de pausa fijo */
    }
    .boletin-btn {
        width: 46px;
        padding: 0;
        justify-content: center;
    }
    .boletin-btn-label {
        display: none;
    }
    #hud {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .hud-cell {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding-bottom: 8px;
    }
    .docs-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .pasaporte-foto {
        width: 70px;
        height: 90px;
        font-size: 3rem;
    }
    .sello-btn {
        font-size: 0.75rem;
        padding: 16px 8px;
    }
    .start-content h1 { font-size: 1.3rem; }
}

@media (max-width: 400px) {
    .sello-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===== PREFERS-REDUCED-MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .sello-animado {
        animation: none !important;
        opacity: 0.9 !important;
        transform: translate(-50%, -50%) scale(1) rotate(-8deg) !important;
    }
}

/* ===== LOGROS MODAL ===== */
.logros-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    color: var(--color-secondary);
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 14px;
}

.logros-contador {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--color-secondary);
    text-align: center;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
    padding: 8px;
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
    border-left: 3px solid var(--color-secondary);
}

.logros-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.logro-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(212, 175, 55, 0.12);
    border-radius: 6px;
    border-left: 3px solid var(--color-secondary);
}

.logro-item .logro-icono {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.logro-item .logro-info {
    flex: 1;
    min-width: 0;
}

.logro-item .logro-titulo {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.logro-item .logro-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.35;
}

.logro-item.logro-bloqueado {
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(255,255,255,0.2);
    opacity: 0.55;
    filter: grayscale(100%);
}

.logro-item.logro-bloqueado .logro-titulo {
    color: rgba(255,255,255,0.55);
}

.logro-item.logro-bloqueado .logro-desc {
    color: rgba(255,255,255,0.45);
    font-style: italic;
}

/* === Ranking Online === */
.ranking-content {
    width: 540px;
    max-width: 95%;
}

.ranking-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 12px;
}

.ranking-nick-info {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.ranking-list {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 16px;
    text-align: left;
}

.ranking-row {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    font-size: 0.85rem;
}

.ranking-row:last-child { border-bottom: none; }

.ranking-row.is-me {
    background: rgba(212, 175, 55, 0.18);
    color: var(--color-secondary);
}

.ranking-row.is-top1 .ranking-rank { color: #ffd700; }
.ranking-row.is-top2 .ranking-rank { color: #c0c0c0; }
.ranking-row.is-top3 .ranking-rank { color: #cd7f32; }

.ranking-rank {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--color-secondary);
}

.ranking-nick {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-score {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-success);
    white-space: nowrap;
}

.ranking-time {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
}

.ranking-loading,
.ranking-empty,
.ranking-error {
    text-align: center;
    color: var(--color-text-muted);
    padding: 20px;
    font-size: 0.85rem;
}

.ranking-error { color: var(--color-danger); }

.ranking-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.nickname-content {
    width: 420px;
    max-width: 95%;
}

.nickname-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 12px;
}

.nickname-input {
    width: 100%;
    padding: 12px 14px;
    margin: 16px 0 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    text-align: center;
    box-sizing: border-box;
}

.nickname-input:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.nickname-error {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.nickname-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
