    :root {
      --bg: #0B0C0F;
      --panel: #14161A;
      --panel-strong: #181A1F;
      --panel-blur: #101216;
      --border: rgba(255, 255, 255, 0.08);
      --border-strong: rgba(255, 255, 255, 0.14);
      --text: #EAECEF;
      --dim: #8E959F;
      --xp-color: #7E93B8;
      --streak-color: #D9A23C;
      --hp-color: #D3655A;
      --mana-color: #3EA57F;
      --accent: #D9A23C;
      --accent-strong: #E4B55E;
      --accent-glow: rgba(217, 162, 60, 0.10);
      --green-glow: rgba(62, 165, 127, 0.10);
      --blue-glow: rgba(94, 143, 203, 0.10);
      --cta-color: #D3655A;
      --cta-color-strong: #B94A40;
      --mana-orb-color: #5E8FCB;
      --font-ui: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
      --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: var(--font-ui);
    }

    body {
      background: var(--bg);
      color: var(--text);
      overflow-x: hidden;
      padding-bottom: 90px;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      user-select: none;
      -webkit-user-select: none;
      font-size: 14px;
      line-height: 1.5;
    }

    a { color: var(--accent); text-decoration: none; }
    a:hover { color: var(--accent-strong); text-decoration: underline; }

    /* Inline line icons */
    svg.ic {
      width: 1.1em;
      height: 1.1em;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      vertical-align: -0.16em;
      flex-shrink: 0;
    }

    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

    /* Top Sticky HUD */
    .top-hud {
      position: sticky;
      top: 0;
      background: rgba(11, 12, 15, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      padding: 10px 20px;
      z-index: 100;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .hud-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .logo-area {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
    }

    #hud-logo, .knot-logo-img {
      width: 30px;
      height: 30px;
      object-fit: contain;
    }

    .brand-name {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.4px;
      color: var(--text);
    }

    .brand-name span { color: var(--accent); }

    .hud-stats {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .stat-capsule {
      display: flex;
      align-items: center;
      gap: 7px;
      background: rgba(255, 255, 255, 0.03);
      padding: 6px 12px;
      border-radius: 8px;
      font-size: 12.5px;
      font-weight: 600;
      border: 1px solid var(--border);
      transition: border-color 0.15s ease, background 0.15s ease;
    }
    .stat-capsule:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.05); }

    .audio-toggle {
      background: none;
      border: 1px solid transparent;
      border-radius: 8px;
      color: var(--dim);
      cursor: pointer;
      font-size: 15px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 6px;
      transition: color 0.15s, border-color 0.15s;
    }
    .audio-toggle:hover { color: var(--text); border-color: var(--border); }

    .xp-bar-container {
      background: rgba(255, 255, 255, 0.06);
      height: 3px;
      border-radius: 2px;
      width: 100%;
      position: relative;
    }

    .xp-bar-fill {
      height: 100%;
      width: 0%;
      max-width: 100%;
      border-radius: 2px;
      background: var(--accent);
      transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Main Container */
    .app-container {
      max-width: 640px;
      width: 100%;
      margin: 0 auto;
      padding: 20px 16px;
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    .hero-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 24px;
      display: grid;
      gap: 14px;
      margin-bottom: 20px;
    }

    .hero-kicker {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: var(--accent);
    }

    .hero-title {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.3px;
      line-height: 1.25;
      color: var(--text);
    }

    .hero-subtitle {
      font-size: 13.5px;
      line-height: 1.6;
      color: var(--dim);
    }

    .hero-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

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

    .hero-metric {
      background: rgba(255, 255, 255, 0.025);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px;
      text-align: center;
    }

    .hero-metric-value {
      font-family: var(--font-mono);
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
    }

    .hero-metric-label {
      font-size: 10.5px;
      letter-spacing: 0.3px;
      text-transform: uppercase;
      color: var(--dim);
      margin-top: 3px;
      font-weight: 600;
    }

    .roadmap-list {
      display: grid;
      gap: 8px;
      margin: 6px 0 14px;
    }

    .roadmap-item {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
      color: var(--dim);
      font-size: 13px;
      line-height: 1.5;
    }

    .metric-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      padding: 3px 8px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      color: var(--accent);
      background: rgba(217, 162, 60, 0.08);
      border: 1px solid rgba(217, 162, 60, 0.22);
      white-space: nowrap;
    }

    h2 {
      font-size: 17px;
      font-weight: 700;
      letter-spacing: -0.2px;
      color: var(--text);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 9px;
      flex-shrink: 0;
    }
    h2 svg.ic { color: var(--accent); width: 1em; height: 1em; }

    /* Track / Course Cards */
    .track-grid, .course-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
      animation: fadeIn 0.3s ease-out;
    }

    .track-card, .course-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 18px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      transition: border-color 0.15s ease, background 0.15s ease;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .track-card::before, .course-card::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      width: 3px;
      background: var(--track-color, var(--accent));
      opacity: 0.55;
      transition: opacity 0.15s;
    }

    .track-card:hover, .course-card:hover {
      border-color: var(--border-strong);
      background: var(--panel-strong);
    }

    .track-card:hover::before, .course-card:hover::before { opacity: 1; }

    .track-header, .course-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
    }

    .track-title, .course-title {
      font-weight: 600;
      font-size: 14.5px;
      color: var(--text);
      line-height: 1.4;
    }

    .track-desc, .course-desc {
      font-size: 12.5px;
      color: var(--dim);
      line-height: 1.5;
    }

    .progress-bar-container {
      height: 3px;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 2px;
      overflow: hidden;
      width: 100%;
      margin-top: 6px;
    }

    .progress-bar-fill {
      height: 100%;
      width: 0%;
      background: var(--mana-color);
      transition: width 0.4s ease;
    }

    .breadcrumbs {
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 500;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      color: var(--dim);
      margin-bottom: 6px;
    }

    /* Level Graph View */
    .level-view {
      animation: fadeIn 0.3s ease-out;
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .back-btn {
      background: none;
      border: 1px solid var(--border);
      color: var(--dim);
      padding: 9px 16px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 16px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      min-height: 40px;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
    }

    .back-btn:hover {
      color: var(--text);
      border-color: var(--border-strong);
      background: rgba(255, 255, 255, 0.03);
    }

    /* Content Blocks */
    .content-block {
      background: rgba(255, 255, 255, 0.015);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      margin-bottom: 12px;
      transition: border-color 0.15s ease;
    }
    .content-block:hover { border-color: var(--border-strong); }
    .content-block.block-exam {
      border: 1px dashed rgba(217, 162, 60, 0.35);
      background: rgba(217, 162, 60, 0.03);
    }
    .content-block.block-exam:hover { border-color: rgba(217, 162, 60, 0.6); }
    .content-block.block-trap {
      border-color: rgba(138, 107, 176, 0.4);
      background: rgba(138, 107, 176, 0.04);
    }
    .content-block.block-trap:hover { border-color: rgba(138, 107, 176, 0.7); }
    .content-block.block-analogy {
      border-color: rgba(94, 143, 203, 0.35);
      background: rgba(94, 143, 203, 0.04);
    }
    .content-block.block-analogy:hover { border-color: rgba(94, 143, 203, 0.55); }
    .content-block.block-roles {
      border-color: rgba(62, 165, 127, 0.35);
      background: rgba(62, 165, 127, 0.04);
    }
    .content-block.block-roles:hover { border-color: rgba(62, 165, 127, 0.55); }
    .content-block.block-penalty {
      border-color: rgba(206, 91, 80, 0.4);
      background: rgba(206, 91, 80, 0.04);
    }
    .content-block.block-penalty:hover { border-color: rgba(206, 91, 80, 0.65); }

    .block-lbl {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      margin-bottom: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      padding-bottom: 5px;
    }

    .content-block ul {
      margin-left: 18px;
      margin-top: 4px;
      margin-bottom: 4px;
      list-style-type: disc;
    }
    .content-block li {
      margin-bottom: 5px;
      line-height: 1.5;
      font-size: 13.5px;
      color: #C4C9D0;
    }
    .content-block p {
      margin-bottom: 6px;
      line-height: 1.55;
      font-size: 13.5px;
      color: #C4C9D0;
    }

    /* Notes Selectors */
    .notes-selector-bar {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 12px;
      margin-bottom: 20px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 14px;
    }
    .notes-select-wrapper {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    select {
      width: 100%;
      border-radius: 8px;
      background-color: var(--bg);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 10px 32px 10px 12px;
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      min-height: 42px;
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238E959F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: calc(100% - 12px) center;
      transition: border-color 0.15s;
    }
    select:hover { border-color: var(--border-strong); }
    select:focus { outline: none; border-color: var(--accent); }
    select option { background: var(--bg); color: var(--text); }

    /* Level Graph */
    .graph-container {
      background: var(--panel-blur);
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
      background-size: 24px 24px;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 32px 24px;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 36px;
      overflow-y: auto;
      max-height: 56vh;
    }

    .node-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      z-index: 2;
      transition: all 0.25s ease;
    }
    .node-item.pos-center { align-self: center; }
    .node-item.pos-right { align-self: center; transform: translateX(65px); }
    .node-item.pos-left { align-self: center; transform: translateX(-65px); }

    .connection-path-under {
      fill: none;
      stroke: rgba(255, 255, 255, 0.05);
      stroke-width: 6;
      stroke-linecap: round;
    }
    .connection-path-under.unlocked {
      stroke: var(--track-color, rgba(94, 143, 203, 0.3));
      stroke-width: 7;
      filter: blur(2px);
      opacity: 0.35;
    }
    .connection-path-under.completed {
      stroke: rgba(62, 165, 127, 0.15);
      stroke-width: 7;
      filter: blur(2px);
    }

    .connection-path-over {
      fill: none;
      stroke: var(--border);
      stroke-width: 2;
      stroke-linecap: round;
      transition: stroke 0.3s, stroke-width 0.3s;
    }
    .connection-path-over.unlocked { stroke: var(--track-color, var(--xp-color)); stroke-width: 2.5; }
    .connection-path-over.completed { stroke: var(--mana-color); stroke-width: 2.5; }

    .connections-svg {
      position: absolute;
      top: 0; left: 0;
      width: 100%; height: 100%;
      pointer-events: none;
      z-index: 1;
    }

    .connection-line {
      stroke: var(--border);
      stroke-width: 2.5;
      stroke-dasharray: 6 4;
      fill: none;
      transition: stroke 0.3s, stroke-width 0.3s;
    }
    .connection-line.unlocked { stroke: var(--xp-color); stroke-width: 3; stroke-dasharray: none; }
    .connection-line.completed { stroke: var(--mana-color); stroke-width: 3; stroke-dasharray: none; }

    .node-item {
      position: relative;
      z-index: 5;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      width: 100px;
      text-align: center;
    }

    .node-circle {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: var(--panel-strong);
      border: 2px solid var(--border-strong);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      cursor: pointer;
      position: relative;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .node-circle::after {
      content: '';
      position: absolute;
      inset: -6px;
      border-radius: 50%;
      border: 2px solid transparent;
      transition: all 0.25s;
    }

    .node-item.locked .node-circle { opacity: 0.45; cursor: not-allowed; }

    .node-item.unlocked .node-circle {
      border-color: var(--track-color, var(--xp-color));
    }
    .node-item.unlocked .node-circle::after {
      border-color: var(--track-color, var(--xp-color));
      animation: pulseOutline 2s infinite;
    }

    .node-item.completed .node-circle {
      border-color: var(--mana-color);
      background: rgba(62, 165, 127, 0.15);
      color: var(--mana-color);
    }

    .node-item.active-level .node-circle {
      border-color: var(--track-color, var(--accent));
    }
    .node-item.active-level .node-circle::after {
      border-color: var(--track-color, var(--accent));
      animation: pulseOutline 1.5s infinite;
    }

    .node-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--dim);
      max-width: 140px;
      line-height: 1.35;
    }

    .node-item.unlocked .node-label,
    .node-item.completed .node-label { color: var(--text); }

    /* Active Workspace */
    .card-arena {
      display: flex;
      flex-direction: column;
      gap: 16px;
      animation: slideUp 0.3s ease-out;
      flex: 1;
    }

    .micro-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 26px;
      min-height: 280px;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      position: relative;
    }

    .card-header-badge {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 10px;
    }

    .blbl {
      display: block;
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 8px;
    }

    .card-title {
      font-size: 19px;
      font-weight: 700;
      letter-spacing: -0.2px;
      margin-bottom: 6px;
      color: var(--text);
      line-height: 1.35;
    }

    .card-subtitle {
      font-size: 13px;
      line-height: 1.5;
      color: var(--accent);
      margin-bottom: 12px;
      font-weight: 600;
    }

    .card-body {
      font-size: 14px;
      line-height: 1.65;
      color: #C4C9D0;
    }

    .card-body h3 {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      color: var(--accent);
      margin-top: 18px;
      margin-bottom: 6px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 5px;
    }

    .card-body ul { margin-left: 18px; margin-top: 6px; margin-bottom: 10px; }
    .card-body li { margin-bottom: 6px; }

    .choice-box {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 16px;
    }

    .gamified-btn {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 13px 16px;
      text-align: left;
      color: var(--text);
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      line-height: 1.45;
      transition: border-color 0.15s ease, background 0.15s ease;
    }

    .gamified-btn:hover:not(:disabled) {
      border-color: var(--border-strong);
      background: rgba(255, 255, 255, 0.04);
    }

    .gamified-btn.selected {
      border-color: var(--accent);
      background: rgba(217, 162, 60, 0.07);
    }

    .gamified-btn.correct {
      border-color: var(--mana-color) !important;
      background: rgba(62, 165, 127, 0.08) !important;
      color: #6FC9A6 !important;
      font-weight: 600;
    }

    .gamified-btn.incorrect {
      border-color: var(--hp-color) !important;
      background: rgba(206, 91, 80, 0.08) !important;
      color: #E08A81 !important;
    }

    .explain-box {
      border: 1px solid rgba(62, 165, 127, 0.3);
      background: rgba(62, 165, 127, 0.05);
      padding: 14px 16px;
      border-radius: 10px;
      font-size: 13.5px;
      line-height: 1.55;
      margin-top: 14px;
      animation: fadeIn 0.2s ease-out;
    }

    .action-floor { display: flex; gap: 12px; }

    .action-btn {
      flex: 1;
      padding: 13px;
      border-radius: 8px;
      font-weight: 600;
      font-size: 13.5px;
      letter-spacing: 0.1px;
      text-align: center;
      cursor: pointer;
      border: 1px solid transparent;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

    .action-btn.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: #1A1305;
    }
    .action-btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
    .action-btn.primary:disabled {
      background: var(--panel-strong);
      color: var(--dim);
      border-color: var(--border);
      cursor: not-allowed;
    }

    .action-btn.secondary {
      background: transparent;
      border-color: var(--border-strong);
      color: var(--text);
    }
    .action-btn.secondary:hover {
      background: rgba(255, 255, 255, 0.04);
      border-color: var(--dim);
    }

    /* Term Highlights */
    .term {
      border-bottom: 1px dotted var(--accent);
      cursor: help;
      position: relative;
      color: var(--accent-strong);
      font-weight: 500;
    }

    #tip {
      position: fixed;
      z-index: 1000;
      max-width: 320px;
      background: var(--panel-strong);
      border: 1px solid var(--border-strong);
      border-radius: 10px;
      padding: 12px 14px;
      font-size: 12.5px;
      line-height: 1.55;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
      display: none;
      color: var(--text);
      pointer-events: none;
    }

    #tip b {
      color: var(--accent);
      display: block;
      margin-bottom: 4px;
      font-size: 13px;
      letter-spacing: 0.2px;
    }

    /* Study Hub */
    .study-hub-menu {
      display: flex;
      flex-direction: column;
      gap: 12px;
      animation: fadeIn 0.3s ease-out;
    }

    .hub-tabs {
      display: flex;
      overflow-x: auto;
      gap: 6px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
      flex-shrink: 0;
    }

    .hub-tab-btn {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--dim);
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 12.5px;
      font-weight: 600;
      white-space: nowrap;
      cursor: pointer;
      transition: all 0.15s;
    }
    .hub-tab-btn:hover { color: var(--text); border-color: var(--border-strong); }

    .hub-tab-btn.active {
      background: rgba(217, 162, 60, 0.1);
      border-color: rgba(217, 162, 60, 0.45);
      color: var(--accent-strong);
    }

    .flashcard-box {
      width: 100%;
      min-height: 220px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 26px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      cursor: pointer;
      position: relative;
      transition: border-color 0.15s;
    }
    .flashcard-box:hover { border-color: var(--border-strong); }

    .flashcard-content {
      font-size: 16px;
      line-height: 1.6;
      font-weight: 500;
      color: var(--text);
    }
    .flashcard-content.ans { color: #6FC9A6; }

    .flashcard-hint {
      position: absolute;
      bottom: 12px;
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      color: var(--dim);
    }

    /* Timed Exam */
    .exam-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }

    .timer {
      font-size: 16px;
      font-weight: 700;
      font-family: var(--font-mono);
      color: var(--text);
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      padding: 5px 10px;
      border-radius: 8px;
    }
    .timer.low {
      color: var(--hp-color);
      border-color: var(--hp-color);
      animation: flashRed 1s infinite alternate;
    }

    .question-palette {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      max-height: 90px;
      overflow-y: auto;
      background: var(--panel-blur);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px;
      margin-bottom: 14px;
    }

    .palette-btn {
      width: 28px;
      height: 26px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--dim);
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
    }
    .palette-btn.answered {
      background: rgba(94, 143, 203, 0.12);
      color: var(--mana-orb-color);
      border-color: rgba(94, 143, 203, 0.5);
    }
    .palette-btn.flagged { border-color: var(--streak-color); color: var(--streak-color); }
    .palette-btn.current { outline: 2px solid var(--accent); color: var(--text); }

    /* Study Notes & Glossary */
    .study-notes-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-height: 56vh;
      overflow-y: auto;
      padding-right: 4px;
    }

    .study-note-item {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
    }

    .glossary-search-container { margin-bottom: 14px; }

    input[type=text], input[type=email], input[type=password] {
      background: var(--panel-blur);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 12px 16px;
      border-radius: 10px;
      font-size: 14px;
      width: 100%;
      outline: none;
      margin-bottom: 10px;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    input[type=text]:focus, input[type=email]:focus, input[type=password]:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }
    input[type=text]::placeholder, input[type=email]::placeholder, input[type=password]::placeholder { color: var(--dim); }

    .gloss-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 48vh;
      overflow-y: auto;
    }

    .gloss-item {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
      font-size: 13.5px;
      line-height: 1.5;
    }

    .gloss-term {
      font-weight: 600;
      color: var(--accent);
      margin-bottom: 4px;
    }

    /* Identity */
    .identity-console {
      display: flex;
      flex-direction: column;
      gap: 16px;
      animation: fadeIn 0.3s ease-out;
    }

    .identity-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 22px;
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .avatar-row {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .avatar-frame {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      border: 2px solid var(--accent);
      background: var(--panel-blur);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      color: var(--accent);
    }

    .avatar-info { display: flex; flex-direction: column; gap: 2px; }

    .avatar-name {
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.2px;
    }

    .avatar-title {
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      color: var(--accent);
    }

    .badge-vault {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
      margin-top: 4px;
    }
    .badge-vault.course-badges {
      grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    }

    .badge-item {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 4px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      text-align: center;
      color: var(--dim);
      opacity: 0.45;
      transition: all 0.3s;
    }

    .badge-item.unlocked {
      opacity: 1;
      color: var(--accent);
      border-color: rgba(217, 162, 60, 0.4);
      background: rgba(217, 162, 60, 0.05);
    }

    .badge-icon { font-size: 20px; display: flex; justify-content: center; }
    .badge-icon svg.ic { width: 20px; height: 20px; stroke-width: 1.8; }

    .badge-name {
      font-family: var(--font-mono);
      font-size: 8.5px;
      font-weight: 600;
      letter-spacing: 0.4px;
      color: var(--dim);
      white-space: nowrap;
    }
    .badge-item.unlocked .badge-name { color: var(--text); }

    /* Stats Grid */
    .stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .stat-box {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 12px;
      text-align: center;
    }

    .stat-val {
      font-family: var(--font-mono);
      font-size: 20px;
      font-weight: 700;
      color: var(--text);
    }

    .stat-lbl {
      font-size: 10px;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      color: var(--dim);
      font-weight: 600;
      margin-top: 3px;
    }

    /* Bottom Navigation */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(13, 14, 17, 0.94);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: space-around;
      padding: 8px 6px;
      z-index: 90;
    }

    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      color: var(--dim);
      font-size: 10.5px;
      font-weight: 600;
      letter-spacing: 0.2px;
      background: none;
      border: none;
      cursor: pointer;
      position: relative;
      padding: 6px 12px;
      min-width: 60px;
      min-height: 44px;
      border-radius: 10px;
      transition: color 0.2s;
    }
    .nav-item:hover { color: var(--text); }
    .nav-item.active { color: var(--accent-strong); }

    .nav-item.active::before {
      content: '';
      position: absolute;
      top: -9px;
      left: 50%;
      transform: translateX(-50%);
      width: 18px;
      height: 2px;
      background: var(--accent);
      border-radius: 1px;
    }

    @media (prefers-reduced-motion: no-preference) {
      .track-card, .course-card {
        transition: border-color 0.2s, background 0.2s, transform 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
      }
      .track-card:hover, .course-card:hover {
        transform: translateY(-2px);
        will-change: transform;
      }
      .node-circle {
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s;
      }
      .node-circle:hover:not(.locked) {
        transform: scale(1.08);
        will-change: transform;
      }
    }

    .nav-icon { font-size: 17px; display: flex; }
    .nav-icon svg.ic { width: 19px; height: 19px; stroke-width: 1.9; }

    /* Animations */
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes slideUp {
      from { opacity: 0; transform: translateY(12px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes pulseOutline {
      0% { transform: scale(1); opacity: 0.8; }
      50% { transform: scale(1.15); opacity: 0; }
      100% { transform: scale(1.15); opacity: 0; }
    }
    @keyframes flashRed {
      from { border-color: var(--border); }
      to { border-color: var(--hp-color); }
    }

    .shake { animation: shakeEffect 0.3s ease-in-out; }
    @keyframes shakeEffect {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-6px); }
      40%, 80% { transform: translateX(6px); }
    }

    .disclaimer-bar {
      color: var(--dim);
      font-size: 11px;
      line-height: 1.6;
      padding: 14px 16px;
      text-align: center;
      margin: 8px auto 16px;
      max-width: 1000px;
      opacity: 0.75;
    }
    .disclaimer-bar strong { color: var(--dim); font-weight: 600; }

    @media (max-width: 760px) {
      body { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
      .top-hud { padding: 10px 14px; }
      .hud-row { flex-direction: column; align-items: flex-start; gap: 8px; }
      .logo-area { gap: 8px; }
      .brand-name { font-size: 14px; }
      .hud-stats { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
      .stat-capsule { padding: 5px 10px; font-size: 12px; flex: 1 1 auto; justify-content: center; }
      .app-container { padding: 14px 14px calc(108px + env(safe-area-inset-bottom)); max-width: 100%; }
      .hero-panel { padding: 18px; border-radius: 12px; margin-bottom: 14px; }
      .hero-title { font-size: 19px; }
      .hero-subtitle { font-size: 13px; }
      .hero-actions { flex-direction: column; }
      .hero-metrics { grid-template-columns: repeat(3, 1fr); }
      .hero-metric { padding: 10px 6px; }
      .hero-metric-value { font-size: 15px; }
      .bottom-nav { padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
      .nav-item { font-size: 9.5px; gap: 3px; }
      .disclaimer-bar { margin: 8px 12px 20px; padding: 8px 10px; font-size: 10.5px; }
    }

    @media (min-width: 900px) {
      body {
        padding-bottom: 0;
        display: grid;
        grid-template-areas:
          "nav hud"
          "nav main"
          "nav disclaimer";
        grid-template-columns: 240px 1fr;
        grid-template-rows: auto 1fr auto;
        height: 100vh;
        overflow: hidden;
      }

      .top-hud {
        grid-area: hud;
        position: static;
        background: var(--bg);
      }

      .bottom-nav {
        grid-area: nav;
        position: static;
        flex-direction: column;
        justify-content: start;
        align-items: stretch;
        border-top: none;
        border-right: 1px solid var(--border);
        background: #0D0E11;
        height: 100%;
        padding: 20px 14px;
        gap: 4px;
        overflow-y: auto;
      }

      .bottom-nav::before {
        content: 'GRIMLIN';
        font-family: var(--font-mono);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 3px;
        color: var(--accent);
        padding: 4px 14px 18px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 14px;
      }

      .nav-item {
        flex-direction: row;
        width: 100%;
        justify-content: start;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 8px;
        font-size: 13.5px;
        font-weight: 500;
        height: auto;
        min-height: 0;
        transition: all 0.15s ease;
      }

      .nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }

      .nav-item.active {
        background: rgba(217, 162, 60, 0.09);
        color: var(--accent-strong);
        font-weight: 600;
      }

      .nav-item.active::before {
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 2.5px;
        height: 18px;
        border-radius: 2px;
      }

      .app-container {
        grid-area: main;
        max-width: 1060px;
        width: 100%;
        margin: 0 auto;
        padding: 28px 32px;
        overflow-y: auto;
        height: 100%;
      }

      .disclaimer-bar {
        grid-area: disclaimer;
        margin: 4px auto 10px;
        max-width: 1000px;
        position: relative;
        z-index: 2;
      }

      .track-grid, .course-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
      }

      .identity-console {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
      }
      .identity-card { grid-column: 1; grid-row: 1 / span 2; }
      .stats-grid { grid-column: 2; grid-row: 1; }
      .arena-setup { grid-column: 2; grid-row: 2; }
      .identity-console > .micro-card,
      .identity-console > .action-btn.secondary { grid-column: 1 / -1; }
    }
