.level-dots { display: flex; gap: 6px; align-items: center; }
  .lvl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: 1.5px solid var(--line); transition: all .2s; }
  .lvl-dot.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,.25); animation: dotPop .4s cubic-bezier(.34,1.56,.64,1); }
  .lvl-dot.done { background: var(--success); border-color: var(--success); }
  @keyframes dotPop { 0% { transform: scale(1); } 45% { transform: scale(1.6); } 100% { transform: scale(1); } }

  .lvl-dot.boss { border-color: var(--accent2); background: rgba(232,93,63,.12); }
  .lvl-dot.boss.active { background: var(--accent2); border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(232,93,63,.25); }
  .level-badge.boss { background: rgba(232,93,63,.08); border-color: var(--accent2); color: var(--accent2); }

  /* ── HUD (bottom bar, in normal flow) ── */
  .hud {
    position: relative;
    flex-shrink: 0;
    width: 100%; max-width: 480px; margin: 0 auto; background: var(--surface);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.13);
    border-radius: 22px 22px 0 0;
    padding: 28px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
  }
  .hud-level { display: flex; align-items: center; justify-content: center; gap: 8px; row-gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
  .hud-stats { display: flex; justify-content: center; gap: 18px; margin-bottom: 3px; }
  .hud .stat { line-height: 1; }
  .hud .stat-val { font-size: 1.35rem; display: inline-block; }
  .hud .stat-val.bump { animation: statBump .32s cubic-bezier(.34,1.56,.64,1); }
  @keyframes statBump { 0% { transform: scale(1); } 45% { transform: scale(1.32); } 100% { transform: scale(1); } }
  .hud .stat-lbl { font-size: 8.5px; margin-top: 1px; letter-spacing: 1px; }

  .timer-bar { width: 100%; height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
  .timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--success), var(--accent)); transition: width 1s linear, background .3s; border-radius: 999px; }
  .timer-fill.low { background: linear-gradient(90deg, var(--accent2), var(--danger)); }

  /* Floating icon dock — pokes up above the HUD card's top edge, the way
     boosters float above the bottom bar in Royal Match / Candy Crush. */
  .hud-btns {
    position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
    display: flex; justify-content: center; gap: 12px; z-index: 5;
  }
  .icon-btn {
    position: relative;
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; line-height: 1; padding: 0;
    background: linear-gradient(160deg, #ffffff, #f1f5f9);
    border: 1.5px solid var(--line);
    box-shadow: 0 6px 14px rgba(15,23,42,.18), inset 0 1.5px 0 rgba(255,255,255,.9);
    cursor: pointer;
    transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s;
  }
  .icon-btn:active { transform: scale(.88); }
  .icon-btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
  .icon-btn.hint { color: var(--success); border-color: rgba(22,163,74,.35); background: linear-gradient(160deg, #ffffff, #f0fdf4); }
  .icon-btn.shuffle { color: var(--accent2); border-color: rgba(232,93,63,.35); background: linear-gradient(160deg, #ffffff, #fff1ee); }
  .icon-badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 999px; background: var(--accent2); color: #fff;
    font-family: 'Sora', sans-serif; font-size: 10px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.25); border: 1.5px solid #fff;
  }
  .result-btn:active { transform: scale(.9); }

  /* danger flash when time < 60s */
  .stat-val.low-time { color: var(--danger) !important; animation: lowPulse 1s ease infinite; }
  @keyframes lowPulse { 50% { opacity: .45; } }

  /* ── Name gate ── */
  .namegate-overlay {
    display: none; position: fixed; inset: 0; z-index: 400;
    background: rgba(15,23,42,.72); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 20px;
  }
  .namegate-overlay.show { display: flex; }
  .namegate-card {
    background: var(--surface); border-radius: 18px; padding: 26px 22px;
    max-width: 340px; width: 100%; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
  }
  .namegate-logo { max-height: 54px; margin-bottom: 10px; }
  .namegate-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
  .namegate-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
  .namegate-input {
    width: 100%; padding: 12px 14px; border-radius: 10px;
    border: 1.5px solid var(--line); font-family: 'Sora', sans-serif;
    font-size: 15px; font-weight: 700; text-align: center; color: var(--ink);
    margin-bottom: 8px;
  }
  .namegate-input:focus { outline: none; border-color: var(--accent); }
  .namegate-input.shake-input { animation: shake .3s; border-color: var(--danger); }
  .namegate-error {
    font-size: 12px; font-weight: 700; color: var(--danger);
    min-height: 16px; margin-bottom: 6px; opacity: 0; transition: opacity .2s;
  }
  .namegate-error.show { opacity: 1; }

  /* ── Lose / Win taunts ── */
  .lose-taunt {
    font-size: 13px; color: var(--muted); line-height: 1.4; max-width: 300px;
    margin-top: 2px;
  }
  .wof-share-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
  .wof-thumb {
    width: 46px; height: 46px; border-radius: 8px; object-fit: cover;
    border: 1.5px solid var(--line);
  }
  .btn-share {
    background: linear-gradient(120deg, #38bdf8, #6366f1); color: #fff; border: none;
    margin-top: 0;
  }

  @media (max-width: 640px) {
    .board-wrap { --bpad: 2px; border-radius: 12px; }
    .onet-board { gap: 1px; }
    .onet-tile { border-radius: 5px; box-shadow: none; }
    .onet-tile:hover { transform: none; }
    .onet-tile.selected { transform: none; }
    .hud { border-radius: 16px 16px 0 0; }
    .icon-btn { width: 44px; height: 44px; font-size: 18px; }
    .hud-btns { top: -22px; gap: 10px; }
  }
