:root {
 --coral: #FFB5C2;
 --coral-deep: #FF8FAB;
 --coral-soft: #FFF0F4;
 --sky: #BDE0FE;
 --sky-deep: #8AC4FF;
 --sky-soft: #EEF7FF;
 --cream: #FFF8E7;
 --cream-deep: #FFE5B4;
 --mint: #B8F2E6;
 --mint-deep: #6ADAC2;
 --mint-soft: #EDFCF8;
 --ink: #2D2542;
 --ink-muted: #5C5275;
 --surface: rgba(255, 255, 255, 0.88);
 --surface-solid: #FFFFFF;
 --border-soft: rgba(45, 37, 66, 0.09);
 --shadow-soft: 0 14px 34px rgba(45, 37, 66, 0.08);
 --shadow-hover: 0 18px 38px rgba(45, 37, 66, 0.13);
 --radius-xl: 28px;
 --radius-lg: 20px;
 --radius-md: 14px;
 --sidebar-w: 240px;
 --font-display: "Fredoka", system-ui, -apple-system, sans-serif;
 --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
 box-sizing: border-box;
}

html {
 scroll-behavior: smooth;
 overflow-x: clip;
}

body {
 margin: 0;
 font-family: var(--font-body);
 color: var(--ink);
 background:
 radial-gradient(circle at 12% 10%, rgba(255, 181, 194, 0.42), transparent 38%),
 radial-gradient(circle at 88% 14%, rgba(189, 224, 254, 0.48), transparent 42%),
 radial-gradient(circle at 80% 85%, rgba(184, 242, 230, 0.45), transparent 40%),
 var(--cream);
 background-attachment: fixed;
 line-height: 1.58;
 overflow-x: clip;
}

h1, h2, h3, h4 {
 font-family: var(--font-display);
 color: var(--ink);
 margin-top: 0;
 line-height: 1.2;
}

img {
 max-width: 100%;
 height: auto;
 display: block;
}

a {
 color: inherit;
 text-decoration: none;
}

/* Barra superior de progreso */
.conveyor-progress-shell {
 position: fixed;
 top: 0;
 left: 0;
 right: 0;
 height: 6px;
 background: rgba(255, 255, 255, 0.65);
 z-index: 60;
}

.conveyor-fill {
 height: 100%;
 width: 8%;
 background: linear-gradient(90deg, var(--coral-deep), var(--sky-deep), var(--mint-deep));
 border-radius: 0 999px 999px 0;
 transition: width 0.12s ease-out;
}

/* Botones Pill Pastel */
.pill-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 0.4rem;
 font-family: var(--font-display);
 font-weight: 600;
 font-size: 0.94rem;
 padding: 0.68rem 1.25rem;
 border-radius: 999px;
 border: 2px solid transparent;
 cursor: pointer;
 transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
 color: var(--ink);
 white-space: nowrap;
}

.pill-btn:hover {
 transform: translateY(-2px);
 box-shadow: 0 8px 18px rgba(45, 37, 66, 0.12);
}

.pill-btn:active {
 transform: translateY(0);
}

.pill-coral {
 background: linear-gradient(135deg, var(--coral), var(--coral-deep));
 color: #FFFFFF;
 box-shadow: 0 6px 16px rgba(255, 143, 171, 0.35);
}

.pill-mint {
 background: linear-gradient(135deg, var(--mint), var(--mint-deep));
 color: var(--ink);
 box-shadow: 0 6px 16px rgba(106, 218, 194, 0.32);
}

.pill-sky {
 background: linear-gradient(135deg, var(--sky), var(--sky-deep));
 color: var(--ink);
 box-shadow: 0 6px 16px rgba(138, 196, 255, 0.3);
}

.pill-ghost {
 background: rgba(255, 255, 255, 0.85);
 border-color: rgba(45, 37, 66, 0.14);
 color: var(--ink);
}

/* Mobile top pill bar (oculto en desktop) */
.mobile-pill-bar {
 display: none;
 position: sticky;
 top: 6px;
 z-index: 50;
 padding: 0.65rem 0.9rem;
}

.mobile-pill-top {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 0.5rem;
 background: rgba(255, 255, 255, 0.92);
 backdrop-filter: blur(12px);
 border: 2px solid rgba(255, 181, 194, 0.6);
 border-radius: 999px;
 padding: 0.4rem 0.55rem 0.4rem 0.75rem;
 box-shadow: var(--shadow-soft);
}

.back-pill-mini {
 font-family: var(--font-display);
 font-size: 0.85rem;
 font-weight: 600;
 padding: 0.36rem 0.72rem;
 border-radius: 999px;
 background: var(--sky-soft);
 color: var(--ink);
}

.mobile-brand-title {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 0.95rem;
}

.mobile-drawer {
 display: none;
 flex-direction: column;
 gap: 0.45rem;
 margin-top: 0.55rem;
 padding: 0.9rem;
 background: rgba(255, 255, 255, 0.96);
 backdrop-filter: blur(14px);
 border-radius: var(--radius-lg);
 border: 2px solid rgba(189, 224, 254, 0.75);
 box-shadow: var(--shadow-hover);
}

.mobile-drawer.open {
 display: flex;
}

/* App Shell: Sticky Left Sidebar Rail + Main */
.app-shell {
 position: relative;
 z-index: 5;
 display: grid;
 grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
 gap: 1.5rem;
 max-width: 1420px;
 margin: 0 auto;
 padding: 1.4rem 1.4rem 3rem;
 align-items: start;
}

.sidebar-rail {
 position: sticky;
 top: 1.4rem;
 height: calc(100vh - 2.8rem);
 max-height: 760px;
 display: flex;
 flex-direction: column;
 justify-content: space-between;
 gap: 1rem;
 padding: 1.15rem 1rem;
 background: var(--surface);
 backdrop-filter: blur(14px);
 border: 2px solid rgba(255, 181, 194, 0.55);
 border-radius: var(--radius-xl);
 box-shadow: var(--shadow-soft);
}

.rail-back-link {
 display: inline-flex;
 align-items: center;
 gap: 0.35rem;
 font-family: var(--font-display);
 font-size: 0.86rem;
 font-weight: 600;
 padding: 0.45rem 0.85rem;
 border-radius: 999px;
 background: var(--sky-soft);
 border: 1.5px solid var(--sky);
 color: var(--ink);
 margin-bottom: 0.85rem;
 transition: transform 0.16s ease, background-color 0.16s ease;
}

.rail-back-link:hover {
 transform: translateX(-2px);
 background: var(--sky);
}

.rail-brand-card {
 background: linear-gradient(145deg, var(--coral-soft), var(--cream));
 border: 2px solid var(--coral);
 border-radius: var(--radius-md);
 padding: 0.8rem;
}

.rail-badge {
 display: block;
 font-size: 0.68rem;
 font-weight: 800;
 letter-spacing: 0.05em;
 color: #B4436C;
 margin-bottom: 0.25rem;
}

.rail-title {
 display: block;
 font-family: var(--font-display);
 font-size: 1.02rem;
 line-height: 1.25;
}

.rail-nav {
 display: flex;
 flex-direction: column;
 gap: 0.38rem;
}

.rail-link {
 display: flex;
 align-items: center;
 gap: 0.6rem;
 padding: 0.6rem 0.8rem;
 border-radius: 14px;
 font-weight: 700;
 font-size: 0.92rem;
 color: var(--ink-muted);
 transition: background-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}

.rail-link:hover {
 background: var(--sky-soft);
 color: var(--ink);
 transform: translateX(3px);
}

.rail-link.active {
 background: linear-gradient(135deg, var(--coral-soft), #FFE3EC);
 color: var(--ink);
 border: 1.5px solid var(--coral);
}

.rail-num {
 display: inline-grid;
 place-items: center;
 width: 24px;
 height: 24px;
 border-radius: 8px;
 background: #FFFFFF;
 font-family: var(--font-display);
 font-size: 0.78rem;
 color: var(--ink);
 box-shadow: 0 2px 6px rgba(45, 37, 66, 0.08);
}

.rail-progress-box {
 background: var(--mint-soft);
 border: 2px solid var(--mint);
 border-radius: var(--radius-md);
 padding: 0.85rem;
}

.rail-prog-head {
 display: flex;
 justify-content: space-between;
 align-items: center;
 font-size: 0.84rem;
 font-weight: 700;
 margin-bottom: 0.45rem;
}

.rail-prog-track {
 height: 10px;
 border-radius: 999px;
 background: #FFFFFF;
 overflow: hidden;
 margin-bottom: 0.75rem;
}

.rail-prog-fill {
 height: 100%;
 width: 0%;
 background: linear-gradient(90deg, var(--coral-deep), var(--mint-deep));
 border-radius: 999px;
 transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rail-actions {
 display: flex;
 flex-direction: column;
 gap: 0.45rem;
}

.rail-actions .pill-btn {
 width: 100%;
 padding: 0.55rem 0.9rem;
 font-size: 0.85rem;
}

/* Main Column */
.plant-main {
 display: flex;
 flex-direction: column;
 gap: 1.6rem;
 min-width: 0;
}

/* HERO BENTO GRID */
.hero-bento {
 display: grid;
 grid-template-columns: repeat(12, minmax(0, 1fr));
 gap: 1.15rem;
}

.bento-card {
 position: relative;
 background: var(--surface);
 backdrop-filter: blur(14px);
 border: 2px solid rgba(255, 255, 255, 0.9);
 border-radius: var(--radius-xl);
 padding: 1.5rem;
 box-shadow: var(--shadow-soft);
}

.bento-main {
 grid-column: span 7;
 background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), var(--coral-soft));
 border-color: rgba(255, 181, 194, 0.7);
 display: flex;
 flex-direction: column;
 justify-content: center;
 overflow: hidden;
}

.bento-media {
 grid-column: span 5;
 margin: 0;
 padding: 1rem;
 background: linear-gradient(155deg, #FFFFFF, var(--sky-soft));
 border-color: rgba(189, 224, 254, 0.85);
 display: flex;
 flex-direction: column;
 justify-content: space-between;
 gap: 0.7rem;
}

.bento-media img {
 width: 100%;
 aspect-ratio: 16 / 10;
 object-fit: cover;
 border-radius: 18px;
 border: 3px solid #FFFFFF;
 box-shadow: 0 10px 24px rgba(45, 37, 66, 0.12);
}

.bento-media figcaption {
 font-size: 0.86rem;
 color: var(--ink-muted);
 font-weight: 600;
}

.media-badge {
 align-self: flex-start;
 font-family: var(--font-display);
 font-size: 0.8rem;
 font-weight: 600;
 padding: 0.3rem 0.75rem;
 border-radius: 999px;
 background: var(--sky);
 color: var(--ink);
}

.bento-stat {
 grid-column: span 4;
 padding: 1.1rem 1.25rem;
 display: flex;
 flex-direction: column;
 gap: 0.2rem;
}

.stat-sky { background: linear-gradient(145deg, #FFFFFF, var(--sky-soft)); border-color: var(--sky); }
.stat-coral { background: linear-gradient(145deg, #FFFFFF, var(--coral-soft)); border-color: var(--coral); }
.stat-mint { background: linear-gradient(145deg, #FFFFFF, var(--mint-soft)); border-color: var(--mint); }

.stat-icon { font-size: 1.45rem; }
.stat-label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; color: var(--ink-muted); }
.stat-val { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }

.eyebrow-pill {
 display: inline-block;
 align-self: flex-start;
 font-size: 0.76rem;
 font-weight: 800;
 letter-spacing: 0.05em;
 padding: 0.35rem 0.85rem;
 border-radius: 999px;
 background: var(--cream);
 border: 1.5px solid var(--coral);
 color: #A83A63;
 margin-bottom: 0.75rem;
}

.hero-heading {
 font-size: clamp(1.65rem, 2.8vw, 2.35rem);
 margin-bottom: 0.7rem;
}

.hero-lead {
 margin: 0 0 1.2rem;
 font-size: 1.02rem;
 color: var(--ink-muted);
}

.hero-actions {
 display: flex;
 flex-wrap: wrap;
 gap: 0.65rem;
}

.center-actions {
 justify-content: center;
}

/* Floating decorative pills */
.floating-deco {
 position: absolute;
 font-family: var(--font-display);
 font-size: 0.76rem;
 font-weight: 600;
 padding: 0.28rem 0.7rem;
 border-radius: 999px;
 background: rgba(255, 255, 255, 0.92);
 border: 1.5px solid var(--sky);
 box-shadow: 0 6px 14px rgba(45, 37, 66, 0.08);
 pointer-events: none;
 animation: floatSoft 4.2s ease-in-out infinite;
}

.deco-1 { top: 14px; right: 16px; border-color: var(--sky); }
.deco-2 { bottom: 14px; right: 18px; border-color: var(--mint); animation-delay: 1.4s; }

@keyframes floatSoft {
 0%, 100% { transform: translateY(0); }
 50% { transform: translateY(-6px); }
}

/* Entrance & Scroll Reveal */
.enter-anim {
 opacity: 0;
 transform: translateY(20px) scale(0.98);
 animation: heroEnter 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
 animation-delay: var(--enter-delay, 0ms);
}

@keyframes heroEnter {
 to { opacity: 1; transform: translateY(0) scale(1); }
}

[data-reveal] {
 opacity: 0;
 transform: translateY(24px);
 transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].is-visible {
 opacity: 1;
 transform: translateY(0);
}

/* Paneles principales */
.pastel-panel {
 background: var(--surface);
 backdrop-filter: blur(14px);
 border: 2px solid rgba(255, 255, 255, 0.95);
 border-radius: var(--radius-xl);
 padding: 1.75rem;
 box-shadow: var(--shadow-soft);
}

.section-header-bar {
 margin-bottom: 1.25rem;
}

.section-header-bar h2 {
 font-size: clamp(1.4rem, 2.2vw, 1.85rem);
 margin: 0.45rem 0 0;
}

.step-pill {
 display: inline-block;
 font-size: 0.74rem;
 font-weight: 800;
 letter-spacing: 0.05em;
 padding: 0.32rem 0.85rem;
 border-radius: 999px;
}

.pill-tag-coral { background: var(--coral-soft); color: #A83A63; border: 1.5px solid var(--coral); }
.pill-tag-mint { background: var(--mint-soft); color: #196F5D; border: 1.5px solid var(--mint); }
.pill-tag-sky { background: var(--sky-soft); color: #245B96; border: 1.5px solid var(--sky); }

/* Manual de Teoría */
.theory-intro-card {
 background: linear-gradient(135deg, var(--cream), #FFFFFF);
 border: 2px solid var(--cream-deep);
 border-radius: var(--radius-lg);
 padding: 1.3rem 1.4rem;
 margin-bottom: 1.15rem;
}

.exact-question {
 font-size: 1.22rem;
 margin-bottom: 0.55rem;
 color: var(--ink);
}

.exact-paragraph {
 margin: 0;
 font-size: 1rem;
 color: var(--ink-muted);
}

.theory-columns {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 1.1rem;
 margin-bottom: 1.25rem;
}

.sub-pastel-card {
 border-radius: var(--radius-lg);
 padding: 1.25rem 1.35rem;
 border: 2px solid transparent;
}

.card-sky { background: var(--sky-soft); border-color: var(--sky); }
.card-mint { background: var(--mint-soft); border-color: var(--mint); }

.sub-pastel-card h4 {
 font-size: 1.06rem;
 margin-bottom: 0.7rem;
}

.exact-list, .exact-steps {
 list-style: none;
 padding: 0;
 margin: 0;
 display: flex;
 flex-direction: column;
 gap: 0.55rem;
 font-size: 0.95rem;
 color: var(--ink);
}

.theory-diagram-box {
 background: #FFFFFF;
 border: 2px dashed var(--sky-deep);
 border-radius: var(--radius-lg);
 padding: 1.15rem;
}

.theory-diagram-box img {
 margin: 0 auto 1rem;
 border-radius: 14px;
}

.theory-confirm-bar {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: space-between;
 gap: 0.9rem;
 padding-top: 0.9rem;
 border-top: 1.5px solid var(--border-soft);
}

.theory-confirm-bar p {
 margin: 0;
 font-weight: 700;
 color: var(--ink-muted);
 flex: 1 1 280px;
}

/* Tabs de los 4 juegos */
.station-selector {
 display: flex;
 flex-wrap: wrap;
 gap: 0.55rem;
 margin-bottom: 1.25rem;
 padding: 0.45rem;
 background: var(--cream);
 border: 2px solid var(--cream-deep);
 border-radius: 999px;
}

.station-tab {
 flex: 1 1 140px;
 font-family: var(--font-display);
 font-weight: 600;
 font-size: 0.92rem;
 padding: 0.62rem 1rem;
 border: 0;
 border-radius: 999px;
 background: transparent;
 color: var(--ink-muted);
 cursor: pointer;
 transition: background-color 0.2s ease, color 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease;
}

.station-tab:hover {
 color: var(--ink);
 background: rgba(255, 255, 255, 0.7);
}

.station-tab.active {
 background: linear-gradient(135deg, var(--coral), var(--coral-deep));
 color: #FFFFFF;
 box-shadow: 0 6px 14px rgba(255, 143, 171, 0.35);
}

.game-stage {
 background: #FFFFFF;
 border: 2px solid var(--border-soft);
 border-radius: var(--radius-lg);
 padding: 1.35rem;
}

.game-top-bar {
 display: flex;
 flex-wrap: wrap;
 justify-content: space-between;
 align-items: flex-start;
 gap: 1rem;
 margin-bottom: 1rem;
}

.game-top-bar h3 {
 font-size: 1.2rem;
 margin-bottom: 0.35rem;
}

.game-top-bar p {
 margin: 0;
 max-width: 66ch;
 color: var(--ink-muted);
 font-size: 0.94rem;
}

.game-controls-mini {
 display: flex;
 flex-wrap: wrap;
 gap: 0.5rem;
}

/* HUD chips */
.hud-metrics {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
 gap: 0.65rem;
 margin-bottom: 1rem;
}

.hud-chip {
 background: var(--cream);
 border: 1.5px solid rgba(45, 37, 66, 0.08);
 border-radius: var(--radius-md);
 padding: 0.6rem 0.85rem;
 display: flex;
 flex-direction: column;
 gap: 0.12rem;
}

.hud-chip span {
 font-size: 0.74rem;
 font-weight: 800;
 text-transform: uppercase;
 letter-spacing: 0.04em;
 color: var(--ink-muted);
}

.hud-chip strong {
 font-family: var(--font-display);
 font-size: 1rem;
 color: var(--ink);
}

.hud-wide {
 grid-column: span 2;
}

/* Canvas Frames */
.canvas-frame {
 border-radius: 18px;
 overflow: hidden;
 border: 3px solid var(--sky);
 background: #FFFDF8;
 box-shadow: inset 0 2px 10px rgba(45, 37, 66, 0.06);
 margin-bottom: 1rem;
}

.sim-canvas {
 display: block;
 width: 100%;
 height: auto;
 touch-action: manipulation;
}

.interactive-canvas {
 cursor: pointer;
}

/* Botones de estación grandes y táctiles */
.physical-switches-row {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 0.75rem;
}

.action-pad {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 0.98rem;
 padding: 0.9rem 1rem;
 border-radius: 16px;
 border: 2px solid transparent;
 color: var(--ink);
 cursor: pointer;
 transition: transform 0.12s ease, box-shadow 0.16s ease;
 box-shadow: 0 5px 0 rgba(45, 37, 66, 0.12);
}

.action-pad:hover {
 transform: translateY(-2px);
}

.action-pad:active {
 transform: translateY(3px);
 box-shadow: 0 2px 0 rgba(45, 37, 66, 0.12);
}

.pad-cream { background: linear-gradient(180deg, #FFF3D1, #FFE09E); border-color: #F4C86A; }
.pad-mint { background: linear-gradient(180deg, #D5F8F0, #9CEAD9); border-color: #5ECFB8; }
.pad-coral { background: linear-gradient(180deg, #FFD3DC, #FFA3B6); border-color: #FF8FAB; }

/* Juego 3 Balance Grid */
.balance-grid {
 display: grid;
 grid-template-columns: repeat(4, minmax(0, 1fr));
 gap: 0.85rem;
}

.balance-card {
 border-radius: 18px;
 padding: 1rem;
 border: 2px solid transparent;
 display: flex;
 flex-direction: column;
 gap: 0.45rem;
 transition: background-color 0.25s ease, border-color 0.25s ease;
}

.balance-card.bottleneck {
 background: var(--coral-soft);
 border-color: var(--coral-deep);
}

.balance-card.balanced {
 background: var(--mint-soft);
 border-color: var(--mint-deep);
}

.balance-card strong {
 font-family: var(--font-display);
 font-size: 1.04rem;
}

.balance-meta {
 font-size: 0.85rem;
 font-weight: 700;
 color: var(--ink-muted);
}

.pile-bar-wrap {
 height: 10px;
 background: rgba(255, 255, 255, 0.9);
 border-radius: 999px;
 overflow: hidden;
 border: 1px solid rgba(45, 37, 66, 0.08);
}

.pile-bar-fill {
 height: 100%;
 border-radius: 999px;
 transition: width 0.35s ease;
}

.bottleneck .pile-bar-fill { background: linear-gradient(90deg, var(--coral-deep), #FF5D8F); }
.balanced .pile-bar-fill { background: linear-gradient(90deg, var(--mint-deep), #38C9A8); }

.balance-btn-row {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 0.45rem;
 margin-top: 0.35rem;
}

.mini-elf-btn {
 font-family: var(--font-display);
 font-weight: 600;
 font-size: 0.84rem;
 padding: 0.48rem 0.5rem;
 border-radius: 12px;
 border: 1.5px solid rgba(45, 37, 66, 0.12);
 background: #FFFFFF;
 color: var(--ink);
 cursor: pointer;
 transition: transform 0.14s ease, background-color 0.14s ease;
}

.mini-elf-btn:hover { transform: translateY(-1px); background: var(--cream); }
.mini-elf-btn.plus { background: var(--mint); border-color: var(--mint-deep); }
.mini-elf-btn.minus { background: var(--coral-soft); border-color: var(--coral); }

/* Split Camera Console */
.camera-split-grid {
 display: grid;
 grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
 gap: 1.25rem;
 align-items: start;
}

.camera-sidebar-info {
 display: flex;
 flex-direction: column;
 gap: 0.95rem;
}

.camera-intro {
 margin: 0;
 font-size: 0.95rem;
 color: var(--ink-muted);
}

.gesture-guide {
 display: flex;
 flex-direction: column;
 gap: 0.6rem;
}

.gesture-card {
 display: flex;
 align-items: flex-start;
 gap: 0.7rem;
 padding: 0.75rem 0.85rem;
 border-radius: 16px;
 border: 2px solid transparent;
}

.gesture-ico {
 font-size: 1.35rem;
 line-height: 1;
}

.gesture-card strong {
 display: block;
 font-family: var(--font-display);
 font-size: 0.92rem;
}

.gesture-card p {
 margin: 0.15rem 0 0;
 font-size: 0.83rem;
 color: var(--ink-muted);
 line-height: 1.35;
}

.g-swat { background: var(--coral-soft); border-color: var(--coral); }
.g-pinch { background: var(--cream); border-color: var(--cream-deep); }
.g-crate { background: var(--mint-soft); border-color: var(--mint); }

.camera-hud-stack {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 0.55rem;
}

.camera-controls-bar {
 display: flex;
 flex-direction: column;
 gap: 0.55rem;
}

.camera-controls-bar .pill-btn {
 width: 100%;
}

.camera-stage-wrap {
 position: relative;
 width: 100%;
 border-radius: 22px;
 overflow: hidden;
 border: 3px solid var(--coral);
 background: #242038;
 box-shadow: 0 16px 36px rgba(45, 37, 66, 0.16);
 aspect-ratio: 16 / 9;
}

.camera-stage-wrap.portrait-cam {
 max-width: 460px;
 margin: 0 auto;
 aspect-ratio: 3 / 4;
}

.camera-live-canvas {
 display: block;
 width: 100%;
 height: 100%;
 touch-action: none;
}

/* Certificado */
.congrats-panel {
 text-align: center;
 background: linear-gradient(155deg, #FFFFFF 0%, var(--coral-soft) 52%, var(--mint-soft) 100%);
 border: 3px solid var(--coral);
}

.congrats-ribbon {
 display: inline-block;
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 0.86rem;
 padding: 0.42rem 1rem;
 border-radius: 999px;
 background: var(--cream);
 border: 2px solid var(--coral-deep);
 color: var(--ink);
 margin-bottom: 0.75rem;
}

.congrats-panel p {
 max-width: 64ch;
 margin: 0 auto 1.15rem;
 color: var(--ink-muted);
}

.badges-row {
 display: flex;
 flex-wrap: wrap;
 justify-content: center;
 gap: 0.6rem;
 margin-bottom: 1.4rem;
}

.unit-badge {
 font-family: var(--font-display);
 font-size: 0.88rem;
 font-weight: 600;
 padding: 0.5rem 0.95rem;
 border-radius: 999px;
 background: rgba(255, 255, 255, 0.82);
 border: 2px dashed rgba(45, 37, 66, 0.22);
 color: var(--ink-muted);
 transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.unit-badge.done {
 background: linear-gradient(135deg, var(--mint), #80ED99);
 border-style: solid;
 border-color: #2EB88B;
 color: var(--ink);
 transform: scale(1.04);
 box-shadow: 0 6px 14px rgba(46, 184, 139, 0.22);
}

.learned-summary-cards {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 0.95rem;
 text-align: left;
 margin-bottom: 1.4rem;
}

.learned-item {
 border-radius: 18px;
 padding: 1.1rem;
 border: 2px solid transparent;
}

.learned-item strong {
 display: block;
 font-family: var(--font-display);
 font-size: 1rem;
 margin-bottom: 0.35rem;
}

.learned-item p {
 margin: 0;
 font-size: 0.9rem;
}

.card-coral-soft { background: rgba(255, 240, 244, 0.92); border-color: var(--coral); }
.card-sky-soft { background: rgba(238, 247, 255, 0.92); border-color: var(--sky); }
.card-mint-soft { background: rgba(237, 252, 248, 0.92); border-color: var(--mint); }

.plant-footer {
 text-align: center;
 padding: 0.8rem 1rem 1.4rem;
 font-size: 0.9rem;
 color: var(--ink-muted);
}

/* Modal Dialog */
.pastel-dialog {
 border: 3px solid var(--coral);
 border-radius: 26px;
 padding: 0;
 width: min(560px, 92vw);
 background: linear-gradient(155deg, #FFFFFF, var(--cream));
 color: var(--ink);
 box-shadow: 0 24px 60px rgba(45, 37, 66, 0.24);
}

.pastel-dialog::backdrop {
 background: rgba(45, 37, 66, 0.42);
 backdrop-filter: blur(6px);
}

.dialog-inner {
 padding: 1.6rem;
}

.dialog-head h2 {
 margin: 0.45rem 0 0.8rem;
 font-size: 1.38rem;
}

.dialog-list {
 padding-left: 1.15rem;
 margin: 0 0 1.25rem;
 display: flex;
 flex-direction: column;
 gap: 0.55rem;
 font-size: 0.94rem;
 color: var(--ink-muted);
}

.dialog-footer {
 display: flex;
 justify-content: flex-end;
}

/* Responsive Breakpoints */
@media (max-width: 1120px) {
 .camera-split-grid {
 grid-template-columns: 1fr;
 }
 .camera-controls-bar {
 flex-direction: row;
 flex-wrap: wrap;
 }
 .camera-controls-bar .pill-btn {
 flex: 1 1 180px;
 }
 .balance-grid {
 grid-template-columns: repeat(2, minmax(0, 1fr));
 }
}

@media (max-width: 960px) {
 .mobile-pill-bar {
 display: block;
 }
 .sidebar-rail {
 display: none;
 }
 .app-shell {
 grid-template-columns: 1fr;
 padding: 0.75rem 0.9rem 2.5rem;
 }
 .bento-main,
 .bento-media {
 grid-column: span 12;
 }
 .bento-stat {
 grid-column: span 4;
 }
 .theory-columns,
 .learned-summary-cards {
 grid-template-columns: 1fr;
 }
}

@media (max-width: 640px) {
 .pastel-panel,
 .bento-card {
 padding: 1.15rem;
 border-radius: 22px;
 }
 .bento-stat {
 grid-column: span 12;
 }
 .floating-deco {
 display: none;
 }
 .station-selector {
 border-radius: 20px;
 }
 .hud-wide {
 grid-column: span 1;
 }
 .physical-switches-row {
 grid-template-columns: 1fr;
 }
 .balance-grid {
 grid-template-columns: 1fr;
 }
 .camera-hud-stack {
 grid-template-columns: 1fr;
 }
}

@media (prefers-reduced-motion: reduce) {
 .enter-anim,
 [data-reveal] {
 opacity: 1 !important;
 transform: none !important;
 animation: none !important;
 transition: none !important;
 }
 .floating-deco {
 animation: none !important;
 }
}


/* =========================================================================
 PANTALLA INICIAL "TOCA AQUÍ PARA ABRIR" + MÚSICA + MATERIA PRIMA/ELAB
 ========================================================================= */
.tap-open-overlay {
 position: fixed;
 inset: 0;
 z-index: 10000;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 20px;
 background: radial-gradient(circle at 20% 20%, rgba(255, 181, 194, 0.96), rgba(189, 224, 254, 0.96) 52%, rgba(184, 242, 230, 0.96));
 backdrop-filter: blur(12px);
 transition: opacity 0.55s ease, transform 0.55s ease, visibility 0.55s ease;
}

.tap-open-overlay.is-opened {
 opacity: 0;
 transform: scale(1.06);
 visibility: hidden;
 pointer-events: none;
}

.tap-open-card {
 max-width: 480px;
 width: 100%;
 background: rgba(255, 255, 255, 0.94);
 border: 2px solid rgba(255, 143, 171, 0.35);
 border-radius: 32px;
 padding: 36px 28px;
 text-align: center;
 box-shadow: 0 24px 60px rgba(45, 37, 66, 0.16);
 animation: tapCardFloat 3.2s ease-in-out infinite;
}

@keyframes tapCardFloat {
 0%, 100% { transform: translateY(0); }
 50% { transform: translateY(-6px); }
}

.tap-open-icon {
 font-size: 3.4rem;
 margin-bottom: 10px;
 display: inline-block;
 animation: tapIconPulse 1.8s ease-in-out infinite;
}

@keyframes tapIconPulse {
 0%, 100% { transform: scale(1); }
 50% { transform: scale(1.12); }
}

.tap-open-badge {
 display: inline-block;
 padding: 6px 14px;
 border-radius: 999px;
 background: var(--coral-soft);
 color: var(--ink);
 font-size: 0.74rem;
 font-weight: 800;
 letter-spacing: 0.06em;
 margin-bottom: 12px;
}

.tap-open-title {
 margin: 0 0 10px;
 font-family: var(--font-display);
 font-size: clamp(1.55rem, 3.2vw, 2.05rem);
 color: var(--ink);
}

.tap-open-sub {
 margin: 0 0 22px;
 color: var(--ink-muted);
 font-size: 0.98rem;
 line-height: 1.5;
}

.tap-open-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 8px;
 padding: 15px 30px;
 border: none;
 border-radius: 999px;
 background: linear-gradient(135deg, #FF8FAB, #FF6B8B);
 color: #fff;
 font-family: var(--font-display);
 font-size: 1.08rem;
 font-weight: 700;
 cursor: pointer;
 box-shadow: 0 12px 26px rgba(255, 107, 139, 0.35);
 transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tap-open-btn:hover {
 transform: translateY(-2px) scale(1.03);
 box-shadow: 0 16px 32px rgba(255, 107, 139, 0.45);
}

.music-fab {
 position: fixed;
 right: 18px;
 bottom: 18px;
 z-index: 950;
 padding: 10px 16px;
 border-radius: 999px;
 border: 2px solid rgba(255, 143, 171, 0.45);
 background: rgba(255, 255, 255, 0.92);
 color: var(--ink);
 font-family: var(--font-body);
 font-weight: 800;
 font-size: 0.85rem;
 cursor: pointer;
 box-shadow: 0 10px 24px rgba(45, 37, 66, 0.14);
 backdrop-filter: blur(8px);
 transition: transform 0.2s ease, background 0.2s ease;
}

.music-fab:hover {
 transform: translateY(-2px);
 background: var(--coral-soft);
}

/* Galería Materia Prima, Preparación y Elaboración */
.stages-lead {
 margin: 0 0 22px;
 color: var(--ink-muted);
 font-size: 1rem;
 line-height: 1.55;
}

.stages-cards-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
 gap: 20px;
}

.stage-photo-card {
 background: #ffffff;
 border-radius: var(--radius-lg);
 border: 2px solid var(--border-soft);
 overflow: hidden;
 box-shadow: var(--shadow-soft);
 display: flex;
 flex-direction: column;
 transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stage-photo-card:hover {
 transform: translateY(-5px);
 box-shadow: var(--shadow-hover);
}

.stage-photo-card.stage-coral { border-color: rgba(255, 143, 171, 0.45); }
.stage-photo-card.stage-sky { border-color: rgba(138, 196, 255, 0.55); }
.stage-photo-card.stage-mint { border-color: rgba(106, 218, 194, 0.55); }

.stage-img-wrap {
 position: relative;
 width: 100%;
 aspect-ratio: 16 / 10;
 background: linear-gradient(135deg, var(--coral-soft), var(--sky-soft));
 overflow: hidden;
}

.stage-img-wrap img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 display: block;
 transition: transform 0.35s ease;
}

.stage-photo-card:hover .stage-img-wrap img:not(.is-broken) {
 transform: scale(1.05);
}

.stage-img-wrap img.is-broken {
 display: none;
}

.stage-img-wrap.is-placeholder::after {
 content: "Imagen: " attr(data-placeholder);
 position: absolute;
 inset: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 16px;
 text-align: center;
 font-weight: 700;
 font-size: 0.88rem;
 color: var(--ink-muted);
 border: 2px dashed rgba(45, 37, 66, 0.18);
 margin: 10px;
 border-radius: 14px;
}

.stage-num-badge {
 position: absolute;
 top: 12px;
 left: 12px;
 padding: 5px 12px;
 border-radius: 999px;
 background: rgba(255, 255, 255, 0.92);
 color: var(--ink);
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 0.85rem;
 box-shadow: 0 4px 12px rgba(45, 37, 66, 0.12);
}

.stage-card-body {
 padding: 18px 20px 22px;
 flex: 1;
}

.stage-card-body h3 {
 margin: 0 0 8px;
 font-family: var(--font-display);
 font-size: 1.22rem;
 color: var(--ink);
}

.stage-card-body p {
 margin: 0;
 color: var(--ink-muted);
 font-size: 0.94rem;
 line-height: 1.55;
}

/* === UPGRADED COLORFUL INTRO OVERLAY (JUGUETES) === */
.tap-open-overlay {
  background: radial-gradient(circle at 15% 20%, rgba(255, 181, 194, 0.95), transparent 50%),
              radial-gradient(circle at 85% 25%, rgba(189, 224, 254, 0.95), transparent 52%),
              radial-gradient(circle at 50% 85%, rgba(184, 242, 230, 0.96), #fff8e7 75%);
}
.tap-open-card {
  position: relative;
  overflow: hidden;
  border: 2.5px solid rgba(255, 143, 171, 0.55);
  box-shadow: 0 26px 65px rgba(255, 107, 139, 0.22), 0 8px 24px rgba(138, 196, 255, 0.2);
}
.tap-open-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 24px;
  border: 1.5px dashed rgba(138, 196, 255, 0.65);
  pointer-events: none;
}
.tap-open-badge {
  background: linear-gradient(90deg, #FFE3EC, #E6F3FF, #E3FAF4);
  color: #C93B6B;
  border: 1px solid rgba(255, 143, 171, 0.4);
}
.tap-open-title {
  font-size: clamp(1.85rem, 3.8vw, 2.45rem);
  line-height: 1.15;
  background: linear-gradient(120deg, #FF4D79 0%, #9B5DE5 48%, #00BBF9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}
.tap-open-sub {
  color: #4A3F6B;
  font-weight: 600;
}
.tap-open-btn {
  background: linear-gradient(135deg, #FF5D8F 0%, #FF8FAB 45%, #5B8DEF 100%);
  background-size: 180% 180%;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 30px rgba(255, 93, 143, 0.38);
  animation: btnShimmer 3.5s ease infinite;
}
@keyframes btnShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === REPRODUCTOR SUPERIOR DE 3 CANCIONES + GALERÍA VISUAL === */
.music-top-bar {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 980;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(45, 37, 66, 0.14);
  box-shadow: 0 10px 26px rgba(45, 37, 66, 0.13);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 700;
}
.music-top-bar[hidden] {
  display: none;
}
.music-now-label {
  color: #2D2542;
  padding-right: 4px;
  white-space: nowrap;
}
.music-track-pills {
  display: inline-flex;
  gap: 4px;
}
.music-track-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(45, 37, 66, 0.18);
  background: #f5f2f8;
  color: #2D2542;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.music-track-btn:hover {
  transform: scale(1.08);
}
.music-track-btn.active {
  background: linear-gradient(135deg, #FF6B8B, #8B5CF6);
  color: #fff;
  border-color: transparent;
}
.music-pp-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(45, 37, 66, 0.16);
  background: #fff;
  color: #2D2542;
  font-weight: 700;
  font-size: 0.76rem;
  cursor: pointer;
}
.music-pp-btn:hover {
  background: #f7f4fb;
}
@media (max-width: 640px) {
  .music-top-bar {
    top: auto;
    bottom: 14px;
    right: 12px;
    left: 12px;
    justify-content: space-between;
  }
}

.web-inspo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 22px 0 10px;
}
.web-inspo-card {
  margin: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1.5px solid rgba(45, 37, 66, 0.1);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(45, 37, 66, 0.07);
}
.web-inspo-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.web-inspo-card figcaption {
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4b425c;
  text-align: center;
}
