* {
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }
    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: #020617;
      color: #e5e7eb;
    }
    body {
      display: flex;
      align-items: stretch;
      justify-content: stretch;
    }
    #game-root {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: radial-gradient(circle at top, #0b1120, #020617 65%);
    }
    canvas {
      display: block;
      width: 100%;
      height: 100%;
    }

    /* Loading screen */
    #loading-screen {
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at top, #020617, #000000 70%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 999;
      transition: opacity 0.5s ease;
    }
    #loading-logo {
      font-size: 42px;
      margin-bottom: 16px;
    }
    #loading-title {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 8px;
    }
    #loading-sub {
      font-size: 13px;
      color: #9ca3af;
      margin-bottom: 18px;
      text-align: center;
      max-width: 300px;
    }
    #loading-bar {
      width: 70%;
      max-width: 360px;
      height: 10px;
      border-radius: 999px;
      background: #020617;
      border: 1px solid #1f2937;
      overflow: hidden;
      box-shadow: 0 0 25px rgba(59,130,246,0.4);
    }
    #loading-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(to right, #22c55e, #0ea5e9, #a855f7);
      border-radius: inherit;
      transition: width 0.2s ease;
    }
    #loading-tip {
      margin-top: 10px;
      font-size: 12px;
      color: #6b7280;
    }

    /* UI overlay */
    #ui-layer {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      pointer-events: none;
      padding: 8px;
    }
    #top-ui {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      pointer-events: none;
    }
    .hud-block {
      backdrop-filter: blur(18px);
      background: radial-gradient(circle at top left, rgba(15,23,42,0.95), rgba(0,0,0,0.9));
      border-radius: 12px;
      border: 1px solid rgba(148,163,184,0.4);
      padding: 6px 10px;
      font-size: 11px;
      pointer-events: auto;
      box-shadow: 0 12px 30px rgba(15,23,42,0.8);
    }
    .hud-title {
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 3px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .hud-row {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }
    .pill {
      border-radius: 999px;
      padding: 2px 6px;
      border: 1px solid rgba(148,163,184,0.4);
      font-size: 11px;
      color: #e5e7eb;
      background: rgba(15,23,42,0.9);
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .hp-bar-container {
      width: 120px;
      height: 8px;
      border-radius: 999px;
      background: #020617;
      border: 1px solid rgba(148,163,184,0.6);
      overflow: hidden;
    }
    .hp-bar-fill {
      width: 100%;
      height: 100%;
      background: linear-gradient(to right, #ef4444, #22c55e);
      transform-origin: left center;
      transform: scaleX(1);
    }
    .kbd {
      border-radius: 4px;
      padding: 1px 4px;
      border: 1px solid rgba(148,163,184,0.7);
      font-size: 10px;
      font-family: monospace;
      background: rgba(15,23,42,0.95);
    }

    /* Bird selection */
    #bird-select {
      pointer-events: auto;
      display: flex;
      flex-direction: row;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 4px;
    }
    .bird-btn {
      border-radius: 999px;
      padding: 4px 8px;
      border: 1px solid rgba(148,163,184,0.5);
      background: rgba(15,23,42,0.95);
      font-size: 11px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      user-select: none;
    }
    .bird-btn span.icon {
      font-size: 14px;
    }
    .bird-btn.selected {
      border-color: #22c55e;
      box-shadow: 0 0 0 1px rgba(34,197,94,0.4);
      background: radial-gradient(circle at top left, rgba(22,163,74,0.75), rgba(15,23,42,0.95));
    }

    /* Start button */
    #start-btn {
      margin-top: 6px;
      border-radius: 999px;
      padding: 6px 12px;
      font-size: 12px;
      font-weight: 600;
      border: none;
      outline: none;
      cursor: pointer;
      background: linear-gradient(to right, #22c55e, #16a34a);
      color: #022c22;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 8px 22px rgba(22,163,74,0.7);
    }
    #start-btn:hover {
      filter: brightness(1.03);
      transform: translateY(-1px);
    }

    /* Bottom overlay (mobile controls + hint) */
    #bottom-ui {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      pointer-events: none;
    }
    #hint-box {
      pointer-events: auto;
      max-width: 220px;
      font-size: 11px;
      padding: 6px 9px;
      border-radius: 10px;
      border: 1px solid rgba(148,163,184,0.45);
      background: radial-gradient(circle at top left, rgba(17,24,39,0.95), rgba(15,23,42,0.95));
      color: #9ca3af;
      box-shadow: 0 10px 28px rgba(15,23,42,0.8);
    }

    /* Virtual joystick */
    #joystick-container {
      position: relative;
      width: 120px;
      height: 120px;
      border-radius: 999px;
      background: radial-gradient(circle at center, rgba(15,23,42,0.9), rgba(15,23,42,0.6));
      border: 1px solid rgba(148,163,184,0.5);
      box-shadow: 0 8px 25px rgba(15,23,42,0.9);
      pointer-events: auto;
      touch-action: none;
      margin: 8px;
    }
    #joystick-stick {
      position: absolute;
      width: 56px;
      height: 56px;
      border-radius: 999px;
      background: radial-gradient(circle at top, #0ea5e9, #1e293b);
      border: 1px solid rgba(148,163,184,0.8);
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      box-shadow: 0 0 20px rgba(56,189,248,0.8);
    }

    /* Fire button */
    #fire-button {
      width: 80px;
      height: 80px;
      border-radius: 999px;
      background: radial-gradient(circle at top, #ef4444, #7f1d1d);
      border: 1px solid rgba(248,113,113,0.9);
      box-shadow: 0 10px 30px rgba(239,68,68,0.9);
      pointer-events: auto;
      touch-action: none;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      color: #fee2e2;
      margin: 18px 12px;
      user-select: none;
    }
    #fire-button:active {
      transform: scale(0.95);
      box-shadow: 0 6px 18px rgba(127,29,29,0.9);
    }

    @media (min-width: 900px) {
      #joystick-container {
        width: 130px;
        height: 130px;
      }
      #fire-button {
        width: 90px;
        height: 90px;
      }
    }

    /* Center overlays: меню, пауза, game over */
    #center-overlay {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }
    .panel {
      pointer-events: auto;
      border-radius: 18px;
      padding: 18px 20px;
      max-width: 360px;
      background: radial-gradient(circle at top, rgba(15,23,42,0.97), rgba(15,23,42,0.93));
      border: 1px solid rgba(148,163,184,0.4);
      box-shadow: 0 20px 60px rgba(15,23,42,0.95);
    }
    .panel-title {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .panel-sub {
      font-size: 12px;
      color: #9ca3af;
      margin-bottom: 10px;
    }
    .panel-row {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 10px;
      flex-wrap: wrap;
    }
    .btn {
      border-radius: 999px;
      border: 1px solid rgba(148,163,184,0.6);
      padding: 7px 12px;
      font-size: 12px;
      font-weight: 600;
      background: rgba(15,23,42,0.98);
      color: #e5e7eb;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .btn-primary {
      border: none;
      background: linear-gradient(to right, #22c55e, #16a34a);
      color: #022c22;
      box-shadow: 0 10px 24px rgba(22,163,74,0.8);
    }
    .btn:active {
      transform: translateY(1px) scale(0.98);
    }