:root {
      --teal: #00ADBC;
      --teal-dark: #008896;
      --teal-light: #E6F8FA;
      --code-teal: #00B0BD;
      --code-teal-dark: #008994;
      --code-orange: #FFA400;
      --code-orange-dark: #D98400;
      --code-magenta: #E63F97;
      --code-magenta-dark: #BD2475;
      --code-blue: #0094CA;
      --code-blue-dark: #00729E;
      --purple: #7665A0;
      --purple-dark: #5A4982;
      --purple-light: #F2EFF9;
      --amber: #FF9F1C;
      --amber-dark: #E08200;
      --amber-light: #FFF5E6;
      --emerald: #10B981;
      --emerald-dark: #059669;
      --coral: #FF5A5F;
      --coral-dark: #DC3B40;
      --bg: #F3F8FC;
      --surface: #FFFFFF;
      --surface-alt: #F8FAFC;
      --text: #1E293B;
      --text-muted: #64748B;
      --border: #E2E8F0;
      --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
      --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
      --shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.12);
      --radius-sm: 10px;
      --radius-md: 16px;
      --radius-lg: 22px;
    }

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

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      overflow-x: hidden;
      line-height: 1.5;
    }

    h1, h2, h3, .font-display {
      font-family: 'Fredoka', 'Inter', sans-serif;
      letter-spacing: -0.01em;
    }

    .material-symbols-outlined {
      font-family: 'Material Symbols Outlined';
      font-weight: normal;
      font-style: normal;
      font-size: 20px;
      line-height: 1;
      letter-spacing: normal;
      text-transform: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      white-space: nowrap;
      word-wrap: normal;
      direction: ltr;
      width: 1em;
      height: 1em;
      overflow: hidden;
      flex-shrink: 0;
      -webkit-font-smoothing: antialiased;
      font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
      vertical-align: middle;
      user-select: none;
    }

    /* Header */
    .topbar {
      position: sticky;
      top: 0;
      z-index: 50;
      background: linear-gradient(135deg, #4338CA 0%, #0098A6 55%, #00ADBC 100%);
      color: #fff;
      box-shadow: 0 4px 18px rgba(15, 23, 42, 0.2);
    }

    .topbar-inner {
      max-width: 1320px;
      margin: 0 auto;
      padding: 9px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 9px;
      cursor: pointer;
      border: none;
      background: transparent;
      color: #fff;
      text-align: left;
      padding: 2px 4px;
      border-radius: 12px;
    }

    .brand-logo {
      width: 38px;
      height: 38px;
      background: #fff;
      border-radius: 11px;
      display: grid;
      place-items: center;
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
      flex-shrink: 0;
    }

    .brand-title { font-family: 'Fredoka', sans-serif; font-size: 1.18rem; font-weight: 700; line-height: 1.1; }
    .brand-sub { font-size: 0.7rem; opacity: 0.9; font-weight: 500; }

    .nav-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

    .nav-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: none;
      background: rgba(255, 255, 255, 0.15);
      color: #fff;
      padding: 7px 11px;
      border-radius: 999px;
      font-size: 0.81rem;
      font-weight: 600;
      cursor: pointer;
      transition: transform 0.15s, background 0.15s;
      font-family: inherit;
    }

    .nav-btn:hover { background: rgba(255, 255, 255, 0.26); transform: translateY(-1px); }
    .nav-btn.active { background: #fff; color: var(--teal-dark); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12); }

    .topbar-actions { display: flex; align-items: center; gap: 7px; }

    .pill-stat {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: rgba(15, 23, 42, 0.22);
      padding: 5px 10px;
      border-radius: 999px;
      font-size: 0.8rem;
      font-weight: 700;
      color: #fff;
    }

    .pill-stat .material-symbols-outlined { font-size: 17px; color: #FFD166; }

    .icon-btn {
      width: 36px;
      height: 36px;
      border-radius: 999px;
      border: none;
      background: rgba(255, 255, 255, 0.18);
      color: #fff;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: background 0.15s, transform 0.15s;
    }
    .icon-btn:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }

    .perf-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(15, 23, 42, 0.22);
      color: #E0F2FE;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.7rem;
      padding: 5px 9px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.18);
    }

    .perf-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }

    /* Main */
    .main { max-width: 1320px; margin: 0 auto; padding: 18px 16px 40px; }
    .view { display: none; animation: fadeIn 0.2s ease-out; }
    .view.active { display: block; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: none;
      border-radius: 11px;
      padding: 9px 16px;
      font-weight: 700;
      font-size: 0.88rem;
      cursor: pointer;
      font-family: inherit;
      transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
    }
    .btn:active { transform: translateY(1px); }
    .btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .btn-primary { background: var(--teal); color: #fff; box-shadow: 0 3px 0 var(--teal-dark); }
    .btn-primary:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
    .btn-amber { background: var(--code-orange); color: #fff; box-shadow: 0 3px 0 var(--code-orange-dark); }
    .btn-amber:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }
    .btn-emerald { background: var(--emerald); color: #fff; box-shadow: 0 3px 0 var(--emerald-dark); }
    .btn-purple { background: var(--purple); color: #fff; box-shadow: 0 3px 0 var(--purple-dark); }
    .btn-coral { background: var(--coral); color: #fff; box-shadow: 0 3px 0 var(--coral-dark); }
    .btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); box-shadow: 0 2px 0 var(--border); }
    .btn-ghost:hover:not(:disabled) { background: var(--surface-alt); }
    .btn-sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 9px; }

    /* Hub Hero */
    .hero-card {
      background: linear-gradient(135deg, #1E1B4B 0%, #312E81 48%, #0F766E 100%);
      color: #fff;
      border-radius: var(--radius-lg);
      padding: 26px;
      display: grid;
      grid-template-columns: 1.3fr 1fr;
      gap: 22px;
      align-items: center;
      box-shadow: var(--shadow-lg);
      margin-bottom: 22px;
    }
    .hero-badge {
      display: inline-flex; align-items: center; gap: 6px;
      background: rgba(255,255,255,0.16); padding: 5px 12px;
      border-radius: 999px; font-size: 0.78rem; font-weight: 600; margin-bottom: 10px;
    }
    .hero-title { font-size: clamp(1.55rem, 2.8vw, 2.2rem); line-height: 1.15; margin-bottom: 10px; }
    .hero-desc { font-size: 0.94rem; color: #E2E8F0; margin-bottom: 16px; max-width: 540px; }
    .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    .hero-visual {
      background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
      border-radius: 16px; padding: 15px; display: flex; flex-direction: column; gap: 11px;
    }
    .hero-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .mini-stat-box { background: rgba(15,23,42,0.35); border-radius: 11px; padding: 9px; text-align: center; }
    .mini-stat-val { font-family: 'Fredoka', sans-serif; font-size: 1.3rem; font-weight: 700; color: #FFD166; }
    .mini-stat-lbl { font-size: 0.7rem; color: #CBD5E1; }

    .section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
    .section-title { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }

    .games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); gap: 16px; margin-bottom: 24px; }
    .game-card {
      background: var(--surface); border-radius: var(--radius-md); border: 1.5px solid var(--border);
      overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
      transition: transform 0.18s, box-shadow 0.18s;
    }
    .game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
    .game-banner { height: 120px; position: relative; display: flex; align-items: center; justify-content: center; padding: 14px; }
    .banner-typing { background: linear-gradient(135deg, #00ADBC 0%, #2EC4B6 100%); }
    .banner-arcade { background: linear-gradient(135deg, #312E81 0%, #7C3AED 100%); }
    .banner-maze   { background: linear-gradient(135deg, #059669 0%, #00B0BD 100%); }
    .banner-artist { background: linear-gradient(135deg, #EA580C 0%, #FF9F1C 100%); }
    .game-tag { position: absolute; top: 9px; left: 9px; background: rgba(15,23,42,0.3); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
    .game-stars-badge { position: absolute; top: 9px; right: 9px; background: rgba(255,255,255,0.94); color: #B45309; font-size: 0.74rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; }
    .game-stars-badge .material-symbols-outlined { font-size: 14px; color: #F59E0B; }
    .game-body { padding: 15px; display: flex; flex-direction: column; flex: 1; gap: 7px; }
    .game-body h3 { font-size: 1.1rem; }
    .game-body p { font-size: 0.85rem; color: var(--text-muted); flex: 1; }
    .skill-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 3px 0 7px; }
    .chip { font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

    .badges-panel { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); }
    .badges-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 10px; margin-top: 12px; }
    .badge-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface-alt); opacity: 0.52; filter: grayscale(0.8); }
    .badge-item.unlocked { opacity: 1; filter: none; background: #FFFBEB; border-color: #FCD34D; }
    .badge-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--teal-light); color: var(--teal-dark); display: grid; place-items: center; flex-shrink: 0; }
    .badge-item.unlocked .badge-icon { background: #FEF3C7; color: #D97706; }
    .badge-name { font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
    .badge-req { font-size: 0.7rem; color: var(--text-muted); }

    .panel { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 16px; }
    .toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
    .level-pills { display: flex; gap: 6px; flex-wrap: wrap; }
    .level-pill {
      border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
      padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
      cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all 0.15s;
    }
    .level-pill:hover { border-color: var(--teal); color: var(--teal-dark); }
    .level-pill.active { background: var(--teal); color: #fff; border-color: var(--teal); }
    .level-pill.done { border-color: var(--emerald); }

    /* ================= CODE.ORG BLOCKLY STUDIO (30 LESSONS) ================= */
    .codeorg-header {
      background: #4F46E5;
      color: #fff;
      border-radius: 14px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .module-select {
      background: rgba(255,255,255,0.16);
      color: #fff;
      border: 1.5px solid rgba(255,255,255,0.3);
      border-radius: 10px;
      padding: 6px 10px;
      font-weight: 700;
      font-size: 0.84rem;
      font-family: inherit;
      cursor: pointer;
    }
    .module-select option { color: #1E293B; background: #fff; }

    .stepper-bar {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 5px;
      background: #fff;
      padding: 5px 10px;
      border-radius: 999px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

    .step-bubble {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 2px solid #CBD5E1;
      background: #fff;
      color: #64748B;
      font-weight: 800;
      font-size: 0.8rem;
      cursor: pointer;
      display: grid;
      place-items: center;
      transition: all 0.15s;
    }
    .step-bubble:hover { border-color: var(--teal); color: var(--teal-dark); }
    .step-bubble.done { background: #10B981; border-color: #059669; color: #fff; }
    .step-bubble.active {
      width: 32px; height: 32px;
      background: #fff; color: #1E293B;
      border: 3px solid #FFA400;
      box-shadow: 0 0 0 2px rgba(255, 164, 0, 0.25);
    }
    .step-bubble.done.active { background: #10B981; color: #fff; border-color: #FFA400; }

    .instruction-strip {
      background: #F8FAFC;
      border: 1.5px solid #CBD5E1;
      border-radius: 14px;
      padding: 12px 14px;
      margin-bottom: 12px;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .instr-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 240px; }
    .instr-avatar {
      width: 44px; height: 44px; border-radius: 12px;
      background: #E6F8FA; border: 2px solid var(--code-teal);
      display: grid; place-items: center; flex-shrink: 0;
    }
    .instr-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; align-items: center; }
    .concept-pill {
      font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
      background: #EDE9FE; color: #5B21B6;
    }
    .purpose-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }
    .goal-text { font-size: 0.95rem; font-weight: 700; color: var(--text); }

    .codeorg-grid {
      display: grid;
      grid-template-columns: minmax(310px, 410px) 1fr;
      gap: 14px;
      align-items: start;
    }

    .stage-box { height: 390px; }

    .word-hud {
      display: none;
      margin-top: 10px;
      background: #F8FAFC;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 10px 14px;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
    }
    .word-hud.show { display: flex; }
    .word-box {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 800;
      font-size: 1.05rem;
      letter-spacing: 0.12em;
      padding: 6px 14px;
      border-radius: 8px;
      min-width: 110px;
      text-align: center;
    }
    .word-target { background: #fff; border: 2px solid #10B981; color: #065F46; }
    .word-typed { background: #10B981; color: #fff; }

    /* Code.org Workspace Header & Jigsaw Blocks */
    .ws-container {
      border: 1.5px solid #CBD5E1;
      border-radius: 14px;
      overflow: hidden;
      background: #FFFFFF;
      box-shadow: var(--shadow-sm);
    }

    .ws-topbar {
      background: #1E293B;
      color: #fff;
      padding: 8px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      font-size: 0.82rem;
      font-weight: 700;
    }

    .ws-budget {
      background: rgba(255,255,255,0.14);
      padding: 3px 10px;
      border-radius: 999px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.78rem;
    }
    .ws-budget.over { background: #DC2626; color: #fff; }
    .ws-budget.ok { background: #059669; color: #fff; }

    .ws-body {
      display: grid;
      grid-template-columns: 186px 1fr;
      min-height: 410px;
    }

    .ws-toolbox {
      background: #E2E8F0;
      padding: 12px 10px;
      border-right: 1.5px solid #CBD5E1;
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: flex-start;
    }

    .ws-canvas {
      background-color: #FFFFFF;
      background-image: radial-gradient(#E2E8F0 1px, transparent 1px);
      background-size: 16px 16px;
      padding: 14px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      max-height: 450px;
      overflow-y: auto;
    }

    /* Authentic Code.org Interlocking Jigsaw Blocks */
    .b-block {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 12px;
      min-width: 146px;
      border-radius: 6px;
      color: #fff;
      font-weight: 700;
      font-size: 0.84rem;
      font-family: inherit;
      cursor: grab;
      user-select: none;
      border: none;
      box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), 0 2px 4px rgba(15,23,42,0.14);
      transition: transform 0.1s, filter 0.12s;
    }
    .b-block:hover { filter: brightness(1.06); }
    .b-block:active { cursor: grabbing; }

    /* Bottom puzzle tab */
    .b-block.has-notch::after {
      content: '';
      position: absolute;
      left: 16px;
      bottom: -6px;
      width: 18px;
      height: 6px;
      background: inherit;
      border-radius: 0 0 4px 4px;
      z-index: 3;
    }

    /* Top puzzle slot indicator */
    .b-block.has-slot::before {
      content: '';
      position: absolute;
      left: 16px;
      top: 0;
      width: 18px;
      height: 5px;
      background: rgba(15, 23, 42, 0.22);
      border-radius: 0 0 4px 4px;
    }

    .b-hat {
      background: var(--code-orange);
      border-radius: 18px 18px 6px 6px;
      padding: 9px 15px;
      cursor: default;
      margin-bottom: 1px;
    }

    .b-teal { background: var(--code-teal); }
    .b-teal-cardinal {
      background: var(--code-teal);
      min-width: 112px;
      padding: 8px 12px;
      font-size: 0.95rem;
    }
    .b-magenta { background: var(--code-magenta); }
    .b-blue { background: var(--code-blue); }

    .b-stack {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      width: 100%;
    }

    .b-node {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      margin-top: 1px;
      position: relative;
    }

    .b-node.running > .b-block,
    .b-node.running > .b-c-wrap > .b-c-head {
      outline: 3px solid #FACC15;
      box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.42);
      z-index: 5;
    }

    /* Closed C-Shaped & E-Shaped Frame Blocks (Loop / While / If / If-Else) */
    .b-while { background: #7C3AED; }

    .b-c-wrap {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      min-width: 235px;
      border-radius: 8px;
      box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
    }

    .b-c-head {
      border-radius: 7px 7px 0 0;
      width: 100%;
    }

    .b-c-body {
      margin-left: 0;
      padding: 6px 10px 8px 14px;
      border-left: 15px solid var(--code-magenta);
      border-right: 4px solid var(--code-magenta);
      min-height: 44px;
      width: 100%;
      background: #FDF2F8;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 1px;
    }

    .b-c-wrap.is-if .b-c-body {
      border-left-color: var(--code-blue);
      border-right-color: var(--code-blue);
      background: #F0F9FF;
    }

    .b-c-wrap.is-while .b-c-body {
      border-left-color: #7C3AED;
      border-right-color: #7C3AED;
      background: #F5F3FF;
    }

    .b-c-mid {
      width: 100%;
      padding: 5px 12px;
      background: var(--code-blue);
      color: #fff;
      font-weight: 800;
      font-size: 0.8rem;
      display: flex;
      align-items: center;
      gap: 6px;
      box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14);
    }

    .b-c-foot {
      height: 18px;
      width: 100%;
      background: var(--code-magenta);
      border-radius: 0 0 7px 7px;
      position: relative;
      box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
      display: flex;
      align-items: center;
      padding-left: 18px;
      font-size: 0.65rem;
      font-weight: 800;
      color: rgba(255,255,255,0.8);
      letter-spacing: 0.04em;
    }
    .b-c-wrap.is-if .b-c-foot { background: var(--code-blue); }
    .b-c-wrap.is-while .b-c-foot { background: #7C3AED; }

    /* Between-block drag-and-drop insertion slots */
    .drop-slot {
      width: 100%;
      min-width: 160px;
      height: 8px;
      margin: 1px 0;
      border-radius: 6px;
      transition: height 0.12s, background 0.12s, outline 0.12s;
      position: relative;
      z-index: 4;
    }
    .ws-canvas.dragging-active .drop-slot {
      height: 14px;
      background: rgba(255, 164, 0, 0.14);
      border: 1.5px dashed rgba(255, 164, 0, 0.5);
    }
    .drop-slot.slot-over {
      height: 22px !important;
      background: #FFA400 !important;
      border: 2px solid #FFF7ED !important;
      box-shadow: 0 0 0 3px rgba(255, 164, 0, 0.35);
    }
    .b-c-foot::after {
      content: '';
      position: absolute;
      left: 16px;
      bottom: -6px;
      width: 18px;
      height: 6px;
      background: inherit;
      border-radius: 0 0 4px 4px;
      z-index: 3;
    }

    .c-target-pill {
      margin-top: 4px;
      border: 1.5px dashed rgba(100,116,139,0.55);
      background: rgba(255,255,255,0.85);
      color: #475569;
      border-radius: 7px;
      padding: 3px 8px;
      font-size: 0.72rem;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .c-target-pill.active-target {
      background: #1E293B;
      color: #fff;
      border-color: #1E293B;
      border-style: solid;
    }

    .drop-highlight {
      outline: 2.5px dashed #FFA400 !important;
      background: rgba(255, 164, 0, 0.12) !important;
    }

    .blk-select {
      background: rgba(255, 255, 255, 0.94);
      color: #1E293B;
      border: none;
      border-radius: 5px;
      padding: 2px 5px;
      font-weight: 800;
      font-size: 0.78rem;
      font-family: inherit;
      cursor: pointer;
    }

    .block-controls { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
    .blk-mini-btn {
      width: 21px; height: 21px; border-radius: 5px; border: none;
      background: rgba(255,255,255,0.22); color: #fff;
      display: grid; place-items: center; cursor: pointer; padding: 0;
    }
    .blk-mini-btn:hover { background: rgba(255,255,255,0.4); }
    .blk-mini-btn .material-symbols-outlined { font-size: 14px; }

    .empty-drop {
      margin-top: 8px;
      border: 2px dashed #CBD5E1;
      border-radius: 10px;
      padding: 18px 14px;
      text-align: center;
      color: var(--text-muted);
      font-size: 0.82rem;
      width: 100%;
    }

    /* Typing & Arcade & Artist styles (preserved) */
    .typing-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
    .metric-card { background: var(--surface-alt); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; }
    .metric-card .material-symbols-outlined { font-size: 22px; color: var(--teal); }
    .metric-val { font-family: 'Fredoka', sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1.1; }
    .metric-lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

    .typing-prompt-box {
      background: #0F172A; color: #F8FAFC; border-radius: 14px; padding: 18px 20px;
      font-family: 'JetBrains Mono', monospace; font-size: clamp(1.1rem, 2.2vw, 1.55rem);
      letter-spacing: 0.04em; line-height: 1.75; margin-bottom: 12px; min-height: 98px;
      display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 1px; cursor: text;
    }
    .t-char { padding: 2px 3px; border-radius: 5px; white-space: pre; }
    .t-char.done { color: #4ADE80; }
    .t-char.current { background: #00ADBC; color: #fff; box-shadow: 0 0 0 2px rgba(0,173,188,0.45); }
    .t-char.wrong { background: #EF4444; color: #fff; }

    .finger-banner {
      display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
      background: var(--teal-light); border: 1.5px solid #B2EBF2; border-radius: 12px; padding: 9px 14px; margin-bottom: 14px;
    }
    .finger-hint-text { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; font-weight: 700; color: var(--teal-dark); }
    .finger-dot-lg { width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; }

    .kb-wrap { background: #E2E8F0; border-radius: 14px; padding: 11px; display: flex; flex-direction: column; gap: 6px; user-select: none; }
    .kb-row { display: flex; justify-content: center; gap: 5px; }
    .kb-key {
      min-width: 30px; flex: 1; max-width: 56px; height: 44px; border-radius: 8px; border: none;
      background: #fff; color: var(--text); font-weight: 800; font-size: 0.88rem;
      display: flex; align-items: center; justify-content: center; cursor: pointer;
      box-shadow: 0 3px 0 #CBD5E1; border-bottom: 3px solid var(--key-color, #CBD5E1); position: relative;
    }
    .kb-key.wide { max-width: 240px; flex: 4.5; }
    .kb-key.home-bump::after { content: ''; width: 10px; height: 2.5px; border-radius: 2px; background: var(--text-muted); position: absolute; bottom: 5px; }
    .kb-key.target { background: var(--key-color, var(--teal)); color: #fff; transform: translateY(-2px) scale(1.05); z-index: 2; }
    .kb-key.pressed { transform: translateY(2px); }
    .kb-key.err-flash { background: #EF4444 !important; color: #fff !important; }
    .hands-svg-wrap { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 10px; flex-wrap: wrap; }

    .canvas-stage-wrap {
      position: relative; width: 100%; border-radius: 14px; overflow: hidden;
      background: #0B1120; border: 2px solid var(--border); box-shadow: var(--shadow-md);
    }
    .canvas-stage-wrap canvas { display: block; width: 100%; height: 100%; }
    .arcade-stage { height: 400px; }
    .arcade-overlay-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
    .arcade-input-row { display: flex; gap: 8px; flex: 1; min-width: 220px; max-width: 420px; }
    .arcade-input { flex: 1; border: 2px solid var(--border); border-radius: 11px; padding: 9px 13px; font-family: 'JetBrains Mono', monospace; font-size: 0.96rem; font-weight: 700; outline: none; }
    .arcade-input:focus { border-color: var(--teal); }

    .studio-grid { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
    .workspace-shell { display: grid; grid-template-columns: 180px 1fr; gap: 12px; background: #F1F5F9; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px; min-height: 390px; }
    .toolbox-col { display: flex; flex-direction: column; gap: 8px; border-right: 1.5px dashed #CBD5E1; padding-right: 10px; }
    .col-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
    .code-block {
      display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px;
      border-radius: 9px; color: #fff; font-weight: 700; font-size: 0.81rem; cursor: pointer;
      border: none; width: 100%; text-align: left; font-family: inherit; box-shadow: 0 3px 0 rgba(0,0,0,0.2);
    }
    .blk-move { background: #2563EB; }
    .blk-turn { background: #0284C7; }
    .blk-paint { background: #EA580C; }
    .blk-loop { background: #9333EA; }
    .blk-start { background: #F59E0B; border-radius: 14px 14px 9px 9px; cursor: default; pointer-events: none; }
    .program-col { display: flex; flex-direction: column; gap: 6px; }
    .program-list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow-y: auto; padding-right: 4px; }
    .loop-children { margin-left: 14px; padding: 4px 0 4px 10px; border-left: 4px solid #9333EA; display: flex; flex-direction: column; gap: 5px; background: rgba(147,51,234,0.06); border-radius: 0 9px 9px 0; }
    .loop-target-btn { border: 1.5px dashed #A855F7; background: rgba(168,85,247,0.08); color: #6B21A8; border-radius: 7px; padding: 4px 8px; font-size: 0.73rem; font-weight: 700; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 4px; }
    .loop-target-btn.selected-target { background: #9333EA; color: #fff; border-style: solid; }

    /* Modal & Documentation Table */
    .modal-backdrop {
      position: fixed; inset: 0; background: rgba(15, 23, 42, 0.58); backdrop-filter: blur(3px);
      display: none; align-items: center; justify-content: center; z-index: 100; padding: 14px;
    }
    .modal-backdrop.open { display: flex; }
    .modal-box {
      background: #fff; border-radius: 18px; max-width: 540px; width: 100%; max-height: 88vh;
      overflow-y: auto; padding: 22px; box-shadow: var(--shadow-lg);
    }
    .modal-box.wide { max-width: 920px; }

    .doc-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 10px; }
    .doc-table th, .doc-table td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
    .doc-table th { background: #F1F5F9; font-weight: 800; color: var(--text); position: sticky; top: 0; }
    .doc-table tr:hover td { background: #F8FAFC; }

    .code-pre {
      background: #0F172A; color: #E2E8F0; padding: 13px; border-radius: 11px;
      font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; overflow-x: auto;
      margin: 10px 0; line-height: 1.55; white-space: pre;
    }

    .toast {
      position: fixed; bottom: 18px; right: 18px; background: #1E293B; color: #fff;
      padding: 10px 15px; border-radius: 11px; font-size: 0.84rem; font-weight: 600;
      display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg);
      opacity: 0; transform: translateY(12px); pointer-events: none; transition: all 0.2s; z-index: 120;
    }
    .toast.show { opacity: 1; transform: translateY(0); }

    .stars-row { display: flex; justify-content: center; gap: 8px; margin: 10px 0 12px; }
    .stars-row .material-symbols-outlined { font-size: 38px; color: #E2E8F0; }
    .stars-row .material-symbols-outlined.lit { color: #F59E0B; }

    @media (max-width: 980px) {
      .hero-card, .codeorg-grid, .studio-grid { grid-template-columns: 1fr; }
      .stage-box { height: 340px; }
    }
    @media (max-width: 680px) {
      .ws-body, .workspace-shell { grid-template-columns: 1fr; }
      .ws-toolbox, .toolbox-col { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1.5px dashed #CBD5E1; }
      .perf-badge { display: none; }
    }

    /* BNCC Marketing Section */
    .bncc-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 16px;
      margin: 18px 0 24px;
    }
    .bncc-card {
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .bncc-icon-box {
      width: 44px; height: 44px; border-radius: 12px;
      display: grid; place-items: center; color: #fff;
    }
    .bncc-card h3 { font-size: 1.05rem; }
    .bncc-card p { font-size: 0.84rem; color: var(--text-muted); }

    /* Auth & Account Controls */
    .user-chip {
      display: inline-flex; align-items: center; gap: 6px;
      background: rgba(255,255,255,0.2); color: #fff;
      padding: 5px 11px; border-radius: 999px;
      font-size: 0.78rem; font-weight: 700; border: 1px solid rgba(255,255,255,0.28);
      cursor: pointer;
    }
    .user-chip:hover { background: rgba(255,255,255,0.3); }

    .auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
    .auth-input {
      width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
      padding: 10px 12px; font-size: 0.9rem; font-family: inherit; outline: none;
    }
    .auth-input:focus { border-color: var(--teal); }
    .auth-divider {
      display: flex; align-items: center; gap: 10px; color: var(--text-muted);
      font-size: 0.78rem; font-weight: 600; margin: 12px 0;
    }
    .auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

    /* Admin Panel */
    .admin-kpi-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 12px; margin-bottom: 18px;
    }
    .admin-kpi {
      background: var(--surface-alt); border: 1.5px solid var(--border);
      border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 12px;
    }
    .admin-kpi-val { font-family: 'Fredoka', sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
    .admin-kpi-lbl { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

    .switch-btn {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 10px; border-radius: 999px; border: none;
      font-size: 0.76rem; font-weight: 800; cursor: pointer;
    }
    .switch-btn.free { background: #D1FAE5; color: #065F46; }
    .switch-btn.paid { background: #FEE2E2; color: #991B1B; }

    .lock-badge {
      position: absolute; top: -5px; right: -5px;
      width: 16px; height: 16px; border-radius: 50%;
      background: #EF4444; color: #fff; font-size: 11px;
      display: grid; place-items: center;
    }
    .step-bubble { position: relative; }


    .modal-box.fullscreen-doc {
      max-width: 96vw;
      width: 96vw;
      height: 92vh;
      max-height: 92vh;
      display: flex;
      flex-direction: column;
      padding: 20px 24px;
    }
    .doc-scroll-area {
      flex: 1;
      overflow-y: auto;
      margin-top: 8px;
      border: 1px solid var(--border);
      border-radius: 12px;
    }
    .bncc-code-badge {
      display: inline-block;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.72rem;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: 6px;
      background: #DBEAFE;
      color: #1E40AF;
      margin: 2px 3px 2px 0;
    }
    .mod-doc-banner {
      background: #F0F9FF;
      border: 1.5px solid #BAE6FD;
      border-radius: 12px;
      padding: 12px 14px;
      margin: 8px 0;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      font-size: 0.84rem;
    }
