:root {
    /* Tema Oscuro (Predeterminado) */
    --paper: #05030a;
    --paper-strong: #11091b;
    --ink: #f4ecff;
    --ink-soft: #b7accd;
    --line: rgba(173, 117, 255, 0.18);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --html: #f472fb;
    --css: #a78bfa;
    --js: #d8b4fe;
    --mint: #c084fc;
    --neon: #43ffd1;
    --neon-soft: rgba(67, 255, 209, 0.16);
    --neon-line: rgba(67, 255, 209, 0.42);
    --neon-glow: 0 0 0 1px rgba(67, 255, 209, 0.2), 0 0 18px rgba(67, 255, 209, 0.24);
    --hero: linear-gradient(135deg, #040107 0%, #10061a 42%, #1d0d2d 100%);
    --guide-header: var(--hero);
    --guide-button-a: #a855f7;
    --guide-button-b: #d946ef;
    --surface: rgba(10, 5, 18, 0.88);
    --surface-strong: rgba(15, 8, 25, 0.95);
    --surface-soft: rgba(18, 10, 30, 0.72);
    --control-bg: rgba(17, 10, 26, 0.9);
    --control-border: rgba(192, 132, 252, 0.18);
    --text-strong: #f4ecff;
    --text-muted: #b7accd;
    --code-bg: #0b0720;
    --code-border: rgba(173, 117, 255, 0.22);
    --code-color: #f8f3ff;
    --code-inline-bg: rgba(168, 85, 247, 0.14);
    --input-bg: rgba(8, 5, 15, 0.94);
    --input-border: rgba(173, 117, 255, 0.22);
}

/* Tema Claro */
[data-theme="light"] {
    --paper: #ffffff;
    --paper-strong: #f8f9fa;
    --ink: #1a1a1a;
    --ink-soft: #6c757d;
    --line: rgba(108, 117, 125, 0.2);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.1);
    --html: #e34c26;
    --css: #264de4;
    --js: #f7df1e;
    --mint: #61dafb;
    --neon: #007acc;
    --neon-soft: rgba(0, 122, 204, 0.1);
    --neon-line: rgba(0, 122, 204, 0.3);
    --neon-glow: 0 0 0 1px rgba(0, 122, 204, 0.2), 0 0 18px rgba(0, 122, 204, 0.15);
    --hero: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 42%, #dee2e6 100%);
    --guide-header: var(--hero);
    --guide-button-a: #007bff;
    --guide-button-b: #0056b3;
    --surface: #ffffff;
    --surface-strong: #f8f9fa;
    --surface-soft: #eef1f5;
    --control-bg: #ffffff;
    --control-border: rgba(108, 117, 125, 0.3);
    --text-strong: #1a1a1a;
    --text-muted: #6c757d;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
    --code-bg: #0b0720;
    --code-border: rgba(173, 117, 255, 0.22);
    --code-color: #f8f3ff;
    --code-inline-bg: rgba(168, 85, 247, 0.14);
    --input-bg: #ffffff;
    --input-border: rgba(108, 117, 125, 0.3);
}

/* Tema Azul Claro */
[data-theme="blue"] {
    --paper: #f0f8ff;
    --paper-strong: #e6f3ff;
    --ink: #1e3a5f;
    --ink-soft: #5a7a9d;
    --line: rgba(30, 58, 95, 0.15);
    --shadow: 0 22px 60px rgba(30, 58, 95, 0.08);
    --html: #ff6b6b;
    --css: #4ecdc4;
    --js: #45b7d1;
    --mint: #96ceb4;
    --neon: #3498db;
    --neon-soft: rgba(52, 152, 219, 0.1);
    --neon-line: rgba(52, 152, 219, 0.3);
    --neon-glow: 0 0 0 1px rgba(52, 152, 219, 0.2), 0 0 18px rgba(52, 152, 219, 0.15);
    --hero: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 42%, #90caf9 100%);
    --guide-header: var(--hero);
    --guide-button-a: #2196f3;
    --guide-button-b: #0d47a1;
    --code-bg: #0b0720;
    --code-border: rgba(173, 117, 255, 0.22);
    --code-color: #f8f3ff;
    --code-inline-bg: rgba(168, 85, 247, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: clamp(80px, 8vw, 128px);
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(217, 70, 239, 0.16), transparent 30%),
        radial-gradient(circle at bottom center, rgba(91, 33, 182, 0.22), transparent 38%),
        linear-gradient(180deg, #030106 0%, #09040f 35%, #12081a 100%);
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    line-height: 1.72;
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
    background:
        radial-gradient(circle at top left, rgba(0, 123, 255, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(40, 167, 69, 0.06), transparent 30%),
        radial-gradient(circle at bottom center, rgba(255, 193, 7, 0.05), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f8f9fa 35%, #e9ecef 100%);
}

[data-theme="blue"] body {
    background:
        radial-gradient(circle at top left, rgba(52, 152, 219, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(155, 89, 182, 0.08), transparent 30%),
        radial-gradient(circle at bottom center, rgba(26, 188, 156, 0.06), transparent 38%),
        linear-gradient(180deg, #f0f8ff 0%, #e6f3ff 35%, #cce7ff 100%);
}

body.menu-open {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.07) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}

body[data-language="html"] {
    --guide-header: linear-gradient(135deg, #08020d 0%, #2b0b29 48%, #5d1460 100%);
    --guide-button-a: #e879f9;
    --guide-button-b: #d946ef;
}

body[data-language="css"] {
    --guide-header: linear-gradient(135deg, #04030d 0%, #160a2b 48%, #35206b 100%);
    --guide-button-a: #c4b5fd;
    --guide-button-b: #8b5cf6;
}

body[data-language="javascript"] {
    --guide-header: linear-gradient(135deg, #05030a 0%, #170a24 48%, #432067 100%);
    --guide-button-a: #e9d5ff;
    --guide-button-b: #a855f7;
}

/* Tema Claro - Ajustes específicos */
[data-theme="light"] body[data-language="html"] {
    --guide-header: linear-gradient(135deg, #ffeef0 0%, #ffccd5 48%, #ffb3ba 100%);
    --guide-button-a: #dc3545;
    --guide-button-b: #c82333;
}

[data-theme="light"] body[data-language="css"] {
    --guide-header: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 48%, #99d6ff 100%);
    --guide-button-a: #007bff;
    --guide-button-b: #0056b3;
}

[data-theme="light"] body[data-language="javascript"] {
    --guide-header: linear-gradient(135deg, #fff8e1 0%, #ffecb3 48%, #ffe082 100%);
    --guide-button-a: #ffc107;
    --guide-button-b: #e0a800;
}

/* Tema Azul Claro - Ajustes específicos */
[data-theme="blue"] body[data-language="html"] {
    --guide-header: linear-gradient(135deg, #ffebee 0%, #ffcdd2 48%, #ef9a9a 100%);
    --guide-button-a: #f44336;
    --guide-button-b: #d32f2f;
}

[data-theme="blue"] body[data-language="css"] {
    --guide-header: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 48%, #90caf9 100%);
    --guide-button-a: #2196f3;
    --guide-button-b: #0d47a1;
}

[data-theme="blue"] body[data-language="javascript"] {
    --guide-header: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 48%, #ce93d8 100%);
    --guide-button-a: #9c27b0;
    --guide-button-b: #7b1fa2;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

code,
pre,
textarea,
select,
input {
    font-family: Consolas, "Courier New", monospace;
}

code {
    padding: 0.16rem 0.38rem;
    border-radius: 0.45rem;
    background: var(--code-inline-bg, rgba(168, 85, 247, 0.14));
    color: var(--code-color, #f0abfc);
    font-size: 0.95em;
}

pre {
    margin: 0;
    overflow-x: auto;
    background: var(--code-bg, #06030c);
    border: 1px solid var(--code-border, rgba(173, 117, 255, 0.14));
    color: var(--code-color, #fff7ef);
    border-radius: 18px;
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[hidden] {
    display: none !important;
}

.page-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 22px auto 36px;
}

.site-header {
    background: var(--guide-header);
    color: var(--ink);
    border: 1px solid rgba(192, 132, 252, 0.14);
    border-radius: 34px;
    box-shadow: var(--shadow);
    overflow: visible;
    position: relative;
    isolation: isolate;
    z-index: 50;
}

.site-header::after {
    content: "";
    position: absolute;
    inset: auto -10% -28% auto;
    width: min(420px, 80vw);
    height: min(420px, 80vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.24), transparent 68%);
    z-index: -1;
}

.top-nav {
    position: fixed;
    top: 14px;
    left: 14px;
    transform: none;
    width: auto;
    max-width: calc(100vw - 28px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface-strong);
    border: 1px solid var(--control-border);
    border-radius: 28px;
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
    z-index: 5000;
}

[data-theme="light"] .top-nav,
[data-theme="blue"] .top-nav {
    color: var(--ink);
}

.nav-launcher {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle {
    width: 52px;
    height: 52px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: 1px solid var(--control-border);
    border-radius: 16px;
    background: var(--surface-strong);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin-left: 14px;
    background: #f4ecff;
    border-radius: 999px;
    transition: transform 180ms ease, width 180ms ease, opacity 180ms ease, background 180ms ease;
}

.menu-toggle span:nth-child(1) {
    width: 16px;
}

.menu-toggle span:nth-child(2) {
    width: 24px;
}

.menu-toggle span:nth-child(3) {
    width: 18px;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
    transform: translateY(-2px);
    border-color: var(--neon-line);
    box-shadow: var(--neon-glow);
}

.menu-toggle:hover span,
.menu-toggle:focus-visible span {
    background: var(--neon);
}

.menu-toggle:hover span:nth-child(1),
.menu-toggle:focus-visible span:nth-child(1) {
    width: 22px;
}

.menu-toggle:hover span:nth-child(2),
.menu-toggle:focus-visible span:nth-child(2) {
    width: 28px;
}

.menu-toggle:hover span:nth-child(3),
.menu-toggle:focus-visible span:nth-child(3) {
    width: 24px;
}

.menu-toggle.is-open span:nth-child(1) {
    width: 24px;
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.4);
}

.menu-toggle.is-open span:nth-child(3) {
    width: 24px;
    transform: translateY(-8px) rotate(-45deg);
}

.side-menu-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transition: opacity 220ms ease;
    z-index: 4700;
}

.side-menu-backdrop.is-open {
    opacity: 1;
}

.side-menu {
    position: fixed;
    top: 14px;
    left: 14px;
    width: min(340px, calc(100vw - 28px));
    height: calc(100vh - 28px);
    padding: 94px 20px 20px;
    display: grid;
    align-content: start;
    gap: 18px;
    border-radius: 30px;
    background: var(--surface-strong);
    border: 1px solid var(--control-border);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.18);
    transform: translateX(-118%);
    opacity: 0;
    pointer-events: none;
    transition: transform 240ms ease, opacity 240ms ease;
    z-index: 4800;
}

.side-menu.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.side-menu-header h2,
.side-menu-label,
.side-link {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}

.side-menu-header h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.15;
}

.side-menu-eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.side-menu-group {
    display: grid;
    gap: 10px;
}

.side-menu-label {
    color: var(--ink-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.side-link {
    text-decoration: none;
    padding: 0.92rem 1rem;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--control-border);
    color: var(--ink);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.side-link:hover,
.side-link:focus-visible,
.side-link[aria-current="page"] {
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(67, 255, 209, 0.14), rgba(168, 85, 247, 0.26));
    border-color: var(--neon-line);
    color: #f7fffd;
    box-shadow: var(--neon-glow);
    text-shadow: 0 0 10px rgba(67, 255, 209, 0.25);
}

.side-link-muted {
    color: var(--ink-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: transform 180ms ease;
}

.brand:hover,
.brand:focus-visible {
    transform: translateY(-2px);
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
    box-shadow: 0 0 0 1px rgba(67, 255, 209, 0.28), 0 0 22px rgba(67, 255, 209, 0.32);
}

.brand:hover .brand-copy strong,
.brand:focus-visible .brand-copy strong {
    color: var(--neon);
    text-shadow: 0 0 10px rgba(67, 255, 209, 0.32);
}

.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #f8f3ff;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 1.1rem;
    font-weight: 800;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-copy strong,
.nav-links a,
.button,
.section-kicker,
.language-pill,
.filter-chip,
.metric-card strong,
.syntax-label,
.route-card span,
.faq-item summary,
.site-footer a,
.challenge-index,
.select-field span {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}

.brand-copy strong {
    font-size: 1.1rem;
}

.brand-copy small {
    color: var(--ink-soft);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links-primary a {
    background: rgba(18, 10, 30, 0.82);
}

.nav-links-secondary a {
    background: rgba(9, 5, 16, 0.7);
}

.nav-links a {
    text-decoration: none;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--control-border);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(67, 255, 209, 0.16), rgba(168, 85, 247, 0.28));
    border-color: var(--neon-line);
    color: #f7fffd;
    box-shadow: var(--neon-glow);
    text-shadow: 0 0 10px rgba(67, 255, 209, 0.25);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 24px;
    padding: 108px clamp(20px, 5vw, 34px) 42px;
}

.hero-copy h1,
.section-head h2,
.language-summary h3,
.cheatsheet h3,
.route-card h3,
.overview-card h3,
.topic-card h3,
.wiki-card h3,
.launch-card h3,
.mini-card h3 {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.hero-copy h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(2.8rem, 4vw, 4.8rem);
}

.hero-text,
.section-text {
    max-width: 62ch;
    color: var(--ink);
    font-size: 1.06rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 28px 0 30px;
}

.button {
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 0.92rem 1.28rem;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--neon-glow);
}

.button-primary {
    background: linear-gradient(135deg, var(--guide-button-a), var(--guide-button-b));
    color: #faf5ff;
    box-shadow: 0 12px 28px rgba(168, 85, 247, 0.35);
}

.button-secondary {
    background: rgba(18, 10, 30, 0.72);
    border: 1px solid rgba(192, 132, 252, 0.22);
    color: #f6efff;
}

main .button-secondary,
.launch-card .button-secondary,
.practice-actions .button-secondary,
.resource-links a {
    background: rgba(18, 10, 30, 0.92);
    border: 1px solid rgba(192, 132, 252, 0.24);
    color: #f6efff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .button-secondary,
[data-theme="blue"] .button-secondary,
[data-theme="light"] .practice-actions .button-secondary,
[data-theme="blue"] .practice-actions .button-secondary {
    background: var(--surface-soft);
    border: 1px solid var(--control-border);
    color: var(--ink);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric-card {
    padding: clamp(14px, 2.5vw, 18px);
    border-radius: 20px;
    background: rgba(9, 4, 18, 0.62);
    border: 1px solid rgba(192, 132, 252, 0.18);
    backdrop-filter: blur(12px);
}

.metric-card strong {
    display: block;
    font-size: 2rem;
}

.metric-card span {
    color: rgba(230, 216, 255, 0.78);
}

.hero-panel {
    display: grid;
    gap: 14px;
    align-content: center;
}

.syntax-card,
.guide-step-card {
    padding: clamp(14px, 2.5vw, 18px);
    border-radius: 22px;
    border: 1px solid rgba(192, 132, 252, 0.18);
    background: rgba(10, 4, 20, 0.62);
    backdrop-filter: blur(12px);
}

.guide-step-card p {
    margin: 0;
    color: rgba(238, 227, 255, 0.84);
}

.syntax-label {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 0.3rem 0.72rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.syntax-card-html .syntax-label {
    background: rgba(217, 70, 239, 0.18);
    color: #f5d0fe;
}

.syntax-card-css .syntax-label {
    background: rgba(139, 92, 246, 0.2);
    color: #ddd6fe;
}

.syntax-card-js .syntax-label {
    background: rgba(192, 132, 252, 0.18);
    color: #f3e8ff;
}

.guide-step-card .syntax-label {
    background: rgba(192, 132, 252, 0.16);
    color: #f6efff;
}

.syntax-card pre {
    color: #fff7ef;
    font-size: 0.95rem;
}

main {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.panel {
    background: var(--surface-strong);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: clamp(16px, 4vw, 32px);
    position: relative;
    overflow: clip;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%);
    pointer-events: none;
}

.panel>* {
    position: relative;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 24px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    max-width: 17ch;
}

.section-text {
    margin: 0;
    color: var(--ink-soft);
}

.launch-grid,
.overview-grid,
.route-grid,
.mini-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.launch-card,
.overview-card,
.route-card,
.language-summary,
.cheatsheet,
.topic-card,
.wiki-card,
.faq-item,
.mini-card,
.challenge-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(17, 10, 29, 0.82);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.launch-card,
.overview-card,
.route-card,
.mini-card {
    padding: clamp(16px, 3vw, 22px);
}

.launch-card h3,
.overview-card h3,
.route-card h3,
.mini-card h3 {
    margin: 14px 0 10px;
    font-size: 1.45rem;
}

.launch-card p,
.overview-card p,
.route-card p,
.mini-card p,
.language-summary p,
.faq-item p,
.topic-card p,
.wiki-card p,
.challenge-card p {
    margin: 0;
    color: var(--ink-soft);
}

/* Estilos para la información de usuario y logout */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(18, 10, 30, 0.72);
    border: 1px solid rgba(192, 132, 252, 0.16);
    border-radius: 18px;
}

.user-name {
    color: #f4ecff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}

.logout-button {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    background: rgba(220, 53, 69, 0.1);
    color: #ff6b7a;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.logout-button:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #ff8a92;
}

/* Tema claro */
[data-theme="light"] .user-info {
    background: rgba(248, 249, 250, 0.9);
    border-color: rgba(108, 117, 125, 0.3);
}

[data-theme="light"] .user-name {
    color: #1a1a1a;
}

[data-theme="light"] .logout-button {
    border-color: rgba(220, 53, 69, 0.4);
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

[data-theme="light"] .logout-button:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.6);
    color: #c82333;
}

/* Tema azul */
[data-theme="blue"] .user-info {
    background: rgba(240, 248, 255, 0.9);
    border-color: rgba(30, 58, 95, 0.2);
}

[data-theme="blue"] .user-name {
    color: #1e3a5f;
}

[data-theme="blue"] .logout-button {
    border-color: rgba(220, 53, 69, 0.4);
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

[data-theme="blue"] .logout-button:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.6);
    color: #c82333;
}

.launch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 18px;
    color: var(--ink-soft);
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

.language-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.82rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overview-card-html .language-pill,
.launch-card--html .language-pill,
.mini-card--html h3,
.topic-card--html .topic-tag,
.wiki-card--html .topic-tag {
    color: #f0abfc;
}

.overview-card-html .language-pill,
.launch-card--html .language-pill,
.topic-card--html .topic-tag,
.wiki-card--html .topic-tag {
    background: rgba(217, 70, 239, 0.16);
}

.overview-card-css .language-pill,
.launch-card--css .language-pill,
.mini-card--css h3,
.topic-card--css .topic-tag,
.wiki-card--css .topic-tag {
    color: #c4b5fd;
}

.overview-card-css .language-pill,
.launch-card--css .language-pill,
.topic-card--css .topic-tag,
.wiki-card--css .topic-tag {
    background: rgba(139, 92, 246, 0.16);
}

.overview-card-js .language-pill,
.launch-card--javascript .language-pill,
.mini-card--javascript h3,
.topic-card--javascript .topic-tag,
.wiki-card--javascript .topic-tag {
    color: #e9d5ff;
}

.overview-card-js .language-pill,
.launch-card--javascript .language-pill,
.topic-card--javascript .topic-tag,
.wiki-card--javascript .topic-tag {
    background: rgba(192, 132, 252, 0.18);
}

.launch-card--locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.launch-card--locked .language-pill {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.launch-card--locked .button {
    opacity: 0.5;
    cursor: not-allowed;
}

.comparison-table-wrap {
    margin-top: 22px;
    border-radius: 24px;
    overflow: auto;
    border: 1px solid var(--line);
    background: rgba(12, 8, 21, 0.88);
}

.comparison-table {
    width: 100%;
    min-width: 740px;
    border-collapse: collapse;
}

.comparison-table caption {
    padding: 18px 20px 0;
    color: var(--ink-soft);
    text-align: left;
}

.comparison-table th,
.comparison-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(173, 117, 255, 0.12);
    text-align: left;
    vertical-align: top;
}

.comparison-table thead th {
    background: rgba(255, 255, 255, 0.05);
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}

.explorer-panel {
    background:
        linear-gradient(180deg, rgba(8, 5, 14, 0.92), rgba(14, 8, 24, 0.98)),
        radial-gradient(circle at top right, rgba(168, 85, 247, 0.16), transparent 30%);
}

.explorer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.search-field,
.select-field,
.answer-field {
    display: grid;
    gap: 8px;
}

.search-field {
    min-width: min(100%, 460px);
}

.search-field span,
.answer-field span {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 0.95rem;
    font-weight: 700;
}

.search-field input,
.select-field select,
.answer-field textarea {
    width: 100%;
    border: 1px solid var(--input-border, rgba(173, 117, 255, 0.22));
    border-radius: 22px;
    padding: 0.98rem 1.2rem;
    background: var(--input-bg, rgba(8, 5, 15, 0.94));
    color: var(--ink);
    font-size: 0.98rem;
}

.search-field input:focus,
.select-field select:focus,
.answer-field textarea:focus {
    outline: 2px solid rgba(192, 132, 252, 0.42);
    outline-offset: 2px;
}

.answer-field textarea {
    min-height: 260px;
    caret-color: #f0abfc;
    resize: vertical;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    border: 1px solid rgba(173, 117, 255, 0.18);
    background: rgba(14, 8, 24, 0.9);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.78rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    transform: translateY(-2px);
    border-color: var(--neon-line);
    box-shadow: var(--neon-glow);
    color: var(--neon);
}

.filter-chip.is-active {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #fff7ef;
    border-color: transparent;
}

.topic-grid,
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.topic-card,
.wiki-card {
    padding: clamp(16px, 3vw, 22px);
    display: grid;
    gap: 12px;
}

.topic-card h3,
.wiki-card h3 {
    margin: 0;
    font-size: 1.38rem;
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.topic-tag,
.topic-level {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topic-level {
    background: rgba(192, 132, 252, 0.14);
    color: #e9d5ff;
}

.topic-block {
    display: grid;
    gap: 8px;
}

.topic-block strong,
.challenge-card strong {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 0.96rem;
}

.topic-card pre,
.wiki-card pre,
.cheatsheet pre,
.challenge-card pre {
    padding: 16px;
    border-radius: 18px;
    background: #06030c;
    border: 1px solid rgba(173, 117, 255, 0.14);
    color: #fff7ef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topic-card pre code,
.wiki-card pre code,
.cheatsheet pre code,
.challenge-card pre code,
.syntax-card pre code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

.topic-link {
    width: fit-content;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-weight: 700;
    text-decoration: none;
    color: #d8b4fe;
}

.topic-link:hover,
.topic-link:focus-visible {
    color: var(--neon);
    text-shadow: 0 0 10px rgba(67, 255, 209, 0.25);
    text-decoration: underline;
}

.language-head {
    align-items: center;
}

.language-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 16px;
    margin-bottom: 24px;
}

.language-summary,
.cheatsheet {
    padding: clamp(16px, 3vw, 24px);
}

.language-summary h3,
.cheatsheet h3 {
    margin: 0 0 12px;
    font-size: 1.45rem;
}

.check-list {
    padding-left: 1.1rem;
    margin: 16px 0 0;
    color: var(--ink-soft);
}

.check-list li+li {
    margin-top: 8px;
}

.route-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    background: rgba(192, 132, 252, 0.14);
    color: #e9d5ff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.resource-strip {
    margin-top: 22px;
    padding: clamp(16px, 3vw, 22px);
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(15, 9, 24, 0.9);
}

.resource-strip p {
    margin: 0 0 14px;
    color: var(--ink-soft);
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.resource-links a {
    text-decoration: none;
    padding: 0.82rem 1rem;
    border-radius: 999px;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-weight: 700;
}

.resource-links a:hover,
.resource-links a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--neon);
    border-color: var(--neon-line);
    box-shadow: var(--neon-glow);
    text-shadow: 0 0 10px rgba(67, 255, 209, 0.25);
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    padding: 0;
    overflow: hidden;
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: clamp(16px, 3vw, 22px) clamp(18px, 4vw, 24px);
    font-size: 1.04rem;
    font-weight: 700;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    padding: 0 clamp(18px, 4vw, 24px) clamp(16px, 3vw, 22px);
}

.practice-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr);
    gap: 16px;
}

.practice-sidebar,
.practice-workspace {
    display: grid;
    gap: 16px;
}

.challenge-card {
    padding: clamp(16px, 3vw, 22px);
}

.challenge-card-soft {
    background: rgba(20, 12, 33, 0.72);
}

.achievement-card {
    background: rgba(78, 154, 218, 0.08);
    border: 1px solid rgba(78, 154, 218, 0.18);
    border-radius: 20px;
    padding: clamp(16px, 3vw, 22px);
}

.achievement-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.achievement-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.achievement-item strong {
    display: block;
    font-size: 1rem;
}

.achievement-item span {
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.achievement-status {
    justify-self: end;
    color: rgba(144, 238, 144, 0.92);
    font-weight: 700;
}

.achievement-item.locked .achievement-status {
    color: rgba(192, 192, 192, 0.92);
}

.challenge-index {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 10px;
    padding: 0.3rem 0.72rem;
    border-radius: 999px;
    background: rgba(192, 132, 252, 0.14);
    color: #e9d5ff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.challenge-goal {
    margin-bottom: 12px;
}

.challenge-hint {
    font-size: 0.96rem;
}

.challenge-list {
    margin: 12px 0 0;
    padding-left: 1.1rem;
    color: var(--ink-soft);
}

.challenge-list li+li {
    margin-top: 8px;
}

.practice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.feedback-box {
    border-radius: 20px;
    padding: 16px 18px;
    border: 1px solid transparent;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-weight: 700;
}

.feedback-info {
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.22);
    color: #d8b4fe;
}

.feedback-good {
    background: rgba(217, 70, 239, 0.14);
    border-color: rgba(217, 70, 239, 0.22);
    color: #f5d0fe;
}

.feedback-warn {
    background: rgba(192, 132, 252, 0.12);
    border-color: rgba(192, 132, 252, 0.22);
    color: #f3e8ff;
}

.feedback-bad {
    background: rgba(126, 34, 206, 0.18);
    border-color: rgba(126, 34, 206, 0.26);
    color: #e9d5ff;
}

.token-tag {
    color: #f472fb;
}

.token-attr-name {
    color: #c4b5fd;
}

.token-string {
    color: #86efac;
}

.token-comment {
    color: #7c6f98;
}

.token-keyword {
    color: #f0abfc;
}

.token-selector {
    color: #67e8f9;
}

.token-property {
    color: #c084fc;
}

.token-number {
    color: #f9a8d4;
}

.token-function {
    color: #facc15;
}

.token-variable {
    color: #67e8f9;
}

.token-method {
    color: #93c5fd;
}

.token-operator,
.token-punctuation {
    color: #ddd6fe;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: clamp(16px, 3vw, 24px) clamp(12px, 2vw, 16px) 6px;
    color: var(--ink-soft);
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    text-decoration: none;
    font-weight: 700;
}

/* Selector de Tema */
.theme-selector {
    position: relative;
    margin-left: 14px;
}

.theme-toggle {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(192, 132, 252, 0.22);
    border-radius: 16px;
    background: rgba(15, 8, 25, 0.92);
    color: #f4ecff;
    cursor: pointer;
    transition: all 180ms ease;
    font-size: 1.2rem;
    position: relative;
}

[data-theme="light"] .theme-toggle {
    background: rgba(248, 249, 250, 0.95);
    border-color: rgba(108, 117, 125, 0.3);
    color: #1a1a1a;
}

[data-theme="blue"] .theme-toggle {
    background: rgba(240, 248, 255, 0.95);
    border-color: rgba(30, 58, 95, 0.2);
    color: #1e3a5f;
}

[data-theme="light"] .theme-toggle {
    background: rgba(248, 249, 250, 0.95);
    border-color: rgba(108, 117, 125, 0.3);
    color: #1a1a1a;
}

[data-theme="blue"] .theme-toggle {
    background: rgba(240, 248, 255, 0.95);
    border-color: rgba(30, 58, 95, 0.2);
    color: #1e3a5f;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: translateY(-2px);
    border-color: var(--neon-line);
    box-shadow: var(--neon-glow);
}

.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 160px;
    background: rgba(15, 8, 25, 0.95);
    border: 1px solid rgba(192, 132, 252, 0.22);
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 200ms ease;
    z-index: 1000;
    padding: 8px 0;
}

[data-theme="light"] .theme-menu {
    background: rgba(248, 249, 250, 0.98);
    border-color: rgba(108, 117, 125, 0.3);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.1);
}

[data-theme="blue"] .theme-menu {
    background: rgba(240, 248, 255, 0.98);
    border-color: rgba(30, 58, 95, 0.2);
    box-shadow: 0 18px 36px rgba(30, 58, 95, 0.1);
}

[data-theme="light"] .theme-menu {
    background: rgba(248, 249, 250, 0.98);
    border-color: rgba(108, 117, 125, 0.3);
}

[data-theme="blue"] .theme-menu {
    background: rgba(240, 248, 255, 0.98);
    border-color: rgba(30, 58, 95, 0.2);
}

.theme-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #f4ecff;
    text-align: left;
    cursor: pointer;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    transition: background 150ms ease;
    border-radius: 0;
}

[data-theme="light"] .theme-option {
    color: #1a1a1a;
}

[data-theme="blue"] .theme-option {
    color: #1e3a5f;
}

.theme-option:hover,
.theme-option:focus-visible {
    background: rgba(67, 255, 209, 0.1);
}

.theme-option.active {
    background: rgba(67, 255, 209, 0.2);
    font-weight: 700;
}

.theme-option:first-child {
    border-radius: 8px 8px 0 0;
}

.theme-option:last-child {
    border-radius: 0 0 8px 8px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: clamp(20px, 5vw, 32px);
    border-radius: 24px;
    border: 1px dashed rgba(192, 132, 252, 0.24);
    text-align: center;
    color: var(--ink-soft);
    background: rgba(15, 9, 24, 0.72);
}

[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 420ms ease, transform 420ms ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .hero,
    .topic-grid,
    .wiki-grid,
    .launch-grid,
    .overview-grid,
    .route-grid,
    .mini-card-grid,
    .language-layout,
    .practice-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-copy h1 {
        max-width: none;
    }

    .comparison-table {
        min-width: 680px;
    }
}

@media (max-width: 900px) {
    .hero,
    .topic-grid,
    .wiki-grid,
    .launch-grid,
    .overview-grid,
    .route-grid,
    .mini-card-grid,
    .language-layout,
    .practice-layout {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        font-size: clamp(2.4rem, 5vw, 4rem);
    }

    .section-head h2 {
        font-size: clamp(1.8rem, 4vw, 2.8rem);
    }

    .comparison-table {
        min-width: 600px;
    }
}

@media (max-width: 820px) {
    .page-shell {
        width: min(100% - 20px, 1220px);
        margin: 10px auto 24px;
    }

    .site-header,
    .panel {
        border-radius: 24px;
    }

    .hero,
    .panel {
        padding-left: 20px;
        padding-right: 20px;
    }

    .top-nav {
        top: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
        padding: 12px 14px;
    }

    .hero {
        padding-top: 120px;
        padding-bottom: 28px;
        grid-template-columns: 1fr;
    }

    .section-head,
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-metrics,
    .topic-grid,
    .wiki-grid,
    .launch-grid,
    .overview-grid,
    .route-grid,
    .mini-card-grid,
    .language-layout,
    .practice-layout {
        grid-template-columns: 1fr;
    }

    .hero-metrics {
        gap: 10px;
    }

    .comparison-table {
        min-width: 500px;
    }
}

@media (max-width: 560px) {
    body {
        line-height: 1.58;
    }

    html {
        scroll-padding-top: 168px;
    }

    .brand {
        width: auto;
    }

    .top-nav {
        max-width: calc(100vw - 20px);
    }

    .brand-copy small {
        display: none;
    }

    .side-menu {
        top: 10px;
        left: 10px;
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        padding-top: 88px;
    }

    .button,
    .filter-chip,
    .resource-links a,
    .practice-actions .button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .hero-actions,
    .resource-links,
    .practice-actions {
        width: 100%;
    }

    .comparison-table {
        min-width: 400px;
    }

    .search-field {
        min-width: 100%;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .section-head h2 {
        font-size: clamp(1.6rem, 5vw, 2.5rem);
    }
}

@media (max-width: 480px) {
    .page-shell {
        width: 100%;
        margin: 5px auto 20px;
    }

    .hero,
    .panel {
        padding-left: 16px;
        padding-right: 16px;
    }

    .top-nav {
        top: 5px;
        left: 5px;
        max-width: calc(100vw - 10px);
        padding: 10px 12px;
    }

    .side-menu {
        top: 5px;
        left: 5px;
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
        padding: 80px 16px 16px;
    }

    .hero {
        padding-top: 100px;
        padding-bottom: 24px;
    }

    .comparison-table {
        min-width: 350px;
    }

    .hero-copy h1 {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    .section-head h2 {
        font-size: clamp(1.4rem, 6vw, 2.2rem);
    }

    .metric-card strong {
        font-size: 1.8rem;
    }
}
