/* La Paguita - Estilos Completos */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;600;700;900&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #0f1923;
    --color-bg-light: #1a2736;
    --color-bg-card: #1e3044;
    --color-primary: #4CAF50;
    --color-primary-dark: #2E7D32;
    --color-gold: #FFB300;
    --color-gold-dark: #FF8F00;
    --color-danger: #f44336;
    --color-danger-dark: #c62828;
    --color-warning: #FF9800;
    --color-text: #e0e0e0;
    --color-text-dim: #78909C;
    --color-text-bright: #ffffff;
    --color-espanolito: #78909C;
    --color-espanolito-bar: #546E7A;
    --color-tu-bar: #66BB6A;
    --color-presupuesto: #ef5350;
    --color-border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --font-pixel: 'Press Start 2P', cursive;
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-scale: 1;
}

html {
    font-size: calc(16px * var(--font-scale, 1));
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   START SCREEN
   ============================================ */
#start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(160deg, #0a1628 0%, #112240 40%, #1a3a2a 100%);
    position: relative;
    overflow: hidden;
}

#start-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(76, 175, 80, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255, 179, 0, 0.06) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.start-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.start-emoji {
    font-size: 5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 20px rgba(255, 179, 0, 0.4));
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.start-content h1 {
    font-family: var(--font-pixel);
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: var(--color-primary);
    text-shadow: 3px 3px 0 #000, 0 0 30px rgba(76, 175, 80, 0.4);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.start-subtitle {
    font-size: 1rem;
    color: var(--color-gold);
    margin-bottom: 30px;
    font-weight: 600;
}

/* Character Selection */
#character-selection {
    margin-bottom: 20px;
}

#character-selection h4 {
    color: var(--color-text-dim);
    margin-bottom: 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#character-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.char-category-label {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

.char-category-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.character-option {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    border: 2px solid var(--color-border);
    background: var(--color-bg-card);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.character-option .char-flag {
    font-size: 0.7rem;
}

.character-option .char-icon {
    font-size: 1.5rem;
}

.character-option:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.character-option.selected {
    border-color: var(--color-primary);
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.character-option.nativo {
    border-color: rgba(255, 179, 0, 0.3);
}

.character-option.nativo:hover {
    border-color: var(--color-gold);
    box-shadow: 0 6px 20px rgba(255, 179, 0, 0.3);
}

.character-option.nativo.selected {
    border-color: var(--color-gold);
    background: rgba(255, 179, 0, 0.15);
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.3);
}

/* Character Info */
#character-info {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.character-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.character-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.char-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text-bright);
}

.char-origin {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.char-desc {
    font-size: 0.85rem;
    color: var(--color-text);
}

.char-bonus {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 600;
}

.char-frase {
    font-size: 0.8rem;
    color: var(--color-gold);
    font-style: italic;
}

.start-note {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin-bottom: 10px;
}

.landing-footer {
    margin-top: 20px;
}

.back-to-menu {
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.back-to-menu:hover {
    color: var(--color-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #fff;
    white-space: normal;
    line-height: 1.3;
}

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

.btn--lg {
    padding: 16px 32px;
    font-size: 1rem;
    width: 100%;
    border-radius: var(--radius);
}

.btn--start {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    box-shadow: 0 4px 0 #1B5E20, 0 6px 15px rgba(0, 0, 0, 0.4);
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    letter-spacing: 1px;
    touch-action: manipulation;
}

.btn--start:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1B5E20, 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn--start:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1B5E20;
}

#click-paguitas-btn {
    min-height: 48px;
    position: relative;
}

.btn--advance {
    background: linear-gradient(180deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 0 #E65100, 0 6px 15px rgba(0, 0, 0, 0.4);
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.btn--advance:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #E65100;
}

.btn--advance:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #E65100;
}

.btn--menu {
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 6px 10px;
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
}

.btn--menu:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn--ayuda {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 8px 14px;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 8px;
}

.btn--accion {
    background: linear-gradient(180deg, #5C6BC0 0%, #3949AB 100%);
    padding: 8px 14px;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 8px;
}

.btn--evento {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.btn--evento:hover {
    border-color: var(--color-primary);
    background: rgba(76, 175, 80, 0.1);
}

.btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn--warning {
    background: linear-gradient(180deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
}

.btn--secondary {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
}

/* ============================================
   GAME CONTAINER
   ============================================ */
#game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 70px;
}

/* ============================================
   HEADER
   ============================================ */
#game-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.player-icon {
    font-size: 1.5rem;
}

.player-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-text-bright);
}

.header-center {
    flex: 1;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#fase-display {
    font-size: 0.75rem;
    color: var(--color-gold);
    font-weight: 600;
}

#trimestre-display {
    font-size: 0.65rem;
    color: var(--color-text-dim);
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fase-progress, .total-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.fase-progress div {
    height: 100%;
    background: var(--color-gold);
    transition: width 0.5s ease;
    border-radius: 2px;
}

.total-progress div {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.5s ease;
    border-radius: 2px;
}

/* ============================================
   RESOURCES BAR
   ============================================ */
#resources-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.resource-item {
    background: var(--color-bg-light);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.resource-item.prod {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6px;
    background: rgba(76, 175, 80, 0.05);
}

.resource-label {
    font-size: 0.65rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resource-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-bright);
}

.resource-val.good { color: var(--color-primary); }
.resource-val.warn { color: var(--color-warning); }
.resource-val.danger { color: var(--color-danger); }

/* ============================================
   COMPARATIVA
   ============================================ */
#comparativa {
    padding: 10px 12px;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
}

.comp-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.comp-label {
    font-size: 0.75rem;
    width: 95px;
    flex-shrink: 0;
    color: var(--color-text-dim);
}

.comp-bar-container {
    flex: 1;
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    overflow: hidden;
}

.comp-bar {
    height: 100%;
    border-radius: 7px;
    transition: width 0.6s ease;
}

.comp-bar.tu {
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-tu-bar));
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.comp-bar.espanolito {
    background: linear-gradient(90deg, var(--color-espanolito-bar), var(--color-espanolito));
}

.comp-value {
    font-size: 0.8rem;
    font-weight: 700;
    width: 25px;
    text-align: right;
    color: var(--color-text-bright);
}

.comp-frase {
    font-size: 0.75rem;
    color: var(--color-espanolito);
    font-style: italic;
    text-align: center;
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
    margin-top: 5px;
}

/* ============================================
   ALERTA MEDIÁTICA
   ============================================ */
#alerta-container {
    padding: 8px 12px;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s;
}

#alerta-container.peligro {
    background: rgba(244, 67, 54, 0.1);
    animation: alertPulse 1s ease-in-out infinite alternate;
}

@keyframes alertPulse {
    0% { background: rgba(244, 67, 54, 0.05); }
    100% { background: rgba(244, 67, 54, 0.15); }
}

.alerta-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
    color: var(--color-text-dim);
}

.alerta-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.alerta-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s;
}

.alerta-fill.bajo { background: var(--color-primary); }
.alerta-fill.medio { background: var(--color-warning); }
.alerta-fill.peligro {
    background: var(--color-danger);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
    animation: alertBarPulse 0.5s ease-in-out infinite alternate;
}

@keyframes alertBarPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* ============================================
   NEWS TICKER
   ============================================ */
#news-ticker {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 179, 0, 0.05);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.7rem;
    overflow: hidden;
}

.ticker-label {
    flex-shrink: 0;
}

.ticker-text {
    color: var(--color-gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   PANELS
   ============================================ */
#panels-container {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
}

.game-panel {
    display: none;
}

.game-panel.active {
    display: block;
}

.game-panel h3 {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--color-gold);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

/* ============================================
   AYUDA CARDS
   ============================================ */
#ayudas-list, #acciones-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ayuda-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.3s ease;
}

.ayuda-card.activa {
    border-color: rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, var(--color-bg-card) 0%, rgba(76, 175, 80, 0.05) 100%);
}

.ayuda-card.maxed {
    border-color: rgba(255, 179, 0, 0.3);
    opacity: 0.7;
}

.ayuda-card.disabled {
    opacity: 0.5;
}

.ayuda-card.flash {
    animation: cardFlash 0.5s ease;
}

@keyframes cardFlash {
    0% { box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.5); border-color: var(--color-primary); }
    100% { box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
}

.ayuda-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ayuda-emoji {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.ayuda-title {
    display: flex;
    flex-direction: column;
}

.ayuda-nombre {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-bright);
}

.ayuda-nivel {
    font-size: 0.7rem;
    color: var(--color-primary);
    font-weight: 600;
}

.ayuda-desc {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: 8px;
    line-height: 1.4;
}

.ayuda-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.ayuda-prod { color: var(--color-primary); font-weight: 600; }
.ayuda-drain { color: var(--color-presupuesto); font-weight: 600; }
.ayuda-pop { color: var(--color-gold); font-weight: 600; }
.ayuda-card.locked {
    opacity: 0.4;
    filter: grayscale(0.5);
}

.ayuda-lock-msg {
    text-align: center;
    color: var(--color-warning);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 8px;
    background: rgba(255, 152, 0, 0.08);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.ayuda-maxed-label {
    text-align: center;
    color: var(--color-gold);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 8px;
    background: rgba(255, 179, 0, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

/* ============================================
   ACCION CARDS
   ============================================ */
.accion-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.3s ease;
}

.accion-card.cooldown {
    opacity: 0.5;
    border-color: rgba(255, 255, 255, 0.03);
}

.accion-card.disabled {
    opacity: 0.5;
}

.accion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.accion-emoji {
    font-size: 1.5rem;
}

.accion-nombre {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-bright);
}

.accion-desc {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: 8px;
    line-height: 1.4;
}

.accion-efectos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.efecto-pos { color: var(--color-primary); font-weight: 600; }
.efecto-neg { color: var(--color-danger); font-weight: 600; }
.efecto-riesgo { color: var(--color-warning); font-weight: 600; }

/* ============================================
   POBLACIÓN PANEL
   ============================================ */
.pop-header h4 {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--color-gold);
    margin-bottom: 15px;
}

.pop-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.pop-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pop-label {
    font-size: 0.75rem;
    width: 120px;
    flex-shrink: 0;
    color: var(--color-text-dim);
}

.pop-bar-container {
    flex: 1;
    height: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    overflow: hidden;
}

.pop-bar {
    height: 100%;
    border-radius: 9px;
    transition: width 0.8s ease;
    min-width: 2px;
}

.pop-bar.nativo {
    background: linear-gradient(90deg, #ef5350, #e53935);
}

.pop-bar.inmigrante {
    background: linear-gradient(90deg, #66BB6A, #43A047);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.pop-value {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 60px;
    text-align: right;
    color: var(--color-text-bright);
}

.pop-ratio {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.ratio-label {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.ratio-value {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--color-text-bright);
}

.ratio-value.victoria {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.pop-info {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    text-align: center;
}

.pop-info p { margin-bottom: 4px; }

/* ============================================
   STATS PANEL
   ============================================ */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-bg-card);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.stat-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-bright);
}

/* ============================================
   ADVANCE BUTTON CONTAINER
   ============================================ */
#advance-container {
    padding: 10px 12px;
    position: sticky;
    bottom: 68px;
    z-index: 40;
    background: linear-gradient(transparent, var(--color-bg) 30%);
    padding-top: 20px;
    display: flex;
    gap: 10px;
    /* Relative for click floater absolute positioning */
    overflow: visible;
    z-index: 101;
}

/* ============================================
   BOTTOM NAV
   ============================================ */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    display: flex;
    background: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    background: none;
    border: none;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: all 0.2s;
    gap: 2px;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item:hover {
    color: var(--color-text-bright);
}

.nav-icon {
    font-size: 1.3rem;
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

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

/* Event Modal */
.event-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-bright);
    margin-bottom: 10px;
}

.event-description {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.opcion-texto {
    font-weight: 600;
    font-size: 0.85rem;
}

.opcion-efectos {
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

/* Result Modal */
.result-content {
    text-align: center;
    cursor: pointer;
}

.result-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.result-hint {
    font-size: 0.7rem;
    color: var(--color-text-dim);
}

#result-efectos {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

/* Quote Modal */
.quote-content {
    text-align: center;
    animation: slideUp 0.3s ease;
}

.quote-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

#quote-text {
    font-size: 1.1rem;
    color: var(--color-gold);
    font-weight: 600;
    font-style: italic;
    text-shadow: 0 0 20px rgba(255, 179, 0, 0.3);
}

/* Pause and Confirm Modals */
.pause-content h3, .confirm-content h3 {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    color: var(--color-gold);
    margin-bottom: 20px;
    text-align: center;
}

.pause-buttons, .confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tipografía pixel consistente en todos los botones de pausa/confirmación */
.pause-buttons .btn--lg,
.confirm-buttons .btn--lg {
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Endgame Modal */
.endgame-content {
    text-align: center;
}

.endgame-content h2 {
    font-family: var(--font-pixel);
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    color: var(--color-gold);
    margin-bottom: 8px;
}

.endgame-subtitulo {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 20px;
}

#endgame-stats {
    margin-bottom: 20px;
}

.endgame-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
}

.endgame-stat span:first-child {
    color: var(--color-text-dim);
}

.endgame-stat span:last-child {
    font-weight: 700;
    color: var(--color-text-bright);
}

.endgame-score {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.endgame-score span:first-child {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

#final-score {
    font-family: var(--font-pixel);
    font-size: 1.2rem;
    color: var(--color-gold);
}

.endgame-rating {
    margin-bottom: 20px;
}

.rating-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 5px;
}

.rating-title {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--color-primary);
    display: block;
    margin-bottom: 5px;
}

.rating-desc {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    font-style: italic;
}

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

/* ============================================
   LOGRO NOTIFICATION
   ============================================ */
#logro-notification {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-bg-card), rgba(76, 175, 80, 0.2));
    border: 1px solid var(--color-primary);
    border-radius: var(--radius);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 300;
    transition: top 0.5s ease;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.3);
    max-width: 350px;
}

#logro-notification.show {
    top: 15px;
}

.logro-emoji {
    font-size: 2rem;
}

.logro-info {
    display: flex;
    flex-direction: column;
}

.logro-titulo {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-gold);
}

.logro-desc {
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

/* ============================================
   SAVE INDICATOR
   ============================================ */
#save-indicator {
    position: fixed;
    bottom: 75px;
    right: 15px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--color-text-dim);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 90;
}

#save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 601px) {
    #advance-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 400px) {
    .character-option {
        width: 50px;
        height: 50px;
    }

    .character-option .char-icon {
        font-size: 1.2rem;
    }

    .ayuda-emoji { font-size: 1.4rem; }
    .accion-emoji { font-size: 1.2rem; }
}

/* ============================================
   CLICK FLOATER FEEDBACK
   ============================================ */
.click-floater {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }
}

/* ============================================
   HELP MODAL
   ============================================ */
.help-content {
    max-height: 85vh;
    overflow-y: auto;
}

.help-title {
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    color: var(--color-gold);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.help-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.help-section summary {
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-gold);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.help-section summary::-webkit-details-marker { display: none; }

.help-section summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    transition: transform 0.2s;
}

.help-section[open] summary::after {
    transform: rotate(90deg);
}

.help-section summary:hover {
    background: rgba(255, 179, 0, 0.05);
}

.help-section-body {
    padding: 10px 14px 14px;
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.5;
    border-top: 1px solid var(--color-border);
}

.help-section-body p { margin-bottom: 8px; }
.help-section-body ul { padding-left: 18px; margin-bottom: 8px; }
.help-section-body li { margin-bottom: 4px; }

.help-resource-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.help-resource-row span:first-child {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.help-tip {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-left: 3px solid var(--color-primary);
    background: rgba(76, 175, 80, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.85rem;
}

.help-tip:last-child { margin-bottom: 0; }

.help-content .btn--start {
    margin-top: 16px;
}

/* ============================================
   TRAMPA MODAL
   ============================================ */
.trampa-content {
    text-align: center;
    border: 2px solid var(--color-danger);
    background: linear-gradient(135deg, var(--color-bg-light), rgba(244, 67, 54, 0.08));
}

.trampa-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    animation: trampaShake 0.5s ease-in-out;
}

@keyframes trampaShake {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-15deg); }
    40% { transform: rotate(15deg); }
    60% { transform: rotate(-10deg); }
    80% { transform: rotate(10deg); }
}

.trampa-titulo {
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    color: var(--color-danger);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.trampa-desc {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: 16px;
}

.trampa-resultado {
    font-size: 0.85rem;
    color: var(--color-warning);
    font-weight: 600;
    padding: 12px;
    background: rgba(255, 152, 0, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    line-height: 1.4;
}

.trampa-debuff {
    margin-bottom: 16px;
}

.debuff-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: var(--radius-sm);
    text-align: left;
}

.debuff-emoji {
    font-size: 2rem;
    flex-shrink: 0;
}

.debuff-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.debuff-info strong {
    color: var(--color-danger);
    font-size: 0.85rem;
}

.debuff-info span {
    color: var(--color-text-dim);
    font-size: 0.8rem;
}

/* ============================================
   DEBUFFS INDICATOR (in header area)
   ============================================ */
.debuff-indicators {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.debuff-indicator {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 10px;
    color: var(--color-danger);
    cursor: help;
    white-space: nowrap;
}

/* ============================================
   HINT TOAST
   ============================================ */
.hint-toast {
    position: fixed;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, rgba(30, 48, 68, 0.97), rgba(255, 179, 0, 0.12));
    border: 1px solid var(--color-gold);
    color: var(--color-text-bright);
    padding: 10px 18px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(255, 179, 0, 0.2);
    z-index: 9998;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 340px;
    text-align: left;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.hint-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hint-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.hint-text {
    line-height: 1.4;
}

/* ============================================
   FASE CONFETTI
   ============================================ */
.fase-confetti {
    position: fixed;
    bottom: -20px;
    pointer-events: none;
    z-index: 150;
    font-size: 1.5rem;
    animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
        bottom: 10%;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-80vh) rotate(360deg) scale(0.3);
        bottom: 90%;
    }
}

/* ============================================
   RESOURCE PULSE
   ============================================ */
.resource-item {
    cursor: help;
    transition: background 0.2s, transform 0.15s;
}

.resource-item.pulse {
    animation: resourcePulse 0.3s ease;
}

@keyframes resourcePulse {
    0% { transform: scale(1); background: var(--color-bg-light); }
    50% { transform: scale(1.05); background: rgba(76, 175, 80, 0.15); }
    100% { transform: scale(1); background: var(--color-bg-light); }
}

/* ============================================
   MINIGAMES - BASE
   ============================================ */
.minigame-content {
    max-width: 400px;
    text-align: center;
    padding: 1.5rem;
}

.minigame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.minigame-titulo {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--color-gold);
}

.minigame-timer {
    font-family: var(--font-pixel);
    font-size: 0.9rem;
    color: var(--color-primary);
    min-width: 2.5rem;
    text-align: right;
}

.minigame-timer.warning {
    color: var(--color-danger);
    animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.minigame-area {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.minigame-score {
    margin-top: 1rem;
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--color-text-dim);
    min-height: 1.2rem;
}

/* --- Huye de la Policía --- */
.huye-prompt {
    font-size: 4rem;
    margin: 1rem 0;
    transition: transform 0.1s;
}

.huye-prompt.flash-ok {
    animation: flashOk 0.3s ease;
}

.huye-prompt.flash-fail {
    animation: flashFail 0.3s ease;
}

@keyframes flashOk {
    0% { color: var(--color-text); }
    50% { color: var(--color-primary); transform: scale(1.2); }
    100% { color: var(--color-text); }
}

@keyframes flashFail {
    0% { color: var(--color-text); }
    50% { color: var(--color-danger); transform: scale(0.8); }
    100% { color: var(--color-text); }
}

.huye-timer-bar {
    width: 100%;
    height: 8px;
    background: var(--color-bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.huye-timer-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width linear;
}

.huye-timer-fill.urgent {
    background: var(--color-danger);
}

.huye-progress {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 0.75rem 0;
}

.huye-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-bg-light);
    border: 2px solid var(--color-border);
}

.huye-dot.ok { background: var(--color-primary); border-color: var(--color-primary); }
.huye-dot.fail { background: var(--color-danger); border-color: var(--color-danger); }
.huye-dot.current { border-color: var(--color-gold); box-shadow: 0 0 8px var(--color-gold); }

.huye-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    width: 180px;
    height: 180px;
    margin: 0.75rem auto;
}

.huye-btn {
    font-size: 1.8rem;
    border: 2px solid var(--color-border);
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.huye-btn:active {
    background: var(--color-primary-dark);
    transform: scale(0.92);
}

.huye-btn[data-dir="up"] { grid-column: 2; grid-row: 1; }
.huye-btn[data-dir="left"] { grid-column: 1; grid-row: 2; }
.huye-btn[data-dir="right"] { grid-column: 3; grid-row: 2; }
.huye-btn[data-dir="down"] { grid-column: 2; grid-row: 3; }

/* --- Top Manta Sprint --- */
.manta-field {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.manta-entity {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    transition: opacity 0.3s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.manta-entity.sold {
    opacity: 0;
    transform: scale(1.3);
    pointer-events: none;
}

.manta-entity.policia {
    cursor: default;
    animation: policiaFlash 0.5s ease infinite;
}

@keyframes policiaFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.manta-earnings {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    color: var(--color-gold);
    margin: 0.5rem 0;
}

.manta-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.manta-btn-recoger {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid var(--color-warning);
    background: transparent;
    color: var(--color-warning);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.manta-btn-recoger:active {
    background: rgba(255, 152, 0, 0.2);
}

.manta-btn-recoger.hiding {
    background: var(--color-warning);
    color: var(--color-bg);
    pointer-events: none;
}

.manta-floater {
    position: absolute;
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--color-gold);
    pointer-events: none;
    animation: mantaFloat 0.8s ease forwards;
}

@keyframes mantaFloat {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-40px); }
}

.manta-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--color-danger);
    background: rgba(244, 67, 54, 0.15);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    animation: warningPulse 0.4s ease;
    pointer-events: none;
    z-index: 5;
}

@keyframes warningPulse {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- Cola de Extranjería --- */
.cola-display {
    font-family: var(--font-pixel);
    font-size: 2.5rem;
    color: var(--color-primary);
    background: var(--color-bg);
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
    min-width: 180px;
    letter-spacing: 4px;
    margin: 0.5rem auto;
}

.cola-tu-numero {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--color-gold);
    margin-bottom: 0.75rem;
}

.cola-hint {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin: 0.5rem 0;
    min-height: 1.5rem;
}

.cola-hint.funcionario {
    color: var(--color-warning);
    font-weight: 700;
}

.cola-btn {
    padding: 0.8rem 2rem;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 0.75rem;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.cola-btn:active {
    background: rgba(76, 175, 80, 0.2);
    transform: scale(0.95);
}

.cola-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cola-result {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    margin-top: 0.75rem;
    min-height: 1.5rem;
}

.cola-result.perfecto { color: var(--color-gold); }
.cola-result.bien { color: var(--color-primary); }
.cola-result.mal { color: var(--color-danger); }

/* --- Drama en el Juzgado --- */
.drama-meter-wrap {
    width: 100%;
    height: 24px;
    background: var(--color-bg-light);
    border-radius: 12px;
    overflow: hidden;
    margin: 0.75rem 0;
    border: 1px solid var(--color-border);
}

.drama-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-warning), var(--color-gold));
    border-radius: 12px;
    transition: width 0.1s;
}

.drama-meter-label {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
}

.drama-fiscal {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--color-danger);
    background: rgba(244, 67, 54, 0.15);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
    display: none;
}

.drama-fiscal.show {
    display: block;
    animation: warningPulse 0.3s ease;
}

.drama-tap-area {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.5rem;
    border: 2px solid var(--color-gold);
    background: transparent;
    color: var(--color-gold);
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.drama-tap-area:active { background: rgba(255, 179, 0, 0.15); }
.drama-tap-area.objection { border-color: var(--color-danger); color: var(--color-danger); opacity: 0.5; }

.drama-hint { font-size: 0.8rem; color: var(--color-text-dim); margin-top: 0.5rem; min-height: 1.2rem; }
.drama-hint.warning { color: var(--color-danger); font-weight: 700; }

/* --- Baja Médica --- */
.baja-progress {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.baja-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--color-bg-light); border: 2px solid var(--color-border);
}
.baja-dot.ok { background: var(--color-primary); border-color: var(--color-primary); }
.baja-dot.fail { background: var(--color-danger); border-color: var(--color-danger); }
.baja-dot.current { border-color: var(--color-gold); box-shadow: 0 0 8px var(--color-gold); }

.baja-doctor { font-size: 2.5rem; margin: 0.25rem 0; }
.baja-pregunta { font-family: var(--font-pixel); font-size: 0.65rem; color: var(--color-text); margin: 0.5rem 0; min-height: 1.2rem; }

.baja-timer-bar { width: 100%; height: 6px; background: var(--color-bg-light); border-radius: 3px; margin: 0.5rem 0; overflow: hidden; }
.baja-timer-fill { height: 100%; background: var(--color-primary); border-radius: 3px; transition: width linear; }
.baja-timer-fill.urgent { background: var(--color-danger); }

.baja-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 0.5rem;
}

.baja-opcion {
    font-size: 2rem;
    padding: 0.8rem;
    border: 2px solid var(--color-border);
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.baja-opcion:active { background: var(--color-bg-light); transform: scale(0.95); }
.baja-opcion.correct { border-color: var(--color-primary); background: rgba(76, 175, 80, 0.2); }
.baja-opcion.wrong { border-color: var(--color-danger); background: rgba(244, 67, 54, 0.2); }

/* --- TikTok Viral --- */
.tiktok-score {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    color: #ff2d55;
    margin-bottom: 0.5rem;
}

.tiktok-card-area {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    padding: 1rem;
    margin: 0.5rem 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.tiktok-card-area.flash-good { background: rgba(76, 175, 80, 0.15); }
.tiktok-card-area.flash-bad { background: rgba(244, 67, 54, 0.15); }

.tiktok-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tiktok-card.slide-in { animation: tiktokSlide 0.2s ease; }

@keyframes tiktokSlide {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tiktok-emoji { font-size: 2.5rem; }
.tiktok-label { font-size: 0.85rem; color: var(--color-text); text-align: center; }

.tiktok-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.tiktok-btn-skip, .tiktok-btn-post {
    flex: 1;
    padding: 0.7rem;
    font-size: 0.9rem;
    font-weight: 700;
    border: 2px solid;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.tiktok-btn-skip { border-color: var(--color-text-dim); color: var(--color-text-dim); }
.tiktok-btn-skip:active { background: rgba(120, 144, 156, 0.2); }
.tiktok-btn-post { border-color: #ff2d55; color: #ff2d55; }
.tiktok-btn-post:active { background: rgba(255, 45, 85, 0.2); }

/* --- Trapicheo del Mercadillo --- */
.mercadillo-cliente {
    font-size: 0.85rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    min-height: 1.5rem;
}

.mercadillo-bar-wrap {
    width: 100%;
    height: 50px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    margin: 0.5rem 0;
}

.mercadillo-bar-zones {
    display: flex;
    height: 100%;
    position: absolute;
    width: 100%;
}

.mercadillo-bar-zones .zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.3;
}

.zone-low { background: rgba(244, 67, 54, 0.1); }
.zone-mid { background: rgba(255, 152, 0, 0.1); }
.zone-high { background: rgba(76, 175, 80, 0.15); }

.mercadillo-bar-indicator {
    position: absolute;
    top: 0; bottom: 0;
    width: 4px;
    background: var(--color-gold);
    box-shadow: 0 0 8px var(--color-gold);
    z-index: 2;
    transition: none;
}

.mercadillo-guardia {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin: 0.5rem 0;
}

.mercadillo-guardia-bar {
    flex: 1;
    height: 8px;
    background: var(--color-bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.mercadillo-guardia-fill {
    height: 100%;
    background: var(--color-warning);
    border-radius: 4px;
    transition: width 0.3s;
}
.mercadillo-guardia-fill.danger { background: var(--color-danger); }

.mercadillo-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mercadillo-btn-vender, .mercadillo-btn-pasar {
    flex: 1;
    padding: 0.7rem;
    font-size: 0.9rem;
    font-weight: 700;
    border: 2px solid;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.mercadillo-btn-vender { border-color: var(--color-primary); color: var(--color-primary); }
.mercadillo-btn-vender:active { background: rgba(76, 175, 80, 0.2); }
.mercadillo-btn-pasar { border-color: var(--color-text-dim); color: var(--color-text-dim); }
.mercadillo-btn-pasar:active { background: rgba(120, 144, 156, 0.2); }

/* --- Carterista Express --- */
.carterista-earnings {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
}

.carterista-field {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.carterista-camera {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(244, 67, 54, 0.12);
    border-left: 2px solid rgba(244, 67, 54, 0.4);
    border-right: 2px solid rgba(244, 67, 54, 0.4);
    pointer-events: none;
    z-index: 1;
}

.carterista-entity {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
    transition: opacity 0.3s, transform 0.2s;
}

.carterista-entity.stolen {
    opacity: 0;
    transform: scale(1.3);
    pointer-events: none;
}

.carterista-entity.spotted {
    animation: flashFail 0.4s ease;
    pointer-events: none;
}

.carterista-hint { font-size: 0.75rem; color: var(--color-text-dim); margin-top: 0.5rem; min-height: 1.2rem; }
.carterista-hint.warning { color: var(--color-danger); font-weight: 700; }

/* --- Pause Toggle --- */
.pause-options {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.pause-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    user-select: none;
}

.pause-toggle input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--color-bg-light);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--color-text-dim);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s, background 0.2s;
}

.pause-toggle input:checked + .toggle-slider {
    background: var(--color-primary-dark);
}

.pause-toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
    background: var(--color-primary);
}

/* --- Ko-fi button --- */
.btn--kofi {
    background: linear-gradient(180deg, #ff5e5b 0%, #d94543 100%);
    color: #fff;
    border: none;
    text-decoration: none;
    text-align: center;
}

.btn--kofi:hover {
    background: linear-gradient(180deg, #ff7572 0%, #e25553 100%);
}

/* --- Font Scale controls --- */
.btn--small {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn--small:hover {
    background: var(--color-bg-light);
}

.btn--small:active {
    transform: scale(0.95);
}

.font-scale-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.font-scale-label {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

#font-scale-value {
    min-width: 50px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 600;
}

.stat-section .stat-label {
    color: var(--color-gold);
    font-weight: 700;
}

/* --- Ayuda Requirements Tags --- */
.ayuda-reqs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0.3rem 0;
}

.ayuda-req {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-dim);
    border: 1px solid var(--color-border);
}

.ayuda-req.prob-alta { color: var(--color-primary); border-color: rgba(76, 175, 80, 0.3); }
.ayuda-req.prob-media { color: var(--color-warning); border-color: rgba(255, 152, 0, 0.3); }
.ayuda-req.prob-baja { color: var(--color-danger); border-color: rgba(244, 67, 54, 0.3); }

/* ============================================
   TEST DE APTITUD SCREEN
   ============================================ */
#test-aptitud-screen {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(160deg, #0a1628 0%, #112240 40%, #1a3a2a 100%);
    position: relative;
    overflow: hidden;
}

#test-aptitud-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(76, 175, 80, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255, 179, 0, 0.06) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite alternate;
}

.test-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.test-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

.test-titulo {
    font-family: var(--font-pixel);
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: var(--color-primary);
    text-shadow: 3px 3px 0 #000, 0 0 30px rgba(76, 175, 80, 0.4);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.test-subtitulo {
    font-size: 0.95rem;
    color: var(--color-gold);
    margin-bottom: 10px;
    font-weight: 600;
}

.test-intro {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    margin-bottom: 20px;
    line-height: 1.4;
}

.test-progress {
    height: 4px;
    background: var(--color-bg-card);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow: hidden;
}

.test-progress-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

.test-progress-text {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    margin-bottom: 20px;
}

.test-question-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
}

.test-question-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-bright);
    margin-bottom: 20px;
    line-height: 1.4;
}

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

.btn--test-option {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: 14px 18px;
    width: 100%;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--test-option:hover {
    border-color: var(--color-primary);
    background: rgba(76, 175, 80, 0.1);
    color: var(--color-text-bright);
    transform: translateY(-1px);
}

.btn--test-option:active {
    transform: scale(0.98);
}

.test-response {
    background: var(--color-bg-card);
    border: 1px solid var(--color-gold);
    border-radius: var(--radius);
    padding: 24px;
    animation: slideUp 0.3s ease;
}

.test-response p {
    font-size: 1rem;
    color: var(--color-gold);
    font-weight: 600;
    font-style: italic;
}

.test-result-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
}

.test-result-titulo {
    font-family: var(--font-pixel);
    font-size: clamp(0.6rem, 2.5vw, 0.85rem);
    color: var(--color-primary);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.test-result-texto {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: 25px;
}

.test-footer {
    margin-top: 25px;
}

.btn--test-replay {
    background: transparent;
    border: 1px solid var(--color-text-dim, #666);
    color: var(--color-text-dim, #999);
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}
.btn--test-replay:hover {
    border-color: var(--color-primary, #22c55e);
    color: var(--color-primary, #22c55e);
}

/* ============================================
   AYUDAS: Renovación periódica (decay)
   ============================================ */
.ayuda-renovacion {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ayuda-renov-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.ayuda-renov-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    transition: width 0.3s ease;
}

.ayuda-renov-fill.warning {
    background: linear-gradient(90deg, #ffb300, #ff8f00);
    animation: renovPulse 1s ease-in-out infinite;
}

.ayuda-renov-fill.frozen {
    background: linear-gradient(90deg, #e53935, #c62828);
    width: 100% !important;
}

@keyframes renovPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ayuda-renov-label.frozen {
    color: #e53935;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.5px;
}

.btn--renovar {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #a5d6a7;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    align-self: stretch;
}

.btn--renovar:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.25);
}

.ayuda-card.frozen {
    border-color: rgba(229, 57, 53, 0.5);
    background: linear-gradient(135deg, var(--color-bg-card) 0%, rgba(229, 57, 53, 0.08) 100%);
    filter: grayscale(0.4);
}

.ayuda-card.frozen .ayuda-prod {
    text-decoration: line-through;
    opacity: 0.5;
}

/* ============================================
   MINIJUEGO: Estafa al Forocochero
   ============================================ */
.forocochero-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 136, 204, 0.08);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.forocochero-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forocochero-avatar {
    font-size: 2rem;
}

.forocochero-name {
    font-weight: bold;
    color: #e0e0e0;
}

.forocochero-status {
    font-size: 0.85rem;
    color: #aaa;
}

.forocochero-love {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.forocochero-love-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.forocochero-love-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #ff6b9d, #e91e63);
    transition: width 0.3s ease;
}

.forocochero-love-fill.low {
    background: linear-gradient(90deg, #e53935, #c62828);
}

.forocochero-love-fill.high {
    background: linear-gradient(90deg, #ff4081, #e91e63);
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.5);
}

.forocochero-chat {
    min-height: 180px;
    max-height: 240px;
    overflow-y: auto;
    padding: 10px;
    background: #1a1a1a;
    border-radius: var(--radius);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.forocochero-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.3;
    animation: bubbleIn 0.25s ease;
}

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

.forocochero-bubble.him {
    align-self: flex-start;
    background: #2d3748;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.forocochero-bubble.me {
    align-self: flex-end;
    background: #0088cc;
    color: white;
    border-bottom-right-radius: 4px;
}

.forocochero-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.forocochero-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.forocochero-option:hover {
    border-color: var(--color-primary);
    background: rgba(76, 175, 80, 0.08);
}

.forocochero-option-label {
    font-weight: bold;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 2px;
}

.forocochero-option-text {
    font-size: 0.85rem;
    color: #e0e0e0;
    font-style: italic;
}

.forocochero-typing {
    font-style: italic;
    color: #888;
    padding: 8px;
    font-size: 0.85rem;
}

.forocochero-end-msg {
    text-align: center;
    padding: 14px;
    font-weight: bold;
    color: #e0e0e0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
}

/* ============================================
   DATOS REALES (ficha informativa por arquetipo)
   ============================================ */
.char-datos-link {
    align-self: flex-start;
    margin-top: 8px;
    padding: 6px 10px;
    background: transparent;
    border: 1px dashed var(--color-gold);
    border-radius: 4px;
    color: var(--color-gold);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
    text-align: left;
    line-height: 1.2;
}

.char-datos-link:hover,
.char-datos-link:focus-visible {
    background: rgba(255, 179, 0, 0.12);
    border-style: solid;
    color: #FFD54F;
    outline: none;
    transform: translateX(2px);
}

.char-datos-link:active {
    transform: translateX(0);
    background: rgba(255, 179, 0, 0.2);
}

.datos-reales-content {
    max-width: 560px;
    position: relative;
    padding: 28px 24px 20px;
}

.datos-reales-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.datos-reales-close:hover,
.datos-reales-close:focus-visible {
    background: var(--color-bg-card);
    color: var(--color-text-bright);
}

.datos-reales-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 14px;
}

.datos-reales-icon {
    font-size: 2.4rem;
    flex-shrink: 0;
}

.datos-reales-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.datos-reales-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-bright);
    margin: 0;
    line-height: 1.25;
}

.datos-reales-subtitulo {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin: 0;
}

.datos-reales-disclaimer {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    line-height: 1.45;
    padding: 10px 12px;
    background: var(--color-bg-card);
    border-left: 3px solid var(--color-warning);
    border-radius: 4px;
    margin-bottom: 16px;
}

.datos-reales-seccion {
    margin-bottom: 18px;
}

.datos-reales-seccion-titulo {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-gold);
    margin: 0 0 8px;
    letter-spacing: 0.3px;
}

.datos-reales-resumen {
    font-size: 0.82rem;
    color: var(--color-text);
    line-height: 1.45;
    margin: 0 0 10px;
    font-style: italic;
}

.datos-reales-conceptos {
    display: flex;
    flex-direction: column;
}

.datos-reales-concepto {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.82rem;
}

.datos-reales-concepto:last-child {
    border-bottom: none;
}

.datos-reales-concepto-label {
    color: var(--color-text-dim);
    flex: 1 1 auto;
}

.datos-reales-concepto-valor {
    color: var(--color-text-bright);
    font-weight: 600;
    text-align: right;
    flex: 0 0 auto;
    max-width: 55%;
}

.datos-reales-concepto--ref .datos-reales-concepto-valor {
    color: var(--color-text-dim);
    font-weight: 400;
    font-style: italic;
}

.datos-reales-seccion--coste .datos-reales-seccion-titulo {
    color: var(--color-danger);
}

.datos-reales-seccion--aportacion .datos-reales-seccion-titulo {
    color: var(--color-primary);
}

.datos-reales-seccion--demografia .datos-reales-seccion-titulo {
    color: var(--color-gold);
}

.datos-reales-seccion--fuentes .datos-reales-seccion-titulo {
    color: var(--color-text-dim);
}

.datos-reales-fuentes {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.datos-reales-fuentes li {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    line-height: 1.4;
    padding-left: 14px;
    position: relative;
}

.datos-reales-fuentes li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

.datos-reales-fuentes a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-border);
    transition: color 0.15s, border-color 0.15s;
}

.datos-reales-fuentes a:hover,
.datos-reales-fuentes a:focus-visible {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.datos-reales-coletilla {
    font-size: 0.82rem;
    color: var(--color-gold);
    font-style: italic;
    line-height: 1.5;
    padding: 12px 14px;
    background: rgba(255, 179, 0, 0.06);
    border-left: 3px solid var(--color-gold);
    border-radius: 4px;
    margin: 18px 0 0;
}

.datos-reales-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.datos-reales-footer .btn--lg {
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    letter-spacing: 1px;
    min-width: 180px;
}

@media (max-width: 480px) {
    .datos-reales-content {
        padding: 24px 16px 16px;
    }

    .datos-reales-icon {
        font-size: 2rem;
    }

    .datos-reales-titulo {
        font-size: 0.92rem;
    }

    .datos-reales-concepto {
        font-size: 0.78rem;
    }

    .datos-reales-concepto-valor {
        max-width: 60%;
    }
}

/* ============================================
   PREFERS-REDUCED-MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

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

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

.ranking-list {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 179, 0, 0.25);
    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(255, 179, 0, 0.15);
    color: var(--color-gold);
}

.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-gold);
}

.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-primary);
    white-space: nowrap;
}

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

.ranking-loading,
.ranking-empty,
.ranking-error {
    text-align: center;
    color: var(--color-text-dim);
    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-gold);
    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(255, 179, 0, 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-gold);
}

.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;
}

#btn-ranking-start {
    margin-top: 10px;
}
