:root {
    --bg-color: #1a1a1a;
    --red-neon: #ff003c;
    --green-neon: #00ff41;
    --blue-neon: #00e5ff;
    --text-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #000;
    color: var(--text-color);
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Prevent browser scrolling on touch */
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    position: relative;
}

/* --- EFECTO CRT --- */
.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    opacity: 0.15;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle, #fff 10%, #000 80%);
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.12; }
    50% { opacity: 0.15; }
    100% { opacity: 0.12; }
}

/* Pantallas y Layout */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.hidden {
    display: none !important;
}

/* --- PANTALLA DE TÍTULO ARCADE --- */
#title-frame {
    position: relative;
    padding: 6px;
    background: linear-gradient(135deg, #c8952c, #f5d76e, #c8952c, #a67c00);
    clip-path: polygon(12% 0%, 88% 0%, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0% 88%, 0% 12%);
    margin-bottom: 2rem;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(200, 149, 44, 0.6)); }
    50% { filter: drop-shadow(0 0 20px rgba(245, 215, 110, 0.9)); }
}

#title-frame-inner {
    background: linear-gradient(180deg, #0a0a2e 0%, #0d0d3a 100%);
    clip-path: polygon(12% 0%, 88% 0%, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0% 88%, 0% 12%);
    padding: 30px 50px 25px;
    border: 3px solid var(--blue-neon);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#title-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 0;
}

#title-the {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    background: linear-gradient(180deg, #00e5ff 0%, #8844ff 40%, #ff00aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.8)) drop-shadow(-1px -1px 0px rgba(255,255,255,0.3));
    letter-spacing: 8px;
    transform: skewX(-5deg);
}

#title-limit {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(3rem, 10vw, 6.5rem);
    font-weight: 900;
    background: linear-gradient(180deg, #00e5ff 0%, #6633ff 35%, #ff0088 70%, #ff00aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.9)) drop-shadow(-1px -1px 0px rgba(255,255,255,0.4));
    letter-spacing: 6px;
    transform: skewX(-5deg);
    margin-top: -5px;
}

#title-katakana {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(1.2rem, 4vw, 2.2rem);
    color: #ff3377;
    text-shadow: 0 0 15px rgba(255, 51, 119, 0.7), 0 0 30px rgba(255, 51, 119, 0.3);
    margin-top: 8px;
    letter-spacing: 6px;
}

/* Esquinas doradas decorativas (simulación de remaches) */
#title-frame::before,
#title-frame::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #f5d76e 30%, #c8952c 100%);
    box-shadow: 0 0 6px rgba(245, 215, 110, 0.8);
    z-index: 2;
}
#title-frame::before { top: 10px; left: 50%; transform: translateX(-50%); }
#title-frame::after { bottom: 10px; left: 50%; transform: translateX(-50%); }

#copyright {
    font-size: 0.55rem;
    color: #555;
    letter-spacing: 2px;
    margin-top: 15px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.retro-btn {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    padding: 15px 30px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 rgba(0,0,0,0);
}

.retro-btn:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--text-color);
}

/* HUD Juego */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

#objectives {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.objective {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.obj-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.obj-color.red { background-color: var(--red-neon); box-shadow: 0 0 10px var(--red-neon); }
.obj-color.green { background-color: var(--green-neon); box-shadow: 0 0 10px var(--green-neon); }
.obj-color.blue { background-color: var(--blue-neon); box-shadow: 0 0 10px var(--blue-neon); }

#level-info {
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#timer-display {
    font-size: 2.5rem;
    color: var(--green-neon);
    text-shadow: 0 0 15px var(--green-neon);
    transition: color 0.3s ease;
}

#timer-display.warning {
    color: #ffff00;
    text-shadow: 0 0 15px #ffff00;
}

#timer-display.danger {
    color: var(--red-neon);
    text-shadow: 0 0 20px var(--red-neon);
    animation: pulse-danger 0.5s infinite;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Canvas */
.hidden {
    display: none !important;
}

/* --- PANTALLA DE TÍTULO ARCADE --- */
#title-frame {
    position: relative;
    padding: 6px;
    background: linear-gradient(135deg, #c8952c, #f5d76e, #c8952c, #a67c00);
    clip-path: polygon(12% 0%, 88% 0%, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0% 88%, 0% 12%);
    margin-bottom: 2rem;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(200, 149, 44, 0.6)); }
    50% { filter: drop-shadow(0 0 20px rgba(245, 215, 110, 0.9)); }
}

#title-frame-inner {
    background: linear-gradient(180deg, #0a0a2e 0%, #0d0d3a 100%);
    clip-path: polygon(12% 0%, 88% 0%, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0% 88%, 0% 12%);
    padding: 30px 50px 25px;
    border: 3px solid var(--blue-neon);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#title-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 0;
}

#title-the {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    background: linear-gradient(180deg, #00e5ff 0%, #8844ff 40%, #ff00aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.8)) drop-shadow(-1px -1px 0px rgba(255,255,255,0.3));
    letter-spacing: 8px;
    transform: skewX(-5deg);
}

#title-limit {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(3rem, 10vw, 6.5rem);
    font-weight: 900;
    background: linear-gradient(180deg, #00e5ff 0%, #6633ff 35%, #ff0088 70%, #ff00aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.9)) drop-shadow(-1px -1px 0px rgba(255,255,255,0.4));
    letter-spacing: 6px;
    transform: skewX(-5deg);
    margin-top: -5px;
}

#title-katakana {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(1.2rem, 4vw, 2.2rem);
    color: #ff3377;
    text-shadow: 0 0 15px rgba(255, 51, 119, 0.7), 0 0 30px rgba(255, 51, 119, 0.3);
    margin-top: 8px;
    letter-spacing: 6px;
}

/* Esquinas doradas decorativas (simulación de remaches) */
#title-frame::before,
#title-frame::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #f5d76e 30%, #c8952c 100%);
    box-shadow: 0 0 6px rgba(245, 215, 110, 0.8);
    z-index: 2;
}
#title-frame::before { top: 10px; left: 50%; transform: translateX(-50%); }
#title-frame::after { bottom: 10px; left: 50%; transform: translateX(-50%); }

#copyright {
    font-size: 0.55rem;
    color: #555;
    letter-spacing: 2px;
    margin-top: 15px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.retro-btn {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    padding: 15px 30px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 rgba(0,0,0,0);
}

.retro-btn:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--text-color);
}

/* HUD Juego */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

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

.objective {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.obj-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.obj-color.red { background-color: var(--red-neon); box-shadow: 0 0 10px var(--red-neon); }
.obj-color.green { background-color: var(--green-neon); box-shadow: 0 0 10px var(--green-neon); }
.obj-color.blue { background-color: var(--blue-neon); box-shadow: 0 0 10px var(--blue-neon); }

#level-info {
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#timer-display {
    font-size: 2.5rem;
    color: var(--green-neon);
    text-shadow: 0 0 15px var(--green-neon);
    transition: color 0.3s ease;
}

#timer-display.warning {
    color: #ffff00;
    text-shadow: 0 0 15px #ffff00;
}

#timer-display.danger {
    color: var(--red-neon);
    text-shadow: 0 0 20px var(--red-neon);
    animation: pulse-danger 0.5s infinite;
}

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

/* Canvas */
canvas {
    display: block;
    background-color: transparent;
}

/* Mensajes de feedback (Game Over, Ganador) */
#message-screen {
    background-color: rgba(20, 5, 5, 0.95);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 0, 60, 0.05) 10px, rgba(255, 0, 60, 0.05) 20px);
    z-index: 10;
}

#message-title {
    font-size: 3rem;
    color: var(--red-neon);
    text-shadow: 0 0 20px var(--red-neon);
    margin-bottom: 2rem;
    text-align: center;
}

#message-subtitle {
    font-size: 1.2rem;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* --- WINNER SCREEN --- */
#winner-screen {
    background-color: rgba(10, 10, 30, 0.95); /* Fondo distinto: azul oscuro */
    z-index: 15;
    gap: 30px;
}

#winner-title {
    font-size: 3.5rem;
    color: #ffd700;
    text-shadow: 0 0 30px #ffd700, 0 0 10px #ffaa00;
    text-align: center;
    animation: winner-pop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, winner-pulse 2s infinite;
}

@keyframes winner-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes winner-pulse {
    0%, 100% { filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
    50% { filter: drop-shadow(0 0 35px rgba(255, 215, 0, 1)); }
}

.winner-stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 90%;
    max-width: 800px;
}

.winner-player {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.winner-player::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.p1-stats::before { background: var(--blue-neon); box-shadow: 0 0 10px var(--blue-neon); }
.p2-stats::before { background: var(--red-neon); box-shadow: 0 0 10px var(--red-neon); }

.player-name {
    font-size: 1.5rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.p1-color { color: var(--blue-neon); text-shadow: 0 0 15px var(--blue-neon); }
.p2-color { color: var(--red-neon); text-shadow: 0 0 15px var(--red-neon); }

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
}

.stat-label {
    color: #aaa;
}

.stat-value {
    color: #fff;
    font-weight: bold;
}

.vs-badge {
    font-size: 2rem;
    color: #ff00ff;
    text-shadow: 0 0 20px #ff00ff;
    font-weight: bold;
    font-style: italic;
    animation: pulse-danger 1s infinite;
}

#winner-subtitle {
    font-size: 1.2rem;
    color: var(--green-neon);
    animation: blink 1.5s infinite;
    margin-top: 20px;
}

/* Confeti (generado por JS) */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1; /* Detrás del contenido */
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 20px;
    background-color: #f00;
    opacity: 0;
}

    text-shadow: 0 0 25px var(--blue-neon);
    letter-spacing: 4px;
}

#scores-table-wrapper {
    width: 80%;
    max-width: 500px;
    max-height: 50vh;
    overflow-y: auto;
}

#scores-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
}

#scores-table thead th {
    color: var(--green-neon);
    text-shadow: 0 0 8px var(--green-neon);
    padding: 10px 5px;
    border-bottom: 2px solid var(--green-neon);
    text-align: center;
}

#scores-table tbody td {
    padding: 10px 5px;
    text-align: center;
    color: var(--text-color);
    border-bottom: 1px solid #333;
}

#scores-table tbody tr:nth-child(1) td { color: #ffd700; text-shadow: 0 0 10px #ffd700; }
#scores-table tbody tr:nth-child(2) td { color: #c0c0c0; text-shadow: 0 0 8px #c0c0c0; }
#scores-table tbody tr:nth-child(3) td { color: #cd7f32; text-shadow: 0 0 6px #cd7f32; }

/* SCORES y BACK usan el mismo estilo base que retro-btn, sin overrides */
.btn-back {
    margin-top: 20px;
}

/* Scrollbar estilo retro */
#scores-table-wrapper::-webkit-scrollbar {
    width: 6px;
}
#scores-table-wrapper::-webkit-scrollbar-track {
    background: #111;
}
#scores-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--green-neon);
    border-radius: 3px;
}

/* --- INSERT COIN --- */
#insert-coin {
    margin-top: 30px;
    font-size: 1rem;
    color: var(--green-neon);
    text-shadow: 0 0 12px var(--green-neon);
    animation: blink 1.2s infinite;
    letter-spacing: 6px;
}

/* --- SCREEN SHAKE --- */
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -4px); }
    20% { transform: translate(6px, 5px); }
    30% { transform: translate(-5px, 3px); }
    40% { transform: translate(7px, -6px); }
    50% { transform: translate(-4px, 5px); }
    60% { transform: translate(3px, -3px); }
    70% { transform: translate(-6px, 4px); }
    80% { transform: translate(5px, -2px); }
    90% { transform: translate(-3px, 6px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* --- COMBO DISPLAY --- */
#combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -120px);
    font-size: 2rem;
    color: var(--green-neon);
    text-shadow: 0 0 20px var(--green-neon);
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#combo-display.combo-bonus {
    color: #ffd700;
    text-shadow: 0 0 25px #ffd700;
    animation: combo-pop 0.5s ease-out;
}

@keyframes combo-pop {
    0% { transform: translate(-50%, -120px) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -120px) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -120px) scale(1); opacity: 1; }
}

/* --- NAME INPUT SCREEN --- */
#name-input-screen {
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 10;
    gap: 25px;
}

#name-input-title {
    font-size: 1.8rem;
    color: var(--green-neon);
    text-shadow: 0 0 20px var(--green-neon);
}

#name-letters {
    display: flex;
    gap: 20px;
}

.name-letter {
    font-size: 4rem;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    cursor: pointer;
    width: 80px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #333;
    transition: all 0.15s ease;
}

.name-letter.active {
    color: var(--green-neon);
    border-color: var(--green-neon);
    text-shadow: 0 0 20px var(--green-neon);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.name-letter:hover {
    border-color: var(--text-color);
}

#name-help {
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 1px;
}

/* ============================================= */
/* === RESPONSIVE: TABLETAS Y MÓVILES        === */
/* ============================================= */

@media (max-width: 768px) {
    .retro-btn {
        font-size: 0.9rem;
        padding: 12px 24px;
    }
    
    #title-frame-inner {
        padding: 20px 30px 18px;
    }
    
    #title-katakana {
        letter-spacing: 3px;
    }
    
    #hud {
        padding: 10px;
    }
    
    .objective {
        font-size: 1rem;
    }
    
    #level-info {
        font-size: 1rem;
    }
    
    #timer-display {
        font-size: 1.8rem;
    }
    
    #combo-display {
        font-size: 1.5rem;
    }
    #scores-table {
        font-size: 0.6rem;
    }
}

/* Landscape en móvil: reducir título para dar espacio al juego */
@media (max-height: 500px) {
    #title-frame-inner {
        padding: 10px 25px 8px;
    }
    
    #title-the {
        font-size: 1.5rem;
    }
    
    #title-limit {
        font-size: 2.5rem;
    }
    
    #title-katakana {
        font-size: 1rem;
    }
    
    .menu-options {
        flex-direction: row;
        gap: 10px;
    }
    
    #insert-coin {
        margin-top: 10px;
    }
}


/* ===================================================
   HELP SCREEN
   =================================================== */
#help-screen {
    justify-content: center;
    align-items: center;
    gap: 0;
    overflow-y: auto;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 30%, #0a0a2e 0%, #050505 80%);
}

/* Cabecera */
#help-header {
    text-align: center;
    margin-bottom: 30px;
}

.jp-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(90deg, #ff003c, #ff00ff, #00e5ff, #ff00ff, #ff003c);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s linear infinite;
    margin-bottom: 8px;
    display: block;
}

@keyframes gradient-shift {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.en-title {
    font-size: 1.4rem;
    color: var(--blue-neon);
    text-shadow: 0 0 20px var(--blue-neon), 0 0 40px rgba(0,229,255,0.4);
    letter-spacing: 4px;
}

/* Separador decorativo */
.help-divider {
    width: 80%;
    max-width: 500px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue-neon), transparent);
    margin: 0 auto 24px;
    box-shadow: 0 0 10px var(--blue-neon);
}

/* Textos de reglas */
.help-rules {
    text-align: center;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 520px;
}

.help-text {
    font-size: 0.65rem;
    line-height: 1.8;
    color: #ccc;
}

.help-text.highlight {
    font-size: 0.7rem;
    color: #ffd700;
    text-shadow: 0 0 12px #ffd700;
    padding: 8px 16px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

/* Sección nodos especiales */
.help-nodes-title {
    font-size: 0.7rem;
    color: var(--green-neon);
    text-shadow: 0 0 10px var(--green-neon);
    letter-spacing: 3px;
    margin-bottom: 16px;
    text-align: center;
}

.nodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 90%;
    max-width: 520px;
}

.node-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}

.node-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
}
.node-item.wildcard-item::before { background: #ff00ff; box-shadow: 0 0 8px #ff00ff; }
.node-item.freeze-item::before   { background: #aaeeff; box-shadow: 0 0 8px #aaeeff; }
.node-item.bomb-item::before     { background: #ff003c; box-shadow: 0 0 8px #ff003c; }

/* Icono circular (imita el canvas) */
.node-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    flex-shrink: 0;
    position: relative;
}

/* Wildcard */
@keyframes rainbow-border {
    0%   { border-color: #ff003c; box-shadow: 0 0 14px #ff003c, inset 0 0 6px rgba(255,0,60,0.2); color: #ff003c; }
    25%  { border-color: #00ff41; box-shadow: 0 0 14px #00ff41, inset 0 0 6px rgba(0,255,65,0.2); color: #00ff41; }
    50%  { border-color: #00e5ff; box-shadow: 0 0 14px #00e5ff, inset 0 0 6px rgba(0,229,255,0.2); color: #00e5ff; }
    75%  { border-color: #ff00ff; box-shadow: 0 0 14px #ff00ff, inset 0 0 6px rgba(255,0,255,0.2); color: #ff00ff; }
    100% { border-color: #ff003c; box-shadow: 0 0 14px #ff003c, inset 0 0 6px rgba(255,0,60,0.2); color: #ff003c; }
}
.node-icon.wildcard {
    border: 4px solid #fff;
    background: rgba(0,0,0,0.8);
    animation: rainbow-border 1.2s linear infinite;
}

/* Freeze */
@keyframes pulse-freeze {
    from { box-shadow: 0 0 8px #aaeeff,  inset 0 0 6px rgba(100,200,255,0.15); border-color: rgba(170,238,255,0.5); }
    to   { box-shadow: 0 0 22px #aaeeff, inset 0 0 12px rgba(100,200,255,0.3); border-color: #aaeeff; }
}
.node-icon.freeze {
    border: 4px solid #aaeeff;
    background: rgba(50, 120, 180, 0.15);
    color: #fff;
    font-family: sans-serif;
    font-size: 1.6rem;
    animation: pulse-freeze 1.8s ease-in-out infinite alternate;
}

/* Bomb */
@keyframes flash-bomb {
    from { border-color: #660011; box-shadow: 0 0 6px #ff003c;  color: #880011; }
    to   { border-color: #ff003c; box-shadow: 0 0 20px #ff003c; color: #ff003c; }
}
.node-icon.bomb {
    width: 58px;
    height: 58px;
    border: 4px solid #ff003c;
    background: #0a0a0a;
    color: #ff003c;
    animation: flash-bomb 0.5s ease-in-out infinite alternate;
}

/* Texto de descripción */
.node-desc {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-name {
    font-size: 0.75rem;
    color: #fff;
    margin-bottom: 2px;
}
.node-name.danger { color: var(--red-neon); text-shadow: 0 0 6px var(--red-neon); }
.node-name.gold   { color: #ffd700;         text-shadow: 0 0 6px #ffd700; }
.node-name.ice    { color: #aaeeff;         text-shadow: 0 0 6px #aaeeff; }

.node-effect {
    font-size: 0.6rem;
    color: #aaa;
    line-height: 1.5;
}

/* Boton BACK */
#help-screen .btn-back {
    margin-top: 28px;
    animation: blink 1.4s step-end infinite;
}

/* Flash dorado cuando se recibe tiempo extra por combo */
#timer-display.bonus-flash {
    animation: timer-bonus 0.65s ease-out forwards !important;
}

@keyframes timer-bonus {
    0%   { color: #ffd700; text-shadow: 0 0 35px #ffd700, 0 0 70px rgba(255,215,0,0.5); transform: scale(1.4); }
    50%  { color: #ffd700; text-shadow: 0 0 20px #ffd700; transform: scale(1.15); }
    100% { transform: scale(1); }
}
