      /* === GAME TYPOGRAPHY === */
      :root {
        --font-display: "Orbitron", sans-serif;
        --font-body: "Outfit", sans-serif;
      }

      body {
        font-family: var(--font-body);
        background-color: #0c0a15;
        color: #f9fafb;
        overflow: hidden;
        min-height: 100vh;
      }

      body.game-playing {
        cursor: none;
      }

      /* Main game title — arcade style, single line, never cut */
      .overlay-title-block {
        margin-top: 0;
        margin-bottom: 1.5rem;
        overflow: visible;
        width: 100%;
        min-width: 0;
      }
      .game-title {
        font-family: var(--font-display);
        font-size: clamp(1.1rem, 6vw, 3.5rem);
        font-weight: 800;
        letter-spacing: 0.06em;
        margin: 0 0 1rem;
        white-space: nowrap;
        background: linear-gradient(135deg, #a78bfa 0%, #ec4899 50%, #fbbf24 100%);
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: none;
        filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.4));
        animation: titleShine 4s ease-in-out infinite;
        display: inline-block;
        max-width: 100%;
        overflow: visible;
      }
      @keyframes titleShine {
        0%, 100% { background-position: 0% center; }
        50% { background-position: 100% center; }
      }

      .title-divider {
        width: 6rem;
        height: 0.25rem;
        margin: 0 auto;
        background: linear-gradient(90deg, #a78bfa, #ec4899);
        border-radius: 9999px;
        box-shadow: 0 0 12px rgba(167, 139, 250, 0.5), 0 0 8px rgba(236, 72, 153, 0.4);
      }

      .game-title--over {
        background: linear-gradient(135deg, #fca5a5 0%, #f472b6 100%);
        background-size: 100% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        animation: none;
        font-size: clamp(2rem, 6vw, 3rem);
      }

      /* === GAME OVER POPUP (compact, uniform spacing) === */
      #overlay.game-over .overlay-content {
        background: rgba(15, 15, 25, 0.97);
        border: 1px solid rgba(75, 85, 99, 0.4);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
        padding: 1.25rem;
        max-width: 28rem;
      }
      #overlay.game-over .title-divider {
        display: none;
      }
      #overlay.game-over .overlay-title-block {
        margin: 0 0 0.75rem;
      }
      #overlay.game-over .game-title {
        margin: 0 0 0.5rem;
      }
      #overlay.game-over .game-over-score-wrap {
        margin-bottom: 1rem;
        text-align: center;
      }
      #overlay.game-over .game-final-score {
        background: transparent;
        border: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        display: inline-block;
      }
      #overlay.game-over .game-final-score-label {
        font-family: var(--font-body);
        font-size: 0.75rem;
        font-weight: 600;
        color: rgba(156, 163, 175, 0.95);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin: 0 0 0.25rem;
      }
      #overlay.game-over .game-final-score-value {
        font-family: var(--font-display);
        font-size: 2.25rem;
        font-weight: 800;
        color: #fff;
        letter-spacing: 0.06em;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
        margin: 0;
      }
      #overlay.game-over .game-button {
        margin-top: 0;
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
      }
      #overlay.game-over .game-button:hover {
        box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
      }

      /* HUD — score and in-game text */
      .game-hud-label {
        font-family: var(--font-body);
        font-size: 1.125rem;
        font-weight: 600;
        color: rgba(209, 213, 219, 0.9);
        letter-spacing: 0.04em;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
      }
      .game-hud-value {
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 1.5rem;
        color: #fff;
        letter-spacing: 0.05em;
        text-shadow: 0 0 12px rgba(167, 139, 250, 0.6), 0 2px 4px rgba(0, 0, 0, 0.5);
      }
      /* Right-side HUD (combo, difficulty, achievements, streak) */
      #combo-display,
      #difficulty-display,
      #achievement-display,
      #streak-display {
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 1.125rem;
        letter-spacing: 0.06em;
      }
      #combo-display {
        font-size: 1.75rem;
        color: #fcd34d;
        text-shadow: 0 0 12px rgba(251, 191, 36, 0.7), 0 2px 4px rgba(0, 0, 0, 0.4);
      }
      #difficulty-display {
        color: #60a5fa;
        text-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
      }
      #achievement-display {
        color: #facc15;
        text-shadow: 0 0 10px rgba(234, 179, 8, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
      }
      #streak-display {
        color: #f87171;
        text-shadow: 0 0 10px rgba(248, 113, 113, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
      }

      /* Overlay cards */
      .game-overlay-text {
        font-size: 1.125rem;
        color: rgba(209, 213, 219, 0.95);
        letter-spacing: 0.02em;
      }
      .game-card {
        background: rgba(30, 27, 45, 0.6);
        border-radius: 0.75rem;
        padding: 1rem 1.25rem;
        border: 1px solid rgba(167, 139, 250, 0.2);
        box-shadow: 0 0 20px -5px rgba(139, 92, 246, 0.1);
      }
      .game-card-title {
        font-family: var(--font-display);
        font-size: 1.125rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        color: #fcd34d;
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
        text-shadow: 0 0 10px rgba(252, 211, 77, 0.3);
      }
      .game-card-title--violet {
        color: #c4b5fd;
        text-shadow: 0 0 10px rgba(196, 181, 253, 0.3);
      }
      .game-card-body {
        color: rgba(209, 213, 219, 0.95);
        font-weight: 500;
        line-height: 1.5;
      }
      .game-steps .game-accent {
        font-weight: 700;
        color: #fcd34d;
        text-shadow: 0 0 8px rgba(252, 211, 77, 0.25);
      }
      .game-dot {
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        flex-shrink: 0;
      }
      .game-dot--amber { background: #fcd34d; box-shadow: 0 0 6px #fbbf24; }
      .game-dot--violet { background: #c4b5fd; box-shadow: 0 0 6px #a78bfa; }
      .game-dot--pink { background: #f9a8d4; box-shadow: 0 0 6px #ec4899; }
      .game-dot--blue { background: #93c5fd; box-shadow: 0 0 6px #3b82f6; }

      /* Final score block */
      .game-final-score {
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.15));
        border-radius: 0.75rem;
        padding: 1rem 1.25rem;
        border: 1px solid rgba(236, 72, 153, 0.35);
      }
      .game-final-score-label {
        font-size: 1rem;
        font-weight: 600;
        color: rgba(209, 213, 219, 0.9);
        margin-bottom: 0.25rem;
        letter-spacing: 0.04em;
      }
      .game-final-score-value {
        font-family: var(--font-display);
        font-size: 2.5rem;
        font-weight: 800;
        color: #f472b6;
        letter-spacing: 0.08em;
        text-shadow: 0 0 20px rgba(244, 114, 182, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
      }

      /* CTA button — game style */
      .game-button {
        font-family: var(--font-display);
        font-size: 1.125rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #fff;
        padding: 1rem 2.5rem;
        border-radius: 0.75rem;
        background: linear-gradient(135deg, #8b5cf6, #ec4899);
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      }
      .game-button::before {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
      }
      .game-button:hover::before {
        left: 100%;
      }
      .game-button:hover {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
      }
      .game-button:active {
        transform: scale(0.98);
      }
      canvas {
        background-color: #090a0f;
        background-image: radial-gradient(
          ellipse at bottom,
          #1b2735 0%,
          #090a0f 100%
        );
        display: block;
        border-radius: 0.5rem;
      }
      /* Overlay: bg.png layer + dark scrim + content */
      .overlay {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        animation: overlayFadeIn 0.6s ease-out;
        overflow: hidden;
      }

      .overlay-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        background-image: url("../img/bg.png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
      }

      .overlay-scrim {
        position: absolute;
        inset: 0;
        z-index: 1;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
      }

      .overlay-content {
        position: relative;
        z-index: 2;
        padding: 1.5rem;
        background: linear-gradient(160deg, rgba(30, 27, 45, 0.95) 0%, rgba(15, 12, 28, 0.98) 100%);
        border: 1px solid rgba(167, 139, 250, 0.35);
        box-shadow:
          0 0 0 1px rgba(236, 72, 153, 0.15),
          0 25px 50px -12px rgba(0, 0, 0, 0.6),
          0 0 60px -10px rgba(139, 92, 246, 0.25),
          0 0 40px -15px rgba(236, 72, 153, 0.2);
        animation: contentSlideIn 0.8s ease-out;
        max-height: 90vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
      }
      .overlay-content::-webkit-scrollbar {
        display: none;
      }
      /* Logo and title stay centered */
      .overlay-title-block {
        text-align: center;
      }
      /* Goal / How to Play section left-aligned (start overlay only; game-over unchanged) */
      .game-overlay-text {
        text-align: left;
      }
      /* Button centered */
      .overlay-content > .game-button {
        display: block;
        margin-left: auto;
        margin-right: auto;
      }
      
      @keyframes overlayFadeIn {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }
      
      @keyframes contentSlideIn {
        from {
          opacity: 0;
          transform: translateY(30px) scale(0.95);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }
      
      .hidden {
        display: none !important;
      }

      /* === LAYOUT (replaces Tailwind utilities) === */
      .game-root {
        min-height: 100vh;
        overflow: hidden;
      }
      .game-card-icon {
        margin-right: 0.5rem;
      }
      .canvas-wrap {
        position: absolute;
        inset: 0;
      }
      .game-hud-bar {
        position: absolute;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 15;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
      }
      .game-hud-bar.hidden {
        display: none !important;
      }
      .game-home-btn {
        box-sizing: border-box;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border-radius: 0.5rem;
        border: 1px solid rgba(167, 139, 250, 0.4);
        background: linear-gradient(135deg, rgba(30, 27, 45, 0.95), rgba(15, 12, 28, 0.98));
        color: #c4b5fd;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s, color 0.2s;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
      }
      .game-home-btn:hover {
        color: #e9d5ff;
        transform: scale(1.08);
        box-shadow: 0 0 20px rgba(167, 139, 250, 0.35);
      }
      .game-home-btn:active {
        transform: scale(0.96);
      }
      .game-home-icon {
        width: 1.25rem;
        height: 1.25rem;
      }
      .game-hud {
        display: flex;
        align-items: center;
      }
      .game-hud .game-hud-label {
        margin: 0;
        line-height: 2.5rem;
      }
      .game-hud .game-hud-value {
        line-height: inherit;
      }
      /* Level on top, combo (x2, x3) below */
      .hud-difficulty { position: absolute; top: 1rem; right: 1rem; }
      .hud-combo { position: absolute; top: 2.75rem; right: 1rem; }
      .hud-achievement { position: absolute; top: 5.5rem; right: 1rem; }
      .hud-streak { position: absolute; top: 8rem; right: 1rem; }
      .overlay-content {
        width: 100%;
        max-width: 32rem;
        margin-left: 1rem;
        margin-right: 1rem;
      }
      .game-overlay-text { margin-bottom: 2rem; text-align: left; }
      .game-overlay-text .game-card + .game-card { margin-top: 1rem; }
      .game-steps > * + * { margin-top: 0.75rem; }
      .game-step-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
      }
      .game-final-score { margin-bottom: 1.5rem; }

      /* === RESPONSIVE DESIGN === */
      /* Breakpoints: Small Mobile ≤480 | Mobile ≤640 | Tablet Portrait 641-768 | Tablet Landscape 769-1024 | Desktop ≥1025 | Landscape (orientation) */

      /* Landscape — pop-up scrollable, centered */
      @media (orientation: landscape) {
        .overlay {
          justify-content: center;
          align-items: center;
          padding: 0.75rem 1rem;
        }
        .overlay-content {
          max-height: 85vh;
          flex-shrink: 0;
          overflow-y: auto;
          -webkit-overflow-scrolling: touch;
        }
      }

      /* Short viewport in landscape — tighter scroll area */
      @media (orientation: landscape) and (max-height: 500px) {
        .overlay {
          padding: 0.5rem 0.75rem;
        }
        .overlay-content {
          max-height: 92vh;
          padding: 0.75rem 1rem;
        }
        #overlay-title {
          font-size: 1.5rem;
          margin-bottom: 0.35rem;
        }
        .overlay-title-block { margin-bottom: 0.5rem; }
        .game-overlay-text { margin-bottom: 0.75rem; }
        .game-overlay-text .game-card + .game-card { margin-top: 0.5rem; }
        .game-steps > * + * { margin-top: 0.25rem; }
        .game-button { padding: 0.5rem 1.25rem; font-size: 0.9375rem; }
      }

      /* Desktop (≥1025px) — base already set; ensure max-width */
      @media (min-width: 1025px) {
        .overlay-content {
          max-width: 32rem;
        }
      }

      /* Tablet Landscape (769px–1024px) */
      @media (min-width: 769px) and (max-width: 1024px) {
        .overlay-content {
          max-width: 28rem;
          padding: 1.25rem 1.5rem;
        }
        #overlay-title {
          font-size: 3rem;
        }
      }

      /* Tablet Portrait (641px–768px) */
      @media (min-width: 641px) and (max-width: 768px) {
        .overlay-content {
          padding: 1.25rem 1.5rem;
          max-width: calc(100vw - 2rem);
        }
        #overlay-title {
          font-size: 2.5rem;
          margin-bottom: 1rem;
        }
        .game-hud-bar { top: 0.5rem; left: 0.5rem; gap: 0.5rem; }
        .game-hud { font-size: 0.875rem; }
        .game-home-btn { width: 2.25rem; height: 2.25rem; }
        .game-home-icon { width: 1.1rem; height: 1.1rem; }
        .hud-difficulty { top: 0.5rem; right: 0.5rem; }
        .hud-combo { top: 2.5rem; right: 0.5rem; font-size: 1.5rem; }
        .hud-achievement { top: 4.5rem; right: 0.5rem; }
        .hud-streak { top: 6.5rem; right: 0.5rem; }
        .hud-difficulty, .hud-achievement, .hud-streak { font-size: 0.875rem; }
      }

      /* Mobile (≤640px) */
      @media (max-width: 640px) {
        .overlay-content {
          padding: 1.25rem;
          margin: 0.5rem;
          max-width: calc(100vw - 1rem);
        }
        #overlay-title {
          text-align: center;
          font-size: 2.25rem;
          margin-bottom: 1rem;
        }
        .game-button {
          padding: 0.75rem 2rem;
          font-size: 1.125rem;
        }
        .game-hud-bar { top: 0.5rem; left: 0.5rem; gap: 0.5rem; }
        .game-hud { font-size: 0.875rem; }
        .game-home-btn { width: 2.25rem; height: 2.25rem; }
        .game-home-icon { width: 1.1rem; height: 1.1rem; }
        .hud-difficulty { top: 0.5rem; right: 0.5rem; }
        .hud-combo { top: 2.5rem; right: 0.5rem; font-size: 1.5rem; }
        .hud-achievement { top: 4.5rem; right: 0.5rem; }
        .hud-streak { top: 6.5rem; right: 0.5rem; }
        .hud-difficulty, .hud-achievement, .hud-streak { font-size: 0.875rem; }
      }

      /* Small Mobile (≤480px) */
      @media (max-width: 480px) {
        .overlay-content {
          padding: 1rem;
          margin: 0.25rem;
          max-width: calc(100vw - 0.5rem);
        }
        #overlay-title {
          font-size: clamp(1.5rem, 7vw, 2rem);
          margin-bottom: 0.75rem;
        }
        .game-button {
          padding: 0.625rem 1.5rem;
          font-size: 1rem;
        }
        .hud-difficulty { top: 0.5rem; right: 0.5rem; }
        .hud-combo { top: 2.5rem; right: 0.5rem; }
        .hud-achievement { top: 4.5rem; right: 0.5rem; }
        .hud-streak { top: 6.5rem; right: 0.5rem; }
      }
      
      @media (hover: none) and (pointer: coarse) {
        .game-button:hover {
          transform: none;
          box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
        }
        
        .game-button:active {
          transform: scale(0.95);
        }
      }
      
      canvas, .overlay, .game-button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
      }
      
      /* iOS Safari specific fixes */
      @supports (-webkit-touch-callout: none) {
        body {
          -webkit-overflow-scrolling: touch;
        }
        
        canvas {
          touch-action: none;
        }
      }
      
      /* Enhanced mobile touch experience */
      @media (max-width: 768px) {
        canvas {
          touch-action: none;
          -webkit-touch-callout: none;
          -webkit-user-select: none;
          -khtml-user-select: none;
          -moz-user-select: none;
          -ms-user-select: none;
          user-select: none;
        }
        
        /* Improve touch responsiveness */
        body {
          touch-action: manipulation;
          -webkit-tap-highlight-color: transparent;
        }
        
        /* Make sure the game area is fully touchable */
        #canvas-container {
          touch-action: none;
        }
      }
      
      /* Device-specific instruction visibility */
      .desktop-only {
        display: inline;
      }
      
      .mobile-only {
        display: none;
      }
      
      @media (max-width: 768px) {
        .desktop-only {
          display: none;
        }
        
        .mobile-only {
          display: inline;
        }
      }
