/* ==========================================================================
   TECLITA BROS 4.0 • ESTILOS MAXIMIZADOS FULL SCREEN PARA NIÑOS
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

html, body.fullscreen-app {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050811;
    color: #FFFFFF;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    touch-action: none;
}

/* ==========================================================================
   1. BARRA SUPERIOR FLOTANTE TRANSLÚCIDA (NO ROBA ESPACIO VERTICAL)
   ========================================================================== */
.floating-top-bar {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 60;
    pointer-events: none;
}

.btn-floating-hub {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #F8FAFC;
    text-decoration: none;
    font-family: 'Fredoka', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 7px 16px;
    border-radius: 99px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-floating-hub:hover {
    background: #4F46E5;
    border-color: #818CF8;
    transform: scale(1.05);
}

.floating-game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85rem;
    color: #FDE047;
    text-shadow: 0 0 14px rgba(253, 224, 71, 0.7), 0 2px 4px rgba(0,0,0,0.8);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    padding: 6px 18px;
    border-radius: 99px;
    border: 1.5px solid rgba(253, 224, 71, 0.4);
    letter-spacing: 1px;
}

@media (max-width: 700px) {
    .floating-game-title {
        display: none;
    }
}

.floating-actions {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.btn-floating-tool {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #F8FAFC;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: all 0.2s;
}

.btn-floating-tool:hover {
    background: #38BDF8;
    color: #0F172A;
    transform: scale(1.1);
}

/* ==========================================================================
   2. CONTENEDOR 100% PANTALLA COMPLETA & CANVAS
   ========================================================================== */
.game-fullscreen-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #050811;
    overflow: hidden;
}

#gameCanvas {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #0284C7;
    image-rendering: pixelated;
    display: block;
}

/* ==========================================================================
   3. OVERLAYS Y DIÁLOGOS GIGANTES PARA NIÑOS
   ========================================================================== */
.overlay-screen {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 17, 0.93);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
    text-align: center;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.overlay-screen.active {
    display: flex;
}

.start-center-card {
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
}

.banner-badge-glow {
    background: linear-gradient(90deg, #F59E0B, #EF4444);
    color: #FFFFFF;
    font-family: 'Fredoka', sans-serif;
    font-weight: 900;
    font-size: 0.95rem;
    padding: 6px 20px;
    border-radius: 99px;
    margin-bottom: 8px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    letter-spacing: 0.5px;
}

.giant-game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 2.5rem;
    color: #F8FAFC;
    text-shadow: 0 6px 0 #312E81, 0 0 30px rgba(56, 189, 248, 0.9);
    margin-bottom: 2px;
    letter-spacing: 2px;
}

.version-tag {
    color: #FDE047;
    font-size: 0.85em;
    text-shadow: 0 0 15px rgba(253, 224, 71, 0.9);
}

@media (max-width: 600px) {
    .giant-game-title {
        font-size: 1.7rem;
    }
}

.giant-game-subtitle {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #38BDF8;
    margin-bottom: 8px;
}

.start-banner-wrapper {
    margin-bottom: 10px;
}

.giant-banner-preview {
    width: 280px;
    max-width: 80vw;
    max-height: 120px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid #6366F1;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Selector de Mundos */
.world-select-box {
    width: 100%;
    max-width: 640px;
    margin: 8px 0 12px 0;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid #4F46E5;
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.world-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.world-select-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.62rem;
    color: #FDE047;
    letter-spacing: 0.5px;
}

.btn-reset-prog {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-prog:hover {
    background: #EF4444;
    color: #FFFFFF;
}

.world-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 580px) {
    .world-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.world-btn {
    background: #1E293B;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 8px 6px;
    color: #94A3B8;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all 0.15s ease;
    font-family: 'Fredoka', sans-serif;
}

.world-btn:not(.locked):hover {
    background: #4F46E5;
    border-color: #818CF8;
    color: #FFFFFF;
    transform: translateY(-2px);
}

.world-btn.active-select {
    background: #059669;
    border-color: #34D399;
    color: #FFFFFF;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
}

.world-btn.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.world-btn-num {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    font-weight: bold;
    color: #38BDF8;
}

.world-btn.active-select .world-btn-num {
    color: #FDE047;
}

.world-btn-name {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.world-btn-boss {
    font-size: 0.65rem;
    color: #FBBF24;
}

.kids-instructions-pill {
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid #38BDF8;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 0.9rem;
    color: #E2E8F0;
    margin-bottom: 14px;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.btn-giant-play {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    font-family: 'Fredoka', 'Press Start 2P', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    padding: 15px 32px;
    border: 4px solid #34D399;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 8px 0 #064E3B, 0 15px 35px rgba(16, 185, 129, 0.5);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-giant-play:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 11px 0 #064E3B, 0 20px 40px rgba(16, 185, 129, 0.7);
}

.btn-giant-play:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #064E3B;
}

/* Pantallas Victoria y Game Over */
.giant-dialog-card {
    background: #1E293B;
    border: 4px solid #4F46E5;
    border-radius: 28px;
    padding: 30px 40px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8);
}

.giant-dialog-card.gameover {
    border-color: #38BDF8;
}

.giant-card-icon {
    font-size: 4rem;
    margin-bottom: 8px;
}

.giant-card-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    color: #FDE047;
    margin-bottom: 12px;
}

.giant-card-msg {
    font-size: 1.05rem;
    color: #CBD5E1;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 20px;
    line-height: 1.4;
}

.victory-stats-box {
    display: flex;
    justify-content: space-around;
    background: #0F172A;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 20px;
    border: 2px solid #334155;
}

.vstat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vstat-lbl {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    color: #94A3B8;
    display: block;
    margin-bottom: 4px;
}

.vstat-num {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    color: #38BDF8;
}

.dialog-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-dialog-back {
    background: transparent;
    color: #94A3B8;
    border: 2px solid #475569;
    padding: 10px;
    border-radius: 14px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-dialog-back:hover {
    color: #FFFFFF;
    border-color: #CBD5E1;
}

/* ==========================================================================
   4. CONTROLES TÁCTILES EXTRA GRANDES CON BOTÓN DE DISPARO
   ========================================================================== */
.touch-controls-layer {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 55;
}

.dpad-group, .action-buttons-group {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.touch-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 3px solid rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    touch-action: manipulation;
    transition: transform 0.08s, background-color 0.08s;
}

.touch-arrow {
    width: 60px;
    height: 60px;
    font-size: 2rem;
}

.touch-action {
    width: 66px;
    height: 66px;
}

.touch-action span {
    font-size: 1.35rem;
}

.touch-action label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    margin-top: 2px;
}

.btn-shoot {
    background: rgba(239, 68, 68, 0.9);
    border-color: #F87171;
}

.btn-jump {
    background: rgba(16, 185, 129, 0.9);
    border-color: #34D399;
}

.btn-step {
    background: rgba(14, 165, 233, 0.9);
    border-color: #38BDF8;
}

.btn-sprint {
    background: rgba(245, 158, 11, 0.9);
    border-color: #FBBF24;
}

.touch-btn:active, .touch-btn.pressed {
    transform: scale(0.9);
    background: rgba(99, 102, 241, 0.95);
}

@media (min-width: 1100px) {
    .touch-controls-layer {
        display: none;
    }
}

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