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

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

:root {
    --color-primary: #f4a460;
    --color-secondary: #daa520;
    --color-bg: #1a1a2e;
    --color-bg-light: #16213e;
    --color-text: #fff;
    --color-text-muted: #aaa;
    --color-success: #4CAF50;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    /* Escala de fuentes para accesibilidad */
    --font-scale: 1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-light) 100%);
    min-height: 100vh;
    color: var(--color-text);
    overflow-x: hidden;
    touch-action: manipulation; /* Previene zoom por doble toque */
}

/* ===== START SCREEN ===== */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f4a460 0%, #cd853f 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.start-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    border-radius: 20px;
    border: 4px solid #fff;
    text-align: center;
    max-width: 90%;
    width: 420px;
}

#start-screen h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.start-subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: #ffd700;
    margin-bottom: 25px;
}

.start-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

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

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

.start-note {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    margin-top: 15px;
}

.back-to-menu {
    display: block;
    margin-top: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* Landing Footer & Ko-fi */
.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: 0.6rem;
    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);
}

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

/* ===== CHARACTER SELECTION ===== */
#character-selection {
    margin-bottom: 20px;
}

#character-selection h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #ffd700;
    margin-bottom: 10px;
}

#character-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.character-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.3);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-option:hover {
    transform: scale(1.1);
    border-color: rgba(255,255,255,0.6);
}

.character-option.selected {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

.character-option.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.character-option.locked:hover {
    transform: none;
}

#character-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

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

.character-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

#selected-char-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #fff;
}

#selected-char-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 3px;
}

#selected-char-bonus {
    font-size: 0.75rem;
    color: var(--color-success);
    margin-top: 5px;
}

#meta-stats {
    margin-top: 15px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

/* ===== LOGROS NOTIFICATIONS ===== */
.logros-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logro-notif {
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease;
    max-width: 300px;
}

.logro-notif.show {
    opacity: 1;
    transform: translateX(0);
}

.logro-notif-icon {
    font-size: 2rem;
}

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

.logro-notif-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #ffd700;
}

.logro-notif-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: #fff;
    margin-top: 3px;
}

.logro-notif-bonus {
    font-size: 0.7rem;
    color: var(--color-success);
    margin-top: 5px;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Press Start 2P', cursive;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn--lg {
    padding: 18px 35px;
    font-size: 0.8rem;
}

.btn--start {
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    color: #fff;
    box-shadow: 0 4px 0 #2E7D32;
}

.btn--start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #2E7D32;
}

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

.btn--advance {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #000;
    box-shadow: 0 4px 0 #b8860b;
    width: 100%;
    max-width: 300px;
}

.btn--advance:hover {
    transform: translateY(-2px);
}

.btn--resource {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 8px;
    font-size: 0.45rem;
    border: 1px solid rgba(255,255,255,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.btn--resource:hover {
    background: rgba(255,255,255,0.25);
}

.btn--resource:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.btn--secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    text-decoration: none;
    display: inline-block;
}

.btn--secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn--menu {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1.2rem;
    padding: 5px 10px;
    cursor: pointer;
}

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

.btn--warning {
    background: linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff;
    box-shadow: 0 4px 0 #7f0000;
}

.btn--warning:hover {
    transform: translateY(-2px);
}

.btn--close {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    padding: 5px 10px;
}

/* ===== GAME HEADER ===== */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
    border-bottom: 2px solid var(--color-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

#player-name {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: var(--color-primary);
}

#player-age {
    font-size: calc(0.8rem * var(--font-scale, 1));
    color: var(--color-text-muted);
}

.header-center {
    text-align: center;
    flex: 1;
}

#decade-display {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: #ffd700;
    display: block;
}

#period-display {
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: var(--color-text-muted);
    display: block;
    margin-top: 2px;
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.year-progress {
    width: 150px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

#year-bar {
    height: 100%;
    background: var(--color-success);
    width: 0%;
    transition: width 0.3s ease;
}

.decade-progress {
    width: 150px;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

#decade-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    width: 0%;
    transition: width 0.5s ease;
}

.header-right {
    text-align: right;
    min-width: 100px;
}

#dinero-display {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #ffd700;
    margin-bottom: 3px;
}

#score-display {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: #4CAF50;
}

/* ===== MAIN CONTAINER ===== */
#game-container {
    padding: 20px;
    padding-bottom: 80px;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SECTION HEADERS ===== */
section h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: var(--color-primary);
    margin-top: 10px;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

/* ===== RESOURCES PANEL ===== */
#resources-panel {
    margin-bottom: 25px;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.resource-card {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.resource-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

.resource-icon {
    font-size: 2rem;
}

.resource-name {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.5rem * var(--font-scale, 1));
    color: var(--color-text-muted);
}

.resource-value {
    font-size: calc(0.85rem * var(--font-scale, 1));
    color: #fff;
    font-weight: bold;
}

/* ===== ACTIONS PANEL ===== */
#actions-panel {
    margin-bottom: 25px;
}

#actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-item {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.action-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-primary);
}

.action-info {
    flex: 1;
}

.action-name {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #fff;
    margin-bottom: 5px;
}

.action-desc {
    font-size: calc(0.8rem * var(--font-scale, 1));
    color: var(--color-text-muted);
}

.action-meta {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.action-cost {
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: var(--color-warning);
    font-weight: bold;
}

.action-cost.insufficient {
    color: var(--color-danger);
}

.action-points {
    font-size: calc(0.65rem * var(--font-scale, 1));
    color: var(--color-success);
}

.action-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
    transition: opacity 0.2s ease, filter 0.2s ease;
    position: relative;
}

/* Tooltip para botones disabled */
.action-btn:disabled + .tooltip-disabled,
.action-item.disabled .tooltip-disabled {
    display: block;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.5rem;
    z-index: 201;
    white-space: nowrap;
    margin-bottom: 5px;
}

.action-item.disabled .tooltip-disabled::before {
    content: "No tienes suficientes recursos";
}

.action-btn {
    background: var(--color-success);
    color: #fff;
    padding: 10px 20px;
    font-size: 0.5rem;
    min-width: 80px;
}

.action-btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.4;
    transform: none;
    filter: grayscale(0.5);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Botones de avance de tiempo */
.btn--advance-decade {
    background: linear-gradient(180deg, #9c27b0 0%, #7b1fa2 100%);
    box-shadow: 0 4px 0 #6a1b9a;
}

.btn--finish {
    background: linear-gradient(180deg, #ffd700 0%, #ffa000 100%);
    box-shadow: 0 4px 0 #ff8f00;
}

/* ===== GENERATIONS PANEL ===== */
#generations-panel {
    margin-bottom: 25px;
}

.generations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.generation {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
}

.gen-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.gen-name {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.45rem * var(--font-scale, 1));
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 5px;
}

.gen-status {
    font-size: calc(0.75rem * var(--font-scale, 1));
    color: #fff;
}

/* Status colors */
.gen-status.good { color: var(--color-success); }
.gen-status.warn { color: var(--color-warning); }
.gen-status.bad { color: var(--color-danger); }

/* ===== ADVANCE BUTTON ===== */
#advance-container {
    text-align: center;
    margin: 30px 0;
}

/* ===== BOTTOM NAV ===== */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    border-top: 2px solid var(--color-primary);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 5px 15px;
    transition: all 0.2s ease;
}

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

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

.nav-label {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.4rem * var(--font-scale, 1));
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
    border: 3px solid var(--color-primary);
    border-radius: 15px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    text-align: center;
}

.event-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.event-title {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.9rem * var(--font-scale, 1));
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.4;
}

.event-description {
    font-size: calc(0.95rem * var(--font-scale, 1));
    color: var(--color-text-muted);
    margin-bottom: 25px;
    line-height: 1.5;
}

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

.event-option {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.event-option:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--color-primary);
}

.event-option-title {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.55rem * var(--font-scale, 1));
    color: #fff;
    margin-bottom: 5px;
}

.event-option-effect {
    font-size: 0.8rem;
    color: var(--color-success);
}

/* Pause Modal */
.pause-content {
    text-align: center;
}

.pause-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 25px;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Controles de escala de fuente */
.font-scale-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

/* Confirm Modal */
.confirm-content {
    text-align: center;
}

.confirm-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--color-warning);
}

.confirm-content p {
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

.confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Quote Modal */
.quote-content {
    background: rgba(244, 164, 96, 0.95);
    border-radius: 20px;
    padding: 25px;
    max-width: 80%;
    text-align: center;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

#quote-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #1a1a2e;
    line-height: 1.8;
}

/* Endgame Modal */
.endgame-content {
    max-width: 450px;
}

.endgame-content h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(1.2rem * var(--font-scale, 1));
    color: #ffd700;
    margin-bottom: 10px;
}

.endgame-year {
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

#endgame-stats {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.stat-label {
    color: var(--color-text-muted);
}

.stat-value {
    font-weight: bold;
}

.stat-value.positive { color: var(--color-success); }
.stat-value.negative { color: var(--color-danger); }

.endgame-score {
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.endgame-score span:first-child {
    display: block;
    font-size: 0.8rem;
    color: rgba(0,0,0,0.7);
    margin-bottom: 5px;
}

#final-score {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(1.5rem * var(--font-scale, 1));
    color: #000;
}

#endgame-rating {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.7rem * var(--font-scale, 1));
    color: #ffd700;
    margin-bottom: 20px;
}

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

/* ===== STATS PANEL ===== */
.panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 350px;
    height: 100%;
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
    border-left: 3px solid var(--color-primary);
    z-index: 4000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-bottom: 2px solid var(--color-primary);
}

.panel-header h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--color-primary);
}

#stats-content {
    padding: 20px;
}

.stats-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stats-section:last-child {
    border-bottom: none;
}

.stats-section h5 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--color-primary);
    margin-bottom: 12px;
}

/* Endgame sections */
.endgame-section {
    margin-bottom: 15px;
}

.endgame-section h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.generation-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.generation-result:last-child {
    border-bottom: none;
}

.generation-result .gen-emoji {
    font-size: 1.5rem;
}

.generation-result .gen-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    color: #fff;
    flex: 1;
}

.generation-result .gen-desc {
    font-size: 0.75rem;
    color: var(--color-danger);
    text-align: right;
}

.rating-title {
    font-size: 0.9rem;
    color: #ffd700;
    margin-bottom: 5px;
}

.rating-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.rating-quote {
    font-style: italic;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

/* No actions message */
.no-actions {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 20px;
}

/* ===== MAINTENANCE MODAL ===== */
.maintenance-content {
    max-width: 450px;
}

.maintenance-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.maintenance-intro {
    color: var(--color-text-muted);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.maintenance-header-info {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.maintenance-total,
.maintenance-available {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.maintenance-total span:first-child,
.maintenance-available span:first-child {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.maintenance-items {
    max-height: 300px;
    overflow-y: auto;
}

.maintenance-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.maintenance-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

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

.maintenance-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.maintenance-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #fff;
}

.maintenance-state {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.maintenance-cost {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--color-warning);
}

.maintenance-cost.insufficient {
    color: var(--color-danger);
}

.maintenance-actions {
    display: flex;
    gap: 8px;
}

.btn--small {
    padding: 6px 12px;
    font-size: 0.45rem;
}

.btn--pay {
    background: var(--color-success);
}

.btn--ignore {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn--sell {
    background: var(--color-warning);
    color: #000;
}

.maintenance-global-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.no-maintenance {
    text-align: center;
    color: var(--color-text-muted);
    padding: 20px;
}

/* ===== SAVE INDICATOR ===== */
#save-indicator {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(76, 175, 80, 0.9);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3000;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    #start-screen h1 {
        font-size: 1.4rem;
    }

    .start-icon {
        font-size: 4rem;
    }

    .start-content {
        padding: 25px;
    }

    #game-header {
        flex-direction: column;
        gap: 10px;
    }

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

    .generations-grid {
        grid-template-columns: 1fr;
    }

    .landing-kofi {
        font-size: 0.5rem;
        padding: 8px 15px;
    }
}

/* ===========================================
   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; }
}

/* ===========================================
   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: 0.5rem;
    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: 0.6rem;
    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: 0.55rem;
    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 FIN DE JUEGO
   =========================================== */

.endgame-kofi {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

.endgame-kofi p {
    margin: 0 0 12px 0;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

.btn--kofi-endgame {
    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: 0.6rem;
    font-weight: bold;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

/* ===========================================
   KO-FI EN MENÚ PAUSA
   =========================================== */

.btn--kofi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff5f5f, #c41e3a);
    color: white;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn--kofi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 95, 95, 0.4);
}

/* ===========================================
   RESPONSIVE DONATION TOAST
   =========================================== */

@media (max-width: 400px) {
    .donation-toast {
        min-width: 260px;
        max-width: 90%;
    }

    .donation-toast-title {
        font-size: 0.45rem;
    }

    .donation-toast-message {
        font-size: 0.55rem;
    }

    .btn--kofi-toast {
        font-size: 0.5rem;
        padding: 10px 15px;
    }

    .btn--kofi-endgame {
        font-size: 0.55rem;
        padding: 10px 15px;
    }
}

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

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

/* ===========================================
   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 animaciones específicas del juego */
    .start-icon {
        animation: none !important;
    }

    .landing-kofi {
        animation: none !important;
    }

    .kofi-floating {
        animation: none !important;
    }

    .logro-notif {
        transition: none !important;
    }

    #start-screen {
        transition: opacity 0.01ms !important;
    }

    .quote-content {
        animation: none !important;
    }

    .panel {
        transition: none !important;
    }

    .donation-toast {
        transition: none !important;
    }

    .donation-toast-timer-bar {
        transition: none !important;
    }

    #year-bar,
    #decade-bar {
        transition: none !important;
    }

    .resource-card:hover,
    .action-item:hover,
    .event-option:hover {
        transform: none !important;
    }

    .btn:hover,
    .character-option:hover {
        transform: none !important;
    }

    .btn--start:hover {
        transform: translateY(0) !important;
    }

    .btn--start:active {
        transform: translateY(0) !important;
    }
}

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

.help-title {
    font-family: 'Press Start 2P', cursive;
    font-size: calc(0.75rem * var(--font-scale, 1));
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.help-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.help-section summary {
    padding: 12px 14px;
    font-weight: 700;
    font-size: calc(0.9rem * var(--font-scale, 1));
    color: var(--color-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    min-height: 44px;
}

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

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

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

.help-section summary:hover,
.help-section summary:focus-visible {
    background: rgba(244, 164, 96, 0.08);
    outline: none;
}

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

.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(244, 164, 96, 0.06);
    border-radius: 0 6px 6px 0;
    font-size: calc(0.85rem * var(--font-scale, 1));
}

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

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

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

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

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

.ranking-list {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
    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, 215, 0, 0.12);
    color: #ffd700;
}

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

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

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

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

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

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

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

/* Nickname modal */
.nickname-content {
    width: 420px;
    max-width: 95%;
}

.nickname-content h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: #ffd700;
    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, 215, 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: #ffd700;
}

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

