:root {
      --bg: #0a0a1a;
      --bg-card: #141428;
      --gold: #FFD700;
      --gold-dark: #B8860B;
      --silver: #C0C0C0;
      --bronze: #CD7F32;
      --accent: #e94560;
      --text: #eee;
      --text-dim: #a0a0b8;
      --neon-blue: #00d4ff;
      --neon-pink: #ff2d95;
      --neon-green: #39ff14;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      min-height: 100dvh;
      overflow: hidden;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }

    /* HUD */
    .hud {
      display: flex;
      justify-content: space-around;
      padding: 0.4rem 1rem;
      background: var(--bg-card);
      border-bottom: 1px solid #1a1a3a;
    }

    .hud-item {
      text-align: center;
    }

    .hud-label {
      font-size: 0.65rem;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .hud-value {
      font-size: 1.1rem;
      font-weight: 800;
      color: var(--gold);
    }

    .hud-value.combo {
      color: var(--neon-pink);
    }

    /* Canvas */
    #gameCanvas {
      display: block;
      width: 100%;
      touch-action: none;
    }

    /* Overlays */
    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.85);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 100;
    }

    .overlay.hidden { display: none; }

    .modal {
      background: var(--bg-card);
      border: 2px solid var(--gold-dark);
      border-radius: 16px;
      padding: 2rem;
      text-align: center;
      max-width: 340px;
      width: 90%;
    }

    .modal h2 {
      color: var(--gold);
      font-size: 1.5rem;
      margin-bottom: 0.5rem;
    }

    .modal p {
      color: var(--text-dim);
      margin-bottom: 1rem;
      font-size: 0.9rem;
    }

    .stat-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin: 1rem 0;
    }

    .stat-box {
      background: rgba(255,215,0,0.08);
      border-radius: 8px;
      padding: 0.5rem;
    }

    .stat-box .label {
      font-size: 0.65rem;
      color: var(--text-dim);
      text-transform: uppercase;
    }

    .stat-box .value {
      font-size: 1.2rem;
      font-weight: 800;
      color: var(--gold);
    }

    .new-best {
      color: var(--neon-green) !important;
    }

    .btn {
      display: inline-block;
      padding: 0.8rem 2rem;
      border: none;
      border-radius: 10px;
      font-size: 1rem;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.15s;
      margin: 0.3rem;
    }

    .btn:active { transform: scale(0.95); }

    .btn-primary {
      background: linear-gradient(135deg, var(--gold), var(--gold-dark));
      color: #000;
    }

    .btn-secondary {
      background: #2a2a4a;
      color: var(--text);
    }

    /* Drop zone indicator */
    .drop-indicator {
      position: absolute;
      width: 2px;
      background: var(--gold);
      opacity: 0.6;
      pointer-events: none;
      z-index: 5;
    }

    /* Achievement Toast */
    .achievement-toast {
      position: fixed; top: 20px; right: 20px;
      background: linear-gradient(135deg, #b59f3b, #8b7a2e);
      padding: 1rem 1.5rem; border-radius: 12px;
      display: flex; align-items: center; gap: 1rem;
      z-index: 2000; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
      transform: translateX(calc(100% + 40px));
      transition: transform 0.35s ease; max-width: 300px;
    }
    .achievement-toast.show { transform: translateX(0); }
    .achievement-icon { font-size: 2rem; }
    .achievement-info { color: #fff; }
    .achievement-name { font-weight: 700; font-size: 1rem; }
    .achievement-desc { font-size: 0.8rem; opacity: 0.9; }

    /* Confetti */
    .confetti-container {
      position: fixed; inset: 0;
      pointer-events: none; z-index: 1500; overflow: hidden;
    }
    .confetti {
      position: absolute; width: 10px; height: 10px; top: -10px;
      animation: confettiFall 3s ease-out forwards;
    }
    @keyframes confettiFall {
      0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
      100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
    }

    /* Level-Up Burst */
    .levelup-container {
      position: fixed; inset: 0; pointer-events: none;
      z-index: 1600; display: flex; align-items: center; justify-content: center;
    }
    .levelup-particle {
      position: absolute; width: 8px; height: 8px; border-radius: 50%;
      animation: levelupBurst 1s ease-out var(--delay, 0s) forwards;
    }
    @keyframes levelupBurst {
      0%   { transform: rotate(var(--angle,0deg)) translateX(0); opacity: 1; }
      100% { transform: rotate(var(--angle,0deg)) translateX(150px); opacity: 0; }
    }

    /* Score Pop */
    .score-pop {
      position: fixed; pointer-events: none; z-index: 1400;
      font-size: 1.4rem; font-weight: 900; color: #ffd700;
      text-shadow: 0 2px 8px rgba(0,0,0,0.6);
      animation: scorePop 1.2s ease-out forwards;
    }
    @keyframes scorePop {
      0%   { transform: translateY(0); opacity: 1; }
      100% { transform: translateY(-80px); opacity: 0; }
    }

    /* Combo label */
    .combo-pop {
      position: fixed; pointer-events: none; z-index: 1400;
      font-size: 1.8rem; font-weight: 900;
      text-shadow: 0 2px 12px rgba(0,0,0,0.8);
      animation: comboPop 1.5s ease-out forwards;
    }
    @keyframes comboPop {
      0%   { transform: scale(0.5) translateY(0); opacity: 0; }
      15%  { transform: scale(1.3) translateY(-10px); opacity: 1; }
      100% { transform: scale(1) translateY(-100px); opacity: 0; }
    }

    /* Shake */
    .shake { animation: shake 0.5s; }
    @keyframes shake {
      0%,100% { transform: translateX(0); }
      20%,60% { transform: translateX(-6px); }
      40%,80% { transform: translateX(6px); }
    }

    .sr-only {
      position: absolute; width: 1px; height: 1px;
      padding: 0; margin: -1px; overflow: hidden;
      clip: rect(0,0,0,0); white-space: nowrap; border: 0;
    }

    :focus-visible {
      outline: 2px solid var(--gold);
      outline-offset: 2px;
    }

    @media (prefers-reduced-motion: reduce) {
      .confetti, .levelup-particle, .score-pop, .combo-pop { animation: none !important; }
      .shake { animation: none !important; }
      .achievement-toast { transition: none; }
      .btn { transition: none; }
    }

    @media (max-width: 480px) {
      .hud { padding: 0.3rem 0.5rem; }
      .hud-value { font-size: 0.95rem; }
    }
