
    :root {
      color-scheme: dark;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      display: grid;
      place-items: center;
      background: #0f172a;
      color: #e2e8f0;
      font-family: Arial, Helvetica, sans-serif;
      overflow-x: hidden;
      overflow-y: auto;
      padding: 12px;
    }

    .app {
      width: min(95vw, 1000px);
      display: grid;
      gap: 10px;
    }

    .mode-menu {
      background: rgba(15, 23, 42, 0.82);
      border: 1px solid rgba(148, 163, 184, 0.35);
      border-radius: 10px;
      padding: 10px;
      display: grid;
      gap: 8px;
    }

    .menu-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .menu-row .grow {
      flex: 1 1 auto;
    }

    .menu-row input {
      flex: 1 1 220px;
      border: 1px solid #334155;
      border-radius: 10px;
      padding: 10px;
      background: #020617;
      color: #e2e8f0;
      outline: none;
    }

    .menu-row input:focus {
      border-color: #60a5fa;
    }

    .menu-status {
      margin: 0;
      font-size: 12px;
      color: #cbd5e1;
      min-height: 14px;
    }

    .game-wrap {
      position: relative;
      width: 100%;
      aspect-ratio: 16 / 9;
      border: 2px solid #334155;
      border-radius: 14px;
      overflow: hidden;
      background: #020617;
    }

    .game-wrap:fullscreen {
      width: 100vw;
      height: 100vh;
      aspect-ratio: auto;
      border-radius: 0;
      border: 0;
    }

    .game-wrap:-webkit-full-screen {
      width: 100vw;
      height: 100vh;
      aspect-ratio: auto;
      border-radius: 0;
      border: 0;
    }

    canvas {
      width: 100%;
      height: 100%;
      display: block;
      cursor: crosshair;
      touch-action: none;
    }

    .hud {
      position: absolute;
      top: 10px;
      left: 10px;
      right: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      pointer-events: none;
      font-size: 14px;
      text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    }

    .panel {
      background: rgba(15, 23, 42, 0.75);
      border: 1px solid rgba(148, 163, 184, 0.35);
      padding: 8px 10px;
      border-radius: 10px;
      backdrop-filter: blur(2px);
    }

    .ping-display {
      position: absolute;
      left: 50%;
      bottom: 10px;
      transform: translateX(-50%);
      background: rgba(15, 23, 42, 0.75);
      border: 1px solid rgba(148, 163, 184, 0.35);
      padding: 6px 10px;
      border-radius: 10px;
      backdrop-filter: blur(2px);
      font-size: 12px;
      color: #e2e8f0;
      pointer-events: none;
      z-index: 3;
      min-width: 88px;
      text-align: center;
      text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    }

    .overlay {
      position: absolute;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(2, 6, 23, 0.75);
    }

    .overlay.show {
      display: flex;
    }

    .card {
      text-align: center;
      background: #111827;
      border: 1px solid #334155;
      border-radius: 14px;
      padding: 18px;
      width: min(90%, 360px);
    }

    .end-form {
      margin-top: 10px;
      display: grid;
      gap: 8px;
    }

    .end-form input {
      width: 100%;
      border: 1px solid #334155;
      border-radius: 10px;
      padding: 10px;
      background: #020617;
      color: #e2e8f0;
      outline: none;
    }

    .end-form input:focus {
      border-color: #60a5fa;
    }

    .small {
      font-size: 12px;
      opacity: 0.9;
      min-height: 14px;
      margin: 0;
    }

    .leaderboard {
      width: 100%;
      max-height: 280px;
      overflow: auto;
      background: rgba(15, 23, 42, 0.82);
      border: 1px solid rgba(148, 163, 184, 0.35);
      border-radius: 10px;
      padding: 8px 10px;
      font-size: 13px;
    }

    .leaderboard h3 {
      margin: 0 0 6px;
      font-size: 13px;
      font-weight: 700;
      color: #cbd5e1;
    }

    .leaderboard ol {
      margin: 0;
      padding-left: 18px;
    }

    .leaderboard li {
      margin: 2px 0;
      color: #e2e8f0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .leaderboard.hidden {
      display: none;
    }

    button {
      border: 0;
      border-radius: 10px;
      padding: 10px 14px;
      font-weight: 700;
      color: white;
      background: #2563eb;
      cursor: pointer;
      margin-top: 10px;
    }

    button:hover {
      background: #1d4ed8;
    }
  
