* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      user-select: none;
      -webkit-user-select: none;
    }

    body, html {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #040910;
      font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
      color: #e0f2fe;
    }

    #gameCanvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: block;
      cursor: crosshair;
    }

    /* UI Overlay Layer */
    #ui-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 10;
    }

    .interactive {
      pointer-events: auto;
    }

    /* Top HUD */
    #hud-top {
      position: absolute;
      top: 16px;
      left: 16px;
      right: 16px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
    }

    .glass-panel {
      background: rgba(8, 22, 36, 0.92);
      border: 1px solid rgba(56, 189, 248, 0.28);
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
      padding: 12px 18px;
    }

    #player-stats-card {
      display: flex;
      flex-direction: column;
      gap: 7px;
      min-width: 280px;
    }

    .stat-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .bar-container {
      width: 100%;
      height: 10px;
      background: rgba(15, 23, 42, 0.85);
      border-radius: 5px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.1);
      position: relative;
    }

    .bar-fill {
      height: 100%;
      width: 100%;
      transition: width 0.12s ease-out;
      border-radius: 4px;
    }

    #health-bar { background: linear-gradient(90deg, #ef4444, #10b981); }
    #stamina-bar { background: linear-gradient(90deg, #0284c7, #38bdf8); }
    #dna-bar { background: linear-gradient(90deg, #8b5cf6, #ec4899); }

    .combat-status-tag {
      font-size: 10px;
      font-weight: 800;
      padding: 1px 6px;
      border-radius: 6px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .status-combat {
      background: rgba(239, 68, 68, 0.25);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.4);
    }
    .status-regen {
      background: rgba(34, 197, 94, 0.25);
      color: #4ade80;
      border: 1px solid rgba(34, 197, 94, 0.4);
    }

    /* Leaderboard & Kill Feed */
    #right-hud-col {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 10px;
    }

    #leaderboard {
      min-width: 275px;
      max-width: 300px;
      font-size: 12px;
      padding: 10px 12px;
    }

    .hud-combined-leaderboard {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .hud-leaderboard-section {
      display: flex;
      flex-direction: column;
    }

    .hud-section-divider {
      height: 1px;
      margin: 7px 0;
      background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
    }

    .leaderboard-header-row {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-bottom: 5px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 3px;
    }

    .alltime-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      color: #fbbf24;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 5px;
      font-weight: 800;
    }

    .live-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      color: #38bdf8;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 5px;
      font-weight: 800;
    }

    .leaderboard-col-tags {
      font-size: 9.5px;
      color: #64748b;
      display: flex;
      gap: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-weight: 700;
    }

    .hud-mini-list {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .leader-separator {
      text-align: center;
      font-size: 8px;
      color: #64748b;
      padding: 1px 0;
      letter-spacing: 2px;
    }

    .leader-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 4px 6px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      font-size: 12px;
      border-radius: 4px;
      transition: background 0.15s ease;
    }

    .leader-row.me {
      color: #38bdf8;
      font-weight: 700;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.25);
    }

    .leader-info {
      display: flex;
      align-items: center;
      gap: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 145px;
    }

    .leader-metrics {
      display: flex;
      align-items: center;
      gap: 10px;
      font-variant-numeric: tabular-nums;
    }

    .leader-score {
      font-weight: 800;
      color: #38bdf8;
      font-size: 11px;
      min-width: 58px;
      text-align: right;
    }

    .leader-mass {
      font-weight: 600;
      color: #cbd5e1;
      min-width: 38px;
      text-align: right;
    }

    .leader-kills {
      font-weight: 700;
      color: #ef4444;
      min-width: 34px;
      text-align: right;
    }

    #kill-feed {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 5px;
      pointer-events: none;
    }

    .kill-item {
      background: rgba(15, 23, 42, 0.82);
      border-left: 3px solid #ef4444;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      color: #cbd5e1;
      animation: fadeInDown 0.2s ease-out forwards;
    }

    /* Bottom HUD */
    #hud-bottom {
      position: absolute;
      bottom: 16px;
      left: 16px;
      right: 16px;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
    }

    #ability-panel {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .ability-slot {
      width: 60px;
      height: 60px;
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.88);
      border: 2px solid #38bdf8;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
      box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
      cursor: pointer;
    }

    .ability-slot.autofire-on {
      border-color: #4ade80;
      box-shadow: 0 0 18px rgba(74, 222, 128, 0.55);
    }

    .ability-icon {
      font-size: 22px;
    }

    .ability-key {
      font-size: 9px;
      font-weight: 800;
      color: #94a3b8;
      margin-top: 2px;
    }

    .ability-cooldown-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 0%;
      background: rgba(0, 0, 0, 0.65);
      transition: height 0.05s linear;
    }

    /* Minimap */
    #minimap-card {
      width: 146px;
      height: 146px;
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      overflow: hidden;
    }

    #minimapCanvas {
      width: 138px;
      height: 138px;
      border-radius: 50%;
      background: rgba(3, 10, 18, 0.85);
      border: 1px solid rgba(56, 189, 248, 0.3);
    }

    /* Evolution Mutation Drawer (Edge of Screen) */
    #evolution-modal {
      position: absolute;
      top: 50%;
      right: 20px;
      left: auto;
      transform: translateY(-50%) translateX(120%);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      width: 300px;
      z-index: 100;
      background: rgba(8, 22, 38, 0.94);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 16px;
      padding: 16px;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    #evolution-modal.active {
      transform: translateY(-50%) translateX(0);
      opacity: 1;
      pointer-events: auto;
    }

    .mutation-title {
      font-size: 15px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: #ec4899;
      text-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .evolution-queue-badge {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 2px 8px;
      border-radius: 10px;
      background: rgba(236, 72, 153, 0.25);
      color: #f472b6;
      border: 1px solid rgba(236, 72, 153, 0.45);
    }

    .mutation-hint {
      font-size: 11px;
      color: #94a3b8;
      margin-bottom: 2px;
    }

    .mutation-cards-container {
      display: flex;
      flex-direction: column;
      gap: 9px;
      width: 100%;
    }

    .mutation-card {
      width: 100%;
      background: rgba(15, 23, 42, 0.85);
      border: 1.5px solid rgba(56, 189, 248, 0.25);
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      text-align: left;
      gap: 12px;
      cursor: pointer;
      transition: all 0.18s ease;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
      position: relative;
    }

    .mutation-card:hover {
      transform: translateX(-4px) scale(1.02);
      border-color: #38bdf8;
      background: rgba(14, 38, 64, 0.95);
      box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
    }

    .mutation-card-key {
      width: 24px;
      height: 24px;
      min-width: 24px;
      border-radius: 6px;
      background: rgba(56, 189, 248, 0.2);
      border: 1px solid rgba(56, 189, 248, 0.4);
      font-size: 12px;
      font-weight: 800;
      color: #38bdf8;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .mutation-icon {
      font-size: 26px;
      min-width: 32px;
      text-align: center;
      filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    }

    .mutation-info-col {
      display: flex;
      flex-direction: column;
      gap: 2px;
      flex: 1;
    }

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

    .mutation-name {
      font-size: 13px;
      font-weight: 700;
      color: #f1f5f9;
    }

    .mutation-desc {
      font-size: 11px;
      color: #94a3b8;
      line-height: 1.3;
    }

    .mutation-type-badge {
      font-size: 9px;
      text-transform: uppercase;
      font-weight: 800;
      letter-spacing: 0.5px;
      padding: 2px 6px;
      border-radius: 10px;
    }

    /* Start / Class Select Screen */
    #start-screen {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: radial-gradient(circle at 50% 30%, rgba(8, 28, 52, 0.96) 0%, rgba(2, 6, 14, 0.98) 100%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 200;
      padding: 18px 24px;
      pointer-events: auto;
      overflow-y: auto;
      box-sizing: border-box;
    }

    #start-screen.hidden {
      display: none;
    }

    .logo-container {
      text-align: center;
      margin-bottom: 12px;
    }

    .game-badge {
      display: inline-block;
      font-size: 9.5px;
      font-weight: 800;
      letter-spacing: 2.5px;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.35);
      padding: 3px 12px;
      border-radius: 20px;
      margin-bottom: 6px;
      text-transform: uppercase;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
    }

    .game-title {
      font-size: 46px;
      font-weight: 900;
      letter-spacing: 6px;
      text-transform: uppercase;
      background: linear-gradient(135deg, #38bdf8 0%, #818cf8 35%, #c084fc 70%, #f472b6 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      filter: drop-shadow(0 0 24px rgba(129, 140, 248, 0.45));
      line-height: 1.1;
    }

    .game-subtitle {
      font-size: 12.5px;
      color: #94a3b8;
      margin-top: 5px;
      letter-spacing: 1.2px;
      font-weight: 500;
    }

    /* Dual Utility Row: Hall of Fame & Regional Server */
    .start-utility-row {
      display: flex;
      gap: 14px;
      max-width: 980px;
      width: 100%;
      justify-content: center;
      margin-bottom: 14px;
    }

    @media (max-width: 820px) {
      .start-utility-row {
        flex-direction: column;
        align-items: center;
      }
    }

    .start-records-card {
      background: linear-gradient(145deg, rgba(15, 23, 42, 0.88) 0%, rgba(20, 27, 45, 0.75) 100%);
      border: 1px solid rgba(245, 158, 11, 0.35);
      border-radius: 12px;
      padding: 10px 14px;
      flex: 1.1;
      min-width: 290px;
      max-width: 480px;
      text-align: left;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    }

    .start-leaderboard-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }

    .start-leaderboard-title-group {
      display: flex;
      flex-direction: column;
    }

    .start-records-title {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: #fbbf24;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .start-leaderboard-subtitle {
      font-size: 9.5px;
      color: #94a3b8;
      font-weight: 500;
    }

    .reset-records-btn {
      background: none;
      border: 1px solid rgba(100, 116, 139, 0.3);
      color: #94a3b8;
      font-size: 10px;
      border-radius: 4px;
      cursor: pointer;
      padding: 2px 6px;
      transition: all 0.2s ease;
    }
    .reset-records-btn:hover {
      color: #f87171;
      border-color: rgba(248, 113, 113, 0.5);
    }

    /* All-Time #1 Record Callout Banner */
    .all-time-champion-banner {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.08) 100%);
      border: 1px solid rgba(245, 158, 11, 0.35);
      border-radius: 8px;
      padding: 5px 10px;
      margin-bottom: 6px;
    }

    .champ-lead-tag {
      font-size: 8.5px;
      font-weight: 800;
      color: #fbbf24;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      margin-bottom: 2px;
    }

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

    .champ-player-info {
      display: flex;
      align-items: baseline;
      gap: 8px;
    }

    .champ-holder {
      font-size: 13px;
      font-weight: 800;
      color: #ffffff;
    }

    .champ-score-text {
      font-size: 11px;
      color: #94a3b8;
    }

    .champ-score-text strong {
      font-size: 13px;
      color: #38bdf8;
      font-weight: 900;
    }

    .champ-kills-tag {
      font-size: 10px;
      color: #f87171;
      font-weight: 700;
      background: rgba(239, 68, 68, 0.12);
      padding: 2px 6px;
      border-radius: 4px;
      border: 1px solid rgba(239, 68, 68, 0.25);
    }

    /* Start Screen Compact Leaderboard Table */
    .start-leaderboard-table {
      background: rgba(2, 6, 23, 0.6);
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.05);
      padding: 4px 8px;
    }

    .start-leaderboard-thead {
      display: flex;
      justify-content: space-between;
      font-size: 9px;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 2px;
      margin-bottom: 2px;
    }

    .start-thead-metrics {
      display: flex;
      gap: 16px;
    }

    .start-leaderboard-tbody {
      display: flex;
      flex-direction: column;
      gap: 1px;
      max-height: 96px;
      overflow-y: auto;
    }

    .start-leader-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 11px;
      padding: 2px 4px;
      border-radius: 4px;
      transition: background 0.15s ease;
    }

    .start-leader-row:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    .start-leader-info {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .start-leader-rank {
      font-size: 11px;
      width: 18px;
      text-align: center;
    }

    .start-leader-name {
      font-weight: 700;
      color: #e2e8f0;
      max-width: 130px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .start-leader-metrics {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .start-leader-score {
      color: #38bdf8;
      font-weight: 800;
      font-size: 11px;
      min-width: 58px;
      text-align: right;
    }

    .start-leader-kills {
      color: #f87171;
      font-size: 10px;
      font-weight: 600;
      min-width: 32px;
      text-align: right;
    }

    /* Player Name Input Pod & Foul Name Alerts */
    .player-input-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
      max-width: 320px;
      margin: 0 auto 12px auto;
    }

    .name-validation-alert {
      display: none;
      color: #f87171;
      font-size: 11px;
      font-weight: 600;
      margin-top: 6px;
      text-align: center;
      background: rgba(239, 68, 68, 0.16);
      border: 1px solid rgba(239, 68, 68, 0.45);
      border-radius: 6px;
      padding: 5px 10px;
      animation: alertFadeIn 0.2s ease;
      width: 100%;
      box-sizing: border-box;
    }

    .name-validation-alert.active {
      display: block;
    }

    .input-field.input-error {
      border-color: #ef4444 !important;
      box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important;
      animation: inputShake 0.3s ease;
    }

    @keyframes alertFadeIn {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes inputShake {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-4px); }
      40%, 80% { transform: translateX(4px); }
    }

    /* Regional Server Selector Card */
    .regional-selector-card {
      background: linear-gradient(145deg, rgba(15, 23, 42, 0.88) 0%, rgba(12, 28, 48, 0.75) 100%);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 12px;
      padding: 10px 16px;
      flex: 1;
      min-width: 290px;
      max-width: 480px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    }

    .regional-header-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .regional-title {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: #38bdf8;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .region-pill {
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 10px;
      letter-spacing: 0.5px;
      transition: all 0.2s ease;
    }
    .region-pill.status-online { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.4); }
    .region-pill.status-offline { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }
    .region-pill.status-connecting { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

    .regional-controls-row {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
    }

    .region-dropdown {
      flex: 1;
      padding: 6px 10px;
      border-radius: 8px;
      background: rgba(2, 6, 23, 0.85);
      border: 1px solid rgba(56, 189, 248, 0.3);
      color: #e0f2fe;
      font-size: 11.5px;
      font-weight: 600;
      outline: none;
      cursor: pointer;
    }
    .region-dropdown option {
      background: #0b1329;
      color: #e0f2fe;
    }

    .regional-stats-row {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .region-metric {
      font-size: 11px;
      font-weight: 700;
      color: #94a3b8;
      background: rgba(2, 6, 23, 0.65);
      padding: 5px 8px;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.05);
      white-space: nowrap;
    }

    .net-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 700;
      color: #38bdf8;
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid rgba(56, 189, 248, 0.35);
      padding: 5px 10px;
      border-radius: 8px;
    }

    /* Player Name Pod */
    .player-input-box {
      margin-bottom: 16px;
      display: flex;
      gap: 0;
      align-items: center;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 30px;
      padding: 4px 6px 4px 14px;
      max-width: 380px;
      width: 100%;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
      transition: all 0.25s ease;
      box-sizing: border-box;
    }

    .player-input-box:focus-within {
      border-color: #38bdf8;
      box-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
    }

    .input-addon-icon {
      font-size: 16px;
      margin-right: 8px;
      opacity: 0.85;
      user-select: none;
    }

    .input-field {
      padding: 8px 6px;
      background: transparent;
      border: none;
      color: #f0f9ff;
      font-size: 14px;
      outline: none;
      flex: 1;
      font-weight: 700;
      letter-spacing: 0.5px;
    }

    .name-random-btn {
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.25);
      color: #e0f2fe;
      border-radius: 50%;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .name-random-btn:hover {
      background: rgba(56, 189, 248, 0.25);
      transform: rotate(25deg) scale(1.08);
      border-color: #38bdf8;
    }

    /* Class Cards */
    .class-selection-container {
      display: flex;
      gap: 14px;
      max-width: 980px;
      width: 100%;
      margin-bottom: 16px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .class-card {
      width: 224px;
      min-height: 245px;
      background: linear-gradient(160deg, rgba(15, 23, 42, 0.85) 0%, rgba(8, 14, 28, 0.9) 100%);
      border: 2px solid rgba(255, 255, 255, 0.08);
      border-radius: 16px;
      padding: 16px 13px 14px 13px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
      position: relative;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
      box-sizing: border-box;
    }

    .class-card:hover {
      transform: translateY(-5px);
      border-color: rgba(255, 255, 255, 0.25);
      background: linear-gradient(160deg, rgba(20, 30, 55, 0.92) 0%, rgba(10, 18, 36, 0.95) 100%);
    }

    /* Individual Class Color Theming when selected */
    .class-card[data-class="grazer"].selected {
      border-color: #4ade80;
      background: linear-gradient(160deg, rgba(6, 40, 24, 0.92) 0%, rgba(4, 20, 14, 0.96) 100%);
      box-shadow: 0 0 25px rgba(74, 222, 128, 0.42);
    }
    .class-card[data-class="hunter"].selected {
      border-color: #f87171;
      background: linear-gradient(160deg, rgba(46, 12, 18, 0.92) 0%, rgba(22, 6, 10, 0.96) 100%);
      box-shadow: 0 0 25px rgba(248, 113, 113, 0.42);
    }
    .class-card[data-class="toxoid"].selected {
      border-color: #c084fc;
      background: linear-gradient(160deg, rgba(38, 14, 52, 0.92) 0%, rgba(18, 6, 26, 0.96) 100%);
      box-shadow: 0 0 25px rgba(192, 132, 252, 0.42);
    }
    .class-card[data-class="tank"].selected {
      border-color: #fbbf24;
      background: linear-gradient(160deg, rgba(44, 28, 6, 0.92) 0%, rgba(22, 14, 4, 0.96) 100%);
      box-shadow: 0 0 25px rgba(251, 191, 36, 0.42);
    }

    .class-badge-indicator {
      position: absolute;
      top: -9px;
      font-size: 8.5px;
      font-weight: 800;
      letter-spacing: 1.5px;
      padding: 2px 8px;
      border-radius: 10px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #94a3b8;
      text-transform: uppercase;
      transition: all 0.2s ease;
    }
    .class-card.selected .class-badge-indicator {
      background: #0284c7;
      border-color: #38bdf8;
      color: #ffffff;
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
    }
    .class-card[data-class="grazer"].selected .class-badge-indicator { background: #15803d; border-color: #4ade80; }
    .class-card[data-class="hunter"].selected .class-badge-indicator { background: #b91c1c; border-color: #f87171; }
    .class-card[data-class="toxoid"].selected .class-badge-indicator { background: #7e22ce; border-color: #c084fc; }
    .class-card[data-class="tank"].selected .class-badge-indicator { background: #b45309; border-color: #fbbf24; }

    .class-icon-wrapper {
      margin-top: 4px;
      margin-bottom: 6px;
    }

    .class-icon {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.1);
      transition: transform 0.25s ease;
    }
    .class-card:hover .class-icon {
      transform: scale(1.1);
    }
    .grazer-icon { background: rgba(34, 197, 94, 0.18); border: 1px solid rgba(74, 222, 128, 0.4); color: #4ade80; }
    .hunter-icon { background: rgba(239, 68, 68, 0.18); border: 1px solid rgba(248, 113, 113, 0.4); color: #f87171; }
    .toxoid-icon { background: rgba(168, 85, 247, 0.18); border: 1px solid rgba(192, 132, 252, 0.4); color: #c084fc; }
    .tank-icon { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(251, 191, 36, 0.4); color: #fbbf24; }

    .class-name {
      font-size: 17px;
      font-weight: 800;
      letter-spacing: 0.5px;
      margin-bottom: 4px;
      color: #f1f5f9;
    }

    .class-diet-tag {
      font-size: 9.5px;
      font-weight: 800;
      text-transform: uppercase;
      padding: 2px 8px;
      border-radius: 8px;
      margin-bottom: 8px;
      letter-spacing: 0.5px;
    }

    .diet-herbivore { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.35); }
    .diet-carnivore { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.35); }
    .diet-parasite { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.35); }
    .diet-omnivore { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.35); }

    .class-description {
      font-size: 11px;
      color: #94a3b8;
      text-align: center;
      line-height: 1.42;
      margin: 4px 0 12px 0;
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .class-stat-list {
      width: 100%;
      font-size: 10.5px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      color: #cbd5e1;
    }

    .stat-bar-group {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .stat-bar-label {
      display: flex;
      justify-content: space-between;
      color: #94a3b8;
      font-size: 10px;
      font-weight: 600;
    }

    .stat-bar-label .stat-num {
      color: #f1f5f9;
      font-weight: 700;
    }

    .stat-meter {
      width: 100%;
      height: 4px;
      background: rgba(2, 6, 23, 0.7);
      border-radius: 3px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .stat-meter-fill {
      height: 100%;
      border-radius: 3px;
      transition: width 0.3s ease;
    }
    .fill-emerald { background: linear-gradient(90deg, #22c55e, #4ade80); }
    .fill-crimson { background: linear-gradient(90deg, #ef4444, #f87171); }
    .fill-violet { background: linear-gradient(90deg, #a855f7, #c084fc); }
    .fill-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

    .class-perk-badge {
      width: 100%;
      box-sizing: border-box;
      font-size: 9.5px;
      font-weight: 700;
      text-align: center;
      padding: 6px 8px;
      border-radius: 8px;
      margin-top: auto;
      letter-spacing: 0.2px;
    }
    .perk-emerald { background: rgba(34, 197, 94, 0.14); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.25); }
    .perk-crimson { background: rgba(239, 68, 68, 0.14); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.25); }
    .perk-violet { background: rgba(168, 85, 247, 0.14); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.25); }
    .perk-amber { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.25); }

    /* Action Center */
    .start-action-center {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
      max-width: 440px;
      align-items: center;
      margin-top: 4px;
    }

    .start-btn {
      width: 100%;
      padding: 13px 36px;
      border-radius: 30px;
      font-size: 17px;
      font-weight: 800;
      letter-spacing: 2px;
      text-transform: uppercase;
      background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
      color: #ffffff;
      border: none;
      cursor: pointer;
      box-shadow: 0 6px 22px rgba(14, 165, 233, 0.5);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .start-btn:hover {
      transform: translateY(-2px) scale(1.02);
      box-shadow: 0 8px 30px rgba(56, 189, 248, 0.7);
    }

    .share-lobby-btn {
      width: 100%;
      padding: 9px 18px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.5px;
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #e0f2fe;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .share-lobby-btn:hover {
      background: rgba(56, 189, 248, 0.18);
      border-color: #38bdf8;
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
    }

    #controls-tip {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: center;
      margin-top: 14px;
      max-width: 680px;
    }

    .control-pill {
      font-size: 11px;
      font-weight: 600;
      color: #94a3b8;
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 4px 10px;
      border-radius: 12px;
    }
    .control-pill strong {
      color: #38bdf8;
    }

    /* Death / Game Over Screen & Live Killer Spectator Cam */
    #death-screen {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: radial-gradient(circle at center, rgba(3, 8, 14, 0.28) 0%, rgba(3, 8, 14, 0.78) 100%);
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 350;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    #death-screen.active {
      display: flex !important;
      opacity: 1 !important;
      pointer-events: auto !important;
    }

    #death-screen.active .interactive,
    #death-screen.active button {
      pointer-events: auto !important;
      cursor: pointer !important;
    }

    .modal-overlay:not(.active) {
      display: none !important;
      pointer-events: none !important;
    }

    .modal-overlay:not(.active) * {
      pointer-events: none !important;
    }

    /* #1 Apex Compass & Location HUD Badge */
    .apex-tracker-badge {
      background: rgba(245, 158, 11, 0.16) !important;
      border: 1px solid rgba(245, 158, 11, 0.45) !important;
      color: #fbbf24 !important;
      font-weight: 800 !important;
      font-size: 11px;
      letter-spacing: 0.5px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      box-shadow: 0 0 12px rgba(245, 158, 11, 0.18);
      transition: all 0.25s ease;
      white-space: nowrap;
    }

    .apex-tracker-badge.me {
      background: rgba(234, 179, 8, 0.28) !important;
      border: 1px solid #facc15 !important;
      color: #fef08a !important;
      box-shadow: 0 0 16px rgba(250, 204, 21, 0.4);
    }

    #death-screen.active .interactive {
      pointer-events: auto;
    }

    /* Live Killer Spectator Cam Banner */
    .killer-cam-banner {
      position: absolute;
      top: 24px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(239, 68, 68, 0.5);
      box-shadow: 0 4px 24px rgba(239, 68, 68, 0.25);
      border-radius: 9999px;
      padding: 8px 24px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 14px;
      z-index: 220;
      letter-spacing: 0.5px;
    }

    .live-rec-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #ef4444;
      box-shadow: 0 0 10px #ef4444;
      animation: pulseLiveDot 1.2s infinite ease-in-out;
    }

    @keyframes pulseLiveDot {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.35); opacity: 0.45; }
    }

    .killer-cam-title {
      font-weight: 800;
      color: #94a3b8;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .killer-cam-name {
      color: #f87171;
      font-weight: 900;
      font-size: 16px;
    }

    .killer-cam-class {
      color: #38bdf8;
      font-size: 12px;
      font-weight: 700;
    }

    .killer-cam-status {
      font-size: 11px;
      font-weight: 800;
      color: #4ade80;
      background: rgba(34, 197, 94, 0.15);
      border: 1px solid rgba(74, 222, 128, 0.4);
      padding: 2px 8px;
      border-radius: 9999px;
    }

    .death-buttons-row {
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin-top: 14px;
      position: relative;
      z-index: 270;
      pointer-events: auto;
    }

    .death-buttons-row button {
      flex: 1;
      cursor: pointer;
      pointer-events: auto;
      position: relative;
      z-index: 280;
    }

    #respawnBtn {
      padding: 12px 18px;
      font-size: 14px;
      letter-spacing: 1.5px;
      position: relative;
      z-index: 285;
      pointer-events: auto !important;
      cursor: pointer;
    }

    .secondary-btn {
      padding: 12px 18px;
      border-radius: 24px;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.5px;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #e0f2fe;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    .secondary-btn:hover {
      background: rgba(56, 189, 248, 0.2);
      border-color: #38bdf8;
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
      transform: translateY(-1px);
    }

    /* Refer a Friend & Lobby Share Modal */
    .modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(2, 6, 23, 0.92);
      align-items: center;
      justify-content: center;
      z-index: 1000 !important;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .modal-overlay.active {
      display: flex !important;
      opacity: 1 !important;
      pointer-events: auto !important;
      z-index: 1000 !important;
    }

    .home-nav-btn {
      background: rgba(15, 23, 42, 0.9) !important;
      border: 1px solid rgba(56, 189, 248, 0.45) !important;
      color: #e0f2fe !important;
      font-weight: 700 !important;
      cursor: pointer !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
      transition: all 0.2s ease !important;
    }

    .home-nav-btn:hover {
      background: rgba(56, 189, 248, 0.25) !important;
      border-color: #38bdf8 !important;
      color: #ffffff !important;
      transform: translateY(-1px);
    }

    .modal-card {
      width: 90%;
      max-width: 480px;
      padding: 24px;
      display: flex;
      flex-direction: column;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-title {
      font-size: 16px;
      font-weight: 900;
      color: #38bdf8;
      letter-spacing: 1px;
    }

    .modal-close-btn {
      background: none;
      border: none;
      color: #94a3b8;
      font-size: 24px;
      cursor: pointer;
      line-height: 1;
      padding: 0 4px;
      transition: color 0.15s;
    }

    .modal-close-btn:hover {
      color: #ffffff;
    }

    .referral-field-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .referral-label {
      font-size: 11px;
      font-weight: 800;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.8px;
    }

    .referral-input-row {
      display: flex;
      gap: 8px;
    }

    .referral-input-row .input-field {
      flex: 1;
      font-size: 13px;
      padding: 8px 12px;
    }

    /* Referral Toast Notification */
    .referral-toast {
      position: fixed;
      bottom: 32px;
      left: 50%;
      transform: translateX(-50%) translateY(40px);
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid #38bdf8;
      box-shadow: 0 8px 28px rgba(56, 189, 248, 0.4);
      color: #f8fafc;
      font-size: 14px;
      font-weight: 700;
      padding: 12px 24px;
      border-radius: 9999px;
      z-index: 350;
      opacity: 0;
      pointer-events: none;
      transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .referral-toast.show {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }

    .invite-glow-btn {
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
      border: 1px solid rgba(56, 189, 248, 0.5) !important;
      color: #38bdf8 !important;
      font-weight: 800 !important;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
    }
    .invite-glow-btn:hover {
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(168, 85, 247, 0.35));
      box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
    }

    .death-modal-card {
      width: 90%;
      max-width: 440px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: stretch;
      padding: 24px 28px;
      box-sizing: border-box;
      pointer-events: auto;
      z-index: 260;
    }

    .death-title {
      font-size: 32px;
      font-weight: 900;
      color: #ef4444;
      letter-spacing: 2px;
      text-align: center;
      margin-bottom: 6px;
      text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }

    .death-stats-card {
      min-width: 320px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      font-size: 14px;
    }

    .death-hof-section {
      margin-top: 6px;
      padding-top: 8px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .death-hof-heading {
      font-size: 11px;
      font-weight: 800;
      color: #fbbf24;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      margin-bottom: 2px;
    }

    /* Notifications / Floating Alert (Single non-intrusive banner at the very top) */
    #notification-area {
      position: absolute;
      top: 16px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      pointer-events: none;
      z-index: 100;
      max-width: 520px;
    }

    .notify-toast {
      padding: 6px 16px;
      background: rgba(15, 23, 42, 0.94);
      border: 1px solid rgba(56, 189, 248, 0.45);
      border-radius: 16px;
      font-size: 12px;
      font-weight: 700;
      color: #e0f2fe;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
      white-space: nowrap;
      animation: fadeInDown 0.2s ease-out forwards;
    }

    @keyframes fadeInDown {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Sound and Help Toggles */
    #quick-toggles {
      position: absolute;
      top: 16px;
      right: 252px;
      display: flex;
      gap: 8px;
    }

    .icon-btn {
      height: 36px;
      padding: 0 12px;
      border-radius: 8px;
      background: rgba(8, 22, 36, 0.78);
      border: 1px solid rgba(56, 189, 248, 0.28);
      color: #38bdf8;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
      font-weight: 700;
      gap: 6px;
      transition: all 0.15s ease;
    }

    .icon-btn:hover {
      background: rgba(56, 189, 248, 0.2);
    }

    #controls-tip {
      font-size: 12px;
      color: #94a3b8;
      margin-top: 16px;
      text-align: center;
      line-height: 1.6;
    }

    /* Legal Compliance Footer & Modal */
    .start-legal-footer {
      margin-top: 18px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: #64748b;
      user-select: none;
    }

    .legal-disclaimer {
      font-size: 11px;
      color: #64748b;
    }

    .legal-disclaimer a {
      color: #38bdf8;
      text-decoration: underline;
      cursor: pointer;
      transition: color 0.15s ease;
    }

    .legal-disclaimer a:hover {
      color: #7dd3fc;
    }

    .legal-links-row {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      color: #475569;
    }

    .legal-nav-link {
      color: #64748b;
      text-decoration: none;
      cursor: pointer;
      transition: color 0.15s ease;
    }

    .legal-nav-link:hover {
      color: #38bdf8;
      text-decoration: underline;
    }

    .legal-sep {
      color: #334155;
    }

    .legal-copy {
      color: #475569;
    }

    .legal-modal-card {
      width: 90%;
      max-width: 620px;
      max-height: 82vh;
      display: flex;
      flex-direction: column;
      padding: 20px 24px;
      box-sizing: border-box;
      background: rgba(10, 25, 42, 0.96);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 16px;
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
    }

    .legal-modal-tabs {
      display: flex;
      gap: 8px;
    }

    .legal-tab-btn {
      background: rgba(15, 23, 42, 0.7);
      border: 1px solid rgba(56, 189, 248, 0.25);
      color: #94a3b8;
      font-size: 13px;
      font-weight: 700;
      padding: 6px 14px;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .legal-tab-btn:hover {
      background: rgba(56, 189, 248, 0.15);
      color: #e2e8f0;
    }

    .legal-tab-btn.active {
      background: rgba(56, 189, 248, 0.25);
      border-color: #38bdf8;
      color: #38bdf8;
    }

    .legal-modal-body {
      flex: 1;
      overflow-y: auto;
      margin: 16px 0;
      padding-right: 8px;
      max-height: 52vh;
    }

    .legal-modal-body::-webkit-scrollbar {
      width: 6px;
    }

    .legal-modal-body::-webkit-scrollbar-thumb {
      background: rgba(56, 189, 248, 0.3);
      border-radius: 3px;
    }

    .legal-pane {
      display: none;
      font-size: 12.5px;
      line-height: 1.6;
      color: #94a3b8;
    }

    .legal-pane.active {
      display: block;
    }

    .legal-pane p {
      margin: 0 0 10px 0;
    }

    .legal-pane strong {
      color: #e2e8f0;
    }

    .legal-pane a {
      color: #38bdf8;
      text-decoration: underline;
    }

    .legal-modal-footer {
      display: flex;
      justify-content: flex-end;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      padding-top: 12px;
    }
