/* ===== RESET Y VARIABLES DE ESTADO CIELO ===== */
:root {
    /* Paleta Cielo/Orden */
    --sky-primary: #0a1a3a;
    --sky-secondary: #1a3a6a;
    --sky-accent: #4a8fe7;
    --sky-highlight: #64dfdf;
    --sky-light: #e6f7ff;
    --sky-gold: #ffd700;
    --sky-shadow: rgba(10, 26, 58, 0.8);
    
    /* Gradientes característicos */
    --gradient-sky: linear-gradient(135deg, var(--sky-primary) 0%, var(--sky-secondary) 50%, #2a5a9a 100%);
    --gradient-gold: linear-gradient(90deg, transparent, var(--sky-gold), transparent);
    
    /* Tipografía de alta relojería */
    --font-heading: 'Orbitron', monospace;
    --font-body: 'Crimson Pro', serif;
    
    /* Efectos de estado */
    --particle-color: rgba(100, 223, 223, 0.3);
    --glow-intensity: 0.8;
}

/* ===== ANIMACIONES DE ESTADO ===== */
@keyframes skyPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes gearSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes particleFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-100px) translateX(100px); opacity: 0; }
}

@keyframes orderCrystallize {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

@keyframes entropyWarning {
    0%, 100% { background-color: var(--sky-primary); }
    50% { background-color: #8b0000; }
}

/* ===== ESTRUCTURA PRINCIPAL ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--gradient-sky);
    color: var(--sky-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

/* Fondo de partículas (estado Cielo) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, var(--particle-color) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, var(--particle-color) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, var(--particle-color) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px;
    z-index: -1;
    animation: skyPulse 20s infinite alternate;
}

/* ===== CABECERA DE ESTADO ===== */
.state-header {
    padding: 1rem;
    background: rgba(10, 26, 58, 0.9);
    border-bottom: 2px solid var(--sky-accent);
    box-shadow: 0 4px 20px var(--sky-shadow);
    position: relative;
    width: 100%;
    max-width: 100vw;
}

.state-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
    animation: skyPulse 3s infinite;
}

.state-indicator {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.state-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    justify-content: center;
}

.state-icon i {
    color: var(--sky-gold);
    font-size: 1.2rem;
}

.state-label {
    background: rgba(74, 143, 231, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--sky-accent);
    font-size: 0.9rem;
}

.entropy-meter {
    width: 100%;
}

.meter-bar {
    height: 8px;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
    border-radius: 4px;
    margin-bottom: 5px;
    width: 0%;
    transition: width 1s ease;
    max-width: 100%;
}

.meter-label {
    font-size: 0.8rem;
    opacity: 0.8;
    display: flex;
    justify-content: space-between;
}

.title-container {
    text-align: center;
    position: relative;
    padding: 0 1rem;
}

.main-title {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.title-top {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    background: linear-gradient(to right, var(--sky-light), var(--sky-highlight));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    line-height: 1.2;
}

.title-sub {
    display: block;
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--sky-highlight);
    font-weight: 300;
    letter-spacing: 2px;
}

.title-decoration {
    display: none; /* Ocultamos en todos los dispositivos por ahora */
}

.gear {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    opacity: 0.3;
}

/* ===== SELECTOR DE MODO DE LECTURA ===== */
.reading-mode {
    display: flex;
    justify-content: center;
    margin: 1.5rem auto;
    max-width: min(600px, 90vw);
    background: rgba(26, 58, 106, 0.5);
    border-radius: 50px;
    padding: 5px;
    position: relative;
    width: 100%;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--sky-light);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.mode-btn.active {
    color: var(--sky-primary);
    font-weight: bold;
}

.mode-desc {
    font-size: 0.7rem;
    opacity: 0.7;
    font-family: var(--font-body);
    font-style: italic;
}

.mode-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    width: calc(50% - 10px);
    background: var(--sky-highlight);
    border-radius: 50px;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.content-container {
    display: block;
    max-width: min(1200px, 95vw);
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* ===== SECCIONES DE CONTENIDO ===== */
.content-section {
    background: rgba(26, 58, 106, 0.7);
    border-radius: 15px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(74, 143, 231, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--sky-accent);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--sky-highlight);
}

.section-header h2 i {
    margin-right: 8px;
}

.section-tag {
    background: rgba(100, 223, 223, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--sky-highlight);
}

/* ===== RESUMEN EJECUTIVO ===== */
.executive-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: rgba(10, 26, 58, 0.8);
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid var(--sky-highlight);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    border-left-color: var(--sky-gold);
}

.card-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.summary-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--sky-highlight);
}

.summary-card p {
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.9;
    margin-bottom: 10px;
}

.card-stat {
    background: rgba(74, 143, 231, 0.2);
    padding: 5px 10px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid var(--sky-accent);
}

/* ===== FILTRO DE CURIOSIDAD ===== */
.curiosity-blast {
    background: rgba(255, 215, 0, 0.05);
    border-radius: 10px;
    padding: 1.2rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    width: 100%;
}

.curiosity-blast h3 {
    color: var(--sky-gold);
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.curiosity-item {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.curiosity-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.curiosity-number {
    flex: 0 0 28px;
    height: 28px;
    background: var(--sky-gold);
    color: var(--sky-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 0.9rem;
}

/* ===== CONTENIDO PROFUNDO ===== */
.deep-hidden {
    display: none;
}

.deep-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.theorem-box, .analogy-box, .philosophy-box {
    background: rgba(10, 26, 58, 0.8);
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid var(--sky-accent);
}

.theorem-box h3, .analogy-box h3, .philosophy-box h3 {
    color: var(--sky-highlight);
    margin-bottom: 8px;
    font-family: var(--font-heading);
    font-size: 1rem;
}

.formula {
    font-family: monospace;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 5px;
    margin: 8px 0;
    text-align: center;
    border-left: 3px solid var(--sky-gold);
}

/* ===== EXPLICACIÓN DUAL ===== */
.dual-explanation {
    background: rgba(26, 58, 106, 0.7);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    width: 100%;
}

.explanation-tabs {
    display: flex;
    background: rgba(10, 26, 58, 0.9);
    flex-wrap: wrap;
}

.exp-tab {
    flex: 1;
    min-width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--sky-light);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.exp-tab.active {
    color: var(--sky-highlight);
    border-bottom-color: var(--sky-highlight);
    background: rgba(100, 223, 223, 0.1);
}

.explanation-content {
    padding: 1.2rem;
    width: 100%;
}

.exp-content {
    display: none;
}

.exp-content.active {
    display: block;
}

.child-illustration {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

#child-exp p {
    font-size: 1rem;
    line-height: 1.6;
}

#scholar-exp p {
    font-size: 0.95rem;
    line-height: 1.7;
    font-style: italic;
    opacity: 0.9;
}

/* ===== LABORATORIO INTERACTIVO ===== */
.lab-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(10, 26, 58, 0.7);
    border-radius: 10px;
    border: 1px solid var(--sky-accent);
    width: 100%;
}

.lab-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--sky-highlight);
    margin-bottom: 5px;
}

.lab-subtitle {
    opacity: 0.8;
    font-style: italic;
    font-size: 0.95rem;
}

/* ===== SELECTOR DE DESAFÍOS ===== */
.challenge-selector {
    margin-bottom: 1.5rem;
    width: 100%;
}

.challenge-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.challenge-btn {
    background: rgba(26, 58, 106, 0.7);
    border: 1px solid var(--sky-accent);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--sky-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.challenge-btn.active {
    background: rgba(74, 143, 231, 0.3);
    border-color: var(--sky-highlight);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(100, 223, 223, 0.3);
}

.challenge-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.challenge-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-align: center;
}

/* ===== ÁREA DE DATOS ===== */
.data-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.data-panel {
    width: 100%;
    background: rgba(10, 26, 58, 0.8);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--sky-accent);
}

.data-panel h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--sky-highlight);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.data-size {
    background: rgba(74, 143, 231, 0.3);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.data-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1rem;
    width: 100%;
}

textarea {
    width: 100%;
    height: 120px;
    background: rgba(26, 58, 106, 0.5);
    border: 1px solid var(--sky-accent);
    border-radius: 5px;
    color: var(--sky-light);
    padding: 10px;
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

#outputData {
    background: rgba(26, 58, 106, 0.3);
    color: var(--sky-highlight);
}

.data-visual {
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.data-controls, .result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.data-btn, .result-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
    padding: 8px 12px;
    background: rgba(74, 143, 231, 0.3);
    border: 1px solid var(--sky-accent);
    border-radius: 5px;
    color: var(--sky-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.data-btn:hover, .result-btn:hover {
    background: rgba(74, 143, 231, 0.5);
    transform: translateY(-2px);
}

/* ===== COMPRESOR CENTRAL ===== */
.compressor-core {
    width: 100%;
    background: rgba(10, 26, 58, 0.9);
    border-radius: 10px;
    padding: 1.2rem;
    border: 1px solid var(--sky-highlight);
    box-shadow: 0 0 20px rgba(100, 223, 223, 0.2);
    margin: 0 auto;
}

.compressor-title {
    text-align: center;
    margin-bottom: 1.2rem;
    font-family: var(--font-heading);
    color: var(--sky-highlight);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.algorithm-belt {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 1.2rem;
}

.algorithm-card {
    background: rgba(26, 58, 106, 0.5);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.algorithm-card:hover {
    background: rgba(74, 143, 231, 0.3);
    transform: scale(1.05);
}

.algorithm-card.selected {
    background: rgba(100, 223, 223, 0.3);
    border-color: var(--sky-highlight);
    box-shadow: 0 0 10px rgba(100, 223, 223, 0.5);
}

.algo-icon {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.algo-name {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: bold;
}

.algo-desc {
    font-size: 0.7rem;
    opacity: 0.8;
}

.compression-controls {
    margin-bottom: 1.2rem;
}

.compress-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(90deg, var(--sky-accent), var(--sky-highlight));
    border: none;
    border-radius: 8px;
    color: var(--sky-primary);
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.compress-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 143, 231, 0.5);
}

.param-slider {
    background: rgba(26, 58, 106, 0.5);
    padding: 8px;
    border-radius: 8px;
}

.param-slider label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--sky-secondary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--sky-highlight);
    border-radius: 50%;
    cursor: pointer;
}

.compression-animation {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
    position: relative;
    min-height: 80px;
}

.animation-track {
    height: 4px;
    background: rgba(74, 143, 231, 0.3);
    border-radius: 2px;
    margin: 25px 0;
    position: relative;
}

.data-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--sky-highlight);
    border-radius: 50%;
    top: -3px;
}

.animation-label {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== MÉTRICAS DE COMPRESIÓN ===== */
.compression-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}

.metric {
    background: rgba(26, 58, 106, 0.5);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--sky-highlight);
}

/* ===== VISUALIZACIÓN DE ALGORITMO ===== */
.visualization-panel {
    background: rgba(10, 26, 58, 0.8);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--sky-accent);
    width: 100%;
}

.viz-container {
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#huffmanCanvas {
    background: rgba(10, 26, 58, 0.5);
    border-radius: 5px;
    border: 1px solid var(--sky-accent);
    width: 100%;
    height: auto;
}

.viz-info {
    margin-top: 12px;
    text-align: center;
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9rem;
    padding: 0 5px;
    width: 100%;
}

/* ===== SISTEMA DE LOGROS ===== */
.achievements-panel {
    background: rgba(26, 58, 106, 0.7);
    border-radius: 10px;
    padding: 1.2rem;
    border: 1px solid var(--sky-accent);
    width: 100%;
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 1rem;
}

.achievement {
    background: rgba(10, 26, 58, 0.5);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.achievement.unlocked {
    border-color: var(--sky-gold);
    background: rgba(255, 215, 0, 0.1);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.ach-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.ach-name {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.ach-desc {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* ===== PIE DE PÁGINA ===== */
.state-footer {
    margin-top: 2rem;
    padding: 1.5rem 1rem;
    background: rgba(10, 26, 58, 0.9);
    border-top: 2px solid var(--sky-accent);
    width: 100%;
}

.footer-content {
    max-width: min(1200px, 95vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.footer-brand {
    text-align: center;
}

.brand-logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--sky-highlight);
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.brand-tagline {
    font-style: italic;
    opacity: 0.8;
    font-size: 1rem;
}

.footer-state {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: rgba(26, 58, 106, 0.5);
    border-radius: 10px;
    text-align: center;
}

.state-note {
    font-size: 0.95rem;
}

.next-state {
    color: var(--sky-gold);
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1.1rem;
}

.footer-tech {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(74, 143, 231, 0.3);
    gap: 1rem;
    text-align: center;
}

.tech-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== EFECTOS ESPECIALES ESTADO CIELO ===== */
.crystallize {
    animation: orderCrystallize 1s ease forwards;
}

.entropy-warning {
    animation: entropyWarning 1s infinite;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--sky-highlight);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 2s ease-out forwards;
}

/* ===== VERSION ESCRITORIO ===== */
@media (min-width: 768px) {
    .state-indicator {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .state-icon {
        justify-content: flex-start;
    }
    
    .entropy-meter {
        width: auto;
        min-width: 300px;
    }
    
    .executive-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .exp-tab {
        min-width: auto;
    }
    
    .challenge-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .algorithm-belt {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .data-btn, .result-btn {
        flex: 1 1 calc(33.333% - 8px);
    }
    
    .compression-metrics {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-state, .footer-tech {
        flex-direction: row;
        text-align: left;
    }
    
    .state-note {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .content-container {
        max-width: min(1100px, 95vw);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 26, 58, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--sky-accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sky-highlight);
}

/* ===== MENSAJES FLOTANTES ===== */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    color: white;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    z-index: 10000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateX(150%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: min(400px, 90vw);
    word-wrap: break-word;
    font-size: 14px;
}

.message.success {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.message.warning {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.message.info {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.message.achievement {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.message.blackhole {
    background: linear-gradient(90deg, #000000, #8b0000);
}

.message.error {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}