@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;500&display=swap');

:root {
    --space-dark: #050714;
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --glass-bg: rgba(255, 255, 255, 0.1);
    
    --color-speed: #ff7675; 
    --color-visual: #55efc4;
    --color-story: #a29bfe;
    --color-logic: #ffeaa7;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--space-dark);
    color: white;
    overflow: hidden;
    height: 100vh;
}

.stars, .twinkling {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    display: block;
}
.stars {
    background: #000 url('http://www.script-tutorials.com/demos/360/images/stars.png') repeat top center;
    z-index: -2;
}
.twinkling {
    background: transparent url('http://www.script-tutorials.com/demos/360/images/twinkling.png') repeat top center;
    z-index: -1;
    animation: move-twink-back 200s linear infinite;
}
@keyframes move-twink-back {
    from {background-position:0 0;}
    to {background-position:-10000px 5000px;}
}

.screen { 
    display: none; 
    height: 100%; 
    flex-direction: column; 
    padding: 20px; 
    box-sizing: border-box;
    overflow-y: auto;
}
.screen.active { display: flex; }
.hidden { display: none !important; }

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    margin-bottom: 40px;
}

.btn-primary {
    background: linear-gradient(45deg, #0b3d91, #1a1a2e);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 0 15px var(--neon-blue);
    transition: transform 0.2s;
    margin-top: 10px;
}
.btn-primary:active { transform: scale(0.95); }

.btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
}

.fcc-btn {
    background-color: rgba(9, 10, 28, 0.8);
    color: var(--neon-blue);
    padding: 12px 20px;
    border: 1px solid var(--neon-blue);
    border-radius: 15px;
    text-decoration: none;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin-top: 20px;
    transition: all 0.3s;
    display: inline-block;
}
.fcc-btn:hover {
    background-color: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 15px var(--neon-blue);
    color: white;
}

.input-group input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: var(--glass-bg);
    border: 1px solid var(--neon-purple);
    color: white;
    border-radius: 8px;
    box-sizing: border-box; 
}

.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    padding: 10px;
    border-radius: 15px;
    border-bottom: 2px solid var(--neon-purple);
}
.avatar-img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid white; background: #fff;}

.planets-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    align-items: center;
    padding-bottom: 50px;
}

.planet-item {
    width: 100%;
    max-width: 300px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--neon-blue);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: transform 0.2s;
}
.planet-item:active { transform: scale(0.95); }
.planet-item.locked { border-color: gray; color: gray; opacity: 0.7; pointer-events: none; }

.planet-icon {
    width: 60px; height: 60px;
    background: radial-gradient(circle, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    margin: 0 auto 10px;
    box-shadow: 0 0 20px #4facfe;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}

.hud-game {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timer-container {
    width: 100%;
    margin-bottom: 20px;
}
.timer-text { text-align: right; font-size: 0.9rem; margin-bottom: 5px; color: #ff7675; }
.timer-track {
    width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden;
}
.timer-fill {
    height: 100%; background: linear-gradient(90deg, #ff7675, #d63031); width: 100%; transition: width 1s linear;
}

.modal {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.9);
    display: flex; justify-content: center; align-items: center;
    z-index: 100;
}
.modal-content {
    background: #1a1a2e;
    padding: 30px;
    border: 2px solid var(--neon-blue);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 30px var(--neon-blue);
    animation: zoomIn 0.3s ease;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding: 20px;
    justify-items: center;
}

.avatar-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.avatar-option img {
    width: 100%;
    max-width: 80px;
    height: auto;
}

.avatar-option:hover {
    background: rgba(0, 243, 255, 0.2);
    transform: scale(1.05);
    border-color: var(--neon-blue);
}

.pregunta-card {
    background: rgba(16, 24, 48, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 2px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 243, 255, 0.05);
    padding: 20px;
    margin: 10px auto;
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: zoomIn 0.4s ease-out;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.card-velocidad { border-color: var(--color-speed); box-shadow: 0 0 20px rgba(255, 118, 117, 0.3); }
.card-visual_agrupacion { border-color: var(--color-visual); box-shadow: 0 0 20px rgba(85, 239, 196, 0.3); }
.card-problema_contexto { border-color: var(--color-story); box-shadow: 0 0 20px rgba(162, 155, 254, 0.3); }
.card-concepto_multiplicacion { border-color: var(--color-logic); }

.card-header {
    display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 15px;
}

.card-icon {
    width: 60px; height: 60px; font-size: 2rem;
    background: radial-gradient(circle, #2a2a55, #000);
    border: 2px solid currentColor; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px currentColor;
}
.card-velocidad .card-icon { color: var(--color-speed); }
.card-visual_agrupacion .card-icon { color: var(--color-visual); }
.card-problema_contexto .card-icon { color: var(--color-story); }

.card-type {
    font-family: 'Orbitron', sans-serif; color: var(--neon-blue);
    font-size: 0.9rem; text-transform: uppercase; letter-spacing: 2px; font-weight: bold;
}
.card-planet { font-size: 0.8rem; color: #888; }

.card-narrativa {
    font-style: italic; color: #a4b0be; font-size: 1rem; margin-bottom: 20px;
    line-height: 1.4; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 10px;
}

.card-visual-big {
    font-family: 'Orbitron', sans-serif; font-size: 2.5rem; font-weight: 700;
    color: #fff; text-shadow: 0 0 20px var(--neon-blue); margin: 20px 0;
}

.visual-groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; }
.group-item { background: rgba(0,0,0,0.3); border: 1px dashed var(--neon-blue); border-radius: 12px; padding: 8px; font-size: 1.5rem; }

.card-question { font-size: 1.2rem; color: white; font-weight: 600; margin-bottom: 20px; }
.card-options { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }


.teacher-layout {
    display: flex;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4); 
    color: white;
    backdrop-filter: blur(5px);
}

.sidebar {
    width: 260px;
    background: rgba(20, 20, 40, 0.7);
    border-right: 1px solid rgba(188, 19, 254, 0.5);
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.sidebar-header h3 { 
    color: var(--neon-blue); margin: 0; 
    font-family: 'Orbitron', sans-serif; text-shadow: 0 0 10px var(--neon-blue);
}

.sidebar-nav { margin-top: 40px; display: flex; flex-direction: column; gap: 15px; flex: 1; }

.nav-btn {
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc; 
    text-align: left; padding: 15px;
    cursor: pointer; border-radius: 12px; 
    transition: all 0.3s;
    font-family: 'Roboto', sans-serif; font-weight: 500;
}

.nav-btn:hover { 
    background: rgba(0, 243, 255, 0.1); 
    border-color: var(--neon-blue); color: white; 
    transform: translateX(5px);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(188, 19, 254, 0.3), transparent);
    border-left: 4px solid var(--neon-purple);
    border-color: var(--neon-purple);
    color: white;
    text-shadow: 0 0 5px var(--neon-purple);
}

.content-area {
    flex: 1; padding: 40px; overflow-y: auto;
    background: transparent;
}

.workshop-header {
    background: rgba(16, 24, 48, 0.8);
    border: 1px solid var(--neon-blue);
    padding: 25px;
    border-radius: 20px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
    margin-bottom: 30px;
}

.badge-phase {
    background: var(--neon-purple); color: white; 
    padding: 5px 12px; border-radius: 20px; 
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 0 10px var(--neon-purple);
}

.main-purpose {
    font-style: italic; color: #d0dcff; font-size: 1.1rem;
    background: rgba(255,255,255,0.05); padding: 20px; border-radius: 12px;
    border-left: 5px solid var(--neon-blue);
    margin-bottom: 30px;
}

.tabs-header { 
    display: flex; gap: 10px; margin-bottom: 25px; 
    border-bottom: 2px solid rgba(255,255,255,0.1);
}
.tab-btn {
    background: transparent; border: none; color: #888;
    padding: 12px 25px; cursor: pointer; font-size: 1rem;
    font-family: 'Orbitron', sans-serif; transition: all 0.3s;
    border-radius: 10px 10px 0 0;
}
.tab-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.tab-btn.active { 
    color: var(--neon-blue); 
    background: rgba(0, 243, 255, 0.1);
    border-bottom: 3px solid var(--neon-blue); 
}

.info-card {
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 25px; border-radius: 15px; 
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.info-card h3 { 
    color: var(--neon-blue); margin-top: 0; 
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
}
.info-card ul li { margin-bottom: 8px; color: #ccc; }

.timeline { border-left: 2px solid var(--neon-purple); margin-left: 20px; padding-left: 30px; }
.timeline-item { position: relative; margin-bottom: 30px; }
.time-badge {
    position: absolute; left: -95px; top: 0;
    background: linear-gradient(45deg, #444, #222); 
    border: 1px solid #666;
    padding: 6px 12px; border-radius: 8px; font-size: 0.8rem;
    width: 60px; text-align: center; color: var(--neon-blue); font-weight: bold;
}
.timeline-item::before {
    content: ''; position: absolute; left: -38px; top: 5px;
    width: 14px; height: 14px; background: var(--neon-purple); border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-purple);
}

.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.resource-item { 
    background: rgba(20, 20, 35, 0.8); padding: 15px; 
    border-radius: 8px; border: 1px solid #444; 
}


.view-title {
    border-bottom: 1px solid var(--neon-purple);
    padding-bottom: 15px;
    margin-bottom: 25px;
    color: white;
}

.nav-section-title {
    font-size: 0.7rem; color: #666; text-transform: uppercase;
    margin: 20px 0 10px 5px; letter-spacing: 1px;
}

.workshop-selector {
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.chip-btn {
    background: rgba(255,255,255,0.1); border: 1px solid #444; color: #ccc;
    padding: 8px 15px; border-radius: 20px; cursor: pointer; transition: all 0.3s;
}
.chip-btn.active {
    background: var(--neon-blue); color: black; border-color: var(--neon-blue); font-weight: bold;
}

.mission-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px;
}
.mission-card {
    background: rgba(20, 20, 35, 0.6); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px; padding: 20px; text-align: center;
    cursor: pointer; transition: all 0.3s;
}
.mission-card:hover {
    transform: translateY(-5px); border-color: var(--neon-blue);
    background: rgba(0, 243, 255, 0.1);
}
.mission-icon { font-size: 2.5rem; margin-bottom: 10px; }

.table-container { overflow-x: auto; }
.neon-table {
    width: 100%; border-collapse: collapse; margin-top: 10px;
}
.neon-table th {
    text-align: left; padding: 15px; background: rgba(188, 19, 254, 0.2);
    color: var(--neon-blue); border-bottom: 2px solid var(--neon-purple);
}
.neon-table td {
    padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); color: #ddd;
}
.neon-table tr:hover { background: rgba(255,255,255,0.05); }

.grade-badge {
    background: #fff; color: #000; padding: 4px 8px; border-radius: 5px; font-weight: bold;
}

.input-manual {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--neon-blue);
    color: white;
    padding: 5px;
    border-radius: 5px;
    width: 60px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
}
.input-manual:focus {
    outline: none;
    box-shadow: 0 0 5px var(--neon-blue);
}

/* =========================================
   GRAN FINAL - PANTALLA DE CELEBRACIÓN
   ========================================= */
#view-grand-finale {
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden; /* Oculta lo que se sale de la pantalla */
}

.finale-container {
    position: relative;
    animation: zoomIn 1s ease-out;
}

.finale-container h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.8rem;
    color: #ffd700; /* Oro */
    text-shadow: 0 0 15px #ffd700, 0 0 30px #f39c12;
    margin-bottom: 10px;
}

.finale-subtitle {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.finale-score-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 15px 30px;
    margin: 20px auto;
    display: inline-block;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.finale-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #ffd700;
}

.finale-thanks {
    margin-top: 30px;
    color: #bdc3c7;
    font-style: italic;
}

/* --- Animación del Cohete --- */
.finale-rocket {
    position: absolute;
    font-size: 4rem;
    bottom: -100px; /* Inicia fuera de la pantalla */
    left: 50%;
    transform: translateX(-50%);
    animation: rocketLaunch 5s ease-in-out forwards;
}

@keyframes rocketLaunch {
    0% { bottom: -100px; opacity: 1; }
    20% { bottom: 50%; }
    80% { bottom: 120%; opacity: 1; }
    100% { bottom: 150%; opacity: 0; }
}

/* --- Animación de Confeti --- */
.finale-confetti {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: url('https://i.gifer.com/origin/d7/d7759b43b6e82ema9.gif') no-repeat center center;
    background-size: cover;
    opacity: 0.6;
    z-index: -1;
}

/* --- Estrellas fugaces --- */
.finale-stars {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: transparent;
    animation: star-fall 8s linear infinite;
    z-index: -1;
}

@keyframes star-fall {
    from { transform: translateY(0); }
    to { transform: translateY(2048px); }
}
