:root {
    --ink: #0f172a;
    --bg-sky: #e0f2fe;
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --emerald: #10b981;
    --emerald-dark: #059669;
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --purple: #8b5cf6;
    --rose: #ef4444;
    --card-bg: #ffffff;
    --font-kids: 'Fredoka', 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-kids);
    background: linear-gradient(180deg, #bae6fd 0%, #f0f9ff 45%, #fef9c3 85%, #dcfce7 100%);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Barra superior fija */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 4px solid var(--ink);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 5px 0 rgba(15, 23, 42, 0.12);
}

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

.btn-back {
    background: #e0f2fe;
    color: var(--ink);
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 7px 13px;
    font-family: var(--font-kids);
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform 0.15s;
}
.btn-back:hover {
    transform: translateY(-2px);
    background: #bae6fd;
}

.app-title-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #e0f2fe, #fef9c3);
    border: 3px solid var(--ink);
    border-radius: 16px;
    padding: 6px 14px;
    box-shadow: 0 4px 0 var(--ink);
}
.app-title-pill h1 {
    font-size: clamp(0.95rem, 1.9vw, 1.25rem);
    font-weight: 900;
    color: var(--ink);
}

.badge-grade {
    background: #0284c7;
    color: #fff;
    border: 2.5px solid var(--ink);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 800;
}
.badge-grade.grade-3 {
    background: #7c3aed;
}

/* HUD Superior: Alumno, Reloj 30 min, Puntaje y Panel Docente */
.hud-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.student-pill {
    display: none;
    align-items: center;
    gap: 7px;
    background: #f1f5f9;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 6px 12px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 var(--ink);
}

.timer-pill {
    display: none;
    align-items: center;
    gap: 8px;
    background: #fef08a;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 6px 14px;
    font-weight: 900;
    font-size: 1.05rem;
    box-shadow: 0 4px 0 var(--ink);
    transition: background 0.3s;
}
.timer-pill.warning {
    background: #fed7aa;
    color: #9a3412;
    animation: pulseWarn 1.2s infinite;
}
.timer-pill.danger {
    background: #fecaca;
    color: #991b1b;
    animation: pulseWarn 0.7s infinite;
}

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

.score-pill {
    display: none;
    align-items: center;
    gap: 7px;
    background: #dcfce7;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 6px 13px;
    font-weight: 900;
    font-size: 0.98rem;
    color: #065f46;
    box-shadow: 0 4px 0 var(--ink);
}

.btn-finish-now {
    display: none;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 7px 14px;
    font-family: var(--font-kids);
    font-weight: 900;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--ink);
}
.btn-finish-now:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-teacher-panel {
    background: #ede9fe;
    color: #4c1d95;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 7px 12px;
    font-family: var(--font-kids);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 0 var(--ink);
}
.btn-teacher-panel:hover {
    background: #ddd6fe;
}

/* Contenedor Principal */
.main-wrap {
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 16px 50px;
    flex: 1;
}

/* Tarjeta de Bienvenida / Registro */
.welcome-card {
    background: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 26px;
    padding: 28px 26px;
    box-shadow: 0 10px 0 rgba(15, 23, 42, 0.14);
    max-width: 880px;
    margin: 10px auto;
}

.welcome-header {
    text-align: center;
    margin-bottom: 22px;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fef08a;
    border: 3px solid var(--ink);
    border-radius: 99px;
    padding: 5px 16px;
    font-weight: 900;
    font-size: 0.9rem;
    margin-bottom: 10px;
    box-shadow: 0 3px 0 var(--ink);
}

.welcome-header h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 6px;
}

.welcome-header p {
    font-size: 1.05rem;
    color: #475569;
    font-weight: 600;
}

/* Selector de Grado (2do vs 3ro) */
.grade-selector-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-align: center;
}

.grade-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.grade-option-card {
    border: 4px solid var(--ink);
    border-radius: 20px;
    padding: 18px;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.16s ease;
    position: relative;
    box-shadow: 0 6px 0 var(--ink);
    text-align: left;
}

.grade-option-card:hover {
    transform: translateY(-3px);
}

.grade-option-card.selected-2 {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #059669;
    box-shadow: 0 6px 0 #065f46;
}

.grade-option-card.selected-3 {
    background: linear-gradient(135deg, #e0f2fe 0%, #ddd6fe 100%);
    border-color: #4f46e5;
    box-shadow: 0 6px 0 #3730a3;
}

.grade-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.grade-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 3px solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #fff;
}

.grade-check-pill {
    font-size: 0.8rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 99px;
    border: 2.5px solid var(--ink);
    background: #fff;
}

.grade-option-card h3 {
    font-size: 1.35rem;
    font-weight: 900;
    margin-bottom: 4px;
}

.grade-option-card p {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
    line-height: 1.35;
}

/* Formulario Nombre y Apellido */
.student-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    margin-bottom: 22px;
}

@media (max-width: 720px) {
    .student-form-grid {
        grid-template-columns: 1fr;
    }
}

.form-field label {
    display: block;
    font-weight: 900;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--ink);
}

.input-kid {
    width: 100%;
    padding: 13px 16px;
    font-family: var(--font-kids);
    font-size: 1.1rem;
    font-weight: 800;
    border: 3.5px solid var(--ink);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--ink);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.input-kid:focus {
    background: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.3);
}

/* Resumen de las 5 estaciones en la portada */
.stations-preview-box {
    background: #f8fafc;
    border: 3px dashed #94a3b8;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 22px;
}

.stations-preview-title {
    font-weight: 900;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 10px;
    text-align: center;
}

.stations-mini-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
}

.station-mini-item {
    background: #ffffff;
    border: 2.5px solid var(--ink);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 3px 0 var(--ink);
}
.station-mini-item span {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 3px;
}

.btn-start-eval {
    width: 100%;
    padding: 16px 24px;
    border: 4px solid var(--ink);
    border-radius: 18px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    font-family: var(--font-kids);
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 7px 0 var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.15s, filter 0.15s;
}
.btn-start-eval:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
}
.btn-start-eval:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 var(--ink);
}

.error-banner {
    display: none;
    background: #fee2e2;
    border: 3px solid #dc2626;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 14px;
}

/* Barra de Navegación de las 5 Estaciones */
.stations-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

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

.station-tab {
    background: #ffffff;
    border: 3.5px solid var(--ink);
    border-radius: 16px;
    padding: 10px 12px;
    cursor: pointer;
    font-family: var(--font-kids);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 0 var(--ink);
    transition: all 0.15s;
    position: relative;
}

.station-tab:hover {
    transform: translateY(-2px);
}

.station-tab.active {
    background: #fef08a;
    transform: translateY(-2px);
}

.station-tab.done {
    background: #dcfce7;
}

.station-tab-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 2.5px solid var(--ink);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.station-tab-info {
    min-width: 0;
    flex: 1;
}

.station-tab-title {
    font-weight: 900;
    font-size: 0.88rem;
    color: var(--ink);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-tab-pts {
    font-weight: 800;
    font-size: 0.76rem;
    color: #0369a1;
}

/* Contenedor de Estación Activa */
.station-panel {
    display: none;
    background: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 9px 0 rgba(15, 23, 42, 0.12);
}

.station-panel.active {
    display: block;
}

.station-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 3px dashed #cbd5e1;
}

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

.station-badge-num {
    background: #0284c7;
    color: #fff;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 6px 13px;
    font-weight: 900;
    font-size: 0.95rem;
    box-shadow: 0 3px 0 var(--ink);
}

.station-header h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    font-weight: 900;
}

.station-score-badge {
    background: #fef9c3;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 6px 14px;
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 3px 0 var(--ink);
}

/* ==========================================================================
   ESTACIÓN 1: TRIVIA INTERACTIVA DE INFORMÁTICA
   ========================================================================== */
.quiz-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.quiz-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quiz-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid var(--ink);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.82rem;
}
.quiz-dot.current {
    background: #fef08a;
    transform: scale(1.1);
}
.quiz-dot.correct {
    background: #4ade80;
    color: #064e3b;
}
.quiz-dot.wrong {
    background: #fca5a5;
    color: #7f1d1d;
}

.quiz-question-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 3.5px solid var(--ink);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 5px 0 var(--ink);
}

.quiz-emoji-bubble {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    background: #ffffff;
    border: 3px solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 0 var(--ink);
}

.quiz-question-text {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 900;
    line-height: 1.35;
    flex: 1;
}

.btn-speak {
    background: #fef08a;
    border: 3px solid var(--ink);
    border-radius: 14px;
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--ink);
    flex-shrink: 0;
}
.btn-speak:hover {
    background: #fde047;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.quiz-option-btn {
    background: #ffffff;
    border: 3.5px solid var(--ink);
    border-radius: 16px;
    padding: 15px 16px;
    font-family: var(--font-kids);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 5px 0 var(--ink);
    transition: all 0.14s;
}
.quiz-option-btn:hover:not(:disabled) {
    background: #f0f9ff;
    transform: translateY(-2px);
}
.quiz-option-btn.correct {
    background: #bbf7d0 !important;
    border-color: #15803d !important;
}
.quiz-option-btn.wrong {
    background: #fecaca !important;
    border-color: #b91c1c !important;
}

.quiz-feedback-box {
    display: none;
    padding: 14px 18px;
    border-radius: 16px;
    border: 3px solid var(--ink);
    font-weight: 800;
    font-size: 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   ESTACIÓN 2: ESCRITURA Y TECLADO
   ========================================================================== */
.typing-Prompt-card {
    background: #1e293b;
    color: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 6px 0 var(--ink);
}

.typing-instruction {
    color: #38bdf8;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.typing-target-display {
    font-family: 'Outfit', monospace, sans-serif;
    font-size: clamp(1.35rem, 2.8vw, 2rem);
    font-weight: 900;
    letter-spacing: 1.5px;
    background: #0f172a;
    padding: 14px 20px;
    border-radius: 14px;
    border: 2px solid #334155;
    display: inline-block;
    margin-bottom: 12px;
    word-break: break-word;
}

.typing-char {
    padding: 0 1px;
    border-radius: 4px;
}
.typing-char.done {
    color: #4ade80;
}
.typing-char.current {
    background: #facc15;
    color: #0f172a;
}
.typing-char.error {
    background: #ef4444;
    color: #ffffff;
}

.typing-input-wrap {
    max-width: 680px;
    margin: 0 auto 14px;
}

.typing-input {
    width: 100%;
    padding: 14px 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    border: 4px solid var(--ink);
    border-radius: 16px;
    background: #ffffff;
    color: var(--ink);
    outline: none;
    box-shadow: 0 5px 0 var(--ink);
}
.typing-input:focus {
    border-color: #0284c7;
}

/* Teclado Virtual Guía en Pantalla */
.virtual-keyboard {
    background: #e2e8f0;
    border: 3.5px solid var(--ink);
    border-radius: 18px;
    padding: 12px;
    max-width: 780px;
    margin: 0 auto;
    box-shadow: 0 5px 0 var(--ink);
}

.vk-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
}
.vk-row:last-child {
    margin-bottom: 0;
}

.vk-key {
    min-width: 42px;
    height: 42px;
    padding: 0 8px;
    border-radius: 10px;
    border: 2.5px solid var(--ink);
    background: #ffffff;
    font-family: var(--font-kids);
    font-weight: 900;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--ink);
    user-select: none;
    transition: transform 0.08s, background 0.12s;
}
.vk-key:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ink);
}
.vk-key.highlight {
    background: #facc15;
    transform: scale(1.08);
    box-shadow: 0 4px 0 #854d0e;
}
.vk-key.space {
    min-width: 240px;
}
.vk-key.wide {
    min-width: 85px;
    background: #dbeafe;
    font-size: 0.82rem;
}

/* ==========================================================================
   ESTACIÓN 3: HABILIDAD CON EL MOUSE (CLASIFICAR + PRECISIÓN CLIC/DOBLE CLIC)
   ========================================================================== */
.mouse-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.drag-arena {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.drag-items-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: #f8fafc;
    border: 3px dashed #94a3b8;
    border-radius: 18px;
    padding: 16px;
    min-height: 92px;
}

.draggable-chip {
    background: #ffffff;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform 0.12s;
}
.draggable-chip:hover {
    transform: scale(1.04);
    background: #fef9c3;
}
.draggable-chip.selected-chip {
    background: #fef08a;
    border-color: #0284c7;
    transform: scale(1.06);
}

.drop-zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.drop-bucket {
    background: #f0f9ff;
    border: 3.5px solid var(--ink);
    border-radius: 20px;
    padding: 16px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 0 var(--ink);
    transition: background 0.15s;
}
.drop-bucket.drag-over {
    background: #fef9c3;
    border-style: dashed;
}

.drop-bucket-header {
    font-weight: 900;
    font-size: 1.05rem;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2.5px solid rgba(15, 23, 42, 0.15);
}

.drop-bucket-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    align-content: flex-start;
}

/* Fase B del Mouse: Canvas de Precisión Clic y Doble Clic */
.mouse-canvas-wrap {
    position: relative;
    background: #0f172a;
    border: 4px solid var(--ink);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 0 var(--ink);
}

#mouseSkillCanvas {
    display: block;
    width: 100%;
    height: 340px;
    cursor: crosshair;
}

/* ==========================================================================
   ESTACIÓN 4: LÓGICA Y PROGRAMACIÓN DEL ROBOT
   ========================================================================== */
.robot-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 820px) {
    .robot-layout {
        grid-template-columns: 1fr;
    }
}

.robot-grid-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    background: #1e293b;
    padding: 12px;
    border: 4px solid var(--ink);
    border-radius: 20px;
    box-shadow: 0 6px 0 var(--ink);
    aspect-ratio: 1 / 1;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
}

.robot-cell {
    background: #334155;
    border: 2px solid #475569;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    aspect-ratio: 1 / 1;
    transition: all 0.2s;
}
.robot-cell.wall {
    background: #7f1d1d;
    border-color: #ef4444;
}
.robot-cell.goal {
    background: #065f46;
    border-color: #10b981;
}
.robot-cell.bot-here {
    background: #0284c7;
    border-color: #38bdf8;
    transform: scale(1.04);
}

.robot-controls-box {
    background: #f8fafc;
    border: 3.5px solid var(--ink);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 5px 0 var(--ink);
}

.cmd-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.btn-cmd {
    background: #ffffff;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 10px 15px;
    font-family: var(--font-kids);
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-cmd:hover {
    background: #e0f2fe;
    transform: translateY(-2px);
}

.program-queue {
    min-height: 64px;
    background: #0f172a;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.prog-step-chip {
    background: #38bdf8;
    color: #0f172a;
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 900;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ==========================================================================
   ESTACIÓN 5: JUEGO ARCADE (TECLADO + MOUSE)
   ========================================================================== */
.arcade-wrap {
    position: relative;
    background: #090d16;
    border: 4px solid var(--ink);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 0 var(--ink);
}

#arcadeCanvas {
    display: block;
    width: 100%;
    height: 380px;
}

.arcade-touch-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
}

/* ==========================================================================
   PANTALLA DE CALIFICACIÓN FINAL Y BOLETÍN EVOLUTIVO
   ========================================================================== */
.results-screen {
    display: none;
    background: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 26px;
    padding: 28px;
    box-shadow: 0 12px 0 rgba(15, 23, 42, 0.15);
    max-width: 920px;
    margin: 10px auto;
}

.certificate-header {
    text-align: center;
    background: linear-gradient(135deg, #e0f2fe 0%, #fef9c3 50%, #dcfce7 100%);
    border: 3.5px solid var(--ink);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 6px 0 var(--ink);
}

.final-grade-circle {
    width: 126px;
    height: 126px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef08a, #f59e0b);
    border: 4px solid var(--ink);
    margin: 12px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 var(--ink);
}

.final-grade-circle .lbl {
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.final-grade-circle .num {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.breakdown-card {
    background: #f8fafc;
    border: 3px solid var(--ink);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 4px 0 var(--ink);
}

.breakdown-top {
    display: flex;
    justify-content: space-between;
    font-weight: 900;
    margin-bottom: 8px;
}

.breakdown-bar-bg {
    height: 12px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    border: 2px solid var(--ink);
}

.breakdown-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #10b981);
    width: 0%;
    transition: width 0.6s ease;
}

/* Modal / Panel Docente */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 24px;
    padding: 24px;
    max-width: 1020px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 12px 0 var(--ink);
}

.teacher-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 0.92rem;
}

.teacher-table th,
.teacher-table td {
    border: 2px solid #cbd5e1;
    padding: 9px 11px;
    text-align: left;
}

.teacher-table th {
    background: #f1f5f9;
    font-weight: 900;
}

.btn-action {
    background: #0284c7;
    color: #ffffff;
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 10px 18px;
    font-family: var(--font-kids);
    font-weight: 900;
    font-size: 0.98rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-action:hover {
    filter: brightness(1.08);
}
.btn-action.green {
    background: #10b981;
}
.btn-action.amber {
    background: #f59e0b;
    color: var(--ink);
}

@media print {
    .top-bar, .stations-nav, .no-print {
        display: none !important;
    }
    body {
        background: #ffffff;
    }
    .results-screen {
        display: block !important;
        box-shadow: none;
        border: 2px solid #000;
    }
}
