@import 'buttons.css';
@import 'start-screen.css';

@font-face {
    font-family: 'Press Start 2P';
    src: url('../fonts/PressStart2P-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #f0f0f0;
    --primary-red: #e60000;
    --primary-purple: #7b297b;
    --secondary-blue: #0055a7;
    --accent-yellow: #ffcc00;
    --text-color: #222;
    /* Colores de partidos */
    --psoe-color: #e60000;
    --pp-color: #0055a7;
    --vox-color: #63be21;
    --podemos-color: #7b297b;
    --neutral-color: #888888;
    /* Escala de fuentes para accesibilidad */
    --font-scale: 1;
}

body {
    font-family: "Press Start 2P", cursive;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport para móvil */
    min-height: -webkit-fill-available; /* iOS Safari */
    overflow: auto; /* Permitir scroll */
    user-select: none;
    touch-action: manipulation; /* Previene zoom por doble toque */
    /* Safe area support */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

#news-ticker {
    background: black;
    color: lime;
    padding: 5px;
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 2px solid var(--primary-red);
    position: relative; /* Para anclar el botón fab */
}

#back-to-menu-fab {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #222;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 10;
    border-right: 2px solid var(--primary-red);
    font-size: 1rem;
    transition: background 0.2s, transform 0.1s;
}

#back-to-menu-fab:active {
    background: #000;
    transform: scale(0.95);
}

#news-content {
    display: inline-block;
    padding-left: 100%;
    animation: scroll 600s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

main {
    display: flex;
    flex: 1;
    height: calc(100vh - 30px); /* Restar altura del ticker */
    height: calc(100dvh - 30px); /* Dynamic viewport */
    height: calc(-webkit-fill-available - 30px); /* iOS Safari */
    overflow: hidden;
}

/* Sección Izquierda: El Mapa y Botón */
#click-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    background: radial-gradient(circle, #fff 0%, #ddd 100%);
    border-right: 4px solid var(--primary-purple);
    position: relative;
    overflow-y: auto;
    touch-action: manipulation;
    z-index: 1; /* Por encima del region-info-panel */
}

/* MAPA ESPAÑA */
#map-container {
    width: 80%;
    max-width: 220px;
    margin-bottom: 5px;
}

/* Contenedor horizontal para ranking y personaje */
#ranking-character-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    width: 95%;
    max-width: 420px;
    margin-bottom: 10px;
}
#map-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.2));
}
.region {
    fill: var(--neutral-color);
    stroke: white;
    stroke-width: 0.5;
    transition: fill 0.5s ease;
    cursor: help;
}
.region:hover { opacity: 0.8; }
/* Para grupos SVG (islas), los paths hijos heredan el fill */
.region path {
    fill: inherit;
    stroke: inherit;
    stroke-width: inherit;
}

/* Regiones vendidas a otros países */
.region-vendida {
    stroke: #333;
    stroke-width: 1;
    stroke-dasharray: 4 2;
    animation: sold-pulse 2s ease-in-out infinite;
}
@keyframes sold-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Personaje animado */
#character-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 100px;
    min-height: 160px; /* Altura fija para evitar saltos */
    margin: 0;
    text-align: center;
}

#character-sprite {
    max-width: 100px;
    height: auto;
    image-rendering: pixelated;
    transition: opacity 0.3s ease;
}

#character-quote {
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #333;
    margin: 8px 0 0 0;
    max-width: 120px;
    line-height: 1.4;
    min-height: 3.5em; /* Espacio fijo para citas */
    text-align: center;
}

/* Panel de Ranking */
#ranking-panel {
    flex: 1;
    max-width: 200px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 0;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

#ranking-panel h4 {
    margin: 0 0 8px 0;
    text-align: center;
    font-size: calc(0.7rem * var(--font-scale, 1));
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 5px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: calc(0.6rem * var(--font-scale, 1));
}

.ranking-item.player {
    border: 2px solid var(--psoe-color);
    background: rgba(230, 0, 0, 0.1);
}

.ranking-position {
    font-weight: bold;
    width: 20px;
    text-align: center;
}

.ranking-emoji {
    font-size: 1.2rem;
    margin: 0 5px;
}

.ranking-name {
    flex: 1;
    font-weight: bold;
}

.ranking-votos {
    text-align: right;
    font-size: calc(0.55rem * var(--font-scale, 1));
}

.ranking-regiones {
    width: 40px;
    text-align: center;
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #666;
}

/* Barra de progreso hacia 50M */
#progress-bar-container {
    width: 90%;
    max-width: 260px;
    background: #ddd;
    border-radius: 10px;
    height: 20px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid #333;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--psoe-color), #ff6666);
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: calc(0.5rem * var(--font-scale, 1));
    font-weight: bold;
    line-height: 20px;
    color: #333;
    text-shadow: 0 0 3px white;
}

#votos-display {
    font-size: calc(1.5rem * var(--font-scale, 1));
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    text-shadow: 2px 2px var(--accent-yellow);
    line-height: 1;
}

#vps-display {
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: #666;
    margin-bottom: 10px;
}

/* Action Zone: Contenedor prominente para botón + déficit */
#action-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: radial-gradient(ellipse at center, rgba(230, 0, 0, 0.08) 0%, transparent 70%);
    border-radius: 20px;
    z-index: 50;
    position: relative;
}

#main-button {
    width: clamp(100px, 18vmin, 160px);
    height: clamp(100px, 18vmin, 160px);
    border-radius: 50%;
    border: 8px solid var(--primary-red);
    background: white;
    font-size: clamp(2.5rem, 5vmin, 4rem);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 0 var(--primary-red), 0 12px 30px rgba(230, 0, 0, 0.3);
    touch-action: manipulation;
}

#main-button:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 var(--primary-red), 0 4px 15px rgba(230, 0, 0, 0.2);
}

/* Barra de déficit */
#deficit-container {
    width: clamp(140px, 22vw, 200px);
    padding: 10px;
    background: rgba(0, 51, 153, 0.05);
    border-radius: 12px;
    text-align: center;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Estado crítico del déficit (>=50%) */
#deficit-container.deficit-critical {
    background: rgba(204, 119, 0, 0.1);
    box-shadow: 0 0 15px rgba(204, 119, 0, 0.3);
}

#deficit-bar-bg {
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid #003399;
}

#deficit-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #003399, #0055cc);
    transition: width 0.1s ease, background 0.3s ease;
}

#deficit-text {
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #003399;
    margin-top: 4px;
    font-weight: bold;
}

/* BCE button - extiende .btn--bce de buttons.css */
#bce-btn {
    margin-top: 8px;
}

/* Los estilos base vienen de .btn--bce */

/* Sección Derecha: Tienda */
#shop-zone {
    flex: 1;
    background: white;
    padding: 15px;
    overflow-y: auto;
    border-left: 4px solid var(--primary-red);
}

/* Barra de multiplicadores de compra */
#multiplier-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 8px;
    background: #333;
    border-radius: 5px;
    align-items: center;
    flex-wrap: wrap;
}

#multiplier-bar span {
    color: #aaa;
    font-size: calc(0.6rem * var(--font-scale, 1));
    margin-right: 5px;
}

/* Multiplier buttons - extienden .btn--multiplier de buttons.css */
/* Los estilos base vienen de .btn--multiplier */

/* Indicador de cantidad en bulk */
.bulk-qty {
    background: var(--primary-purple);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: calc(0.6rem * var(--font-scale, 1));
    margin-left: 5px;
}

.shop-category {
    margin-bottom: 20px;
}

.shop-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 8px;
    border: 2px solid #ccc;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s;
    font-size: calc(0.7rem * var(--font-scale, 1));
}

.shop-item:hover { background: #eee; }
.shop-item.disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

.item-icon { font-size: 2rem; margin-right: 10px; }
.item-info { flex: 1; }
.item-name { font-weight: bold; font-size: calc(0.8rem * var(--font-scale, 1)); }
.item-cost { color: var(--primary-red); font-weight: bold; font-size: calc(0.7rem * var(--font-scale, 1)); }
.item-count { font-size: calc(1.3rem * var(--font-scale, 1)); font-weight: bold; color: var(--primary-purple); margin-left: 10px; }

/* Prestige Button */
#prestige-btn {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 8px;
    width: 100%;
    font-size: calc(0.7rem * var(--font-scale, 1));
    cursor: pointer;
    margin-top: 15px;
    border-radius: 5px;
}

/* Animación de números al click */
.click-text {
    position: absolute;
    color: var(--primary-red);
    font-weight: bold;
    pointer-events: none;
    animation: float-up 1s forwards;
    z-index: 100;
}

@keyframes float-up {
    to { transform: translateY(-100px); opacity: 0; }
}

/* Tooltip simple */
.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: calc(0.55rem * var(--font-scale, 1));
    pointer-events: none;
    display: none;
    z-index: 200;
    max-width: 200px;
}

/* Tooltip para botones disabled */
.btn:disabled + .tooltip-disabled,
.btn.disabled + .tooltip-disabled,
.shop-item.disabled .tooltip-disabled {
    display: block;
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: calc(0.5rem * var(--font-scale, 1));
    z-index: 201;
    white-space: nowrap;
}

.shop-item.disabled {
    position: relative;
}

.shop-item.disabled .tooltip-disabled::before {
    content: "No tienes suficientes votos";
}

/* Overlays de Victoria/Derrota */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

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

#victory-overlay {
    background: rgba(230, 0, 0, 0.95);
    color: white;
}

#defeat-overlay {
    background: rgba(0, 0, 0, 0.95);
    color: white;
}

.overlay-title {
    font-size: calc(1.8rem * var(--font-scale, 1));
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

.overlay-stats {
    font-size: calc(0.8rem * var(--font-scale, 1));
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.8;
}

/* Overlay buttons - extienden .btn--overlay de buttons.css */
/* Los estilos base vienen de .btn--overlay */

/* Botones de derrota */
.defeat-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Reset progresista - extiende .btn--overlay-progresista de buttons.css */
/* Los estilos vienen de .btn--overlay-progresista */

.overlay-ranking {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    line-height: 1.8;
}

.overlay-ranking strong {
    font-size: calc(0.9rem * var(--font-scale, 1));
    display: block;
    margin-bottom: 8px;
}

/* CTA Ko-fi en pantalla de victoria */
.victory-kofi {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

.victory-kofi p {
    margin: 0 0 12px 0;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: rgba(255, 255, 255, 0.9);
}

/* Make overlay scrollable on mobile */
.game-overlay {
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Desktop: scroll independiente por sección */
@media (min-width: 801px) {
    body {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
}

/* Responsive */
@media (max-width: 800px) {
    body {
        /* Ticker height (~27px) + safe-area para evitar status bar */
        padding-top: calc(27px + env(safe-area-inset-top, 0));
    }
    main {
        flex-direction: column;
        flex: 1 1 auto;
        height: auto;
        min-height: auto;
        overflow: visible;
    }
    #click-zone {
        border-right: none;
        border-bottom: 4px solid var(--primary-purple);
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
        padding-bottom: 20px;
    }
    #shop-zone {
        border-left: none;
        border-top: 4px solid var(--primary-red);
        overflow-y: visible;
        height: auto;
        margin-right: 0; /* Sin margin en móvil */
        padding-right: 15px;
    }
    #map-container {
        max-width: 220px;
    }
    #ranking-character-row {
        max-width: 380px;
    }
    #character-container {
        width: 100px;
        min-height: 150px;
    }
    #character-sprite {
        max-width: 100px;
    }
    #main-button {
        width: clamp(100px, 16vmin, 130px);
        height: clamp(100px, 16vmin, 130px);
        font-size: clamp(2.5rem, 4.5vmin, 3.5rem);
    }
    #action-zone {
        padding: 12px 18px;
    }
    #deficit-container {
        width: clamp(130px, 20vw, 180px);
    }
    #news-ticker {
        position: fixed;
        top: env(safe-area-inset-top, 0);
        left: 0;
        right: 0;
        z-index: 100;
    }
    #news-content {
        animation-duration: 600s; /* 10 minutos en tablets */
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    #news-content {
        animation-duration: 480s; /* 8 minutos en móviles */
    }
    #map-container {
        width: 100%;
        max-width: 180px;
    }
    #ranking-character-row {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        max-width: 100%;
    }
    #ranking-panel {
        max-width: none;
        width: 95%;
        padding: 8px;
    }
    #character-container {
        width: auto;
        min-height: auto;
        margin: 0;
    }
    #character-sprite {
        max-width: 80px;
    }
    #character-quote {
        font-size: calc(0.45rem * var(--font-scale, 1));
        max-width: 200px;
        min-height: auto;
    }
    /* Action Zone: Sticky en móvil para visibilidad constante */
    #action-zone {
        position: sticky;
        bottom: calc(80px + env(safe-area-inset-bottom, 0));
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        margin: 10px auto;
        padding: 12px 15px;
        border-radius: 16px;
        z-index: 60;
    }
    #main-button {
        width: clamp(90px, 20vmin, 110px);
        height: clamp(90px, 20vmin, 110px);
        font-size: clamp(2.2rem, 6vmin, 2.8rem);
        border-width: 6px;
        box-shadow: 0 6px 0 var(--primary-red), 0 10px 25px rgba(230, 0, 0, 0.25);
        min-width: 44px;
        min-height: 44px;
    }
    #main-button:active {
        transform: translateY(6px);
        box-shadow: 0 0 0 var(--primary-red), 0 4px 12px rgba(230, 0, 0, 0.2);
    }
    #deficit-container {
        width: clamp(120px, 35vw, 160px);
        padding: 8px;
    }
    #deficit-text {
        font-size: calc(0.4rem * var(--font-scale, 1));
    }
    #bce-btn {
        font-size: calc(0.45rem * var(--font-scale, 1));
        padding: 6px 8px;
    }
    #ranking-panel h4 {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }
    .ranking-item {
        padding: 4px;
        font-size: calc(0.5rem * var(--font-scale, 1));
    }
    .ranking-emoji {
        font-size: 1rem;
    }
    #progress-bar-container {
        width: 95%;
        max-width: none;
    }
    #votos-display {
        font-size: calc(1rem * var(--font-scale, 1));
    }
    #vps-display {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }
    #shop-zone {
        padding: 10px;
    }
    #shop-zone h3 {
        font-size: calc(0.7rem * var(--font-scale, 1));
        margin: 8px 0;
    }
    .shop-item {
        padding: 10px 8px;
        font-size: calc(0.6rem * var(--font-scale, 1));
        min-height: 44px;
    }
    .item-icon {
        font-size: 1.5rem;
        margin-right: 8px;
    }
    .item-name {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }
    .item-cost {
        font-size: calc(0.55rem * var(--font-scale, 1));
    }
    .item-count {
        font-size: calc(1.1rem * var(--font-scale, 1));
    }
    /* Multiplier bar responsive */
    #multiplier-bar {
        padding: 6px;
        gap: 3px;
        justify-content: center;
    }
    #multiplier-bar span {
        font-size: calc(0.5rem * var(--font-scale, 1));
        width: 100%;
        text-align: center;
        margin-bottom: 3px;
    }
    #multiplier-bar button {
        padding: 4px 6px;
        font-size: calc(0.45rem * var(--font-scale, 1));
        min-height: 28px;
        min-width: 32px;
    }
    .bulk-qty {
        font-size: calc(0.5rem * var(--font-scale, 1));
        padding: 1px 4px;
    }
    .overlay-title {
        font-size: calc(1.2rem * var(--font-scale, 1));
    }
    .overlay-stats {
        font-size: calc(0.7rem * var(--font-scale, 1));
        padding: 0 15px;
        max-height: 60vh;
        overflow-y: auto;
    }
    .overlay-ranking {
        font-size: calc(0.6rem * var(--font-scale, 1));
        padding: 8px;
        margin-top: 8px;
    }
    .overlay-ranking strong {
        font-size: calc(0.7rem * var(--font-scale, 1));
        margin-bottom: 5px;
    }
    .overlay-btn {
        padding: 12px 30px;
        font-size: calc(0.8rem * var(--font-scale, 1));
        min-width: 44px;
        min-height: 44px;
    }
    /* Tooltips táctiles - visibles con clase activa */
    .tooltip {
        display: none;
    }
    .tooltip.tooltip-mobile-visible {
        display: block !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
        max-width: 280px;
        width: 90%;
        background: rgba(0,0,0,0.95);
        padding: 15px;
        border-radius: 8px;
        font-size: calc(0.6rem * var(--font-scale, 1));
        text-align: center;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    }
}

/* Modal de Eventos Aleatorios */
#event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 20px;
    box-sizing: border-box;
}

#event-modal.active {
    display: flex;
}

.event-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.event-title {
    font-size: calc(0.9rem * var(--font-scale, 1));
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

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

.event-option {
    padding: 15px 20px;
    border: 2px solid var(--primary-red);
    background: white;
    cursor: pointer;
    font-size: calc(0.7rem * var(--font-scale, 1));
    font-family: inherit;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 44px;
}

.event-option:hover {
    background: var(--primary-red);
    color: white;
}

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

.event-effect {
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #666;
    margin-top: 5px;
}

/* Estado deshabilitado para botones de evento */
.event-option.event-option-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.event-option.event-option-disabled:hover {
    background: white;
    color: inherit;
}

/* Mensaje de espera */
.event-wait-message {
    font-size: calc(0.65rem * var(--font-scale, 1));
    color: var(--primary-red);
    margin-bottom: 10px;
    font-style: italic;
    animation: pulse-wait 1s ease-in-out infinite;
}

@keyframes pulse-wait {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ===========================================
   DESKTOP TOOLBAR (Barra vertical derecha)
   =========================================== */

#desktop-toolbar {
    display: none;
    position: fixed;
    right: 0;
    top: 30px; /* Debajo del ticker */
    bottom: 0;
    width: 52px;
    background: linear-gradient(180deg, #2d2d2d, #1a1a1a);
    border-left: 3px solid var(--primary-red);
    z-index: 600;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px 0;
    box-shadow: -3px 0 10px rgba(0,0,0,0.3);
}

@media (min-width: 801px) {
    #desktop-toolbar {
        display: flex;
    }

    main {
        margin-right: 52px;
    }

    #shop-zone {
        margin-right: 0; /* Eliminar margin viejo, el toolbar usa margin en main */
    }
}

.toolbar-main,
.toolbar-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toolbar-separator {
    flex: 1;
}

/* Toolbar buttons - estilos de posicionamiento dentro del toolbar */
#desktop-toolbar .btn {
    position: static;
    box-shadow: none;
    text-decoration: none;
}

/* Panel de Logros */
#achievements-panel {
    position: fixed;
    top: 50px;
    right: 70px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    max-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 500;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

#achievements-panel.visible {
    display: block;
    z-index: 502;
}

/* En desktop, posicionar paneles a la izquierda del toolbar */
@media (min-width: 801px) {
    #achievements-panel {
        right: 62px; /* 52px toolbar + 10px gap */
    }
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: #f5f5f5;
    font-size: calc(0.6rem * var(--font-scale, 1));
}

.achievement-item.unlocked {
    background: #d4edda;
    border: 1px solid #28a745;
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: bold;
}

.achievement-desc {
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #666;
}

/* Notificación de logro */
.achievement-notification {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 1000;
    animation: achievementPop 3s forwards;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: top 0.3s ease;
}

@keyframes achievementPop {
    0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    10% { transform: translateX(-50%) translateY(0); opacity: 1; }
    80% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

/* Indicador de guardado */
#save-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #0f0;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: calc(0.5rem * var(--font-scale, 1));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

#save-indicator.visible {
    opacity: 1;
}

@media (min-width: 801px) {
    #save-indicator {
        right: 62px; /* 52px toolbar + 10px gap */
    }
}

/* Botón Ko-fi (ya no usado como elemento flotante, ahora en toolbar) */

/* Responsive: ocultar toolbar en móvil (se acceden via menú "Más") */
@media (max-width: 480px) {
    /* Ocultar toolbar - botones ahora están en el menú "Más" */
    #desktop-toolbar {
        display: none !important;
    }
}

/* Panel de Estadísticas */
#stats-panel {
    position: fixed;
    top: 100px;
    right: 70px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    max-width: 250px;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    z-index: 500;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

#stats-panel.visible {
    display: block;
    z-index: 502;
}

/* En desktop, posicionar paneles a la izquierda del toolbar */
@media (min-width: 801px) {
    #stats-panel {
        right: 62px; /* 52px toolbar + 10px gap */
    }
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: #f5f5f5;
    font-size: calc(0.55rem * var(--font-scale, 1));
}

.stat-label {
    color: #555;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-red);
}

.stats-section h4 {
    margin: 0 0 8px 0;
    font-size: calc(0.9rem * var(--font-scale, 1));
    color: #888;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
}

.stats-section + .stats-section {
    margin-top: 12px;
}

/* Header de paneles con botón de cierre */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.panel-header h4 {
    margin: 0;
}

/* Panel close - extiende .btn--panel-close de buttons.css */
/* Los estilos base vienen de .btn--panel-close */

/* Panel de información de región para móvil */
.region-info-panel {
    display: none; /* Oculto en desktop */
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 15px;
    text-align: center;
    z-index: 50; /* Reducido para no tapar contenido */
    font-size: calc(0.55rem * var(--font-scale, 1));
    line-height: 1.6;
    border-top: 2px solid var(--primary-red);
    /* Posicionar encima del bottom-nav */
    bottom: calc(70px + env(safe-area-inset-bottom, 0));
}

.region-info-panel.active {
    display: block;
}

#region-info-content strong {
    color: var(--accent-yellow);
}

/* Mostrar solo en móvil */
@media (max-width: 480px) {
    .region-info-panel.active {
        display: block;
    }
    #achievements-panel, #stats-panel {
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        top: 60px;
    }
}

/* Modal de Eventos Incontrolables */
#uncontrollable-event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(80, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 950;
    padding: 20px;
    box-sizing: border-box;
}

#uncontrollable-event-modal.active {
    display: flex;
    animation: uncontrollableShake 0.5s ease-in-out;
}

@keyframes uncontrollableShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.uncontrollable-event-content {
    background: linear-gradient(135deg, #2d0a0a, #4a1010);
    border: 3px solid #ff3333;
    border-radius: 12px;
    padding: 25px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
    animation: uncontrollablePulse 1s ease-in-out infinite;
}

@keyframes uncontrollablePulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 0 50px rgba(255, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5); }
}

.uncontrollable-event-header {
    font-size: calc(0.65rem * var(--font-scale, 1));
    color: #ff6666;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.uncontrollable-event-title {
    font-size: calc(0.9rem * var(--font-scale, 1));
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.uncontrollable-event-message {
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: #ffcccc;
    margin-bottom: 20px;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.uncontrollable-countdown-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ff3333;
}

.uncontrollable-countdown-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff3333, #ff6666);
    border-radius: 4px;
}

/* Responsive para modal incontrolable */
@media (max-width: 480px) {
    .uncontrollable-event-content {
        padding: 18px;
    }
    .uncontrollable-event-header {
        font-size: calc(0.55rem * var(--font-scale, 1));
    }
    .uncontrollable-event-title {
        font-size: calc(0.75rem * var(--font-scale, 1));
    }
    .uncontrollable-event-message {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }
}

/* === Panel de Corrupción === */
#corrupcion-panel {
    background: linear-gradient(135deg, rgba(139, 0, 139, 0.15), rgba(255, 0, 0, 0.1));
    border: 1px solid rgba(139, 0, 139, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 10px;
    font-size: calc(0.6rem * var(--font-scale, 1));
    color: #666;
    text-align: center;
    transition: all 0.3s ease;
}

#economia-display {
    font-size: calc(0.6rem * var(--font-scale, 1));
    color: #888;
    margin-bottom: 10px;
}

#corrupcion-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.corrupcion-separator { opacity: 0.5; }
.corrupcion-emoji { font-size: calc(0.8rem * var(--font-scale, 1)); }

#corrupcion-stats span span:last-child {
    color: #8b008b;
    font-weight: bold;
}

#teflon-display {
    font-size: calc(0.5rem * var(--font-scale, 1));
    margin-top: 4px;
    color: #888;
}

#teflon-bonus {
    color: #28a745;
    font-weight: bold;
}

/* Animación cuando sube */
.corrupcion-pulse {
    animation: corrupcionPulse 0.5s ease-out;
}

@keyframes corrupcionPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(139, 0, 139, 0); }
    50% { transform: scale(1.03); box-shadow: 0 0 12px rgba(139, 0, 139, 0.4); background: rgba(139, 0, 139, 0.2); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(139, 0, 139, 0); }
}

/* Responsive */
@media (max-width: 480px) {
    #corrupcion-panel { font-size: calc(0.5rem * var(--font-scale, 1)); padding: 4px 8px; }
    #teflon-display { font-size: calc(0.4rem * var(--font-scale, 1)); }
}

/* === Botón y Modal de Ayuda === */
#help-toggle {
    background: #9b59b6;
}

#help-toggle:hover {
    background: #8e44ad;
}

#help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 20px;
    box-sizing: border-box;
}

#help-modal.active {
    display: flex;
}

.help-content {
    background: white;
    border-radius: 12px;
    max-width: 550px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.help-content .panel-header {
    padding: 15px 20px;
    border-bottom: 2px solid #eee;
    flex-shrink: 0;
}

.help-content .panel-title {
    font-size: calc(0.9rem * var(--font-scale, 1));
    font-weight: bold;
    color: #333;
}

.help-body {
    padding: 15px 20px;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h4 {
    margin: 0 0 8px 0;
    font-size: calc(0.75rem * var(--font-scale, 1));
    color: var(--primary-red);
}

.help-section p {
    margin: 0 0 5px 0;
    font-size: calc(0.6rem * var(--font-scale, 1));
    line-height: 1.6;
    color: #444;
}

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

.help-section strong {
    color: var(--primary-purple);
}

/* Responsive para modal de ayuda en móvil */
@media (max-width: 480px) {
    .help-content {
        max-height: 80vh;
    }
    .help-content .panel-title {
        font-size: calc(0.75rem * var(--font-scale, 1));
    }
    .help-section h4 {
        font-size: calc(0.65rem * var(--font-scale, 1));
    }
    .help-section p {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }
}

/* === Modal de Nueva Partida y Ascensión === */
#new-game-modal,
#ascension-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#new-game-modal.active,
#ascension-confirm-modal.active {
    display: flex;
}

.new-game-content {
    background: white;
    border-radius: 10px;
    max-width: 320px;
    width: 90%;
    overflow: hidden;
}

.new-game-content .panel-header {
    padding: 12px 15px;
    border-bottom: 2px solid #eee;
}

.new-game-content .panel-title {
    font-size: calc(0.8rem * var(--font-scale, 1));
    font-weight: bold;
}

.new-game-options {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* New game option - extiende .btn de buttons.css */
.btn.new-game-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #ddd;
    background: #f9f9f9;
    color: inherit;
    white-space: normal;
}

.btn.new-game-option:hover {
    border-color: var(--primary-red);
    background: #fff;
}

.btn.new-game-option.danger {
    border-color: #dc3545;
}

.btn.new-game-option.danger:hover {
    background: #fff5f5;
}

.option-icon { font-size: 2rem; }
.option-title { font-weight: bold; margin: 5px 0; font-size: calc(0.7rem * var(--font-scale, 1)); }
.option-desc { font-size: calc(0.55rem * var(--font-scale, 1)); color: #666; text-align: center; }

/* Responsive para modal de nueva partida */
@media (max-width: 480px) {
    .new-game-content {
        max-width: 280px;
    }
    .option-icon { font-size: 1.5rem; }
    .option-title { font-size: calc(0.6rem * var(--font-scale, 1)); }
    .option-desc { font-size: calc(0.45rem * var(--font-scale, 1)); }
}

/* ===========================================
   MODAL DE CONFIRMACIÓN
   =========================================== */

#confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#confirm-modal.active {
    display: flex;
}

.confirm-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.confirm-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.9rem * var(--font-scale, 1));
    color: #ffc107;
    margin: 0 0 20px 0;
}

.confirm-content p {
    color: var(--text-color);
    font-size: calc(0.65rem * var(--font-scale, 1));
    margin-bottom: 25px;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 120px;
}

/* Responsive para modal de confirmación */
@media (max-width: 480px) {
    .confirm-content {
        max-width: 300px;
        padding: 20px;
    }
    .confirm-content h3 {
        font-size: calc(0.75rem * var(--font-scale, 1));
    }
    .confirm-content p {
        font-size: calc(0.55rem * var(--font-scale, 1));
    }
    .confirm-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .confirm-buttons .btn {
        width: 100%;
    }
}

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

    /* Deshabilitar scroll del ticker de noticias */
    #news-content {
        animation: none !important;
    }

    /* Deshabilitar pulse de regiones vendidas */
    .region-vendida {
        animation: none !important;
    }

    /* Deshabilitar animaciones de logros */
    .achievement-notification {
        animation: none !important;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    /* Deshabilitar shake de eventos incontrolables */
    #uncontrollable-event-modal.active {
        animation: none !important;
    }

    .uncontrollable-event-content {
        animation: none !important;
    }

    /* Deshabilitar pulse de espera de eventos */
    .event-wait-message {
        animation: none !important;
    }

    /* Deshabilitar pulse de corrupción */
    .corrupcion-pulse {
        animation: none !important;
    }

    /* Deshabilitar transiciones de paneles */
    #ascension-panel {
        transition: none !important;
    }

    /* Deshabilitar float-up de clicks */
    .click-text {
        animation: none !important;
        opacity: 0.8;
    }

    /* Deshabilitar fadeIn de overlays */
    .game-overlay {
        animation: none !important;
    }

    /* Deshabilitar transiciones del personaje */
    #character-sprite {
        transition: none !important;
    }

    /* Efecto toast sin animación */
    .effect-toast {
        transition: none !important;
    }
}

/* ========================================
   SISTEMA DE ASCENSIÓN - Estado Profundo
   ======================================== */

/* Botón de Ascensión */
#ascension-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #4a3728;
    background: linear-gradient(145deg, #8b6914, #d4af37);
    color: #2d1810;
    font-size: calc(1.3rem * var(--font-scale, 1));
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.3);
    transition: all 0.2s ease;
}

#ascension-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.4);
}

/* Panel de Ascensión */
#ascension-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: linear-gradient(180deg, #3d2817 0%, #2d1810 100%);
    border: 4px solid #d4af37;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 20px rgba(212, 175, 55, 0.3);
    z-index: 500;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

#ascension-panel.visible {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#ascension-panel .panel-header {
    background: linear-gradient(90deg, #4a3728, #6b4423, #4a3728);
    border-bottom: 2px solid #d4af37;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ascension-panel .panel-header h4 {
    color: #d4af37;
    margin: 0;
    font-size: calc(0.9rem * var(--font-scale, 1));
    text-shadow: 2px 2px 0 #000;
}

#ascension-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(85vh - 60px);
    color: #e8d5b5;
}

/* Header del panel */
.ascension-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4a3728;
}

.ascension-header h2 {
    color: #d4af37;
    margin: 0 0 10px 0;
    font-size: calc(1rem * var(--font-scale, 1));
    text-shadow: 2px 2px 0 #000;
}

.ascension-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: calc(0.7rem * var(--font-scale, 1));
}

.casta-display {
    color: #d4af37;
    font-weight: bold;
}

.ascension-count {
    color: #a89078;
}

/* Información de dificultad */
.difficulty-info {
    background: rgba(0,0,0,0.3);
    border: 1px solid #4a3728;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

.difficulty-info h4 {
    color: #c9a54a;
    margin: 0 0 10px 0;
    font-size: calc(0.65rem * var(--font-scale, 1));
    text-align: center;
}

.difficulty-bars {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
}

.diff-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: calc(0.5rem * var(--font-scale, 1));
}

.diff-stat span:first-child {
    color: #a89078;
}

.diff-value {
    color: #ff6b6b;
    font-weight: bold;
    margin-top: 2px;
}

/* Reset de Dificultad */
.difficulty-reset {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #4a3728;
    gap: 6px;
}

.difficulty-reset .btn {
    font-size: calc(0.5rem * var(--font-scale, 1));
}

.reset-info {
    font-size: calc(0.45rem * var(--font-scale, 1));
    color: #a89078;
    text-align: center;
}

.reset-maxed {
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #4caf50;
    font-weight: bold;
}

/* Secciones de Tier */
.tier-section {
    margin-bottom: 20px;
}

.tier-section h3 {
    color: #d4af37;
    font-size: calc(0.7rem * var(--font-scale, 1));
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #4a3728;
}

.tier-range {
    color: #a89078;
    font-size: calc(0.55rem * var(--font-scale, 1));
    font-weight: normal;
}

/* Grid de privilegios */
.privilegios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

/* Tarjeta de privilegio */
.privilegio-card {
    background: linear-gradient(180deg, #4a3728, #3d2817);
    border: 2px solid #5a4738;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.privilegio-card.available {
    border-color: #d4af37;
    cursor: pointer;
}

.privilegio-card.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.privilegio-card.owned {
    background: linear-gradient(180deg, #2a4a28, #1d3d1a);
    border-color: #4caf50;
}

.privilegio-card.locked {
    opacity: 0.6;
    filter: grayscale(30%);
}

.priv-emoji {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.priv-name {
    color: #e8d5b5;
    font-size: calc(0.55rem * var(--font-scale, 1));
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.3;
}

.priv-desc {
    color: #a89078;
    font-size: calc(0.45rem * var(--font-scale, 1));
    margin-bottom: 8px;
    line-height: 1.4;
}

.priv-cost {
    color: #d4af37;
    font-size: calc(0.5rem * var(--font-scale, 1));
    font-weight: bold;
    margin-bottom: 5px;
}

.privilegio-card.owned .priv-cost {
    color: #4caf50;
}

/* Priv buy button - extiende .btn--gold de buttons.css */
.priv-buy-btn {
    font-size: calc(0.45rem * var(--font-scale, 1));
}

/* Estados de disabled vienen de .btn:disabled */

/* Sección Golpe de Estado */
.golpe-estado-section {
    background: rgba(180, 50, 50, 0.2);
    border: 2px solid #b43232;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.golpe-estado-section h3 {
    color: #ff6b6b;
    margin: 0 0 10px 0;
    border: none;
    padding: 0;
}

.golpe-estado-section p {
    color: #e8d5b5;
    font-size: calc(0.55rem * var(--font-scale, 1));
    margin-bottom: 10px;
}

.golpe-estado-section.eliminated {
    background: rgba(50, 100, 50, 0.2);
    border-color: #4caf50;
}

.golpe-estado-section.eliminated h3 {
    color: #4caf50;
}

.rival-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Rival buttons - extienden .btn--danger de buttons.css */
/* Los estilos base vienen de .btn--danger */

/* Bonuses activos */
.active-bonuses {
    background: rgba(0,0,0,0.3);
    border: 1px solid #4a3728;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
}

.active-bonuses h4 {
    color: #4caf50;
    margin: 0 0 10px 0;
    font-size: calc(0.6rem * var(--font-scale, 1));
    text-align: center;
}

.bonus-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.bonus-tag {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    border-radius: 4px;
    padding: 4px 8px;
    color: #4caf50;
    font-size: calc(0.45rem * var(--font-scale, 1));
}

/* Ascend button - extiende .btn--gold y .btn--3d de buttons.css */
.ascend-btn {
    margin: 10px;
}

/* Los estilos base vienen de .btn--gold y .btn--3d */

/* Responsive para panel de ascensión */
@media (max-width: 480px) {
    #ascension-panel {
        width: 95%;
        max-height: 90vh;
    }

    .privilegios-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .priv-emoji {
        font-size: 1.2rem;
    }

    .priv-name {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }

    .priv-desc {
        font-size: calc(0.4rem * var(--font-scale, 1));
    }

    .ascension-header h2 {
        font-size: calc(0.85rem * var(--font-scale, 1));
    }

    .tier-section h3 {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }
}

/* --- TOAST DE EFECTO (eventos) --- */
.effect-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #d4af37;
    border-radius: 12px;
    padding: 15px 25px;
    z-index: 10001;
    font-family: "Press Start 2P", cursive;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: #fff;
    text-align: center;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.effect-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.effect-toast.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.effect-toast-label {
    color: #d4af37;
    display: block;
    margin-bottom: 8px;
    font-size: calc(0.6rem * var(--font-scale, 1));
}

@media (max-width: 480px) {
    .effect-toast {
        width: 85%;
        font-size: calc(0.55rem * var(--font-scale, 1));
        padding: 12px 15px;
    }
}

/* --- FASE GOBIERNO UI --- */
.government-panel {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #d4af37;
    border-radius: 12px;
    padding: 15px 25px;
    z-index: 9000;
    font-family: "Press Start 2P", cursive;
    text-align: center;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 280px;
}

.gov-header {
    color: #d4af37;
    font-size: calc(0.8rem * var(--font-scale, 1));
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.gov-timer {
    color: #fff;
    font-size: calc(1.5rem * var(--font-scale, 1));
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.gov-votos {
    font-size: calc(0.7rem * var(--font-scale, 1));
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.gov-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.gov-bar {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 10px;
}

.gov-min-line {
    position: absolute;
    top: 0;
    left: 100%;
    width: 3px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 5px #fff;
}

.gov-hint {
    color: #aaa;
    font-size: calc(0.45rem * var(--font-scale, 1));
}

/* Botón Gobernar - extiende .btn de buttons.css */
.govern-btn {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #d4af37;
    margin: 10px 5px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.govern-btn:hover {
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    border-color: #ffd700;
}

@media (max-width: 480px) {
    .government-panel {
        top: 35px;
        width: 90%;
        min-width: auto;
        padding: 10px 15px;
    }

    .gov-header {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }

    .gov-timer {
        font-size: calc(1.2rem * var(--font-scale, 1));
    }

    .gov-votos {
        font-size: calc(0.55rem * var(--font-scale, 1));
    }

    .gov-hint {
        font-size: calc(0.4rem * var(--font-scale, 1));
    }

    .govern-btn {
        font-size: calc(0.55rem * var(--font-scale, 1));
        padding: 12px 15px;
    }
}

/* === EVENTOS CLICKEABLES === */
.click-event {
    position: fixed;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #ff9800;
    border-radius: 12px;
    padding: 15px;
    min-width: 100px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
    animation: pulse-glow 1s ease-in-out infinite;
}

.click-event.visible {
    opacity: 1;
    transform: scale(1);
}

.click-event.success {
    transform: scale(1.2);
    opacity: 0;
}

.click-event.missed {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
}

.click-event-emoji {
    font-size: 2rem;
    margin-bottom: 5px;
    animation: bounce 0.5s ease infinite alternate;
}

.click-event-name {
    color: #fff;
    font-size: calc(0.5rem * var(--font-scale, 1));
    font-family: "Press Start 2P", cursive;
    text-shadow: 1px 1px 0 #000;
}

.click-event-timer {
    width: 100%;
    height: 4px;
    background: #ff9800;
    margin-top: 8px;
    border-radius: 2px;
    transition: width 0.1s linear, background 0.3s ease;
}

.click-event-result {
    position: fixed;
    z-index: 1001;
    color: #4CAF50;
    font-size: calc(0.6rem * var(--font-scale, 1));
    font-family: "Press Start 2P", cursive;
    text-shadow: 2px 2px 0 #000;
    animation: float-up 1.5s ease-out forwards;
    pointer-events: none;
}

.click-event-result.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 152, 0, 0.8);
    }
}

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

@keyframes float-up {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0.7;
    }
}

@media (max-width: 480px) {
    .click-event {
        padding: 10px;
        min-width: 80px;
    }

    .click-event-emoji {
        font-size: 1.5rem;
    }

    .click-event-name {
        font-size: calc(0.4rem * var(--font-scale, 1));
    }

    .click-event-result {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }
}

/* ===========================================
   NAVEGACIÓN INFERIOR MÓVIL (BOTTOM NAV)
   =========================================== */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #2d2d2d, #1a1a1a);
    border-top: 3px solid var(--primary-red);
    z-index: 600;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    justify-content: space-around;
    align-items: center;
}

/* Mostrar bottom-nav directamente en móvil via media query */
@media (max-width: 480px) {
    .bottom-nav {
        display: flex;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 80px;
    min-height: 44px;
    font-family: inherit;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: white;
    background: rgba(230, 0, 0, 0.3);
    border: 2px solid var(--primary-red);
}

.bottom-nav-item .nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.bottom-nav-item .nav-label {
    font-size: calc(0.5rem * var(--font-scale, 1));
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Clase para ocultar secciones en móvil */
.hidden-mobile {
    display: none !important;
}

/* Ajustar padding de main cuando bottom-nav está visible */
@media (max-width: 480px) {
    main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
    }

    /* Click zone con padding para no tapar el botón rosa */
    #click-zone:not(.hidden-mobile) {
        flex: 1;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    }

    /* Shop zone a pantalla completa cuando es el tab activo */
    #shop-zone:not(.hidden-mobile) {
        flex: 1;
        max-height: calc(100vh - 100px - env(safe-area-inset-bottom, 0));
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
        overflow-y: auto;
    }
}

/* ===========================================
   MENÚ "MÁS" PARA MÓVIL
   =========================================== */

/* Menú principal como modal centrado */
.more-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.more-menu.active {
    display: flex;
}

.more-menu-content {
    background: linear-gradient(180deg, #2d2d2d, #1a1a1a);
    border: 2px solid var(--primary-red);
    border-radius: 12px;
    padding: 20px 16px;
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.more-menu-header {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.9rem * var(--font-scale, 1));
    color: var(--primary-red);
    text-align: center;
    margin: 0 0 4px 0;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 2px;
}

.more-menu-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.more-menu-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.more-menu-section-title {
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 15px 2px;
    font-weight: 700;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: #ccc;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: calc(0.72rem * var(--font-scale, 1));
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    text-decoration: none;
    text-align: left;
    width: 100%;
}

.more-menu-item:hover,
.more-menu-item:active,
.more-menu-item:focus-visible {
    background: rgba(230, 0, 0, 0.3);
    color: white;
    outline: none;
}

.more-menu-item.danger {
    color: #ff6b6b;
}

.more-menu-item span:first-child {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

/* Estilo para enlace Ko-fi en el menú */
.more-menu-item.kofi-link {
    color: #ff5f5f;
    animation: kofi-glow 5s infinite;
}

.more-menu-item.kofi-link:hover {
    background: rgba(255, 95, 95, 0.2);
}

.more-menu-close {
    margin-top: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #aaa;
    font-family: inherit;
    font-size: calc(0.7rem * var(--font-scale, 1));
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    min-height: 44px;
    transition: all 0.2s;
}

.more-menu-close:hover,
.more-menu-close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* Controles de escala de fuente */
.font-scale-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-scale-controls .btn--xs {
    padding: 6px 10px;
    font-size: calc(0.55rem * var(--font-scale, 1));
    min-width: 32px;
    min-height: 32px;
}

#font-scale-value {
    min-width: 45px;
    text-align: center;
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #ccc;
}

/* ===========================================
   BOTÓN FLOTANTE KO-FI (MÓVIL)
   =========================================== */

.kofi-floating {
    display: none;
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: 15px;
    z-index: 550;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5f5f, #c41e3a);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    animation: kofi-float 3s ease-in-out infinite;
}

@media (max-width: 480px) {
    .kofi-floating { display: flex; }
}

/* Ocultar botón Ko-fi cuando el panel regional está activo */
body:has(.region-info-panel.active) .kofi-floating {
    display: none;
}

@keyframes kofi-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ===========================================
   ITEMS DE TIENDA COMPACTOS (MÓVIL)
   =========================================== */

@media (max-width: 480px) {
    /* Items más compactos */
    .shop-item {
        padding: 6px;
        margin-bottom: 6px;
        gap: 6px;
    }

    .item-icon {
        font-size: 1.2rem;
        margin-right: 6px;
        min-width: 28px;
        text-align: center;
    }

    .item-name {
        font-size: calc(0.55rem * var(--font-scale, 1));
    }

    .item-cost {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }

    .item-count {
        font-size: calc(1rem * var(--font-scale, 1));
        margin-left: 6px;
    }

    /* Descripciones de tienda con fuente reducida en móvil */
    .shop-item .item-info > div:nth-child(3) {
        font-size: calc(0.45rem * var(--font-scale, 1));
        line-height: 1.2;
    }
    .shop-item .item-info > div:nth-child(4) {
        font-size: calc(0.4rem * var(--font-scale, 1));
        line-height: 1.2;
    }

    /* Multiplier bar más compacto */
    #multiplier-bar {
        padding: 4px;
        gap: 2px;
    }

    #multiplier-bar button {
        padding: 3px 5px;
        font-size: calc(0.4rem * var(--font-scale, 1));
        min-height: 26px;
        min-width: 28px;
    }

    /* Títulos de sección más pequeños */
    #shop-zone h3 {
        font-size: calc(0.6rem * var(--font-scale, 1));
        margin: 6px 0;
    }

    #shop-zone hr {
        margin: 8px 0;
    }
}

/* ===========================================
   MODAL "SOBRE EL JUEGO" (ABOUT)
   =========================================== */

#about-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#about-modal.active {
    display: flex;
}

.about-content {
    background: white;
    border-radius: 12px;
    max-width: 400px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.about-content .panel-header {
    padding: 15px 20px;
    border-bottom: 2px solid #eee;
    flex-shrink: 0;
}

.about-content .panel-title {
    font-size: calc(0.85rem * var(--font-scale, 1));
    font-weight: bold;
    color: #333;
}

.about-body {
    padding: 20px;
    overflow-y: auto;
    text-align: center;
}

.about-logo {
    font-size: calc(4rem * var(--font-scale, 1));
    margin-bottom: 10px;
}

.about-body h2 {
    margin: 0 0 5px 0;
    font-size: calc(1.1rem * var(--font-scale, 1));
    color: var(--primary-red);
}

.about-tagline {
    font-size: calc(0.6rem * var(--font-scale, 1));
    color: #666;
    margin-bottom: 20px;
}

.about-section {
    text-align: left;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.about-section:last-of-type {
    border-bottom: none;
}

.about-section h4 {
    margin: 0 0 8px 0;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: var(--primary-red);
}

.about-section p {
    margin: 0;
    font-size: calc(0.55rem * var(--font-scale, 1));
    line-height: 1.6;
    color: #444;
}

.about-section.about-support {
    background: linear-gradient(135deg, rgba(255, 95, 95, 0.1), rgba(196, 30, 58, 0.1));
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 95, 95, 0.3);
    text-align: center;
    margin-top: 10px;
}

.about-section.about-support h4 {
    text-align: center;
    font-size: calc(0.75rem * var(--font-scale, 1));
}

.about-section.about-support p {
    text-align: center;
    margin-bottom: 10px;
}

.about-credits {
    margin-top: 15px;
    text-align: center;
}

.about-credits p {
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #666;
    margin: 0 0 8px 0;
}

.about-credits a {
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: var(--primary-red);
    text-decoration: none;
}

.about-credits a:hover {
    text-decoration: underline;
}

/* Botón About en toolbar */
.btn--toolbar-about {
    background: #607d8b;
}

.btn--toolbar-about:hover {
    background: #546e7a;
}

/* Responsive para modal About */
@media (max-width: 480px) {
    .about-content {
        max-height: 80vh;
    }
    .about-logo {
        font-size: calc(3rem * var(--font-scale, 1));
    }
    .about-body h2 {
        font-size: calc(0.9rem * var(--font-scale, 1));
    }
    .about-tagline {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }
    .about-section h4 {
        font-size: calc(0.6rem * var(--font-scale, 1));
    }
    .about-section p {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }
}

/* ===========================================
   LANDING MEJORADA (Start Screen)
   =========================================== */

.landing-description {
    margin: 15px 0;
    padding: 0 20px;
}

.landing-description p {
    font-size: calc(0.6rem * var(--font-scale, 1));
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.landing-footer {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.landing-kofi {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff5f5f, #c41e3a);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: calc(0.6rem * var(--font-scale, 1));
    font-weight: bold;
    transition: all 0.2s ease;
    animation: kofi-float 3s ease-in-out infinite;
}

.landing-kofi:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 95, 95, 0.4);
}

@media (max-width: 480px) {
    .landing-description p {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }
    .landing-kofi {
        font-size: calc(0.5rem * var(--font-scale, 1));
        padding: 8px 15px;
    }
}

/* ===========================================
   TOAST DE DONACIÓN (Publicidad Satírica)
   =========================================== */

.donation-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #ff5f5f;
    border-radius: 12px;
    padding: 0;
    z-index: 800;
    font-family: "Press Start 2P", cursive;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(255, 95, 95, 0.3), 0 0 20px rgba(255, 95, 95, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.donation-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.donation-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 95, 95, 0.2);
    border-bottom: 2px solid rgba(255, 95, 95, 0.3);
    border-radius: 9px 9px 0 0;
}

.donation-toast-icon {
    font-size: 1.2rem;
}

.donation-toast-title {
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #ff9999;
    letter-spacing: 1px;
    flex: 1;
    text-align: center;
}

.donation-toast-close {
    background: transparent;
    border: none;
    color: #ff6666;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.donation-toast-close:hover {
    color: #fff;
}

.donation-toast-body {
    padding: 15px;
    text-align: center;
}

.donation-toast-message {
    color: #e8e8e8;
    font-size: calc(0.6rem * var(--font-scale, 1));
    line-height: 1.6;
    margin: 0 0 15px 0;
    font-style: italic;
}

.btn--kofi-toast {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff5f5f, #c41e3a);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: calc(0.55rem * var(--font-scale, 1));
    font-weight: bold;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn--kofi-toast:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 95, 95, 0.5);
}

.donation-toast-timer {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 9px 9px;
    overflow: hidden;
}

.donation-toast-timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff5f5f, #ff9999);
    transition: width 8s linear;
}

/* Ko-fi en pantalla de derrota */
.defeat-kofi {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

.defeat-kofi p {
    margin: 0 0 12px 0;
    font-size: calc(0.65rem * var(--font-scale, 1));
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

.btn--kofi-defeat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff5f5f, #c41e3a);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: calc(0.6rem * var(--font-scale, 1));
    font-weight: bold;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn--kofi-defeat:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 95, 95, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Transición suave para rotación de texto Ko-fi */
.landing-kofi {
    transition: opacity 0.2s ease;
}

/* Responsive para toast de donación */
@media (max-width: 480px) {
    .donation-toast {
        bottom: calc(90px + env(safe-area-inset-bottom, 0));
        min-width: 260px;
        max-width: 90%;
        left: 50%;
    }

    .donation-toast-title {
        font-size: calc(0.4rem * var(--font-scale, 1));
    }

    .donation-toast-message {
        font-size: calc(0.5rem * var(--font-scale, 1));
    }

    .btn--kofi-toast {
        font-size: calc(0.5rem * var(--font-scale, 1));
        padding: 10px 15px;
    }

    .defeat-kofi p {
        font-size: calc(0.55rem * var(--font-scale, 1));
    }

    .btn--kofi-defeat {
        font-size: calc(0.5rem * var(--font-scale, 1));
        padding: 10px 15px;
    }
}

@media (min-width: 801px) {
    .donation-toast {
        bottom: 30px;
        right: 70px;
        left: auto;
        transform: translateY(20px);
    }

    .donation-toast.visible {
        transform: translateY(0);
    }
}

/* === Ranking Online (clases prefijadas con online- para no chocar con el ranking in-game) === */
#online-ranking-modal,
#online-nickname-modal {
    z-index: 5000;
}

.online-ranking-content {
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
    border: 3px solid var(--accent-yellow);
    border-radius: 15px;
    padding: 24px;
    width: 540px;
    max-width: 95%;
    text-align: center;
    color: #fff;
}

.online-ranking-nick-info {
    color: #aaa;
    font-size: 0.85rem;
    margin: 8px 0 12px;
}

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

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

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

.online-ranking-row.is-me {
    background: rgba(255, 204, 0, 0.18);
    color: var(--accent-yellow);
}

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

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

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

.online-ranking-score {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: #4CAF50;
    white-space: nowrap;
}

.online-ranking-time {
    color: #aaa;
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
}

.online-ranking-loading,
.online-ranking-empty,
.online-ranking-error {
    text-align: center;
    color: #aaa;
    padding: 20px;
    font-size: 0.85rem;
}

.online-ranking-error { color: #e60000; }

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

.online-nickname-input {
    width: 100%;
    padding: 12px 14px;
    margin: 16px 0 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 204, 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;
}

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

.online-nickname-error {
    color: #e60000;
    font-size: 0.8rem;
    margin-bottom: 12px;
}
