/* --- DESIGN SYSTEM ADU JUEGOS --- */
:root {
    --bg-dark: #0a0e1a;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.25);
    
    /* Neon Colors */
    --color-primary: #6366f1; /* Indigo */
    --color-secondary: #ec4899; /* Pink */
    --color-cyan: #06b6d4; /* Cyan */
    --color-yellow: #eab308; /* Yellow */
    --color-green: #10b981; /* Green */
    --color-danger: #ef4444; /* Red */
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    
    /* Shadows */
    --shadow-neon-blue: 0 0 15px rgba(59, 130, 246, 0.4);
    --shadow-neon-pink: 0 0 15px rgba(236, 72, 153, 0.4);
    --shadow-neon-purple: 0 0 20px rgba(139, 92, 246, 0.5);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Global resets and body styling */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-dark);
    color: #f3f4f6;
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
}

/* Soft mesh background glowing effects */
body::before {
    content: "";
    position: fixed;
    top: -20%;
    left: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Font styles */
h1, h2, h3, h4, h5, .font-kids {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

/* Navigation bar */
.navbar-custom {
    background: rgba(10, 14, 26, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    transition: all 0.3s ease;
}

.logo-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--color-cyan);
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.6));
    animation: gamepad-float 3s ease-in-out infinite;
}

.logo-accent {
    background: linear-gradient(to right, #00f2fe, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link-custom {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: #e5e7eb !important;
    padding: 8px 16px !important;
    margin: 0 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link-custom:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.dropdown-custom-menu {
    background: rgba(10, 14, 26, 0.95) !important;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-glass);
}

.dropdown-custom-menu .dropdown-item {
    font-family: 'Fredoka', sans-serif;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-custom-menu .dropdown-item:hover {
    background: var(--bg-card-hover) !important;
    color: #fff !important;
    transform: translateX(5px);
}

/* Page containers & main content spacing */
.main-content {
    padding-bottom: 80px;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 80px 0 60px 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-title .highlight {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 2px 10px rgba(99, 102, 241, 0.3));
}

.hero-subtitle {
    font-size: 1.4rem;
    color: #9ca3af;
    max-width: 700px;
    margin: 0 auto 35px auto;
    font-weight: 300;
}

/* Glassmorphic cards styling */
.glass-card {
    background: var(--gradient-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-glass);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.15);
}

.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glass-card:hover::before {
    opacity: 1;
}

/* Educational Landing Sections */
.section-title {
    font-size: 2.2rem;
    margin-bottom: 25px;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.section-indicator {
    width: 6px;
    height: 35px;
    border-radius: 4px;
    margin-right: 12px;
    display: inline-block;
}

.indicator-purple { background: var(--color-primary); box-shadow: 0 0 10px rgba(99, 102, 241, 0.6); }
.indicator-cyan { background: var(--color-cyan); box-shadow: 0 0 10px rgba(6, 182, 212, 0.6); }
.indicator-orange { background: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, 0.6); }

.concept-box {
    border-top: 4px solid var(--color-primary);
}

.concept-box.web {
    border-top-color: var(--color-cyan);
}

.concept-box.mobile {
    border-top-color: var(--color-primary);
}

.concept-box.games {
    border-top-color: #f97316;
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #fff;
}

.icon-bg-lime {
    background: linear-gradient(135deg, #84cc16, #22c55e);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.icon-bg-purple {
    background: var(--gradient-purple);
    box-shadow: var(--shadow-neon-purple);
}

.icon-bg-cyan {
    background: var(--gradient-cyan);
    box-shadow: var(--shadow-neon-blue);
}

.icon-bg-orange {
    background: var(--gradient-orange);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.highlight-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 15px auto;
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
    box-shadow: var(--shadow-neon-purple);
    background: rgba(99, 102, 241, 0.1);
    position: relative;
    animation: pulse-glow 3s infinite;
}

.list-item-fun {
    list-style: none;
    padding-left: 0;
}

.list-item-fun li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.list-item-fun li i {
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 1.25rem;
}

/* Call to Action Section */
.cta-section {
    padding: 60px 0;
    text-align: center;
}

.cta-button {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 16px 40px;
    border-radius: 50px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: #fff !important;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-glass);
}

.cta-button:hover {
    transform: scale(1.05);
    border-style: solid;
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-neon-pink), var(--shadow-glass);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
}

/* Phaser Game Center Styling */
.game-container-outer {
    max-width: 840px;
    margin: 40px auto;
}

.game-title-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-canvas-wrapper {
    position: relative;
    border: 4px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    aspect-ratio: 4 / 3; /* Matches Phaser game size 800x600 */
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    touch-action: none; /* Prevents mobile scroll/gestures on game container */
}

.game-canvas-wrapper canvas {
    touch-action: none; /* Prevents mobile scroll/gestures on game canvas */
    display: block;
}

/* Leaderboard Board */
.leaderboard-tabs {
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 25px;
    justify-content: center;
}

.leaderboard-tabs .nav-link {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: #9ca3af !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 10px 25px !important;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.leaderboard-tabs .nav-link.active {
    background: transparent !important;
    color: #ffffff !important;
    border-bottom-color: var(--color-cyan) !important;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.leaderboard-table {
    color: #fff !important;
    vertical-align: middle;
}

.leaderboard-table th {
    border-bottom: 2px solid var(--border-color) !important;
    color: #9ca3af;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
}

.leaderboard-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 14px 10px !important;
}

.leaderboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.95rem;
}

.rank-1 {
    background: radial-gradient(circle, #ffe066, #f59f00);
    color: #000;
    box-shadow: 0 0 10px rgba(245, 159, 0, 0.6);
}

.rank-2 {
    background: radial-gradient(circle, #e2e8f0, #cbd5e1);
    color: #000;
    box-shadow: 0 0 10px rgba(203, 213, 225, 0.6);
}

.rank-3 {
    background: radial-gradient(circle, #ffca99, #d97706);
    color: #fff;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.6);
}

.rank-other {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Footer style */
.main-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(10, 14, 26, 0.95);
    padding: 30px 0;
    margin-top: 80px;
}

.footer-brand {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    color: #fff;
}

.footer-sub {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0;
}

/* Presentation layout helpers (side image & cartoon) */
.illustration-img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-glass);
    border: 1px solid var(--border-color);
}

/* Animations */
@keyframes gamepad-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(-5deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.8); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.3rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .glass-card {
        padding: 20px;
    }
}

/* ==========================================
   CSS OVERRIDES FOR HIGH CONTRAST & ACCESSIBILITY 
   ========================================== */

/* Force all standard body texts to be highly readable off-white */
body, p, span, li, td, label {
    color: #e2e8f0; /* Slate 200 - excellent contrast on dark backgrounds */
}

/* Force headings to be clean crisp white */
h1, h2, h3, h4, h5, h6, .section-title {
    color: #ffffff !important;
}

/* Override bootstrap's default dark .text-muted with a readable slate-400 */
.text-muted {
    color: #94a3b8 !important; /* bright grey - passes contrast criteria */
}

/* Custom helper class used for subtitles */
.text-light-50, .text-white-50 {
    color: rgba(243, 244, 246, 0.75) !important;
}

/* Form elements styling to avoid white/black default inputs clashing */
input, select, textarea, .form-control {
    background-color: rgba(15, 23, 42, 0.85) !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    background-color: #0f172a !important;
    border-color: var(--color-cyan) !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3) !important;
    color: #ffffff !important;
}

/* Dropdown menu items readability */
.dropdown-custom-menu .dropdown-item {
    color: #e2e8f0 !important;
}

.dropdown-custom-menu .dropdown-item:hover {
    color: #ffffff !important;
    background-color: rgba(99, 102, 241, 0.25) !important;
}

/* Fix navbar links if standard bootstrap classes try to override them */
.navbar-custom .nav-link {
    color: #e2e8f0 !important;
}

.navbar-custom .nav-link:hover {
    color: #ffffff !important;
}

/* Fix standard Bootstrap table default borders and headers */
.table th, .table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure Phaser overlay styling has high contrast and is readable */
#victory-overlay h2, #victory-overlay p, #victory-overlay div {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Responsive overlays for all games */
#victory-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 14, 26, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    z-index: 10;
    padding: 15px;
    box-sizing: border-box;
}

.victory-card {
    text-align: center;
    max-width: 450px;
    width: 100%;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
    box-shadow: var(--shadow-glass), 0 0 30px rgba(234, 179, 8, 0.15);
    animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.victory-card h2 {
    color: #eab308;
    font-size: 2.2rem !important;
    margin-bottom: 15px;
}

.victory-card h2.danger {
    color: #ef4444 !important;
}

.victory-card h2.orange {
    color: #f97316 !important;
}

.victory-card p {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.victory-card .points-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 25px;
}

.victory-card .points-display.danger {
    color: #ef4444 !important;
}

.victory-card .points-display.orange {
    color: #f97316 !important;
}

.victory-card form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.victory-card input {
    padding: 12px !important;
    border-radius: 12px !important;
    border: 2px solid #eab308 !important;
    background: rgba(0,0,0,0.3) !important;
    color: #fff !important;
    text-align: center;
    font-size: 1.1rem !important;
    width: 100%;
}

.victory-card input.danger {
    border-color: #ef4444 !important;
}

.victory-card button {
    padding: 12px !important;
    border-radius: 12px !important;
    border: none !important;
    background: #eab308 !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.victory-card button.danger {
    background: #ef4444 !important;
    color: #fff !important;
}

.victory-card button.outline {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.victory-card button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.victory-card #submit-status-msg {
    margin-top: 15px;
    font-weight: bold;
}

.victory-buttons-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

@keyframes scale-up {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 576px) {
    .game-container-outer {
        margin: 15px auto;
    }
    .game-title-header {
        margin-bottom: 15px;
    }
    .game-canvas-wrapper {
        border-width: 2px;
        border-radius: 16px;
    }
    .victory-card {
        padding: 20px;
        border-radius: 16px;
    }
    .victory-card h2 {
        font-size: 1.6rem !important;
        margin-bottom: 10px;
    }
    .victory-card p {
        font-size: 0.95rem !important;
        margin-bottom: 6px !important;
    }
    .victory-card .points-display {
        font-size: 1.4rem !important;
        margin-bottom: 15px !important;
    }
    .victory-card input, .victory-card button {
        padding: 10px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
    }
    .victory-buttons-row {
        flex-direction: column;
        gap: 8px;
    }
    .victory-buttons-row button {
        width: 100%;
    }
    .leaderboard-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    .leaderboard-tabs .nav-link {
        font-size: 0.95rem;
        padding: 8px 12px !important;
        margin: 2px 0;
        text-align: center;
        border-bottom: 2px solid transparent !important;
    }
    .leaderboard-tabs .nav-link.active {
        border-bottom-color: var(--color-cyan) !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
}

/* --- BLOCK PROGRAMMING BOARD (SCRATCH STYLE) --- */
.block-programming-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(15, 23, 42, 0.45);
    border: 3px dashed rgba(99, 102, 241, 0.25);
    border-radius: 24px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.3);
}

.code-block {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    position: relative;
    user-select: none;
    min-height: 52px;
    width: fit-content;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Puzzle nub style simulation on the bottom */
.code-block::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 40px;
    width: 24px;
    height: 8px;
    background: inherit;
    border-radius: 0 0 8px 8px;
    z-index: 2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* Event blocks (Scratch orange: #ffab19) */
.block-event {
    background: #ffab19;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    color: #3b2300 !important;
}
.block-event .block-label, .block-event i {
    color: #3b2300 !important;
}

/* Variables blocks (Scratch blue: #4c97ff) */
.block-variable {
    background: #4c97ff;
}

/* Control blocks (Scratch gold/yellow/purple: #cf63cf) */
.block-control {
    background: #cf63cf;
}

/* Looks/style blocks (Scratch purple: #9966ff) */
.block-looks {
    background: #9966ff;
}

.block-indented {
    margin-left: 45px;
    border-left: 4px dashed rgba(255,255,255,0.2);
    padding-left: 25px;
}

.block-select {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    padding: 6px 12px !important;
    font-size: 1.05rem !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.block-select:hover {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(0, 0, 0, 0.35) !important;
}

.block-select option {
    background: #0f172a !important;
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif;
    padding: 10px;
}

.btn-run-program {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    padding: 16px 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 50px !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), var(--shadow-glass);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.btn-run-program:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.7), var(--shadow-glass);
}

/* --- IDE WORKSPACE & SIDEBAR --- */
.block-programming-area-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #0c0f1d;
    background-image: radial-gradient(rgba(99, 102, 241, 0.15) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    min-height: 420px;
    box-shadow: inset 0 6px 30px rgba(0,0,0,0.6);
    position: relative;
    overflow-y: auto;
}

.toolbox-sidebar {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 16px;
    color: #cbd5e1;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.category-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3), inset 0 0 5px rgba(99, 102, 241, 0.2);
}

.category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.event-dot { background: #ffab19; box-shadow: 0 0 8px #ffab19; }
.variable-dot { background: #4c97ff; box-shadow: 0 0 8px #4c97ff; }
.control-dot { background: #cf63cf; box-shadow: 0 0 8px #cf63cf; }
.looks-dot { background: #9966ff; box-shadow: 0 0 8px #9966ff; }

/* --- DEBUG TERMINAL CONSOLE --- */
.debug-console-wrapper {
    background: #05070c;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.8);
    transition: border-color 0.3s ease;
}

.debug-console-wrapper.compiling {
    border-color: var(--color-yellow);
}

.debug-console-wrapper.error {
    border-color: var(--color-danger);
}

.console-header {
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    padding: 10px 18px;
    font-size: 0.9rem;
    color: #10b981;
    letter-spacing: 0.5px;
}

.console-body {
    padding: 14px 18px;
    height: 120px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #a7f3d0;
    scroll-behavior: smooth;
}

.console-line {
    word-break: break-all;
}

.console-line.loading {
    color: var(--color-yellow);
}

.console-line.success {
    color: var(--color-green);
    font-weight: bold;
}

.console-line.error {
    color: var(--color-danger);
    font-weight: bold;
}

.status-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 4px;
    animation: console-pulse 1.5s infinite;
}

@keyframes console-pulse {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 4px #10b981; }
    50% { transform: scale(1.3); opacity: 0.4; box-shadow: 0 0 10px #10b981; }
}

/* Block Highlight Animation on Category click */
.block-highlight {
    animation: block-focus-pulse 1.6s ease-in-out;
}

@keyframes block-focus-pulse {
    0%, 100% {
        box-shadow: 0 6px 12px rgba(0,0,0,0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px #ffffff, 0 0 40px var(--color-primary);
        transform: scale(1.03);
        border-color: #ffffff;
    }
}