/* ================================
   TRAGAMONEDAS 777 - ESTILOS
   Tema: Tragamonedas Retro
   ================================ */

:root {
    /* Colores principales - tema casino/tragamonedas */
    --bg-dark: #1a0a2e;
    --bg-medium: #2d1b4e;
    --bg-light: #3d2a5c;
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --gold-light: #ffec8b;
    --red: #ff3b3b;
    --red-dark: #cc0000;
    --green: #00ff88;
    --green-dark: #00cc6a;
    --purple: #9b59b6;
    --blue: #3498db;
    --white: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    
    /* Gradientes */
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ffec8b 50%, #ffd700 100%);
    --gradient-red: linear-gradient(135deg, #ff3b3b 0%, #ff6b6b 50%, #ff3b3b 100%);
    --gradient-purple: linear-gradient(135deg, #1a0a2e 0%, #3d2a5c 100%);
    --gradient-button: linear-gradient(180deg, #4a3a6a 0%, #2d1b4e 100%);
    
    /* Sombras */
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.5);
    --shadow-red: 0 0 20px rgba(255, 59, 59, 0.5);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Tamaños */
    --cell-size: 52px;
    --border-radius: 12px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: var(--gradient-purple);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* ================================
   PANTALLAS
   ================================ */

.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-top));
    padding-bottom: calc(20px + var(--safe-area-bottom));
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ================================
   MENU PRINCIPAL
   ================================ */

.menu-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.game-logo {
    text-align: center;
    margin-bottom: 10px;
}

.logo-777 {
    display: block;
    font-size: 64px;
    font-weight: bold;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
    animation: pulse-gold 2s ease-in-out infinite;
}

.logo-fruits {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.logo-fruit {
    font-size: 56px;
    display: inline-block;
    animation: bounce-fruit 2s ease-in-out infinite;
}

.logo-fruit.cherry {
    filter: drop-shadow(0 4px 12px rgba(220, 20, 60, 0.6));
    animation-delay: 0s;
}

.logo-fruit.grape {
    filter: drop-shadow(0 4px 12px rgba(138, 43, 226, 0.6));
    animation-delay: 0.2s;
}

.logo-fruit.orange {
    filter: drop-shadow(0 4px 12px rgba(255, 165, 0, 0.6));
    animation-delay: 0.4s;
}

@keyframes bounce-fruit {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(-8px) scale(1.1);
    }
}

@keyframes pulse-gold {
    0%, 100% { filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4)); }
    50% { filter: drop-shadow(0 4px 20px rgba(255, 215, 0, 0.8)); }
}

.game-logo h1 {
    margin: 8px 0 4px;
    font-size: 32px;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tagline {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-btn {
    width: 100%;
    padding: 16px 20px;
    background: var(--gradient-button);
    border: 2px solid var(--bg-light);
    border-radius: var(--border-radius);
    color: var(--white);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.menu-btn:hover, .menu-btn:active {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-icon {
    font-size: 32px;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.btn-text {
    font-size: 18px;
    font-weight: bold;
    display: block;
}

.btn-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.menu-footer {
    display: flex;
    gap: 12px;
    width: 100%;
}

.secondary-btn {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* ================================
   PANTALLA DE SELECCION
   ================================ */

.select-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.select-container h2 {
    margin: 0 0 24px;
    font-size: 24px;
    color: var(--gold);
}

.select-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.select-option {
    padding: 16px 20px;
    background: var(--gradient-button);
    border: 2px solid var(--bg-light);
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.select-option:hover, .select-option:active {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.select-option .option-title {
    font-weight: bold;
    display: block;
}

.select-option .option-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.back-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

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

/* ================================
   PANTALLA DE JUEGO
   ================================ */

#game-screen {
    padding: 10px;
    padding-top: calc(10px + var(--safe-area-top));
    padding-bottom: calc(10px + var(--safe-area-bottom));
}

#game-screen.active {
    justify-content: flex-start;
}

#game-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Header del juego */
.game-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    position: relative;
}

.header-left, .header-right {
    min-width: 80px;
}

.header-right {
    text-align: right;
}

.icon-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.score-display {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.score-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.mode-info {
    font-size: 14px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-info .info-label {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
}

.mode-info .info-value {
    font-weight: bold;
    color: var(--gold);
}

/* Íconos y valores grandes para tiempo/movimientos */
.mode-info .info-icon-large {
    font-size: 28px;
    line-height: 1;
}

.mode-info .info-value-large {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold);
    line-height: 1;
}

.mode-info .info-sep {
    font-size: 20px;
    color: var(--text-secondary);
    margin: 0 4px;
}

.mode-info .info-value.danger,
.mode-info .info-value-large.danger {
    color: var(--red);
    animation: pulse-danger 0.5s ease-in-out infinite;
}

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

/* Barra de objetivo */
.objective-bar {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
}

.objective-bar.hidden {
    display: none;
}

.objective-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#objective-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.objective-progress {
    display: flex;
    gap: 8px;
    align-items: center;
}

.objective-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 13px;
}

.objective-item.completed {
    background: rgba(0, 255, 136, 0.2);
    color: var(--green);
}

/* Tablero de juego */
#board-container {
    position: relative;
    padding: 8px;
    background: linear-gradient(145deg, #2a1a4a, #1a0a2e);
    border-radius: 16px;
    border: 3px solid var(--gold-dark);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.2);
}

/* Botón Salir para móviles (debajo del tablero) */
.mobile-quit-btn {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 10px 20px;
    background: rgba(220, 53, 69, 0.8);
    border: 1px solid var(--red);
    border-radius: 8px;
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-quit-btn:active {
    background: rgba(220, 53, 69, 1);
}

/* Mostrar solo en pantallas táctiles/móviles */
@media (max-width: 768px), (pointer: coarse) {
    .mobile-quit-btn {
        display: block;
    }
}

.game-board {
    display: grid;
    gap: 3px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 8px;
}

/* Celdas del tablero */
.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--cell-size) * 0.65);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cell:active {
    transform: scale(0.95);
}

.cell.selected {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    background: rgba(255, 215, 0, 0.2);
    z-index: 10;
    animation: bounce-select 0.3s ease;
}

@keyframes bounce-select {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.15); }
}

.cell.hint {
    animation: hint-pulse 0.8s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

.cell.matching {
    animation: match-pop 0.4s ease forwards;
}

@keyframes match-pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); }
    100% { transform: scale(0); opacity: 0; }
}

.cell.falling {
    animation: fall-in 0.3s ease-out;
}

@keyframes fall-in {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.cell.swapping {
    transition: transform 0.2s ease;
}

.cell.invalid-swap {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Simbolos de tragamonedas */
.symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Siete rojo con fuego - estilo tragamonedas tradicional */
.symbol-seven {
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-size: calc(var(--cell-size) * 0.7);
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(180deg, 
        #ff6b35 0%, 
        #ff0000 25%, 
        #cc0000 50%, 
        #ff0000 75%, 
        #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 3px #ff4500) 
            drop-shadow(0 0 6px #ff0000) 
            drop-shadow(0 2px 2px rgba(0,0,0,0.5));
    text-shadow: none;
    position: relative;
    animation: seven-fire 0.8s ease-in-out infinite alternate;
}

@keyframes seven-fire {
    0% {
        filter: drop-shadow(0 0 3px #ff4500) 
                drop-shadow(0 0 6px #ff0000) 
                drop-shadow(0 2px 2px rgba(0,0,0,0.5));
    }
    100% {
        filter: drop-shadow(0 0 5px #ffff00) 
                drop-shadow(0 0 10px #ff4500) 
                drop-shadow(0 0 15px #ff0000)
                drop-shadow(0 2px 2px rgba(0,0,0,0.5));
    }
}

/* Combo display */
.combo-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
}

.combo-display.hidden {
    display: none;
}

.combo-display.active {
    display: block;
    animation: combo-appear 0.6s ease-out forwards;
}

@keyframes combo-appear {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -60%) scale(1); opacity: 0; }
}

.combo-text {
    display: block;
    font-size: 24px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.combo-count {
    display: block;
    font-size: 48px;
    font-weight: bold;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.5));
}

/* ================================
   MODALES
   ================================ */

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

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(145deg, var(--bg-medium), var(--bg-dark));
    padding: 24px;
    border-radius: 20px;
    border: 2px solid var(--gold-dark);
    box-shadow: var(--shadow-card), var(--shadow-gold);
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    width: 100%;
    max-width: 360px;
}

.modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    color: var(--gold);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.primary-btn {
    padding: 14px 24px;
    background: var(--gradient-gold);
    border: none;
    border-radius: var(--border-radius);
    color: #1a0a2e;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn:hover, .primary-btn:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.danger-btn {
    padding: 12px 24px;
    background: var(--gradient-red);
    border: none;
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.danger-btn:hover {
    opacity: 0.9;
}

/* Game Over Modal */
.gameover-header {
    margin-bottom: 20px;
}

.gameover-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.gameover-stats, .victory-stats {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.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-row.main-stat {
    font-size: 18px;
}

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

.gameover-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Ranking Feedback in Game Over Modal */
.ranking-feedback {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    text-align: center;
}

.ranking-position {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.ranking-position strong {
    color: var(--gold);
    font-size: 18px;
}

.ranking-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

.ranking-badge.new-record {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a0a2e;
}

.ranking-badge.top-10 {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #1a0a2e;
}

.ranking-badge.improved {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Victory Modal */
.victory-header {
    margin-bottom: 20px;
}

.victory-stars {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.victory-stars.stars-1 { opacity: 0.5; }
.victory-stars.stars-2 { opacity: 0.75; }
.victory-stars.stars-3 { 
    animation: stars-shine 1s ease-in-out infinite;
}

@keyframes stars-shine {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)); }
}

/* Ranking Compacto en Menu */
.ranking-compact {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.ranking-compact-title {
    font-size: 13px;
    color: var(--gold);
    margin: 0 0 5px 0;
    text-align: center;
    font-weight: bold;
}

.ranking-compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.ranking-compact-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 4px;
}

.ranking-section-title {
    font-size: 12px;
    color: var(--gold);
    margin-bottom: 3px;
    text-align: center;
    font-weight: bold;
}

.ranking-mini-list {
    font-size: 12px;
    min-height: 36px;
}

.ranking-mini-entry {
    display: flex;
    justify-content: space-between;
    padding: 1px 2px;
    border-radius: 3px;
}

.ranking-mini-entry:nth-child(odd) {
    background: rgba(255, 255, 255, 0.05);
}

.ranking-mini-entry .mini-rank {
    color: var(--gold);
    font-weight: bold;
    width: 14px;
    font-size: 12px;
}

.ranking-mini-entry .mini-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 2px;
    font-size: 12px;
}

.ranking-mini-entry .mini-score {
    color: var(--text-secondary);
    font-size: 12px;
}

.ranking-mini-empty {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    padding: 4px 0;
}

/* Ranking Modal */
.ranking-content {
    max-width: 400px;
}

.ranking-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--gold);
    color: var(--bg-dark);
    font-weight: bold;
}

.ranking-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.ranking-header {
    display: grid;
    grid-template-columns: 40px 1fr 80px;
    gap: 8px;
    padding: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-entry {
    display: grid;
    grid-template-columns: 40px 1fr 80px;
    gap: 8px;
    padding: 10px 8px;
    font-size: 14px;
    border-radius: 6px;
}

.ranking-entry:nth-child(odd) {
    background: rgba(255, 255, 255, 0.05);
}

.ranking-entry.current-user {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid var(--gold);
}

.ranking-entry .rank {
    font-weight: bold;
    color: var(--gold);
}

.ranking-entry .rank.top-3 {
    font-size: 16px;
}

/* Username Modal */
.username-header {
    margin-bottom: 16px;
}

.slot-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

#username-input {
    width: 100%;
    max-width: 250px;
    padding: 14px 18px;
    font-size: 18px;
    margin: 16px auto;
    border-radius: var(--border-radius);
    border: 2px solid var(--bg-light);
    background: rgba(0, 0, 0, 0.3);
    color: var(--white);
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    display: block;
}

#username-input:focus {
    border-color: var(--gold);
}

#username-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.error {
    color: var(--red);
    min-height: 20px;
    font-size: 13px;
    margin: 8px 0;
}

/* Settings Modal */
.settings-list {
    text-align: left;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-light);
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--gradient-gold);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Pause Modal */
.pause-stats {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 16px;
}

.pause-stats div {
    padding: 4px 0;
}

/* ================================
   MODAL DE INFORMACIÓN
   ================================ */

.info-modal-content {
    max-width: 400px;
    text-align: left;
}

.info-modal-content h2 {
    text-align: center;
}

.info-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.info-tab {
    flex: 1;
    min-width: 70px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-tab:hover {
    background: rgba(255, 215, 0, 0.15);
}

.info-tab.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 180, 0, 0.2));
    border-color: var(--gold);
    color: var(--gold);
    font-weight: 600;
}

.info-content {
    min-height: 280px;
}

.info-panel {
    display: none;
}

.info-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.info-panel h3 {
    color: var(--gold);
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.info-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    align-items: flex-start;
}

.info-item.highlight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.info-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.info-text {
    flex: 1;
}

.info-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.info-text p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

.info-text ul {
    margin: 8px 0 0;
    padding-left: 16px;
    font-size: 11px;
    color: var(--text-secondary);
}

.info-text ul li {
    margin-bottom: 4px;
}

.info-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
    font-style: italic;
}

.info-note {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid var(--gold);
    padding: 10px 12px;
    margin-top: 12px;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.info-note strong {
    color: var(--gold);
}

/* Tabla de puntos */
.points-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.point-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 13px;
}

.point-row span:first-child {
    color: var(--text-primary);
}

.point-row span:last-child {
    color: var(--gold);
    font-weight: 600;
}

.point-row.highlight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.4);
}

/* ================================
   EFECTOS Y PARTICULAS
   ================================ */

#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: particle-fall 1s ease-out forwards;
}

@keyframes particle-fall {
    0% { 
        transform: translateY(0) rotate(0deg) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(50px) translateX(var(--dx, 0)) rotate(360deg) scale(0.5); 
        opacity: 0; 
    }
}

.effect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 998;
}

.effect-overlay.jackpot {
    animation: jackpot-flash 0.5s ease-out;
}

/* Efectos de Jackpot para los 7 */
.effect-overlay.jackpot-mini {
    animation: jackpot-mini-flash 1s ease-out;
}

.effect-overlay.jackpot-super {
    animation: jackpot-super-flash 1.5s ease-out;
}

.effect-overlay.jackpot-mega {
    animation: jackpot-mega-flash 2s ease-out;
}

@keyframes jackpot-mini-flash {
    0%, 100% { background: transparent; }
    25%, 75% { background: rgba(255, 0, 0, 0.2); }
    50% { background: rgba(255, 215, 0, 0.3); }
}

@keyframes jackpot-super-flash {
    0%, 100% { background: transparent; }
    20% { background: rgba(255, 0, 0, 0.3); }
    40% { background: rgba(255, 215, 0, 0.4); }
    60% { background: rgba(255, 100, 0, 0.3); }
    80% { background: rgba(255, 215, 0, 0.2); }
}

@keyframes jackpot-mega-flash {
    0%, 100% { background: transparent; }
    10% { background: rgba(255, 0, 0, 0.4); }
    20% { background: rgba(255, 215, 0, 0.5); }
    30% { background: rgba(255, 100, 0, 0.4); }
    40% { background: rgba(255, 0, 0, 0.5); }
    50% { background: rgba(255, 255, 0, 0.4); }
    60% { background: rgba(255, 100, 0, 0.5); }
    70% { background: rgba(255, 0, 0, 0.4); }
    80% { background: rgba(255, 215, 0, 0.3); }
    90% { background: rgba(255, 100, 0, 0.2); }
}

/* Notificación de Jackpot */
.jackpot-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    text-align: center;
    padding: 30px 50px;
    border-radius: 20px;
    animation: jackpot-appear 0.5s ease-out;
}

.jackpot-notification.jackpot-mini {
    background: linear-gradient(145deg, rgba(200, 0, 0, 0.95), rgba(100, 0, 0, 0.95));
    border: 3px solid #ff4444;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5), 0 0 60px rgba(255, 0, 0, 0.3);
}

.jackpot-notification.jackpot-super {
    background: linear-gradient(145deg, rgba(255, 150, 0, 0.95), rgba(200, 50, 0, 0.95));
    border: 3px solid #ffcc00;
    box-shadow: 0 0 40px rgba(255, 200, 0, 0.6), 0 0 80px rgba(255, 100, 0, 0.4);
}

.jackpot-notification.jackpot-mega {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 100, 0, 0.95));
    border: 4px solid #fff;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 100, 0, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.2);
    animation: jackpot-appear 0.5s ease-out, mega-pulse 0.3s ease-in-out infinite;
}

@keyframes jackpot-appear {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes mega-pulse {
    0%, 100% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 100, 0, 0.5); }
    50% { box-shadow: 0 0 70px rgba(255, 215, 0, 1), 0 0 120px rgba(255, 100, 0, 0.7); }
}

.jackpot-notification.fade-out {
    animation: jackpot-fade 0.3s ease-out forwards;
}

@keyframes jackpot-fade {
    to { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.jackpot-sevens {
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-size: 48px;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff4400, 0 0 30px #ff0000, 2px 2px 0 #000;
    letter-spacing: 10px;
    animation: sevens-glow 0.5s ease-in-out infinite alternate;
}

@keyframes sevens-glow {
    0% { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff4400, 0 0 30px #ff0000, 2px 2px 0 #000; }
    100% { text-shadow: 0 0 20px #ffff00, 0 0 40px #ff4400, 0 0 60px #ff0000, 2px 2px 0 #000; }
}

.jackpot-title {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 10px 0;
}

.jackpot-points {
    font-size: 36px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8), 2px 2px 0 #000;
    animation: points-bounce 0.3s ease-in-out;
}

@keyframes points-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.jackpot-multiplier {
    font-size: 18px;
    color: #fff;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Partículas de 7 */
.seven-particle {
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-weight: 900;
    font-style: italic;
    color: #ff0000;
    text-shadow: 0 0 5px #ff4400, 0 0 10px #ff0000;
    animation: seven-fall 1.5s ease-out forwards;
}

@keyframes seven-fall {
    0% { 
        transform: translateY(0) rotate(0deg) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(var(--dy, 100px)) translateX(var(--dx, 0)) rotate(720deg) scale(0.3); 
        opacity: 0; 
    }
}

/* Display del Multiplicador */
.multiplier-display {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(145deg, #ff4400, #ff0000);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.6);
    animation: mult-pulse 0.5s ease-in-out infinite alternate;
    z-index: 100;
}

.multiplier-display.active {
    display: flex;
    align-items: center;
    gap: 4px;
}

@keyframes mult-pulse {
    0% { box-shadow: 0 0 10px rgba(255, 100, 0, 0.4); }
    100% { box-shadow: 0 0 20px rgba(255, 100, 0, 0.8); }
}

.mult-icon {
    font-size: 12px;
}

.mult-value {
    color: #ffff00;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
}

.mult-moves {
    font-size: 11px;
    opacity: 0.8;
}

@keyframes jackpot-flash {
    0%, 100% { background: transparent; }
    50% { background: rgba(255, 215, 0, 0.3); }
}

/* ================================
   RESPONSIVE
   ================================ */

/* Pantallas pequeñas */
@media (max-width: 380px) {
    :root {
        --cell-size: 44px;
    }
    
    .logo-777 {
        font-size: 48px;
    }
    
    .logo-fruit {
        font-size: 42px;
    }
    
    .game-logo h1 {
        font-size: 26px;
    }
    
    .menu-btn {
        padding: 12px 14px;
        gap: 12px;
    }
    
    .btn-icon {
        font-size: 28px;
        min-width: 40px;
    }
    
    .btn-text {
        font-size: 16px;
    }
}

@media (max-height: 650px) {
    :root {
        --cell-size: 38px;
    }
    
    .game-header {
        padding: 6px 10px;
    }
    
    .score-value {
        font-size: 20px;
    }
    
    .menu-container {
        gap: 16px;
    }
    
    .logo-777 {
        font-size: 48px;
    }
    
    .logo-fruit {
        font-size: 42px;
    }
    
    .game-logo h1 {
        font-size: 26px;
    }
    
    .menu-btn {
        padding: 12px 16px;
    }
    
    .btn-icon {
        font-size: 28px;
        min-width: 40px;
    }
}

@media (max-height: 550px) {
    :root {
        --cell-size: 32px;
    }
    
    #board-container {
        padding: 6px;
    }
    
    .game-board {
        gap: 2px;
        padding: 3px;
    }
}

/* Desktop */
@media (min-width: 768px) {
    :root {
        --cell-size: 54px;
    }
    
    .menu-container {
        max-width: 500px;
    }
    
    .logo-777 {
        font-size: 48px;
    }
    
    .logo-fruit {
        font-size: 42px;
    }
    
    .game-logo h1 {
        font-size: 40px;
    }
    
    .cell:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }
}

/* Deshabilitar hover en dispositivos táctiles para evitar estados atascados */
@media (hover: none) {
    .cell:hover {
        background: rgba(255, 255, 255, 0.05);
        transform: none;
    }
}

/* Landscape en móvil */
@media (max-height: 450px) and (orientation: landscape) {
    :root {
        --cell-size: 28px;
    }
    
    .screen {
        padding: 10px;
    }
    
    .game-header {
        padding: 4px 8px;
    }
    
    .score-value {
        font-size: 18px;
    }
    
    #board-container {
        padding: 4px;
    }
    
    .menu-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }
    
    .game-logo {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .logo-777 {
        font-size: 36px;
    }
    
    .logo-fruit {
        font-size: 32px;
    }
    
    .game-logo h1 {
        font-size: 20px;
    }
    
    .menu-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .menu-btn {
        flex: 1 1 45%;
        padding: 10px;
    }
    
    .btn-desc {
        display: none;
    }
}

/* Inputs - prevenir zoom en iOS */
input, button, select, textarea {
    font-size: 16px;
}

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

/* Hidden utility */
.hidden {
    display: none !important;
}

/* ================================
   SISTEMA DE MONEDAS
   ================================ */

/* Display de monedas en menu */
.coins-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 2px solid var(--gold-dark);
    border-radius: 30px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.coins-display .coin-icon {
    font-size: 24px;
    animation: coin-spin 3s ease-in-out infinite;
}

@keyframes coin-spin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.coins-display .coin-amount {
    font-size: 22px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Barra de extras en juego (monedas + powerups) */
.game-extras-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    gap: 10px;
}

.game-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.game-coins .coin-icon {
    font-size: 18px;
}

.game-coins span:last-child {
    font-weight: bold;
    color: var(--gold);
    min-width: 30px;
    text-align: center;
}

/* Monedas negativas (deuda) */
.game-coins span.negative,
#total-coins.negative {
    color: var(--red);
}

/* Celdas con moneda */
.cell.has-coin {
    position: relative;
}

.cell.has-coin::before {
    content: '💰';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 14px;
    z-index: 5;
    animation: coin-bounce 1s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.8));
}

@keyframes coin-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
}

/* Notificación de moneda recolectada */
.coin-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 180, 0, 0.95));
    border-radius: 30px;
    font-size: 24px;
    font-weight: bold;
    color: #1a0a2e;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    z-index: 3000;
    animation: coin-notif-appear 0.3s ease-out;
}

.coin-notification .coin-icon {
    font-size: 28px;
}

@keyframes coin-notif-appear {
    0% { transform: translateX(-50%) translateY(-20px) scale(0.8); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

.coin-notification.fade-out {
    animation: coin-notif-fade 0.3s ease-out forwards;
}

@keyframes coin-notif-fade {
    to { transform: translateX(-50%) translateY(-20px) scale(0.8); opacity: 0; }
}

/* Notificación de Match 5+ */
.match5-notification {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 30px;
    background: linear-gradient(145deg, rgba(138, 43, 226, 0.95), rgba(75, 0, 130, 0.95));
    border: 2px solid #ffd700;
    border-radius: 15px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 25px rgba(138, 43, 226, 0.6), 0 0 30px rgba(255, 215, 0, 0.3);
    z-index: 3000;
    animation: match5-appear 0.4s ease-out;
}

.match5-notification .match5-icon {
    font-size: 32px;
    animation: match5-star 0.6s ease-in-out infinite;
}

.match5-notification .match5-text {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.match5-notification .match5-coins {
    font-size: 22px;
    color: #ffd700;
}

@keyframes match5-appear {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes match5-star {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(15deg) scale(1.2); }
}

.match5-notification.fade-out {
    animation: match5-fade 0.4s ease-out forwards;
}

@keyframes match5-fade {
    to { transform: translateX(-50%) translateY(-30px) scale(0.8); opacity: 0; }
}

/* Advertencia de pocas jugadas disponibles */
.low-moves-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(145deg, rgba(255, 160, 0, 0.98), rgba(255, 120, 0, 0.98));
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    color: #1a0a2e;
    box-shadow: 0 8px 32px rgba(255, 140, 0, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.low-moves-warning.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.low-moves-warning .warning-icon {
    font-size: 24px;
}

.low-moves-warning .warning-text {
    white-space: nowrap;
}

/* Advertencia de pocos movimientos en el banco */
.low-bank-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(145deg, rgba(220, 50, 50, 0.98), rgba(180, 30, 30, 0.98));
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 8px 32px rgba(220, 50, 50, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.low-bank-warning.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.low-bank-warning .warning-icon {
    font-size: 24px;
}

.low-bank-warning .warning-text {
    white-space: nowrap;
}

/* ================================
   COMODINES / POWERUPS
   ================================ */

.powerups-bar {
    display: flex;
    gap: 8px;
}

.powerup-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--bg-light), var(--bg-medium));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.powerup-btn:hover:not(.disabled) {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.powerup-btn:active:not(.disabled) {
    transform: translateY(0);
}

.powerup-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.powerup-btn.blocked {
    opacity: 0.3;
    cursor: not-allowed;
    position: relative;
}

.powerup-btn.blocked::after {
    content: '🚫';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

.powerup-btn .powerup-icon {
    font-size: 20px;
}

/* Diana más grande para extraMoves */
#powerup-extraMoves .powerup-icon {
    font-size: 26px;
}

.powerup-btn .powerup-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: var(--red);
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Powerup name label (hidden by default, shown on tap/hover) */
.powerup-btn .powerup-name {
    display: none;
}

/* Powerup tooltip (non-invasive) */
.powerup-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
    width: max-content;
    max-width: 180px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    white-space: normal;
}

/* Tooltip arrow */
.powerup-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

/* Show tooltip on hover (desktop) */
@media (hover: hover) {
    .powerup-btn:hover::before,
    .powerup-btn:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) scale(1);
    }
    .powerup-btn:hover::after {
        transform: translateX(-50%);
    }
}

/* Show tooltip on long press (mobile) - handled via JS class */
.powerup-btn.show-tooltip::before,
.powerup-btn.show-tooltip::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}
.powerup-btn.show-tooltip::after {
    transform: translateX(-50%);
}

/* Don't show tooltip arrow for blocked powerups (they have ::after used for 🚫) */
.powerup-btn.blocked::after {
    content: '🚫';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    border: none;
    bottom: auto;
    opacity: 1;
    visibility: visible;
}

/* Modo comodin activo (bomba/rayo) */
.game-board.powerup-mode {
    cursor: crosshair;
}

.game-board.bomb-mode .cell:hover {
    background: rgba(255, 100, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.5);
}

.game-board.wildcard-mode .cell:hover {
    background: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Efectos de comodines */
.cell.exploding {
    animation: explode 0.3s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); background: rgba(255, 100, 0, 0.8); }
    100% { transform: scale(0); opacity: 0; }
}

.cell.wildcard-placed {
    animation: wildcard-glow 0.5s ease-out;
}

@keyframes wildcard-glow {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
    50% { transform: scale(1.2); box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
}

/* ================================
   TIENDA
   ================================ */

.shop-content {
    max-width: 380px;
}

.shop-coins {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--gold-dark);
    border-radius: 25px;
    margin: 0 auto 20px;
    font-size: 22px;
    font-weight: bold;
    color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.shop-coins .coin-icon {
    font-size: 26px;
    line-height: 1;
}

#shop-coins {
    line-height: 1;
    min-width: 40px;
    text-align: center;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.shop-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas: 
        "icon name btn"
        "icon desc btn";
    align-items: center;
    gap: 4px 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.shop-item:hover {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

.shop-item .item-icon {
    grid-area: icon;
    font-size: 32px;
    text-align: center;
    align-self: center;
}

.shop-item .item-name {
    grid-area: name;
    font-weight: bold;
    color: var(--white);
    font-size: 15px;
    align-self: end;
}

.shop-item .item-desc {
    grid-area: desc;
    font-size: 12px;
    color: var(--text-secondary);
    align-self: start;
}

.shop-item .buy-btn {
    grid-area: btn;
    padding: 8px 16px;
    background: var(--gradient-gold);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #1a0a2e;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: center;
}

.shop-item .buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.shop-item .buy-btn.bought {
    background: var(--green);
    color: white;
}

.shop-item .buy-btn.insufficient {
    animation: shake-btn 0.3s ease;
    background: var(--red);
    color: white;
}

@keyframes shake-btn {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ================================
   RANKING SUBTABS (Aventura)
   ================================ */

.ranking-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.subtab-btn {
    flex: 1;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.subtab-btn.active {
    background: var(--purple);
    color: white;
    font-weight: bold;
}

/* ================================
   SETTINGS - Username section
   ================================ */

.small-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.small-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Monedas ganadas highlight */
.stat-row.coins-earned .stat-value {
    color: var(--gold);
}

/* ================================
   SELECTOR DE NIVELES (Aventura)
   ================================ */

/* Progreso en opciones de dificultad */
.option-progress {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
}

.progress-levels {
    color: var(--green);
}

.progress-stars {
    color: var(--gold);
}

/* Grid de niveles */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.level-btn {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: var(--gradient-button);
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.level-btn .level-num {
    font-size: 20px;
    font-weight: bold;
    color: var(--white);
}

.level-btn .level-stars {
    font-size: 10px;
    line-height: 1;
}

/* Nivel disponible */
.level-btn.available {
    border-color: rgba(255, 255, 255, 0.3);
}

.level-btn.available:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

/* Nivel completado */
.level-btn.completed {
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.1));
    border-color: var(--green);
}

.level-btn.completed .level-num {
    color: var(--green);
}

.level-btn.completed:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

/* Nivel bloqueado */
.level-btn.locked {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

.level-btn.locked .level-num {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Boton volver en niveles */
.level-back {
    margin-top: 10px;
}

/* Responsive para grid de niveles */
@media (max-width: 350px) {
    .levels-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .level-btn .level-num {
        font-size: 16px;
    }
    
    .level-btn .level-stars {
        font-size: 8px;
    }
}

/* ==========================================
   SUGERENCIAS DE USUARIO
   ========================================== */
.username-input-container {
    position: relative;
    width: 100%;
}

.username-input-container input {
    width: 100%;
}

.username-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border: 1px solid var(--gold);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.username-suggestions.active {
    display: block;
}

.username-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.username-suggestion:last-child {
    border-bottom: none;
}

.username-suggestion:hover {
    background: rgba(255, 215, 0, 0.1);
}

.username-suggestion .name {
    font-weight: bold;
    color: var(--gold);
}

.username-suggestion .score {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Boton de logout */
#logout-btn {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    color: #ff4444;
}

#logout-btn:hover {
    background: rgba(255, 68, 68, 0.3);
}

.settings-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.settings-user span {
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
}

.settings-user .small-btn {
    flex: 1;
    max-width: 120px;
}

/* ==========================================
   INFO DE USUARIO EN MENU PRINCIPAL
   ========================================== */

/* Contenedor flex para user-info y ranking lado a lado */
.menu-top-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: stretch;
}

.user-info {
    flex: 1;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
}

.user-greeting {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-greeting strong {
    color: var(--gold);
    font-size: 16px;
}

.coins-inline {
    font-size: 14px;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

.user-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.user-score-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.user-score-item .mode-icon {
    font-size: 13px;
}

.user-score-item .mode-name {
    color: var(--text-secondary);
}

.user-score-item .mode-score {
    color: var(--gold);
    font-weight: bold;
}

.user-scores-empty {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

/* Ocultar info si no hay usuario */
.user-info.hidden {
    display: none;
}

/* Botón de sincronización */
.sync-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: linear-gradient(145deg, rgba(255, 100, 100, 0.2), rgba(255, 50, 50, 0.1));
    border: 1px solid rgba(255, 100, 100, 0.5);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.sync-btn:hover {
    background: linear-gradient(145deg, rgba(255, 100, 100, 0.3), rgba(255, 50, 50, 0.2));
    border-color: rgba(255, 100, 100, 0.7);
}

.sync-btn.syncing {
    opacity: 0.7;
    cursor: wait;
}

.sync-btn.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

.sync-btn.success {
    background: linear-gradient(145deg, rgba(100, 255, 100, 0.2), rgba(50, 200, 50, 0.1));
    border-color: rgba(100, 255, 100, 0.5);
    color: #6bff6b;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-icon {
    font-size: 16px;
    display: inline-block;
}

.sync-text {
    font-weight: 500;
}

/* Modal Sin Movimientos */
.nomoves-content {
    text-align: center;
    max-width: 320px;
}

.nomoves-header {
    margin-bottom: 15px;
}

.nomoves-header .warning-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nomoves-header h2 {
    color: #ff6b6b;
    font-size: 24px;
    margin: 0;
}

.nomoves-content > p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.nomoves-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.power-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2a2a5a, #1a1a3a);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.power-option-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a3a7a, #2a2a5a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.power-option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
}

.power-option-btn .power-icon {
    font-size: 24px;
}

.power-option-btn .power-name {
    flex: 1;
    text-align: left;
    margin-left: 10px;
}

.power-option-btn .power-count {
    color: var(--gold);
    font-weight: bold;
}

.power-option-btn.buy-btn {
    border-color: var(--gold);
}

.power-option-btn.buy-btn .power-cost {
    color: var(--gold);
    font-weight: bold;
}

.nomoves-footer {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.danger-btn {
    background: linear-gradient(135deg, #dc3545, #a71d2a);
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.danger-btn:hover {
    background: linear-gradient(135deg, #e74c5c, #c82333);
    transform: translateY(-2px);
}

/* Modal No Moves - Nuevos estilos */
.nomoves-modal-content,
.rescue-modal-content {
    text-align: center;
    max-width: 320px;
}

.nomoves-header,
.rescue-header {
    margin-bottom: 15px;
}

.nomoves-header h2,
.rescue-header h2 {
    margin: 10px 0 0;
    font-size: 20px;
}

.rescue-icon {
    font-size: 48px;
    display: block;
}

.nomoves-description,
.rescue-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 14px;
}

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

.nomoves-tip {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--gold-light);
    line-height: 1.4;
}

.rescue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #00c853, #00a040);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.rescue-btn:hover {
    background: linear-gradient(135deg, #00e676, #00c853);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.4);
}

.rescue-btn .btn-icon {
    font-size: 20px;
}

.debt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.debt-btn:hover {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.debt-btn .btn-icon {
    font-size: 20px;
}

/* ==========================================
   CELDAS CONGELADAS - SISTEMA DE HIELO
   ========================================== */

/* Celda congelada base */
.cell.frozen {
    position: relative;
    background: linear-gradient(145deg, 
        rgba(173, 216, 255, 0.4), 
        rgba(100, 180, 255, 0.3),
        rgba(200, 230, 255, 0.4));
    border: 2px solid rgba(150, 200, 255, 0.6);
    box-shadow: 
        inset 0 0 15px rgba(173, 216, 255, 0.5),
        0 0 10px rgba(100, 180, 255, 0.4);
    overflow: visible;
}

/* Pingüino congelado */
.cell.frozen-penguin {
    border-color: rgba(100, 180, 255, 0.8);
}

/* Pollito congelado */
.cell.frozen-chick {
    border-color: rgba(255, 220, 100, 0.6);
    background: linear-gradient(145deg, 
        rgba(173, 216, 255, 0.35), 
        rgba(255, 240, 180, 0.2),
        rgba(200, 230, 255, 0.35));
}

/* Animal dentro del hielo */
.frozen-animal {
    filter: brightness(0.85) saturate(0.8);
    opacity: 0.9;
}

/* Capa de hielo sobre el animal */
.ice-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    pointer-events: none;
    z-index: 5;
    background: rgba(173, 216, 255, 0.2);
    border-radius: 6px;
}

/* Resistencia del hielo - visual por capas 
   1 hit = grietas severas, rojo/naranja pulsante (a punto de romperse!)
   2 hits = grietas moderadas, tono más claro
   3 hits = pequeñas grietas, hielo sólido  
   4 hits = hielo grueso perfecto, muy azul
*/

/* 1 hit restante - CRÍTICO: Hielo muy agrietado, a punto de romperse */
.ice-layer.ice-1 {
    background: 
        /* Grietas grandes en múltiples direcciones */
        linear-gradient(30deg, transparent 0%, transparent 28%, rgba(255, 200, 150, 0.7) 29%, rgba(255, 200, 150, 0.7) 31%, transparent 32%, transparent 100%),
        linear-gradient(-45deg, transparent 0%, transparent 38%, rgba(255, 180, 130, 0.6) 39%, rgba(255, 180, 130, 0.6) 41%, transparent 42%, transparent 100%),
        linear-gradient(60deg, transparent 0%, transparent 18%, rgba(255, 220, 180, 0.5) 19%, rgba(255, 220, 180, 0.5) 21%, transparent 22%, transparent 48%, rgba(255, 200, 150, 0.6) 49%, rgba(255, 200, 150, 0.6) 51%, transparent 52%, transparent 100%),
        linear-gradient(-70deg, transparent 0%, transparent 55%, rgba(255, 180, 130, 0.5) 56%, rgba(255, 180, 130, 0.5) 58%, transparent 59%, transparent 100%),
        linear-gradient(145deg, transparent 0%, transparent 65%, rgba(255, 200, 150, 0.6) 66%, rgba(255, 200, 150, 0.6) 68%, transparent 69%, transparent 100%),
        rgba(255, 230, 220, 0.25);
    box-shadow: 
        inset 0 0 10px rgba(255, 180, 130, 0.4),
        inset 2px 2px 4px rgba(255, 220, 200, 0.3),
        0 0 8px rgba(255, 150, 100, 0.3);
    border: 1px dashed rgba(255, 150, 100, 0.6);
}

/* 2 hits restantes - Hielo dañado con grietas visibles */
.ice-layer.ice-2 {
    background: 
        /* Grietas medianas */
        linear-gradient(40deg, transparent 0%, transparent 33%, rgba(220, 240, 255, 0.8) 34%, rgba(220, 240, 255, 0.8) 36%, transparent 37%, transparent 100%),
        linear-gradient(-50deg, transparent 0%, transparent 48%, rgba(230, 245, 255, 0.7) 49%, rgba(230, 245, 255, 0.7) 51%, transparent 52%, transparent 100%),
        linear-gradient(70deg, transparent 0%, transparent 60%, rgba(220, 240, 255, 0.6) 61%, rgba(220, 240, 255, 0.6) 63%, transparent 64%, transparent 100%),
        linear-gradient(180deg, rgba(180, 220, 255, 0.5) 0%, rgba(200, 230, 255, 0.35) 50%, rgba(180, 220, 255, 0.45) 100%);
    box-shadow: 
        inset 0 0 12px rgba(200, 230, 255, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        0 0 6px rgba(173, 216, 255, 0.4);
    border: 2px solid rgba(180, 220, 255, 0.6);
}

/* 3 hits restantes - Hielo sólido con pequeñas grietas */
.ice-layer.ice-3 {
    background: 
        /* Pequeñas grietas/burbujas */
        linear-gradient(55deg, transparent 0%, transparent 42%, rgba(255, 255, 255, 0.5) 43%, rgba(255, 255, 255, 0.5) 44%, transparent 45%, transparent 100%),
        linear-gradient(-40deg, transparent 0%, transparent 58%, rgba(255, 255, 255, 0.4) 59%, rgba(255, 255, 255, 0.4) 60%, transparent 61%, transparent 100%),
        linear-gradient(180deg, rgba(120, 190, 255, 0.6) 0%, rgba(150, 210, 255, 0.45) 50%, rgba(120, 190, 255, 0.55) 100%);
    box-shadow: 
        inset 0 0 18px rgba(180, 220, 255, 0.6),
        inset 0 3px 6px rgba(255, 255, 255, 0.6),
        0 0 10px rgba(100, 180, 255, 0.5);
    border: 2px solid rgba(120, 190, 255, 0.7);
}

/* 4 hits restantes - Hielo grueso perfecto, muy sólido */
.ice-layer.ice-4 {
    background: 
        /* Efecto cristalino sin grietas */
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 35%),
        linear-gradient(180deg, rgba(70, 160, 255, 0.7) 0%, rgba(100, 180, 255, 0.5) 30%, rgba(130, 200, 255, 0.55) 70%, rgba(70, 160, 255, 0.65) 100%);
    box-shadow: 
        inset 0 0 25px rgba(180, 220, 255, 0.7),
        inset 0 4px 10px rgba(255, 255, 255, 0.7),
        inset 0 -3px 6px rgba(70, 130, 200, 0.4),
        0 0 15px rgba(80, 160, 255, 0.6),
        0 2px 8px rgba(50, 130, 220, 0.4);
    border: 3px solid rgba(80, 160, 255, 0.8);
}

/* Efecto de grieta cuando se daña el hielo */
.cell.ice-crack {
    animation: ice-crack-effect 0.3s ease-out;
}

@keyframes ice-crack-effect {
    0% { 
        transform: scale(1);
        filter: brightness(1);
    }
    30% { 
        transform: scale(1.05);
        filter: brightness(1.5) hue-rotate(-10deg);
    }
    60% {
        transform: scale(0.98);
        filter: brightness(0.9);
    }
    100% { 
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Efecto cuando se libera un animal */
.cell.animal-freed {
    animation: animal-freed-effect 0.5s ease-out;
}

@keyframes animal-freed-effect {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    30% { 
        transform: scale(1.2);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
    60% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(100, 255, 150, 0.6);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Notificación cuando se libera un animal */
.animal-freed-notification {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 25px;
    background: linear-gradient(145deg, 
        rgba(100, 255, 150, 0.95), 
        rgba(50, 200, 100, 0.95));
    border-radius: 15px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 5px 25px rgba(100, 255, 150, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3);
    z-index: 3000;
    animation: freed-notif-appear 0.4s ease-out;
}

@keyframes freed-notif-appear {
    0% { 
        transform: translateX(-50%) translateY(-30px) scale(0.5); 
        opacity: 0; 
    }
    50% {
        transform: translateX(-50%) translateY(5px) scale(1.1);
    }
    100% { 
        transform: translateX(-50%) translateY(0) scale(1); 
        opacity: 1; 
    }
}

.animal-freed-notification.fade-out {
    animation: freed-notif-fade 0.3s ease-out forwards;
}

@keyframes freed-notif-fade {
    to { 
        transform: translateX(-50%) translateY(-30px) scale(0.8); 
        opacity: 0; 
    }
}

.animal-freed-notification .freed-animal {
    font-size: 40px;
    animation: freed-bounce 0.5s ease-in-out infinite alternate;
}

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

.animal-freed-notification .freed-text {
    font-size: 18px;
    font-weight: bold;
    color: #1a5a2e;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.animal-freed-notification .freed-coins {
    font-size: 20px;
    font-weight: bold;
    color: #8b6914;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* Efecto de brillo en celdas congeladas - DESHABILITADO (molesto)
.cell.frozen::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: ice-shine 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ice-shine {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}
*/


/* ==========================================
   ANIMACIONES DE POWERUPS
   ========================================== */

/* Overlay de animación de powerup */
.powerup-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    font-weight: bold;
    z-index: 9999;
    pointer-events: none;
    animation: powerup-pop 1s ease-out forwards;
    text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
}

@keyframes powerup-pop {
    0% { 
        transform: translate(-50%, -50%) scale(0.3); 
        opacity: 0; 
    }
    20% { 
        transform: translate(-50%, -50%) scale(1.4); 
        opacity: 1; 
    }
    40% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    60% {
        transform: translate(-50%, -55%) scale(1.2);
    }
    100% { 
        transform: translate(-50%, -70%) scale(1); 
        opacity: 0; 
    }
}

/* Colores específicos por tipo de powerup */
.powerup-anim-shuffle {
    color: #FF9800;
    text-shadow: 0 0 30px #FF9800, 0 0 60px #FF9800, 0 0 90px #FF6F00;
}

.powerup-anim-extraTime {
    color: #4CAF50;
    text-shadow: 0 0 30px #4CAF50, 0 0 60px #4CAF50, 0 0 90px #2E7D32;
    font-family: 'Arial Black', sans-serif;
}

.powerup-anim-extraMoves {
    color: #2196F3;
    text-shadow: 0 0 30px #2196F3, 0 0 60px #2196F3, 0 0 90px #1565C0;
    font-family: 'Arial Black', sans-serif;
}

/* Animación de shuffle en el tablero - efecto de mezcla evidente */
.game-board.shuffling {
    animation: board-shuffle 1s ease-in-out;
}

@keyframes board-shuffle {
    0% { 
        transform: rotate(0deg) scale(1); 
        filter: blur(0px);
    }
    15% { 
        transform: rotate(-5deg) scale(0.92); 
        filter: blur(2px);
    }
    30% { 
        transform: rotate(5deg) scale(0.92); 
        filter: blur(3px);
    }
    45% { 
        transform: rotate(-4deg) scale(0.94); 
        filter: blur(2px);
    }
    60% { 
        transform: rotate(4deg) scale(0.96); 
        filter: blur(1px);
    }
    75% { 
        transform: rotate(-2deg) scale(0.98); 
        filter: blur(0px);
    }
    90% { 
        transform: rotate(1deg) scale(1); 
    }
    100% { 
        transform: rotate(0deg) scale(1); 
        filter: blur(0px);
    }
}

/* Las celdas también se sacuden durante shuffle */
.game-board.shuffling .cell {
    animation: cell-shake 0.15s ease-in-out infinite;
}

@keyframes cell-shake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, -2px); }
}
