  :root {
    --bg-slate: #1E293B;
    --bg-panel: #0F172A;
    --card-bg: #FFFFFF;
    --wood-light: #E8C391;
    --wood-mid: #C8965E;
    --wood-dark: #8B5A2B;
    --belt-dark: #334155;
    --belt-stripe: #475569;
    --accent-cyan: #06B6D4;
    --accent-amber: #F59E0B;
    --accent-emerald: #10B981;
    --accent-rose: #F43F5E;
    --accent-violet: #8B5CF6;
    --text-dark: #0F172A;
    --text-muted: #64748B;
  }

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

  body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top, #293548 0%, #0F172A 100%);
    color: #F8FAFC;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 14px 20px;
  }

  /* Beautiful k -> infinity Top Emblem Banner */
  .kinf-banner {
    width: 100%;
    max-width: 1120px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 50%, rgba(15, 23, 42, 0.96) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 16px;
    padding: 8px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
  }

  .kinf-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(6, 182, 212, 0.14) 0%, transparent 70%);
    pointer-events: none;
  }

  .kinf-line {
    height: 1.5px;
    flex: 1;
    max-width: 180px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.65), transparent);
  }

  .kinf-symbol {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #38BDF8 0%, #818CF8 50%, #F472B6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(56, 189, 248, 0.35));
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .kinf-symbol .k-var {
    font-style: italic;
  }

  .kinf-symbol .arrow {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 400;
  }

  .kinf-symbol .inf-glyph {
    font-size: 2rem;
    line-height: 1;
  }

  .kinf-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #94A3B8;
    border-left: 1.5px solid #334155;
    padding-left: 14px;
  }

  @media (max-width: 600px) {
    .kinf-tag { display: none; }
  }

  /* Top Arcade HUD */
  .hud {
    width: 100%;
    max-width: 1120px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid #334155;
    border-radius: 18px;
    padding: 10px 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .brand-badge {
    font-size: 2rem;
    background: linear-gradient(135deg, #F59E0B, #EA580C);
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
  }

  .brand h1 {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    color: #F8FAFC;
  }

  .brand p {
    font-size: 0.78rem;
    color: #94A3B8;
  }

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

  .metric-box {
    background: #1E293B;
    border: 1.5px solid #334155;
    border-radius: 12px;
    padding: 5px 12px;
    text-align: center;
    min-width: 82px;
  }

  .metric-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94A3B8;
    font-weight: 700;
  }

  .metric-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: #F8FAFC;
  }

  .metric-val.time-low { color: var(--accent-rose); animation: pulse 0.5s infinite alternate; }
  .metric-val.combo-hot { color: var(--accent-amber); }
  .metric-val.score-val { color: var(--accent-emerald); }

  .hud-btn {
    background: #1E293B;
    color: #F8FAFC;
    border: 1.5px solid #475569;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .hud-btn:hover { background: #334155; border-color: #38BDF8; }
  .hud-btn.help-btn { border-color: rgba(56, 189, 248, 0.5); color: #38BDF8; }

  /* Timer Progress Bar */
  .timer-track {
    width: 100%;
    max-width: 1120px;
    height: 10px;
    background: #1E293B;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid #334155;
  }

  .timer-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #F43F5E, #F59E0B, #10B981);
    transition: width 0.2s linear;
  }

  /* Main Layout */
  .main-grid {
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 16px;
    align-items: start;
  }

  @media (max-width: 920px) {
    .main-grid { grid-template-columns: 1fr; }
  }

  /* Factory Stage */
  .factory-stage {
    background: #F8FAFC;
    color: var(--text-dark);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.3);
    border: 3px solid #CBD5E1;
  }

  /* Conveyor Belt Section */
  .belt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .belt-title {
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
  }

  .btn-mini {
    background: #E2E8F0;
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #1E293B;
    cursor: pointer;
  }
  .btn-mini:hover { background: #CBD5E1; }

  .conveyor-belt {
    position: relative;
    height: 132px;
    background: repeating-linear-gradient(
      90deg,
      var(--belt-dark) 0px,
      var(--belt-dark) 28px,
      var(--belt-stripe) 28px,
      var(--belt-stripe) 56px
    );
    border-radius: 16px;
    border: 4px solid #1E293B;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: inset 0 6px 14px rgba(0,0,0,0.45);
  }

  .belt-arrow-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.06);
    pointer-events: none;
  }

  /* Clustered Snack Packet on Belt */
  .snack-cluster {
    position: absolute;
    top: 12px;
    height: 100px;
    min-width: 96px;
    background: #FFFFFF;
    border: 3px solid #0F172A;
    border-radius: 16px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    box-shadow: 0 6px 0 #0F172A, 0 10px 16px rgba(0,0,0,0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    z-index: 5;
  }

  .snack-cluster:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: var(--accent-cyan);
  }

  .snack-cluster:active { cursor: grabbing; }

  .cluster-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 1.55rem;
    line-height: 1.1;
    margin-top: 2px;
  }

  .cluster-meta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-top: 1.5px solid #E2E8F0;
    padding-top: 4px;
  }

  .shape-tag {
    font-size: 0.7rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
  }
  .color-red    { background: #FEE2E2; color: #B91C1C; }
  .color-green  { background: #DCFCE7; color: #15803D; }
  .color-yellow { background: #FEF3C7; color: #A16207; }

  .qty-pill {
    background: #0F172A;
    color: #FFFFFF;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 1px 7px;
    border-radius: 99px;
  }

  /* Bento Box Assembly Station */
  .bento-station {
    background: linear-gradient(180deg, #D9A773 0%, #B8814B 100%);
    border: 5px solid #78481D;
    border-radius: 22px;
    padding: 16px;
    box-shadow: inset 0 4px 10px rgba(255,255,255,0.25), 0 8px 20px rgba(0,0,0,0.18);
    position: relative;
    transition: transform 0.25s ease;
  }

  .bento-station.lid-slam { animation: slamBox 0.45s ease; }

  .bento-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #FFFBEB;
    flex-wrap: wrap;
    gap: 8px;
  }

  .order-type-badge {
    background: #78481D;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 0.4px;
  }

  .bento-instruction {
    font-size: 0.85rem;
    font-weight: 800;
    color: #451A03;
    background: rgba(255, 251, 235, 0.9);
    padding: 4px 12px;
    border-radius: 99px;
  }

  /* Compartments Layout */
  .compartments-wrap {
    display: grid;
    gap: 12px;
  }
  .compartments-wrap.cols-2 { grid-template-columns: 1fr 1fr; }
  .compartments-wrap.cols-3 { grid-template-columns: 1fr 1.15fr 1fr; }

  @media (max-width: 640px) {
    .compartments-wrap.cols-2,
    .compartments-wrap.cols-3 { grid-template-columns: 1fr; }
  }

  .compartment {
    background: #FFFBEB;
    border: 3.5px solid #92400E;
    border-radius: 16px;
    padding: 12px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.15s ease;
    position: relative;
  }

  .compartment.venn-center {
    background: linear-gradient(135deg, #EEF2FF 0%, #FDF2F8 100%);
    border-color: #6D28D9;
    border-style: dashed;
  }

  .compartment.drag-over {
    transform: scale(1.02);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.3);
  }

  .compartment.complete {
    background: #ECFDF5;
    border-color: var(--accent-emerald);
  }

  .compartment.error-flash {
    animation: shake 0.35s;
    border-color: var(--accent-rose);
    background: #FFF1F2;
  }

  .comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #D6D3D1;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }

  .rule-visual {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 900;
    font-size: 0.92rem;
    color: #1E293B;
  }

  .rule-chip {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 900;
    border: 1.5px solid rgba(0,0,0,0.12);
  }

  .target-counter {
    font-size: 1.15rem;
    font-weight: 900;
    background: #1E293B;
    color: #FFFFFF;
    padding: 3px 11px;
    border-radius: 10px;
  }

  .compartment.complete .target-counter { background: var(--accent-emerald); }

  .comp-items {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
  }

  .packed-chip {
    background: #FFFFFF;
    border: 2px solid #CBD5E1;
    border-radius: 10px;
    padding: 4px 8px;
    font-size: 1.2rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  }

  .packed-chip:hover {
    background: #FFE4E6;
    border-color: #FDA4AF;
  }

  .packed-chip small { font-size: 0.72rem; color: #475569; }

  .comp-footer {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #78716C;
  }

  /* Lid Slam Overlay */
  .lid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(16, 185, 129, 0.93);
    border-radius: 17px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .lid-overlay.show { opacity: 1; transform: scale(1); }

  .lid-stamp {
    border: 4px solid #FFFFFF;
    padding: 8px 22px;
    border-radius: 14px;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    transform: rotate(-4deg);
    margin-bottom: 6px;
  }

  /* Feedback Strip */
  .feedback-strip {
    margin-top: 12px;
    min-height: 36px;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 800;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    color: #334155;
  }
  .feedback-strip.good { background: #DCFCE7; color: #166534; }
  .feedback-strip.warn { background: #FEE2E2; color: #991B1B; }

  /* Right Sidebar: Leaderboard & Quick Instructions */
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .side-card {
    background: rgba(15, 23, 42, 0.94);
    border: 2px solid #334155;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  }

  .side-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }

  .side-card h2 {
    font-size: 1rem;
    font-weight: 900;
    color: #FACC15;
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .lb-filter-tabs {
    display: flex;
    gap: 4px;
  }

  .lb-tab {
    background: #1E293B;
    color: #94A3B8;
    border: 1px solid #334155;
    border-radius: 7px;
    padding: 3px 7px;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
  }

  .lb-tab.active {
    background: #F59E0B;
    color: #0F172A;
    border-color: #F59E0B;
  }

  .lb-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1E293B;
    border: 1px solid #334155;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  .lb-row.me {
    border-color: #F59E0B;
    background: #292524;
  }

  .lb-left {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
  }

  .lb-rank { font-weight: 900; min-width: 22px; color: #94A3B8; }
  .lb-mode-pill {
    font-size: 0.64rem;
    background: #0F172A;
    color: #38BDF8;
    padding: 1px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 800;
  }
  .lb-pts { color: #34D399; font-weight: 900; }

  .lb-footer-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
  }

  .btn-reset-lb {
    background: transparent;
    border: none;
    color: #64748B;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
  }
  .btn-reset-lb:hover { color: #94A3B8; }

  /* How to Play Card */
  .steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: #E2E8F0;
  }

  .step-item {
    background: #1E293B;
    padding: 8px 10px;
    border-radius: 11px;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    line-height: 1.35;
  }

  .step-num {
    background: #38BDF8;
    color: #0F172A;
    font-weight: 900;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
  }

  /* Modals */
  .modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.84);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
  }

  .modal-box {
    background: #FFFFFF;
    color: #0F172A;
    border-radius: 24px;
    max-width: 520px;
    width: 100%;
    padding: 24px;
    text-align: center;
    border: 4px solid #F59E0B;
    box-shadow: 0 24px 48px rgba(0,0,0,0.45);
    max-height: 92vh;
    overflow-y: auto;
  }

  .modal-kinf {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0284C7;
    margin-bottom: 4px;
    letter-spacing: 1px;
  }

  .modal-box h2 { font-size: 1.65rem; font-weight: 900; margin-bottom: 6px; }
  .modal-box p { color: #475569; font-size: 0.92rem; margin-bottom: 14px; }

  .field-block { text-align: left; margin-bottom: 14px; }
  .field-block label { display: block; font-size: 0.82rem; font-weight: 800; margin-bottom: 6px; color: #334155; }

  .text-input {
    width: 100%;
    padding: 10px 12px;
    border: 2.5px solid #CBD5E1;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
  }

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

  .mode-btn {
    border: 2.5px solid #CBD5E1;
    background: #F8FAFC;
    border-radius: 12px;
    padding: 10px 6px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.8rem;
  }

  .mode-btn.selected {
    border-color: #EA580C;
    background: #FFF7ED;
    color: #9A3412;
  }

  .guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
    margin-bottom: 16px;
  }

  @media (max-width: 500px) {
    .guide-grid { grid-template-columns: 1fr; }
  }

  .guide-card {
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #334155;
  }

  .guide-card strong {
    display: block;
    color: #0F172A;
    margin-bottom: 3px;
    font-size: 0.88rem;
  }

  .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 5px 0 #047857;
  }
  .btn-primary:hover { filter: brightness(1.05); }

  /* An untimed welcome: choose a shift, then learn by example. */
  .intro-modal {
    max-width: 940px;
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: 24px;
    text-align: left;
    background: var(--bg-panel);
    color: #F8FAFC;
    color-scheme: dark;
    scrollbar-color: #64748B var(--bg-panel);
  }
  .intro-header { padding: 30px 36px 26px; border-bottom: 1px solid var(--belt-dark); }
  .intro-header h2 { color: var(--accent-amber); font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.03em; text-wrap: balance; }
  .intro-modal p { line-height: 1.55; color: #CBD5E1; }
  .intro-header p { margin: 10px 0 0; max-width: 65ch; font-size: 1rem; }
  .intro-layout { display: grid; grid-template-columns: 1.05fr 1fr; }
  .intro-layout > section { min-width: 0; padding: 28px 32px 30px; }
  .intro-modal h3 { font-size: 1.15rem; line-height: 1.35; margin-bottom: 22px; }
  .intro-setup .intro-field-label,
  .intro-setup label { display: block; color: #CBD5E1; font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
  .intro-setup .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .intro-setup .mode-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; min-height: 72px;
    border: 2px solid #64748B; background: var(--bg-slate); color: #F8FAFC;
    text-align: left; font-family: inherit; font-size: 1rem;
    transition: border-color 150ms ease, background-color 150ms ease;
  }
  .intro-setup .mode-btn:hover { border-color: #94A3B8; background: var(--belt-dark); }
  .intro-setup .mode-btn.selected { border-color: var(--accent-amber); background: #292524; color: #FCD34D; }
  .mode-choice { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #94A3B8; border-radius: 50%; display: grid; place-items: center; }
  .selected .mode-choice { border-color: var(--accent-amber); }
  .selected .mode-choice::after { content: ""; width: 10px; height: 10px; background: var(--accent-amber); border-radius: 50%; }
  .mode-copy { display: grid; gap: 4px; flex: 1; }
  .intro-setup .mode-btn small { font-weight: 400; font-size: 0.82rem; line-height: 1.35; color: #CBD5E1; }
  .intro-setup .mode-btn.selected small { color: #FDE68A; }
  .mode-recommendation { font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
  .intro-setup .field-block { margin-bottom: 22px; }
  .duration-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .duration-choices button { min-height: 46px; padding: 10px; border: 2px solid #64748B; border-radius: 12px; background: var(--bg-slate); color: #F8FAFC; font: inherit; font-weight: 700; cursor: pointer; }
  .duration-choices button:hover { background: var(--belt-dark); border-color: #94A3B8; }
  .duration-choices button[aria-pressed="true"] { border-color: var(--accent-amber); background: #292524; color: #FCD34D; }
  .intro-setup .mode-explanation { font-size: 0.85rem; margin: 12px 0 0; }
  .intro-setup .text-input { min-height: 48px; border-width: 2px; font-family: inherit; font-weight: 600; background: var(--bg-slate); color: #F8FAFC; border-color: #64748B; }
  .intro-setup .btn-primary { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--accent-amber); color: var(--text-dark); box-shadow: none; min-height: 54px; font-family: inherit; font-size: 1.05rem; border-radius: 12px; }
  .intro-setup .btn-primary:hover { background: #FBBF24; filter: none; }
  .intro-setup .btn-primary:active { background: #D97706; }
  .intro-setup .btn-primary svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .intro-setup .start-note { text-align: center; font-size: 0.8rem; margin: 10px 0 0; }
  .intro-lesson { background: var(--wood-light); border-left: 1px solid var(--wood-mid); }
  .intro-lesson h3 { color: #542F17; }
  .intro-steps { list-style: none; counter-reset: lesson; display: grid; gap: 22px; }
  .intro-steps li { counter-increment: lesson; position: relative; padding-left: 40px; }
  .intro-steps li::before {
    content: counter(lesson); position: absolute; left: 0; top: 0;
    width: 28px; height: 28px; border-radius: 50%; background: var(--wood-dark);
    color: #FFFFFF; text-align: center; line-height: 28px; font-weight: 800; font-size: 0.85rem;
  }
  .intro-steps strong { display: block; margin-bottom: 5px; font-size: 0.98rem; color: #542F17; }
  .intro-steps p { margin: 0; font-size: 0.9rem; color: #633C20; }
  .packing-example { margin: 28px 0 24px; padding: 22px 0; border-top: 1px solid var(--wood-mid); border-bottom: 1px solid var(--wood-mid); }
  .packing-example figcaption { font-size: 0.9rem; font-weight: 700; color: #542F17; }
  .example-equation { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 20px 0 14px; font-weight: 800; font-size: 1.25rem; }
  .example-packet { display: grid; justify-items: center; gap: 8px; min-width: 42px; color: #9F1239; }
  .example-dots { display: flex; align-items: center; justify-content: center; gap: 3px; height: 16px; }
  .example-dots i { width: 12px; height: 12px; border-radius: 50%; background: #BE123C; }
  .example-operator { color: #633C20; }
  .example-total { display: grid; place-items: center; width: 52px; height: 56px; border: 2px solid #047857; border-radius: 12px; color: #065F46; background: #ECFDF5; font-size: 1.8rem; }
  .packing-example p { font-size: 0.82rem; margin: 0; color: #065F46; }
  .intro-modal .intro-tip { font-size: 0.82rem; margin: 0; color: #633C20; }
  .modal-box :is(button, input, summary):focus-visible { outline: 3px solid #0369A1; outline-offset: 3px; }
  .intro-modal :is(button, input):focus-visible { outline-color: #38BDF8; }
  .intro-modal :is(p, strong, label, figcaption) { user-select: text; }
  .intro-modal ::selection { background: #FDE68A; color: #542F17; }
  .intro-modal input { caret-color: var(--accent-amber); }
  body.modal-open { overflow: hidden; }
  @media (max-width: 720px) {
    .intro-layout { grid-template-columns: 1fr; }
    .intro-header { padding: 24px; }
    .intro-layout > section { padding: 24px; }
    .intro-lesson { border-left: 0; border-top: 1px solid var(--wood-mid); }
    .intro-modal { border-radius: 16px; }
  }
  @media (max-width: 380px) {
    #startModal { padding: 8px; }
    .intro-modal { max-height: calc(100dvh - 16px); }
    .intro-header, .intro-layout > section { padding: 20px 16px; }
    .intro-setup .mode-btn { gap: 9px; padding: 12px 10px; }
    .mode-recommendation { white-space: normal; max-width: 38px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .intro-setup .mode-btn { transition: none; }
  }

  .hidden { display: none !important; }

  @keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    75% { transform: translateX(7px); }
  }
  @keyframes slamBox {
    0% { transform: scale(1); }
    40% { transform: scale(0.95); }
    75% { transform: scale(1.02); }
    100% { transform: scale(1); }
  }
