:root {
      --neon-cyan: #00f3ff;
      --neon-magenta: #ff007f;
      --neon-purple: #9d00ff;
      --neon-amber: #ffaa00;
      --neon-green: #00ff66;
      --dark-bg: #070913;
      --card-bg: rgba(14, 20, 36, 0.88);
      --border-glow: rgba(0, 243, 255, 0.4);
    }
    .neon-gamepad-connected .cyber-btn[data-gamepad-key]::after {
      display: inline-flex !important;
      content: attr(data-gamepad-key);
      min-width: 22px;
      align-items: center;
      justify-content: center;
      padding: 2px 5px;
      margin-left: 7px;
      border-radius: 7px;
      border: 1px solid #72b9e8;
      background: #152f4c;
      color: #e6f7ff;
      font: 800 11px system-ui;
    }
    #modal-levelup .upgrade-card.selected-pending,
    #modal-levelup .upgrade-card.selected-pending:hover {
      outline: 3px solid #54ffbe;
      outline-offset: -3px;
      background: linear-gradient(160deg, rgba(12, 65, 65, .95), rgba(20, 36, 72, .95));
      box-shadow: 0 0 22px rgba(47, 255, 181, .55);
      transform: translateY(-4px);
    }
    #modal-levelup .upgrade-card.selected-pending::after {
      content: '待确认';
      position: absolute;
      top: 5px;
      left: 7px;
      color: #4cffb0;
      font-weight: 800;
      font-size: 10px;
    }

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

    body, html {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background-color: var(--dark-bg);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      color: #fff;
    }

    #canvas-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      touch-action: none;
    }

    canvas {
      display: block;
      width: 100%;
      height: 100%;
      background: #060810;
    }

    /* CRT scanline & vignette overlay (toggleable) */
    .crt-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 2;
      background: radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.75) 100%),
                  repeating-linear-gradient(rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 3px);
      transition: opacity 0.3s;
    }

    /* Top HUD */
    #hud {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      padding: 14px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      z-index: 10;
      pointer-events: none;
      background: linear-gradient(to bottom, rgba(6, 8, 16, 0.9) 0%, rgba(6, 8, 16, 0.3) 80%, transparent 100%);
    }

    .hud-left {
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }

    .hud-center {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .hud-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .stat-pill {
      background: rgba(13, 19, 36, 0.75);
      border: 1px solid rgba(0, 243, 255, 0.25);
      backdrop-filter: blur(8px);
      padding: 6px 14px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      font-weight: 600;
      letter-spacing: 0.5px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .stat-pill.timer-pill {
      border: 1px solid rgba(0, 243, 255, 0.5);
      background: rgba(9, 20, 42, 0.88);
      box-shadow: 0 0 14px rgba(0, 243, 255, 0.28);
    }

    .stat-pill .icon {
      font-size: 16px;
    }

    .stat-pill .value {
      color: var(--neon-cyan);
      font-family: 'Courier New', Courier, monospace;
      font-size: 16px;
      font-weight: 700;
    }

    /* XP Progress Bar */
    #xp-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 6px;
      background: rgba(255, 255, 255, 0.08);
      z-index: 15;
    }

    #xp-bar {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, #00f3ff, #00ffaa, #9d00ff);
      box-shadow: 0 0 10px #00f3ff;
      transition: width 0.15s ease-out;
    }

    #level-badge {
      background: linear-gradient(135deg, #00f3ff, #9d00ff);
      color: #000;
      font-weight: 900;
      padding: 3px 12px;
      border-radius: 999px;
      font-size: 12px;
      letter-spacing: 0.5px;
      box-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
    }

    /* Health and Dash bar above player in HUD */
    .status-bars {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 175px;
    }

    .bar-wrap {
      width: 175px;
      height: 8px;
      background: rgba(0, 0, 0, 0.65);
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.15);
    }

    #hp-fill {
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, #ff0055, #ff3366);
      box-shadow: 0 0 6px #ff0055;
      border-radius: 999px;
      transition: width 0.15s;
    }

    .dash-segments {
      display: flex;
      gap: 3px;
      width: 175px;
      height: 7px;
    }

    .dash-segment {
      flex: 1;
      height: 100%;
      background: rgba(0, 0, 0, 0.65);
      border-radius: 999px;
      border: 1px solid rgba(0, 243, 255, 0.28);
      overflow: hidden;
      position: relative;
    }

    .dash-segment-fill {
      height: 100%;
      width: 100%;
      background: linear-gradient(90deg, #00bbff, #00f3ff);
      box-shadow: 0 0 6px #00f3ff;
      border-radius: 999px;
      transition: width 0.08s ease-out;
    }

    .dash-stats-bar {
      font-size: 11px;
      color: var(--neon-cyan);
      font-family: 'JetBrains Mono', 'Courier New', monospace;
      font-weight: 700;
      letter-spacing: 0.3px;
      text-shadow: 0 0 6px rgba(0, 243, 255, 0.6);
      margin-top: 3px;
      white-space: nowrap;
    }

    /* Weapons inventory display */
    #weapons-bar {
      position: absolute;
      bottom: 20px;
      left: 20px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      z-index: 10;
      pointer-events: none;
    }

    .equip-group {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      max-width: calc(100vw - 40px);
    }

    .weapon-slot {
      width: 42px;
      height: 42px;
      background: rgba(14, 20, 36, 0.78);
      border: 1.5px solid rgba(0, 243, 255, 0.35);
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      position: relative;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    }

    .weapon-slot.empty {
      border: 1.5px dashed rgba(255, 255, 255, 0.16);
      background: rgba(14, 20, 36, 0.4);
      font-size: 11px;
    }

    .weapon-slot.passive {
      border-color: rgba(157, 0, 255, 0.45);
    }

    .weapon-slot .lvl-text {
      position: absolute;
      bottom: 1px;
      right: 3px;
      font-size: 9px;
      color: var(--neon-cyan);
      font-weight: 800;
      font-family: monospace;
    }

    /* Boss Health Bar */
    #boss-hud {
      position: absolute;
      top: 60px;
      left: 50%;
      transform: translateX(-50%);
      width: min(500px, 80%);
      z-index: 10;
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      pointer-events: none;
      animation: pulseAlert 2s infinite ease-in-out;
    }

    @keyframes pulseAlert {
      0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 0, 85, 0.4)); }
      50% { filter: drop-shadow(0 0 16px rgba(255, 0, 85, 0.9)); }
    }

    .boss-name {
      font-size: 14px;
      font-weight: 800;
      color: #ff0055;
      text-transform: uppercase;
      letter-spacing: 2px;
      text-shadow: 0 0 10px #ff0055;
    }

    .boss-bar-wrap {
      width: 100%;
      height: 12px;
      background: rgba(0, 0, 0, 0.8);
      border: 1.5px solid #ff0055;
      border-radius: 6px;
      overflow: hidden;
    }

    #boss-hp-fill {
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, #ff0055, #ff5500, #ff0088);
      box-shadow: 0 0 10px #ff0055;
      transition: width 0.1s;
    }

    /* Modal windows (Level up, Pause, Game Over, Victory) */
    .modal-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(4, 6, 14, 0.85);
      backdrop-filter: blur(10px);
      z-index: 50;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease-out;
    }

    .modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .modal-card {
      background: var(--card-bg);
      border: 1.5px solid rgba(0, 243, 255, 0.25);
      border-radius: 26px;
      padding: 32px 36px;
      max-width: 620px;
      width: 90%;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 243, 255, 0.1);
      text-align: center;
      position: relative;
      animation: modalPop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    }

    @keyframes modalPop {
      from { transform: scale(0.9) translateY(20px); opacity: 0; }
      to { transform: scale(1) translateY(0); opacity: 1; }
    }

    .modal-title {
      font-size: 28px;
      font-weight: 900;
      letter-spacing: 1.5px;
      margin-bottom: 8px;
      background: linear-gradient(135deg, #00f3ff, #ff007f);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .modal-sub {
      color: #8c9cb8;
      font-size: 14px;
      margin-bottom: 24px;
    }

    /* Upgrade Selection Cards */
    .upgrade-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 16px;
      width: 100%;
      margin-bottom: 16px;
    }

    #modal-levelup .modal-card {
      max-width: min(1100px, calc(100vw - 26px));
      max-height: calc(100dvh - 32px);
      overflow-y: auto;
      padding: clamp(12px, 2vw, 26px);
    }
    #modal-levelup .upgrade-grid {
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
      gap: clamp(8px, 1vw, 14px);
    }
    #modal-levelup .upgrade-card { padding: 14px 9px; }
    .upgrade-card.picked,
    .upgrade-card.picked:hover {
      opacity: .52;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
      border-color: #6e96a0;
    }
    .upgrade-bank-actions {
      display: flex;
      position: sticky;
      bottom: 0;
      z-index: 5;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin: 10px auto 0;
      padding: 12px 8px max(10px, env(safe-area-inset-bottom));
      background: linear-gradient(180deg, rgba(10, 19, 38, .97), rgba(7, 20, 31, .99));
      border-top: 1px solid rgba(77, 234, 200, .35);
      border-radius: 10px;
      color: #c1e6ff;
      font-size: 13px;
    }
    .upgrade-bank-actions button {
      min-height: 42px;
      padding: 9px 14px;
      color: #baffdf;
      background: #112a37;
      border: 1px solid #51b991;
      border-radius: 9px;
      font-weight: 700;
      cursor: pointer;
    }
    .upgrade-bank-actions button:hover { background: #164735; }
    .upgrade-bank-actions .upgrade-preview-label {
      flex: 1 1 100%;
      text-align: center;
      color: #a9c6df;
      font-size: 12px;
    }
    .upgrade-bank-actions .upgrade-confirm-btn {
      background: linear-gradient(135deg, #0b6854, #084d60);
      border-color: #39f6c6;
      color: #e4fff4;
    }
    .upgrade-bank-actions .upgrade-cancel-btn {
      background: rgba(36, 45, 65, .9);
      border-color: #7896ad;
      color: #e0eeff;
    }
    .upgrade-bank-actions button:disabled {
      opacity: .38;
      cursor: not-allowed;
    }

    .upgrade-card {
      background: rgba(18, 26, 48, 0.85);
      border: 1.5px solid rgba(0, 243, 255, 0.22);
      border-radius: 18px;
      padding: 18px 14px;
      display: flex;
      flex-direction: column;
      align-items: center;
      cursor: pointer;
      touch-action: none;
      transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
      position: relative;
      overflow: hidden;
    }

    .upgrade-card:hover {
      transform: translateY(-6px);
      border-color: var(--neon-cyan);
      box-shadow: 0 10px 24px rgba(0, 243, 255, 0.3);
      background: rgba(24, 38, 70, 0.95);
    }

    .upgrade-card.rare {
      border-color: rgba(157, 0, 255, 0.6);
    }
    .upgrade-card.rare:hover {
      border-color: var(--neon-purple);
      box-shadow: 0 10px 24px rgba(157, 0, 255, 0.4);
    }

    .upgrade-card.legendary {
      border-color: rgba(255, 170, 0, 0.8);
    }
    .upgrade-card.legendary:hover {
      border-color: var(--neon-amber);
      box-shadow: 0 10px 24px rgba(255, 170, 0, 0.5);
    }

    .upgrade-card.limit-break {
      border-color: #ffaa00;
      background: linear-gradient(135deg, rgba(32, 22, 60, 0.95), rgba(46, 16, 75, 0.95));
      box-shadow: 0 0 18px rgba(255, 170, 0, 0.4);
      animation: pulseGold 2s infinite alternate ease-in-out;
    }
    .upgrade-card.limit-break:hover {
      transform: translateY(-8px);
      box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
      border-color: #ffd700;
    }
    @keyframes pulseGold {
      from { box-shadow: 0 0 14px rgba(255, 170, 0, 0.35); border-color: #ffaa00; }
      to { box-shadow: 0 0 28px rgba(255, 220, 0, 0.75); border-color: #ffe600; }
    }

    .upgrade-card.dash-card {
      border-color: #00f3ff;
      background: linear-gradient(135deg, rgba(8, 28, 54, 0.95), rgba(12, 42, 78, 0.95));
      box-shadow: 0 0 16px rgba(0, 243, 255, 0.35);
    }
    .upgrade-card.dash-card:hover {
      border-color: #70ffff;
      box-shadow: 0 0 26px rgba(0, 243, 255, 0.7);
    }

    .upgrade-card .rarity-tag {
      position: absolute;
      top: 6px;
      right: 8px;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 2px 6px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.08);
      color: #8c9cb8;
    }

    .upgrade-card.rare .rarity-tag { color: #d37aff; background: rgba(157, 0, 255, 0.2); }
    .upgrade-card.legendary .rarity-tag { color: #ffca40; background: rgba(255, 170, 0, 0.2); }

    .upgrade-icon {
      font-size: 34px;
      margin: 10px 0 10px;
    }

    .upgrade-name {
      font-size: 16px;
      font-weight: 700;
      color: #fff;
      margin-bottom: 6px;
    }

    .upgrade-desc {
      font-size: 12px;
      color: #9cb0d0;
      line-height: 1.4;
      text-align: center;
    }

    .upgrade-lvl {
      margin-top: 10px;
      font-size: 11px;
      color: var(--neon-cyan);
      font-weight: 600;
    }

    /* Buttons */
    .cyber-btn {
      background: linear-gradient(135deg, #00d2ff, #0077ff);
      color: #fff;
      font-weight: 800;
      font-size: 15px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 11px 26px;
      border-radius: 999px;
      cursor: pointer;
      letter-spacing: 0.5px;
      box-shadow: 0 4px 18px rgba(0, 187, 255, 0.35);
      transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .cyber-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 24px rgba(0, 187, 255, 0.7);
      filter: brightness(1.15);
    }

    .cyber-btn:active {
      transform: translateY(1px);
    }

    .cyber-btn.danger {
      background: linear-gradient(135deg, #ff0055, #cc0033);
      box-shadow: 0 4px 18px rgba(255, 0, 85, 0.4);
    }
    .cyber-btn.danger:hover {
      box-shadow: 0 6px 24px rgba(255, 0, 85, 0.7);
    }

    /* Quick action buttons in HUD */
    .hud-btn {
      background: rgba(14, 20, 36, 0.75);
      border: 1px solid rgba(0, 243, 255, 0.3);
      color: #fff;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      pointer-events: auto;
      transition: all 0.2s;
      font-size: 15px;
    }

    .hud-btn:hover {
      border-color: var(--neon-cyan);
      box-shadow: 0 0 10px var(--neon-cyan);
      transform: scale(1.08);
    }

    /* Stats Grid for Game Over / Victory */
    .stats-table {
      width: 100%;
      background: rgba(0, 0, 0, 0.35);
      border-radius: 10px;
      padding: 14px 18px;
      margin: 18px 0 24px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px 20px;
      text-align: left;
    }

    .stat-row {
      display: flex;
      justify-content: space-between;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      padding-bottom: 4px;
      font-size: 13px;
    }

    .stat-row .lbl { color: #8c9cb8; }
    .stat-row .val { color: var(--neon-cyan); font-weight: 700; font-family: monospace; }

    /* Touch Controls for Mobile */
    #touch-controls {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 5;
      pointer-events: none;
      display: none;
    }

    .joystick-base {
      position: absolute;
      width: 120px;
      height: 120px;
      border-radius: 50%;
      background: rgba(0, 243, 255, 0.08);
      border: 2px dashed rgba(0, 243, 255, 0.3);
      transform: translate(-50%, -50%);
      pointer-events: none;
      display: none;
    }

    .joystick-thumb {
      position: absolute;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: radial-gradient(circle, #00f3ff, #0088cc);
      box-shadow: 0 0 16px #00f3ff;
      transform: translate(-50%, -50%);
      pointer-events: none;
    }

    #touch-dash-btn {
      position: absolute;
      bottom: 40px;
      right: 36px;
      width: 68px;
      height: 68px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(0, 243, 255, 0.4), rgba(0, 119, 255, 0.8));
      border: 2px solid var(--neon-cyan);
      box-shadow: 0 0 16px rgba(0, 243, 255, 0.5);
      color: #fff;
      font-weight: 900;
      font-size: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
      cursor: pointer;
    }

    #touch-dash-btn:active {
      transform: scale(0.92);
      filter: brightness(1.3);
    }

    #touch-dash-btn {
      width: var(--neon-dash-size, 68px);
      height: var(--neon-dash-size, 68px);
      opacity: var(--neon-dash-opacity, .90);
      touch-action: none;
    }

    /* Dedicated phone/tablet settings; standard HTML inputs remain accessible. */
    .neon-settings-overlay[hidden] { display: none !important; }
    .neon-settings-overlay {
      position: fixed;
      inset: 0;
      z-index: 400;
      background: rgba(3, 8, 19, .93);
      backdrop-filter: blur(12px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
      overflow-y: auto;
      box-sizing: border-box;
      touch-action: pan-y;
    }
    .neon-lan-profile-preview {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      margin: 12px 0 4px;
      padding: 9px 12px;
      border-radius: 12px;
      border: 1px solid #385c76;
      background: #13253a;
      font-size: 13px;
    }
    .neon-lan-profile-preview .neon-lan-action {
      flex: 0 1 auto;
      min-width: min(170px, 100%);
    }
    .neon-lan-code-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: stretch;
      margin: 12px 0;
    }
    .neon-lan-code-input {
      min-width: min(180px, 100%);
      flex: 1 1 170px;
      min-height: 48px;
      border: 1px solid #59bedb;
      border-radius: 11px;
      background: #081c2c;
      padding: 8px 13px;
      color: #b8ffec;
      font: bold clamp(18px, 4vw, 23px) monospace;
      letter-spacing: .11em;
      text-align: center;
      text-transform: uppercase;
      -webkit-user-select: text;
      user-select: text;
      touch-action: manipulation;
    }
    .neon-lan-advanced {
      margin-top: 16px;
      border-top: 1px solid #385a70;
      padding: 13px 0 0;
    }
    .neon-lan-advanced summary {
      cursor: pointer;
      color: #a4bdd4;
      font-size: 12px;
      padding: 9px 0;
    }
    .neon-lan-code-row .neon-lan-action { flex: 1 1 165px; }
    .neon-lan-qr-panel {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      align-items: center;
      justify-content: center;
      margin: 12px 0 16px;
      padding: 16px;
      border: 1px solid #3a8e9c;
      border-radius: 14px;
      background: linear-gradient(140deg, #123a47 0%, #0d2236 100%);
    }
    .neon-lan-qr-panel[hidden] { display: none; }
    .neon-lan-qr-code {
      box-sizing: content-box;
      width: 200px;
      height: 200px;
      padding: 10px;
      flex: 0 0 200px;
      display: grid;
      place-items: center;
      background: #fff;
      border-radius: 10px;
      color: #173448;
      text-align: center;
      overflow: hidden;
    }
    .neon-lan-qr-code img,
    .neon-lan-qr-code canvas { display: block; max-width: 100%; }
    .neon-upgrade-wait {
      width: min(100%, 470px);
      margin: 14px auto;
      padding: 28px 18px;
      border: 1px solid rgba(126, 255, 216, .55);
      border-radius: 14px;
      background: rgba(7, 27, 41, .88);
      color: #b7ffec;
      font-weight: 700;
      text-align: center;
      line-height: 1.7;
    }
    .neon-lan-qr-info {
      flex: 1 1 190px;
      min-width: 0;
      line-height: 1.6;
      color: #b8d1e3;
    }
    .neon-lan-qr-info strong { color: #afffe5; font-size: 16px; }
    .neon-lan-qr-info p { margin: 8px 0; font-size: 13px; }
    .neon-lan-invite-url {
      display: inline-block;
      color: #95eefa;
      font-size: 13px;
      text-decoration: underline;
      overflow-wrap: anywhere;
    }
    @media (max-width: 460px) {
      .neon-lan-qr-panel { padding: 12px; }
      .neon-lan-qr-code { margin: auto; }
      .neon-lan-qr-info { text-align: center; }
    }
    .neon-settings-card {
      width: min(560px, 100%);
      max-height: 92dvh;
      margin: auto;
      overflow-y: auto;
      overscroll-behavior: contain;
      border: 1px solid rgba(78, 190, 228, .55);
      border-radius: 18px;
      background: linear-gradient(160deg, #12273a, #101629);
      box-shadow: 0 16px 60px #0008;
      color: #e8f7ff;
      padding: 18px;
      font: 14px system-ui, sans-serif;
    }
    .neon-settings-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }
    .neon-settings-header h2 { margin: 0; font-size: 23px; color: #a9f4ff; }
    .neon-settings-close {
      background: #233e54; border: 1px solid #6acfe6; color: #ddf7ff;
      border-radius: 10px; padding: 9px 12px; cursor: pointer; min-height: 40px;
    }
    .neon-settings-group {
      border: 1px solid #37516c;
      border-radius: 13px;
      padding: 12px 14px;
      background: #0a192b99;
      margin-bottom: 12px;
    }
    .neon-settings-group h3 { margin: 0 0 8px; font-size: 14px; color: #74e9e7; }
    .neon-setting-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 10px 0;
      border-top: 1px solid #54718e33;
      cursor: pointer;
    }
    .neon-setting-info { display: flex; flex-direction: column; gap: 4px; }
    .neon-setting-info strong { font-size: 13px; }
    .neon-setting-info small { color: #a5b9cd; font-size: 11px; line-height: 1.4; }
    .neon-setting-row input[type="checkbox"] {
      width: 22px; height: 22px; flex-shrink: 0; accent-color: #00cfca;
    }
    .neon-setting-row input[type="range"] {
      min-width: 105px; max-width: 48%; flex: 1; accent-color: #00cfca;
    }
    .neon-settings-foot { color: #a5bfd1; line-height: 1.6; font-size: 12px; }
    .neon-guest-settings {
      display: none; position: fixed; z-index: 85;
      top: calc(12px + env(safe-area-inset-top));
      right: calc(12px + env(safe-area-inset-right));
      padding: 9px 12px; border-radius: 10px;
      border: 1px solid #7bb7cd; color: #d7f7ff;
      background: #14283ce6;
    }
    body.neon-lan-guest .neon-guest-settings { display: block; }

    /* Start screen styling */
    .start-features {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin: 18px 0 24px;
      font-size: 13px;
      color: #9cb0d0;
    }

    .start-features span {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .keyboard-hint {
      display: inline-block;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 2px 6px;
      border-radius: 4px;
      font-family: monospace;
      font-size: 11px;
      color: var(--neon-cyan);
    }

    /* Gamepad Status Indicator */
    .gamepad-pill {
      border: 1px solid rgba(0, 255, 170, 0.5) !important;
      background: rgba(0, 36, 26, 0.85) !important;
      color: #00ffaa !important;
      font-size: 12px !important;
      font-weight: 700 !important;
      padding: 5px 12px !important;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 0 10px rgba(0, 255, 170, 0.3) !important;
    }

    #btn-test-vibrate {
      border-color: rgba(0, 255, 170, 0.5);
      color: #a5ffe0;
      font-size: 11px;
      white-space: nowrap;
      padding: 7px 9px;
    }

    #btn-test-vibrate:hover { background: rgba(0, 255, 170, 0.16); }

    @media (max-width: 760px) {
      .gamepad-pill #gamepad-name { display: none; }
      #btn-test-vibrate { padding: 5px 7px; font-size: 10px; }
    }

    /* Help Manual Modal Styling */
    .modal-help-card {
      max-width: 840px !important;
      max-height: 88vh;
      display: flex;
      flex-direction: column;
      padding: 24px 28px !important;
      text-align: left;
    }

    .help-header {
      text-align: center;
      margin-bottom: 14px;
    }

    .help-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 14px;
      border-bottom: 1px solid rgba(0, 243, 255, 0.2);
      padding-bottom: 10px;
      overflow-x: auto;
    }

    .help-tab-btn {
      background: rgba(13, 22, 45, 0.8);
      border: 1px solid rgba(0, 243, 255, 0.2);
      color: #9cb0d0;
      padding: 7px 16px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
    }

    .help-tab-btn:hover {
      border-color: var(--neon-cyan);
      color: #fff;
    }

    .help-tab-btn.active {
      background: linear-gradient(135deg, rgba(0, 243, 255, 0.25), rgba(157, 0, 255, 0.25));
      border-color: var(--neon-cyan);
      color: var(--neon-cyan);
      box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    }

    .help-content-scroll {
      flex: 1;
      overflow-y: auto;
      padding-right: 8px;
      margin-bottom: 16px;
    }

    .help-content-scroll::-webkit-scrollbar {
      width: 6px;
    }
    .help-content-scroll::-webkit-scrollbar-thumb {
      background: rgba(0, 243, 255, 0.35);
      border-radius: 3px;
    }

    .help-section {
      display: none;
    }
    .help-section.active {
      display: block;
      animation: fadeIn 0.22s ease;
    }

    .help-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 12px;
      margin-bottom: 14px;
    }

    .help-box {
      background: rgba(14, 21, 40, 0.7);
      border: 1px solid rgba(0, 243, 255, 0.16);
      border-radius: 18px;
      padding: 14px 18px;
    }

    .help-box-title {
      font-size: 13.5px;
      font-weight: 800;
      color: var(--neon-cyan);
      margin-bottom: 7px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .help-box p, .help-box li {
      font-size: 12px;
      color: #b5c7e0;
      line-height: 1.55;
    }

    .help-box ul {
      margin: 0;
      padding-left: 16px;
    }

    /* ==========================================================================
       RESPONSIVE ADAPTATIONS (Tablet & Mobile Layout)
       ========================================================================== */
    @media (max-width: 960px) {
      #hud {
        padding: 8px 12px;
        gap: 8px;
      }
      .status-bars {
        min-width: 130px;
      }
      .bar-wrap, .dash-segments {
        width: 130px;
      }
      .dash-stats-bar {
        font-size: 10px;
      }
      .stat-pill {
        padding: 4px 10px;
        gap: 6px;
        font-size: 12px;
      }
      .stat-pill .value {
        font-size: 14px;
      }
      .hud-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
      }
      .hud-right {
        gap: 6px;
      }
      .hud-left {
        gap: 8px;
      }
      .hud-center {
        gap: 8px;
      }
    }

    @media (max-width: 640px) {
      #hud {
        padding: 6px 8px;
        flex-wrap: wrap;
        row-gap: 6px;
        column-gap: 4px;
        background: linear-gradient(to bottom, rgba(6, 8, 16, 0.96) 0%, rgba(6, 8, 16, 0.65) 85%, transparent 100%);
      }
      .hud-left {
        order: 1;
        gap: 6px;
        align-items: center;
      }
      #level-badge {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 8px;
      }
      .status-bars {
        min-width: 100px;
        gap: 2px;
      }
      .bar-wrap {
        width: 100px;
        height: 6px;
      }
      .dash-segments {
        width: 100px;
        height: 5px;
        gap: 2px;
      }
      .dash-stats-bar {
        font-size: 9px;
        margin-top: 1px;
        letter-spacing: 0;
      }
      .hud-right {
        order: 2;
        gap: 4px;
      }
      .hud-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
      }
      .gamepad-pill {
        padding: 2px 6px !important;
        font-size: 10px !important;
      }
      #gamepad-name {
        display: none;
      }
      .hud-center {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 6px;
        margin-top: 2px;
      }
      .stat-pill {
        padding: 2px 8px;
        gap: 4px;
        font-size: 11px;
        border-radius: 12px;
      }
      .stat-pill .icon {
        font-size: 12px;
      }
      .stat-pill .value {
        font-size: 12px;
      }
      #weapons-bar {
        bottom: 12px;
        left: 10px;
        gap: 4px;
        transform: scale(0.85);
        transform-origin: bottom left;
      }
      .weapon-slot {
        width: 34px;
        height: 34px;
        font-size: 15px;
      }
      #touch-dash-btn {
        bottom: 24px;
        right: 20px;
        width: var(--neon-dash-size, 68px);
        height: var(--neon-dash-size, 68px);
        font-size: 12px;
      }
      /* Keep fullscreen visible on phones; hide nonessential toggles. */
      #hud #btn-vibrate, #hud #btn-test-vibrate,
      #hud #btn-sound, #hud #btn-crt { display: none !important; }
      #hud #btn-fullscreen, #hud #btn-settings, #hud #btn-pause, #hud #btn-help {
        width: 36px; height: 36px; font-size: 15px; flex: 0 0 36px;
      }
      .neon-settings-card { padding: 14px; max-height: 94dvh; }
      .neon-settings-overlay { align-items: flex-start; }
      .modal-card {
        padding: 20px 16px;
        max-width: 95%;
        max-height: 88vh;
        overflow-y: auto;
      }
      .modal-title {
        font-size: 20px;
      }
      .upgrade-grid {
        grid-template-columns: 1fr;
        gap: 10px;
      }
      .upgrade-card {
        padding: 10px 12px;
      }
      .upgrade-icon {
        font-size: 26px;
        margin: 4px 0;
      }
      .upgrade-name {
        font-size: 14px;
      }
    }

    /* Fluid layout for narrow devices, tablets, landscape phones and foldables. */
    :root {
      --neon-safe-top: env(safe-area-inset-top, 0px);
      --neon-safe-bottom: env(safe-area-inset-bottom, 0px);
      --neon-safe-left: env(safe-area-inset-left, 0px);
      --neon-safe-right: env(safe-area-inset-right, 0px);
      --neon-edge: clamp(8px, 2vw, 24px);
    }
    .modal-overlay {
      position: fixed;
      inset: 0;
      overflow: auto;
      overscroll-behavior: contain;
      padding: calc(var(--neon-safe-top) + 10px) calc(var(--neon-safe-right) + 10px)
        calc(var(--neon-safe-bottom) + 10px) calc(var(--neon-safe-left) + 10px);
      box-sizing: border-box;
      touch-action: pan-y;
    }
    .modal-card {
      width: min(680px, 100%);
      min-width: 0;
      max-width: 100%;
      max-height: min(90dvh, 900px);
      overflow-y: auto;
      overscroll-behavior: contain;
      margin: auto;
      padding: clamp(14px, 3vw, 30px);
    }
    .upgrade-grid {
      grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
      gap: clamp(7px, 2vw, 16px);
    }
    .start-features { flex-wrap: wrap; gap: 9px 15px; }
    .help-card-grid {
      grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    }
    .neon-settings-card {
      max-height: calc(100dvh - var(--neon-safe-top) - var(--neon-safe-bottom) - 24px);
      min-width: 0;
    }
    .neon-setting-help {
      color: #a5bfd1;
      line-height: 1.5;
      font-size: 11px;
      margin: 8px 0 3px;
    }
    .neon-setting-name {
      width: clamp(120px, 34%, 195px);
      min-height: 40px;
      padding: 9px 12px;
      background: #071b2b;
      border: 1px solid #4f9fbd;
      border-radius: 9px;
      color: #e3f9ff;
      font: inherit;
      outline-offset: 2px;
      -webkit-user-select: text;
      user-select: text;
      touch-action: manipulation;
    }
    .neon-color-options {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: clamp(7px, 2vw, 12px);
      padding: 12px 0 3px;
    }
    .neon-color-swatch {
      min-height: 43px;
      min-width: 43px;
      padding: 7px 9px;
      background: #0c1d31;
      border: 2px solid #3c5470;
      border-radius: 12px;
      color: var(--swatch-color);
      font: 700 13px system-ui;
      cursor: pointer;
      touch-action: manipulation;
      flex: 0 0 auto;
    }
    .neon-color-swatch.active,
    .neon-color-swatch[aria-pressed="true"] {
      border-color: var(--swatch-color);
      background: #1b3146;
      box-shadow: 0 0 12px color-mix(in srgb, var(--swatch-color) 42%, transparent);
    }
    .neon-teammate-indicator[hidden] { display: none !important; }
    .neon-teammate-indicator {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 35;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      min-height: 38px;
      max-width: min(160px, 48vw);
      padding: 6px 10px;
      pointer-events: none;
      border: 1px solid var(--teammate-color, #ffbb55);
      border-radius: 100px;
      color: #f0f9ff;
      background: rgba(5, 16, 34, .89);
      box-shadow: 0 0 15px color-mix(in srgb, var(--teammate-color) 25%, transparent);
      backdrop-filter: blur(7px);
      font: 600 11px system-ui, sans-serif;
      white-space: nowrap;
    }
    .teammate-arrow {
      color: var(--teammate-color, #ffbb55);
      display: inline-block;
      font-size: 17px;
      transform-origin: 50% 50%;
    }
    .teammate-ship { color: var(--teammate-color); font-size: 13px; }
    .teammate-label { overflow: hidden; text-overflow: ellipsis; }
    @media (max-width: 450px) {
      .neon-teammate-indicator { min-height: 34px; padding: 5px 8px; font-size: 10px; }
      .neon-setting-name { width: min(45%, 175px); }
    }
    .neon-lan-lobby {
      position: fixed;
      inset: 0;
      z-index: 200;
      display: flex;
      justify-content: center;
      align-items: center;
      overflow-y: auto;
      overscroll-behavior: contain;
      touch-action: pan-y;
      background: #040918ef;
      padding: calc(var(--neon-safe-top) + 12px) calc(var(--neon-safe-right) + 12px)
        calc(var(--neon-safe-bottom) + 12px) calc(var(--neon-safe-left) + 12px);
    }
    .neon-lan-card {
      width: min(650px, 100%);
      max-width: 100%;
      max-height: calc(100dvh - var(--neon-safe-top) - var(--neon-safe-bottom) - 24px);
      min-width: 0;
      margin: auto;
      padding: clamp(12px, 2.4vw, 22px);
      overflow-y: auto;
      overscroll-behavior: contain;
      background: linear-gradient(160deg, #0e2436, #0e1b2c);
      color: #e0f3ff;
      border: 1px solid #3c859f;
      border-radius: 16px;
      box-shadow: 0 0 35px #00f3ff22;
      font: 14px system-ui;
    }
    .neon-lan-action {
      background: #17374c;
      color: #e7fbff;
      border: 1px solid #35a1b7;
      border-radius: 9px;
      cursor: pointer;
      min-height: 44px;
      padding: 10px 12px;
      flex: 1 1 min(170px, 100%);
      white-space: normal;
    }
    .neon-lan-field {
      width: 100%;
      max-width: 100%;
      min-height: 92px;
      margin-top: 8px;
      box-sizing: border-box;
      background: #07101e;
      color: #e6ffff;
      border: 1px solid #42627a;
      border-radius: 9px;
      padding: 10px;
      font: 12px monospace;
      resize: vertical;
      -webkit-user-select: text;
      user-select: text;
      touch-action: pan-y;
    }
    #touch-dash-btn {
      right: calc(clamp(15px, 5vw, 54px) + var(--neon-safe-right));
      bottom: calc(clamp(20px, 6vh, 56px) + var(--neon-safe-bottom));
      width: var(--neon-dash-size, 68px);
      height: var(--neon-dash-size, 68px);
      flex: none;
    }
    .joystick-base { width: clamp(96px, 22vw, 136px); height: clamp(96px, 22vw, 136px); }

    /* Vertical phones and narrow portrait tablets: two-level unobstructed HUD. */
    @media (orientation: portrait) and (max-width: 900px) {
      #hud {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 5px 7px;
        padding: calc(var(--neon-safe-top) + 9px) calc(var(--neon-safe-right) + 9px)
          9px calc(var(--neon-safe-left) + 9px);
        width: 100%;
      }
      .hud-left { grid-column: 1; grid-row: 1; order: 0; min-width: 0; }
      .hud-right { grid-column: 2; grid-row: 1; order: 0; justify-content: flex-end; gap: 5px; }
      .hud-center {
        grid-column: 1 / -1; grid-row: 2; order: 0;
        width: 100%; margin: 0; justify-content: center;
        gap: clamp(4px, 3vw, 12px);
      }
      .status-bars { min-width: 0; width: clamp(92px, 30vw, 175px); }
      .bar-wrap, .dash-segments { width: 100%; }
      .hud-btn { width: 36px; height: 36px; flex: 0 0 36px; }
      #hud #btn-vibrate, #hud #btn-test-vibrate,
      #hud #btn-sound, #hud #btn-crt { display: none !important; }
      #hud #btn-fullscreen { flex: 0 0 36px; }
      .stat-pill { padding: 4px clamp(6px, 2vw, 13px); }
      #boss-hud {
        top: calc(var(--neon-safe-top) + 100px);
        width: min(82vw, 460px);
      }
      #weapons-bar {
        left: calc(var(--neon-safe-left) + 10px);
        bottom: calc(var(--neon-safe-bottom) + clamp(100px, 16vh, 155px));
        transform: scale(.88); transform-origin: bottom left;
      }
      #touch-dash-btn {
        bottom: calc(var(--neon-safe-bottom) + clamp(44px, 9vh, 94px));
      }
      .modal-card { max-height: calc(100dvh - var(--neon-safe-top) - var(--neon-safe-bottom) - 24px); }
      #modal-levelup .upgrade-grid { grid-template-columns: minmax(0, 1fr); }
      #modal-levelup .upgrade-card {
        min-height: 80px;
        padding: 12px;
        display: grid;
        grid-template-columns: 42px minmax(0,1fr);
        column-gap: 12px;
        text-align: left;
        align-items: center;
      }
      #modal-levelup .upgrade-icon { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
      #modal-levelup .upgrade-name,
      #modal-levelup .upgrade-desc,
      #modal-levelup .upgrade-lvl { grid-column: 2; text-align: left; margin: 0; }
      #modal-levelup .upgrade-card .rarity-tag { top: 4px; right: 5px; }
    }

    /* Landscape phones: one compact bar, boss and inventory beneath it. */
    @media (orientation: landscape) and (max-height: 650px) {
      .neon-lan-lobby { align-items: flex-start; }
      .neon-lan-card {
        width: min(850px, 100%);
        max-height: calc(100dvh - var(--neon-safe-top) - var(--neon-safe-bottom) - 16px);
        padding: 12px 16px;
      }
      .neon-lan-action { flex: 1 1 min(140px, 100%); }
      .neon-lan-field { min-height: 65px; max-height: 26vh; }
      #hud {
        display: flex; flex-wrap: nowrap; align-items: center;
        gap: clamp(5px, 1.3vw, 14px);
        padding: calc(var(--neon-safe-top) + 5px) calc(var(--neon-safe-right) + 8px)
          8px calc(var(--neon-safe-left) + 8px);
      }
      .hud-left, .hud-center, .hud-right { order: initial; width: auto; margin: 0; }
      .hud-left { gap: 5px; min-width: 0; }
      .hud-center { flex: 1; min-width: 0; gap: 3px; justify-content: center; }
      .hud-right { gap: 5px; }
      .status-bars { width: clamp(100px, 17vw, 150px); min-width: 0; gap: 1px; }
      .bar-wrap, .dash-segments { width: 100%; }
      .dash-stats-bar { font-size: 9px; }
      .stat-pill { padding: 3px 6px; gap: 3px; font-size: 10px; }
      .stat-pill .icon, .stat-pill .value { font-size: 11px; }
      #hud #btn-vibrate, #hud #btn-test-vibrate,
      #hud #btn-sound, #hud #btn-crt { display: none !important; }
      .hud-btn, #hud #btn-fullscreen, #hud #btn-settings, #hud #btn-help, #hud #btn-pause {
        width: 34px; height: 34px; flex: 0 0 34px; font-size: 14px;
      }
      #boss-hud {
        top: calc(var(--neon-safe-top) + 54px);
        width: min(52vw, 430px);
      }
      #weapons-bar {
        left: calc(var(--neon-safe-left) + 11px);
        bottom: calc(var(--neon-safe-bottom) + 13px);
        transform: scale(.75); transform-origin: bottom left;
      }
      #touch-dash-btn {
        bottom: calc(var(--neon-safe-bottom) + clamp(16px, 6vh, 38px));
        right: calc(var(--neon-safe-right) + clamp(19px, 4vw, 48px));
      }
      .modal-card {
        max-height: calc(100dvh - var(--neon-safe-top) - var(--neon-safe-bottom) - 14px);
        width: min(850px, 100%);
        padding: clamp(10px, 2vh, 18px);
      }
      .modal-title { font-size: clamp(17px, 3.6vh, 23px); margin-bottom: 4px; }
      .modal-sub { margin-bottom: 9px; font-size: 12px; }
      .upgrade-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
      .upgrade-card { padding: 10px; }
      .upgrade-icon { font-size: 22px; margin: 2px; }
      .neon-settings-card { width: min(780px, 100%); padding: 12px 18px; }
      .neon-settings-group { padding: 7px 12px; }
      .neon-setting-row { padding: 6px 0; }
    }

    /* Extremely short viewports retain scrollable dialogs, not clipped buttons. */
    @media (max-height: 420px) {
      .modal-overlay { align-items: flex-start; }
      .modal-card { overflow-y: auto; max-height: calc(100dvh - 12px); }
      .neon-settings-overlay { align-items: flex-start; }
      #weapons-bar { transform: scale(.65); transform-origin: bottom left; }
    }

    /* V5 RIFTBLADE command deck: aircraft armor, not an ordinary round button.
       All hit targets retain their original IDs and existing saved dimensions. */
    #touch-dash-btn {
      --dash-fill: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0;
      isolation: isolate;
      overflow: hidden;
      border: 0;
      border-radius: 0;
      clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%,
        28% 100%, 0 72%, 0 28%);
      background: linear-gradient(155deg, #145879 0%, #062b45 43%, #061528 100%);
      color: #e3fbff;
      text-shadow: 0 0 7px rgba(95, 240, 255, .8);
      font-family: system-ui, sans-serif;
      line-height: 1;
      user-select: none;
      -webkit-user-select: none;
      -webkit-tap-highlight-color: transparent;
      transition: transform 110ms ease, filter 180ms ease, opacity 150ms ease;
      filter: drop-shadow(0 0 13px rgba(48, 215, 255, .65));
    }
    #touch-dash-btn::before {
      content: '';
      position: absolute;
      inset: 3px;
      z-index: -1;
      pointer-events: none;
      clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%,
        28% 100%, 0 72%, 0 28%);
      background: conic-gradient(from -90deg, #67f5ff var(--dash-fill), #19384f 0);
      opacity: .95;
    }
    #touch-dash-btn::after {
      content: '';
      position: absolute;
      inset: 6px;
      z-index: -1;
      pointer-events: none;
      clip-path: polygon(27% 0, 73% 0, 100% 27%, 100% 73%, 73% 100%,
        27% 100%, 0 73%, 0 27%);
      background: radial-gradient(ellipse at 36% 24%, #194668 0%, #0b2239 55%, #04101d 100%);
    }
    #touch-dash-btn .dash-key-glyph {
      color: #b1f9ff;
      font-size: clamp(16px, 3vh, 22px);
      line-height: .95;
      font-weight: 900;
      transform: rotate(45deg);
      margin-bottom: 2px;
    }
    #touch-dash-btn .dash-key-label {
      font-size: clamp(10px, 2vh, 12px);
      letter-spacing: .12em;
      font-weight: 950;
    }
    #touch-dash-btn .dash-key-count {
      color: #91d9f2;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .05em;
      margin-top: 3px;
    }
    #touch-dash-btn.dash-empty {
      filter: saturate(.5) brightness(.67);
      text-shadow: none;
    }
    #touch-dash-btn:active {
      transform: scale(.93);
      filter: brightness(1.33) drop-shadow(0 0 17px rgba(102, 250, 255, .8));
    }
    #touch-dash-btn:focus-visible {
      outline: 3px solid #f6db9e;
      outline-offset: 4px;
    }

    /* Compact control panel buttons use cut-corner plating and active borders.
       Small phone HUD buttons keep the pre-existing responsive dimensions. */
    .hud-btn {
      border-radius: 7px;
      clip-path: polygon(16% 0, 84% 0, 100% 16%, 100% 84%,
        84% 100%, 16% 100%, 0 84%, 0 16%);
      background: linear-gradient(145deg, rgba(27, 63, 91, .96), rgba(7, 20, 39, .97));
      border: 1px solid rgba(94, 213, 255, .55);
      color: #d4f8ff;
      font-weight: 800;
      transition: background 130ms ease, border-color 130ms ease, filter 130ms ease;
    }
    .hud-btn:hover,
    .hud-btn:focus-visible {
      transform: none;
      filter: brightness(1.25);
      border-color: #abf8ff;
      box-shadow: inset 0 0 12px rgba(86, 226, 255, .25);
    }
    .hud-btn:focus-visible,
    .cyber-btn:focus-visible,
    #modal-levelup .upgrade-card:focus-visible {
      outline: 2px solid #ffe2a2;
      outline-offset: 3px;
    }
    #modal-levelup .upgrade-card.dash-card {
      background: linear-gradient(155deg, rgba(11, 49, 70, .98), rgba(8, 19, 41, .98));
      border-left: 3px solid #57e9ff;
    }
    @media (prefers-reduced-motion: reduce) {
      #touch-dash-btn, .hud-btn {
        transition: none;
      }
    }

    /* Multiplayer staging screen – no combat controls until host launches. */
    .neon-ready-overlay {
      position: fixed;
      z-index: 170;
      inset: 0;
      overflow: auto;
      display: grid;
      place-items: center;
      padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
      background: radial-gradient(ellipse at 50% 0%, #123a56 0%, #0b1831 43%, #050b1b 90%);
    }
    .neon-ready-panel {
      width: min(760px, 100%);
      max-height: 100%;
      overflow: auto;
      padding: clamp(20px, 4vw, 36px);
      border: 1px solid #4284a9;
      border-radius: 18px;
      background: linear-gradient(150deg, rgba(15, 34, 58, .97), rgba(8, 16, 35, .98));
      box-shadow: 0 24px 80px #0008, inset 0 1px 0 #a1edff33;
    }
    .neon-ready-panel h2 {
      font-size: clamp(22px, 4vw, 30px);
      font-weight: 900;
      letter-spacing: .05em;
      color: #9af1ff;
    }
    .neon-ready-subtitle {
      font-size: 13px;
      color: #afc5db;
      line-height: 1.6;
      margin: 9px 0 20px;
    }
    .neon-ready-roster {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
      gap: 12px;
    }
    .neon-ready-member {
      min-height: 110px;
      padding: 18px;
      border: 1px solid #405c7e;
      border-radius: 12px;
      background: linear-gradient(130deg, #142c47, #101a2e);
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 9px;
      color: #afc7de;
      font-size: 12px;
    }
    .neon-ready-member strong {
      font-size: 16px;
      color: #e4f8ff;
    }
    .neon-ready-member.is-ready {
      border-color: #55e0c8;
      box-shadow: inset 0 0 25px #1e987b22;
    }
    .neon-ready-member.is-empty { opacity: .56; }
    .neon-ready-state {
      font-weight: 800;
      font-size: 12px;
      letter-spacing: .04em;
      color: #ffcb84;
    }
    .neon-ready-member.is-ready .neon-ready-state { color: #6dffce; }
    .neon-ready-select-label {
      display: flex;
      flex-direction: column;
      gap: 9px;
      margin-top: 24px;
      color: #d3eaf8;
      font-weight: 700;
      font-size: 13px;
    }
    #neon-ready-ship {
      width: 100%;
      min-height: 48px;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid #5a85ab;
      background: #112a45;
      color: #f4fbff;
      font: inherit;
      font-size: 15px;
      touch-action: manipulation;
    }
    .neon-ready-ship-desc {
      min-height: 18px;
      margin-top: 8px;
      font-size: 12px;
      color: #a4bed4;
    }
    .neon-ready-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 22px;
    }
    .neon-ready-actions button {
      flex: 1 1 210px;
      min-height: 52px;
      padding: 12px 18px;
      border: 1px solid #65cbea;
      border-radius: 11px;
      background: linear-gradient(135deg, #14546b, #10304b);
      color: #e5faff;
      font-size: 15px;
      font-weight: 900;
      cursor: pointer;
      touch-action: manipulation;
    }
    .neon-ready-start {
      background: linear-gradient(135deg, #1b776a, #11525a) !important;
    }
    .neon-ready-leave {
      flex-basis: 100% !important;
      min-height: 44px !important;
      background: #1a263e !important;
      border-color: #617189 !important;
      font-size: 13px !important;
      color: #bcd0e1 !important;
    }
    .neon-ready-actions button:disabled,
    #neon-ready-ship:disabled { opacity: .5; cursor: not-allowed; }
    .neon-ready-actions button:focus-visible,
    #neon-ready-ship:focus-visible {
      outline: 3px solid #f3d58a;
      outline-offset: 3px;
    }
    .neon-ready-hint {
      display: block;
      margin-top: 15px;
      color: #aed3e8;
      line-height: 1.5;
      font-size: 12px;
    }
    @media (max-width: 520px) {
      .neon-ready-roster { grid-template-columns: 1fr 1fr; gap: 8px; }
      .neon-ready-member { min-height: 105px; padding: 12px; }
      .neon-ready-panel { padding: 18px; }
    }
    @media (max-width: 365px) {
      .neon-ready-roster { grid-template-columns: 1fr; }
    }
    @media (prefers-reduced-motion: reduce) {
      .neon-ready-actions button { transition: none; }
    }

    /* Never show controller hints to keyboard/touch-only players. */
    .neon-gamepad-key,
    .neon-gamepad-hint-row,
    [data-gamepad-key]::after { display: none !important; }
    .neon-gamepad-connected .neon-gamepad-hint-row {
      display: flex !important;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 8px 15px;
      margin: 12px 0 4px;
      padding: 8px 11px;
      border: 1px solid rgba(98, 177, 210, .3);
      border-radius: 10px;
      background: rgba(9, 26, 47, .55);
    }
    .neon-gamepad-connected .neon-gamepad-prompt {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: #b8dcf2;
      font-size: 11px;
      font-weight: 700;
    }
    .neon-gamepad-connected .neon-gamepad-key {
      display: inline-grid !important;
      place-items: center;
      min-width: 24px;
      min-height: 23px;
      margin-inline-start: 5px;
      padding: 2px 5px;
      border: 1px solid #72b9e8;
      border-radius: 7px;
      background: linear-gradient(135deg, #2c4667, #101d36);
      color: #e8f9ff;
      box-shadow: inset 0 0 8px #9adfff22;
      font: 800 11px system-ui;
      vertical-align: middle;
    }
    .neon-gamepad-hint-row .neon-gamepad-key { margin-inline-start: 0; }
    .neon-gamepad-connected .neon-ready-panel .neon-gamepad-hint-row {
      margin-top: 17px;
    }

    /* ASTRA arcane command keys use a separate surface and never replace
       Riftblade's familiar dash control or capture the movement touch. */
    #astra-touch-actions[hidden], #astra-mana-hud[hidden] { display: none !important; }
    #phantom-touch-actions[hidden], #phantom-ecto-hud[hidden] { display: none !important; }
    #phantom-ecto-hud { display:flex;align-items:center;gap:6px;font-size:10px;color:#d9b3ff;font-weight:700;white-space:nowrap; }
    #phantom-ecto-fill { display:block;height:100%;width:0;background:linear-gradient(90deg,#7736c7,#df91ff);border-radius:6px; }
    #phantom-touch-actions { position:absolute;right:calc(var(--neon-safe-right, 0px) + 12px);bottom:calc(var(--neon-safe-bottom, 0px) + clamp(112px, 21vh, 165px));pointer-events:none; }
    #phantom-touch-actions button { pointer-events:auto;min-height:46px;padding:10px 14px;border:1px solid #ad79fd;border-radius:12px;background:rgba(35,17,58,.92);color:#efcaff;font-weight:800; }
    #astra-touch-actions {
      position: absolute;
      right: calc(var(--neon-safe-right, 0px) + 12px);
      bottom: calc(var(--neon-safe-bottom, 0px) + clamp(112px, 21vh, 165px));
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
    }
    #astra-touch-actions button {
      min-height: 44px;
      min-width: 90px;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid #b598ed;
      background: linear-gradient(135deg, rgba(73, 38, 118, .96), rgba(20, 27, 58, .98));
      color: #f4eaff;
      font-weight: 800;
      font-size: 12px;
      box-shadow: inset 0 0 14px rgba(156, 120, 230, .16);
      touch-action: none;
      pointer-events: auto;
    }
    #astra-touch-actions button:active {
      filter: brightness(1.22);
      transform: scale(.96);
    }
    #astra-touch-actions button:disabled {
      opacity: .55;
      filter: grayscale(.4);
    }
    #astra-touch-actions button:focus-visible {
      outline: 2px solid #f6d2ff;
      outline-offset: 2px;
    }
    #astra-mana-hud {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 10px;
      white-space: nowrap;
      color: #e8c8ff;
      font-weight: 700;
    }
    .astra-mana-track {
      display: inline-block;
      vertical-align: middle;
      width: clamp(36px, 8vw, 80px);
      height: 5px;
      border-radius: 8px;
      background: rgba(160, 112, 205, .24);
      overflow: hidden;
    }
    #astra-mana-fill {
      display: block;
      width: 60%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #9d6dff, #78eaff);
    }

    /* Hangar Terminal & Ship Showcase Styling */
    .modal-start-card {
      max-width: min(880px, calc(100vw - 28px)) !important;
      padding: 26px 28px !important;
      background: radial-gradient(ellipse at top, rgba(16, 32, 60, 0.96), rgba(6, 12, 26, 0.98)) !important;
      border: 1.5px solid rgba(0, 243, 255, 0.28) !important;
      border-radius: 28px !important;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 45px rgba(0, 243, 255, 0.12) !important;
    }

    .hangar-banner {
      margin-bottom: 6px;
    }

    .hangar-main-title {
      font-size: 26px !important;
      letter-spacing: 2px !important;
      margin-bottom: 4px !important;
    }

    .hangar-sub-title {
      font-size: 12px !important;
      color: #9cb2d6 !important;
      letter-spacing: 1.2px !important;
      margin-bottom: 12px !important;
    }

    .hangar-ship-selector {
      margin: 0 auto 16px;
      width: 100%;
      text-align: left;
    }

    .neon-hangar-heading {
      font-weight: 800;
      font-size: 13px;
      color: #00f3ff;
      margin-bottom: 10px;
      letter-spacing: 0.8px;
      display: flex;
      align-items: center;
      gap: 6px;
      text-transform: uppercase;
    }

    .neon-hangar-locked-info {
      font-size: 11px;
      color: #879ab7;
      margin-top: 10px;
      text-align: center;
    }

    .hangar-difficulty-selector {
      margin: 0 auto 16px;
      width: 100%;
      text-align: left;
      background: rgba(10, 18, 36, 0.6);
      padding: 12px 18px;
      border-radius: 20px;
      border: 1px solid rgba(63, 101, 126, 0.28);
    }

    .hangar-actions-bar {
      display: flex;
      justify-content: center;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 6px;
    }

    .cyber-btn-launch {
      font-size: 15px !important;
      font-weight: 900 !important;
      padding: 12px 34px !important;
      border-radius: 999px !important;
      background: linear-gradient(135deg, rgba(0, 180, 240, 0.95), rgba(0, 100, 200, 0.95)) !important;
      border: 1px solid rgba(255, 255, 255, 0.25) !important;
      color: #ffffff !important;
      box-shadow: 0 0 24px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.25) !important;
      letter-spacing: 1px !important;
      transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    }

    .cyber-btn-launch:hover {
      transform: translateY(-2px) scale(1.02) !important;
      filter: brightness(1.25) !important;
      box-shadow: 0 0 32px rgba(56, 189, 248, 0.6) !important;
    }

    /* Registry-driven class cards: all new ships share this treatment without
       hardcoded hero IDs, and remain usable with keyboard or gamepad focus. */
    .neon-ship-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
      gap: 14px;
      width: 100%;
    }
    .neon-ship-choice {
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: stretch;
      align-items: stretch;
      width: 100%;
      min-height: 220px;
      padding: 0;
      text-align: left;
      background: linear-gradient(155deg, rgba(16, 30, 52, 0.92), rgba(6, 12, 26, 0.96));
      color: #e4f7ff;
      border: 1.5px solid rgba(63, 101, 126, 0.45);
      border-radius: 22px;
      font: 500 13px system-ui;
      cursor: pointer;
      overflow: hidden;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 1px rgba(192, 236, 255, 0.08);
      transition: border-color 160ms, transform 160ms, box-shadow 160ms;
    }

    /* Hide redundant raw pseudo-elements when modern card inner exists */
    .neon-ship-choice::before,
    .neon-ship-choice::after {
      display: none;
    }

    .neon-ship-card-inner {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
    }

    .neon-ship-holo-wrap {
      position: relative;
      width: 100%;
      height: 96px;
      background: radial-gradient(circle at center, rgba(0, 243, 255, 0.08) 0%, rgba(4, 10, 24, 0.75) 75%);
      border-bottom: 1px solid rgba(0, 243, 255, 0.18);
      border-radius: 20px 20px 14px 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      margin: 2px 2px 0;
    }

    .neon-ship-holo-canvas {
      width: 160px;
      height: 96px;
      display: block;
      filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.25));
    }

    .neon-ship-title-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 14px 4px;
      gap: 6px;
    }

    .neon-ship-name-text {
      font-size: 14px;
      font-weight: 800;
      color: #ffffff;
      letter-spacing: 0.5px;
    }

    .neon-ship-tag-pill {
      font-size: 10px;
      font-weight: 700;
      padding: 3px 9px;
      border-radius: 999px;
      background: rgba(0, 243, 255, 0.15);
      color: #00f3ff;
      border: 1px solid rgba(0, 243, 255, 0.3);
      white-space: nowrap;
    }

    .neon-ship-specs-row {
      display: flex;
      gap: 6px;
      padding: 4px 14px;
      flex-wrap: wrap;
    }

    .neon-spec-chip {
      font-size: 10px;
      color: #a5b4fc;
      background: rgba(255, 255, 255, 0.05);
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      font-weight: 600;
      white-space: nowrap;
    }

    .neon-ship-perk-row {
      padding: 6px 14px 8px;
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .neon-ship-weapon-label {
      font-size: 11px;
      color: #38bdf8;
      font-weight: 700;
    }

    .neon-ship-perk-detail {
      font-size: 11px;
      color: #94a3b8;
      line-height: 1.4;
    }

    .neon-ship-status-ribbon {
      padding: 7px 10px;
      font-size: 11px;
      font-weight: 800;
      text-align: center;
      letter-spacing: 0.6px;
      background: rgba(255, 255, 255, 0.03);
      color: #64748b;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 0 0 20px 20px;
      transition: all 160ms;
    }

    .neon-ship-choice[data-selected='true'] {
      border-color: #00f3ff;
      background: linear-gradient(155deg, rgba(20, 44, 72, 0.96), rgba(8, 18, 36, 0.98));
      box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7),
        0 0 22px rgba(0, 243, 255, 0.28),
        inset 0 0 16px rgba(0, 243, 255, 0.1);
      transform: translateY(-2px);
    }

    .neon-ship-choice[data-selected='true'] .neon-ship-holo-wrap {
      border-bottom-color: rgba(0, 243, 255, 0.45);
      background: radial-gradient(circle at center, rgba(0, 243, 255, 0.16) 0%, rgba(4, 10, 24, 0.8) 75%);
    }

    .neon-ship-choice[data-selected='true'] .neon-ship-status-ribbon {
      background: linear-gradient(90deg, rgba(0, 243, 255, 0.22), rgba(168, 85, 247, 0.22));
      color: #67e8f9;
      border-top: 1px solid rgba(0, 243, 255, 0.4);
      text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
    }

    .neon-ship-choice:hover {
      border-color: rgba(0, 243, 255, 0.75);
      transform: translateY(-3px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.2);
    }

    .neon-ship-choice:focus-visible {
      outline: 3px solid #ffdf92;
      outline-offset: 3px;
    }

    @media (max-width: 680px) {
      .modal-start-card { padding: 18px 14px !important; }
      .neon-ship-options { grid-template-columns: 1fr; }
      .neon-ship-choice { min-height: 180px; }
      .neon-ship-holo-wrap { height: 80px; }
      .neon-ship-holo-canvas { width: 140px; height: 80px; }
    }

    @media (max-height: 520px) {
      .modal-start-card { max-height: calc(100dvh - 12px) !important; overflow-y: auto !important; padding: 14px !important; }
      .neon-ship-holo-wrap { height: 60px; }
      .neon-ship-choice { min-height: 150px; }
      .neon-ship-perk-row { display: none; }
    }

    @media (prefers-reduced-motion: reduce) {
      .neon-ship-choice { transition: none; }
    }

    /* ==========================================================================
       TACTICAL COMBAT SKILLS DOCK & LIVE SHIP STATUS MONITOR
       ========================================================================== */
    #combat-hud-dock {
      position: absolute;
      bottom: 24px;
      right: 28px;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
      z-index: 15;
      pointer-events: auto;
      user-select: none;
      -webkit-user-select: none;
    }

    .ship-status-banner {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      background: rgba(10, 20, 38, 0.9);
      border: 1px solid rgba(0, 243, 255, 0.4);
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
      color: #e0f2fe;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 243, 255, 0.15);
      backdrop-filter: blur(8px);
      letter-spacing: 0.5px;
      transition: all 0.2s ease;
      white-space: nowrap;
    }

    .status-indicator-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #00f3ff;
      box-shadow: 0 0 8px #00f3ff;
      animation: statusPulse 1.6s infinite ease-in-out;
      flex-shrink: 0;
    }

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

    .ship-skills-bar {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .combat-skill-btn {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 62px;
      height: 62px;
      background: linear-gradient(145deg, rgba(16, 28, 52, 0.94), rgba(8, 14, 28, 0.98));
      border: 1.5px solid rgba(0, 243, 255, 0.45);
      border-radius: 12px;
      cursor: pointer;
      color: #ffffff;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(0, 243, 255, 0.1);
      transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
      user-select: none;
      -webkit-user-select: none;
      overflow: hidden;
      padding: 0;
    }

    .combat-skill-btn:hover {
      border-color: #00f3ff;
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 243, 255, 0.35);
    }

    .combat-skill-btn:active {
      transform: translateY(1px) scale(0.96);
    }

    .combat-skill-btn .skill-hotkey {
      position: absolute;
      top: 3px;
      left: 4px;
      font-size: 10px;
      font-weight: 800;
      color: #67e8f9;
      background: rgba(0, 0, 0, 0.5);
      padding: 1px 4px;
      border-radius: 3px;
      font-family: monospace;
      line-height: 1;
    }

    .combat-skill-btn .skill-icon {
      font-size: 20px;
      margin-top: 5px;
      margin-bottom: 2px;
      filter: drop-shadow(0 0 6px rgba(0, 243, 255, 0.5));
      line-height: 1;
    }

    .combat-skill-btn .skill-name {
      font-size: 10px;
      font-weight: 800;
      color: #e2e8f0;
      line-height: 1;
      white-space: nowrap;
    }

    .combat-skill-btn .skill-cost {
      font-size: 9px;
      color: #94a3b8;
      margin-top: 2px;
      font-weight: 600;
      line-height: 1;
    }

    .combat-skill-btn .skill-cd-mask {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 0%;
      background: rgba(0, 0, 0, 0.76);
      backdrop-filter: blur(2px);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 900;
      color: #f43f5e;
      font-family: monospace;
      pointer-events: none;
      transition: height 0.1s linear;
    }

    .combat-skill-btn.active-state {
      border-color: #c084fc !important;
      box-shadow: 0 0 20px rgba(192, 132, 252, 0.55) !important;
      animation: skillActivePulse 1.2s infinite alternate ease-in-out;
    }

    @keyframes skillActivePulse {
      0% { box-shadow: 0 0 14px rgba(192, 132, 252, 0.35); }
      100% { box-shadow: 0 0 28px rgba(192, 132, 252, 0.75); }
    }

    @media (max-width: 768px) {
      #combat-hud-dock {
        bottom: calc(var(--neon-safe-bottom, 0px) + 115px);
        right: 16px;
      }
      .combat-skill-btn {
        width: 54px;
        height: 54px;
      }
      .combat-skill-btn .skill-icon {
        font-size: 17px;
      }
      .ship-status-banner {
        font-size: 11px;
        padding: 5px 10px;
      }
    }
