    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      margin: 0;
      overflow: hidden;
      background: #000;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      color: #fff;
      touch-action: none;
    }

    canvas { display: block; }

    #hud {
      position: absolute;
      top: 15px;
      left: 15px;
      font-size: 20px;
      text-shadow: 0 0 10px #000;
      z-index: 10;
      background: rgba(0,0,0,0.6);
      padding: 8px 16px;
      border-radius: 12px;
    }

    #stats {
      position: absolute;
      top: 15px;
      right: 15px;
      z-index: 10;
      background: rgba(10,15,30,0.85);
      border-radius: 12px;
      padding: 12px;
      width: 240px;
      backdrop-filter: blur(8px);
      border: 1px solid rgba(100,200,255,0.2);
    }

    #stats h3 {
      font-size: 18px;
      margin-bottom: 8px;
      color: #4fc3f7;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .stat-item {
      display: flex;
      justify-content: space-between;
      padding: 6px 0;
      font-size: 15px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .stat-item:last-child { border: none; }

    .rank-1 { color: #ffd700; }
    .rank-2 { color: #c0c0c0; }
    .rank-3 { color: #cd7f32; }

    #menu {
      position: absolute;
      top: 15px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 12px;
      z-index: 20;
    }

    .menu-btn {
      background: rgba(255,255,255,0.1);
      color: #e0f7fa;
      border: none;
      padding: 8px 16px;
      border-radius: 20px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .menu-btn:hover, .menu-btn.active {
      background: rgba(100,200,255,0.5);
      color: #fff;
    }

    #settings-panel {
      position: absolute;
      top: 60px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(20,25,45,0.95);
      padding: 16px 20px;
      border-radius: 14px;
      display: none;
      flex-direction: column;
      gap: 12px;
      width: 280px;
      z-index: 30;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5);
      backdrop-filter: blur(10px);
    }

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

    .setting-label {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .toggle {
      position: relative;
      display: inline-block;
      width: 48px;
      height: 24px;
    }

    .toggle input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #444;
      transition: .3s;
      border-radius: 24px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 16px;
      width: 16px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: .3s;
      border-radius: 50%;
    }

    input:checked + .slider { background-color: #4caf50; }
    input:checked + .slider:before { transform: translateX(24px); }

    select {
      background: rgba(0,0,0,0.4);
      color: white;
      border: 1px solid #555;
      padding: 6px 10px;
      border-radius: 8px;
    }

    #gameover {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: #f44336;
      font-size: 48px;
      font-weight: bold;
      text-align: center;
      display: none;
      z-index: 40;
      text-shadow: 0 0 20px rgba(255,0,0,0.5);
      background: rgba(0,0,0,0.85);
      padding: 30px;
      border-radius: 16px;
      width: 80%;
      max-width: 500px;
    }

    #gameover small {
      font-size: 20px;
      color: #aaa;
      display: block;
      margin-top: 16px;
    }

    #joystick-container {
      position: absolute;
      bottom: 20px;
      left: 20px;
      width: 140px;
      height: 140px;
      z-index: 50;
      display: none;
    }

    #joystick-base, #joystick-knob {
      position: absolute;
      border-radius: 50%;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    #joystick-base {
      width: 120px;
      height: 120px;
      background: rgba(100,100,255,0.2);
      border: 2px solid rgba(150,200,255,0.5);
    }

    #joystick-knob {
      width: 50px;
      height: 50px;
      background: rgba(100,200,255,0.8);
      box-shadow: 0 0 10px rgba(100,200,255,0.6);
    }

    #boost-btn {
      position: absolute;
      bottom: 40px;
      right: 20px;
      width: 70px;
      height: 70px;
      text-align: center;
      border-radius: 50%;
      background: rgba(255,100,100,0.3);
      border: 2px solid rgba(255,150,150,0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 24px;
      z-index: 50;
      display: none;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }

    #boost-btn.active {
      background: rgba(255,80,80,0.8);
      transform: scale(0.95);
    }

    @media (min-width: 769px) {
      #joystick-container, #boost-btn { display: none !important; }
    }

    @media (max-width: 768px) {
      #joystick-container, #boost-btn { display: block !important; }
      #menu { top: auto; bottom: 160px; left: 53%; transform: translateX(-50%); }
      #settings-panel { top: auto; bottom: 180px; }
      #stats {
        width: 150px;
        padding: 8px;
        font-size: 13px;
      }
      .stat-item {
        padding: 4px 0;
        font-size: 12px;
      }
      .stat-item span:first-child {
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      #stats h3 { font-size: 16px; }
    }