/* City briefing keeps actions outside the scrolling body on short phones. */
#city-intro-overlay { overflow: hidden; }
#city-intro-card {
  --city-accent: #00e5ff;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 470px;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--city-accent);
  border-radius: 22px;
  background: #0d101f;
  box-shadow: 0 0 24px #00e5ff18;
  text-align: start;
}
.city-intro-body { overflow-y: auto; min-height: 0; padding: 18px; overscroll-behavior: contain; }
.city-intro-image { width: 100%; height: clamp(100px, 19vh, 175px); object-fit: cover; object-position: 50% 90%; border-radius: 12px; background: #000; }
.city-intro-range { color: var(--city-accent); font-size: 13px; margin: 14px 0 6px; }
#city-intro-title { color: #fff; font-size: clamp(20px, 4.5vw, 28px); line-height: 1.5; margin: 0 0 10px; }
#city-intro-description { color: #c9d1e4; line-height: 1.9; font-size: 15px; margin: 0 0 14px; }
#city-intro-status { color: var(--city-accent); line-height: 1.8; font-size: 14px; margin: 0 0 12px; }
#city-intro-progress { border: 1px solid #ffffff20; border-radius: 12px; padding: 10px 12px; background: #ffffff05; }
#city-intro-progress p { margin: 0; line-height: 1.8; font-size: 13px; color: #dfe7f7; }
#city-intro-progress-bar { display: block; width: 100%; height: 10px; margin: 10px 0; appearance: none; accent-color: var(--city-accent); border: 0; border-radius: 8px; overflow: hidden; background: #252c43; }
#city-intro-progress-bar::-webkit-progress-bar { background: #252c43; }
#city-intro-progress-bar::-webkit-progress-value { background: var(--city-accent); border-radius: 8px; }
#city-intro-progress-bar::-moz-progress-bar { background: var(--city-accent); border-radius: 8px; }
.city-intro-footer { flex-shrink: 0; padding: 12px 18px; border-top: 1px solid #ffffff14; display: flex; flex-direction: column; gap: 8px; }
.city-intro-footer button { min-height: 44px; width: 100%; border-radius: 12px; padding: 8px 12px; font: inherit; font-weight: 700; cursor: pointer; color: #fff; border: 1px solid #354362; background: #171e33; }
#btn-city-intro-continue { background: var(--city-accent); color: #081019; border-color: var(--city-accent); }
#btn-city-intro-continue:disabled { background: #252b3d; color: #929cb2; border-color: #354362; cursor: not-allowed; }
.city-intro-footer button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.city-intro-footer [hidden], #city-intro-progress[hidden] { display: none; }

/* Modals backdrop */
    .game-modal {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(3, 3, 8, 0.94);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 16px;
      z-index: 100;
      overflow-y: auto;
    }

    /* Style Selection Modal */
    #style-selection-card {
      width: 100%;
      max-width: 350px;
      background: #0d0d14;
      border: 1px solid #25283d;
      border-radius: 10px;
      padding: 18px 14px;
      text-align: center;
      box-shadow: 0 10px 32px rgba(0, 0, 0, 0.9);
    }

    .modal-header-tag {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 2px;
      color: #00e5ff;
      text-transform: uppercase;
      font-family: ui-monospace, monospace;
      margin-bottom: 4px;
    }

    .modal-title {
      font-size: 18px;
      font-weight: 800;
      letter-spacing: 1.5px;
      color: #ffffff;
      margin-bottom: 4px;
    }

    .modal-subtitle {
      font-size: 11px;
      color: #8a8d9f;
      margin-bottom: 14px;
      font-family: ui-monospace, monospace;
    }

    .style-cards-grid {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 8px;
    }

    .style-card {
      background: #121422;
      border: 1px solid #242940;
      border-radius: 8px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 12px;
      cursor: pointer;
      text-align: left;
      transition: all 0.18s ease;
    }

    .style-card:hover {
      border-color: #00e5ff;
      background: #171a2c;
      transform: translateY(-2px);
      box-shadow: 0 4px 14px rgba(0, 229, 255, 0.2);
    }

    .style-card:active {
      transform: scale(0.98);
    }

    .style-preview-canvas {
      width: 80px;
      height: 52px;
      border-radius: 5px;
      background: #080910;
      border: 1px solid #1e2235;
      flex-shrink: 0;
    }

    .style-card-info {
      flex: 1;
    }

    .style-card-name {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 1px;
      color: #ffffff;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 2px;
    }

    .style-card-name .style-icon {
      font-size: 13px;
    }

    .style-card-summary {
      font-size: 11px;
      font-weight: 600;
      color: #00e5ff;
      letter-spacing: 0.5px;
      font-family: ui-monospace, monospace;
      margin-bottom: 2px;
    }

    .style-card-desc {
      font-size: 10px;
      color: #808e9b;
      line-height: 1.25;
    }

    /* Upgrade Selection Modal */
    #upgrade-selection-card {
      width: 100%;
      max-width: 350px;
      background: #0d0d14;
      border: 1px solid #25283d;
      border-radius: 10px;
      padding: 18px 14px;
      text-align: center;
      box-shadow: 0 10px 32px rgba(0, 0, 0, 0.9);
    }

    .upgrade-cards-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 8px;
    }

    .upgrade-card {
      background: #121422;
      border: 1px solid #242940;
      border-radius: 8px;
      padding: 12px 14px;
      cursor: pointer;
      text-align: left;
      transition: all 0.18s ease;
    }

    .upgrade-card:hover {
      border-color: #ffd13b;
      background: #181c2e;
      transform: translateY(-2px);
      box-shadow: 0 4px 14px rgba(255, 209, 59, 0.2);
    }

    .upgrade-card:active {
      transform: scale(0.98);
    }

    .upgrade-card-name {
      font-size: 14px;
      font-weight: 800;
      letter-spacing: 1px;
      color: #ffd13b;
      margin-bottom: 3px;
      font-family: ui-monospace, monospace;
    }

    .upgrade-card-summary {
      font-size: 12px;
      font-weight: 700;
      color: #ffffff;
      margin-bottom: 4px;
    }

    .upgrade-card-desc {
      font-size: 10px;
      color: #9aa0b4;
      line-height: 1.3;
    }

    /* Upgrade Geometric Preview Splash */
    #upgrade-preview-splash {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(3, 3, 8, 0.88);
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 35;
      text-align: center;
    }

    .preview-splash-title {
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 2px;
      color: #ffd13b;
      font-family: ui-monospace, monospace;
      margin-bottom: 12px;
    }

    #preview-splash-canvas {
      width: 220px;
      height: 140px;
      border-radius: 8px;
      border: 1px solid #242940;
      background: #080910;
      margin-bottom: 12px;
    }

    .preview-splash-label {
      font-size: 11px;
      color: #a4b0be;
      font-family: ui-monospace, monospace;
    }

    /* Player Results Screen */
    #results-card {
      width: 100%;
      max-width: 360px;
      background: #0d0d14;
      border: 1px solid #222230;
      border-radius: 12px;
      padding: 22px 18px;
      text-align: center;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
      direction: rtl;
    }

    .res-hero-title {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: 0;
      color: #ffffff;
      margin-bottom: 6px;
      font-family: 'Lalezar', cursive;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    .victory-trophy-box {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      vertical-align: middle;
      flex-shrink: 0;
    }

    .victory-trophy-img {
      width: 36px;
      height: 36px;
      object-fit: contain;
      filter: drop-shadow(0 2px 8px rgba(255, 209, 59, 0.5));
      animation: trophyBounce 2s ease-in-out infinite alternate;
    }

    @keyframes trophyBounce {
      0% { transform: translateY(0) scale(1); }
      100% { transform: translateY(-3px) scale(1.06); }
    }

    .res-hero-title.lost {
      color: #ff4757;
      text-shadow: 0 0 14px rgba(255, 71, 87, 0.5);
    }

    .res-badge {
      display: inline-block;
      background: rgba(56, 239, 125, 0.12);
      border: 1px solid #38ef7d;
      color: #38ef7d;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.5px;
      padding: 4px 12px;
      border-radius: 12px;
      margin-bottom: 14px;
      font-family: 'Lalezar', cursive;
    }

    .res-badge.lost {
      background: rgba(255, 71, 87, 0.12);
      border-color: #ff4757;
      color: #ff4757;
    }

    .res-stage-context {
      width: fit-content;
      max-width: 100%;
      margin: 0 auto 12px;
      padding: 5px 11px;
      border: 1px solid rgba(0, 229, 255, 0.35);
      border-radius: 999px;
      background: rgba(0, 229, 255, 0.08);
      color: #dffbff;
      font: 700 12px 'Estedad', sans-serif;
      line-height: 1.5;
      overflow-wrap: anywhere;
    }

    .next-wave-hero-text {
      display: flex;
      flex-direction: column;
      align-items: center;
      line-height: 1.2;
      min-width: 0;
    }

    .btn-next-destination {
      max-width: 100%;
      margin-top: 2px;
      font: 700 11px 'Estedad', sans-serif;
      line-height: 1.35;
      opacity: 0.86;
      overflow-wrap: anywhere;
    }

    .res-threat-count {
      font-size: 38px;
      font-weight: 800;
      color: #00e5ff;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
      line-height: 1;
      margin-bottom: 2px;
      text-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
    }

    .res-threat-label {
      font-size: 10.5px;
      letter-spacing: 0.5px;
      color: #8a8d9f;
      margin-bottom: 16px;
      font-family: 'Estedad', sans-serif;
    }

    .res-stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 14px;
      text-align: right;
      direction: rtl;
    }

    .res-stat-box {
      background: #121422;
      border: 1px solid #202436;
      border-radius: 8px;
      padding: 8px 10px;
      text-align: right;
    }

    .res-stat-header {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 3px;
    }

    .stat-ico-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      border-radius: 6px;
      font-size: 12px;
      background: rgba(255, 255, 255, 0.08);
      flex-shrink: 0;
    }
    .stat-ico-badge.green { background: rgba(56, 239, 125, 0.16); text-shadow: 0 0 6px rgba(56, 239, 125, 0.6); }
    .stat-ico-badge.orange { background: rgba(255, 165, 2, 0.16); text-shadow: 0 0 6px rgba(255, 165, 2, 0.6); }
    .stat-ico-badge.red { background: rgba(255, 71, 87, 0.16); text-shadow: 0 0 6px rgba(255, 71, 87, 0.6); }
    .stat-ico-badge.purple { background: rgba(224, 86, 253, 0.16); text-shadow: 0 0 6px rgba(224, 86, 253, 0.6); }
    .stat-ico-badge.cyan { background: rgba(0, 229, 255, 0.16); text-shadow: 0 0 6px rgba(0, 229, 255, 0.6); }

    .res-stat-title {
      font-size: 11px;
      color: #8a8fa3;
      letter-spacing: 0.2px;
      margin-bottom: 0;
      font-weight: 700;
      font-family: 'Estedad', sans-serif;
    }

    .res-stat-val {
      font-size: 14.5px;
      font-weight: 700;
      color: #ffffff;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
    }

    .res-stat-box.highlight {
      grid-column: span 2;
      background: rgba(56, 239, 125, 0.08);
      border-color: rgba(56, 239, 125, 0.3);
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 9px 12px;
    }

    .res-stat-box.highlight .res-stat-title {
      color: #38ef7d;
      font-size: 11px;
      margin-bottom: 0;
    }

    .res-stat-box.highlight .res-stat-val {
      color: #38ef7d;
      font-size: 18px;
    }

    .res-replay-box {
      background: #090a12;
      border: 1px dashed #242940;
      border-radius: 6px;
      padding: 6px 10px;
      font-size: 10px;
      font-family: ui-monospace, monospace;
      color: #7f8fa6;
      margin-bottom: 14px;
      display: flex;
      justify-content: space-between;
    }

    .res-replay-box span.val {
      color: #00e5ff;
      font-weight: 700;
    }

    .btn-restart {
      width: 100%;
      background: #38ef7d;
      color: #030306;
      border: none;
      padding: 12px 0;
      font-size: 14px;
      font-weight: 700;
      letter-spacing: 1.5px;
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.15s ease, transform 0.1s ease;
      font-family: ui-monospace, monospace;
    }

    .btn-restart:hover {
      background: #4ef08b;
    }

    .btn-restart:active {
      transform: scale(0.98);
    }

    .btn-dev-analytics {
      margin-top: 8px;
      background: transparent;
      border: 1px dashed #3a3f58;
      color: #7d829e;
      padding: 7px 0;
      width: 100%;
      font-size: 10px;
      letter-spacing: 1px;
      border-radius: 4px;
      cursor: pointer;
      font-family: ui-monospace, monospace;
      transition: all 0.15s ease;
    }

    .btn-dev-analytics:hover {
      color: #00e5ff;
      border-color: #00e5ff;
    }

    /* Developer Analytics Panel */
    #dev-analytics-card {
      width: 100%;
      max-width: 350px;
      max-height: 94vh;
      overflow-y: auto;
      background: #0d0d14;
      border: 1px solid #2a2e45;
      border-radius: 8px;
      padding: 14px 16px;
      text-align: left;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
      font-family: ui-monospace, monospace;
    }

    .dev-title {
      font-size: 13px;
      font-weight: 700;
      color: #ffa502;
      letter-spacing: 1px;
      margin-bottom: 6px;
      border-bottom: 1px solid #222230;
      padding-bottom: 4px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    /* Core Health Diagnostic Block */
    .dev-health-block {
      background: rgba(255, 165, 2, 0.08);
      border: 1px solid rgba(255, 165, 2, 0.35);
      border-radius: 6px;
      padding: 6px 10px;
      margin-bottom: 8px;
    }

    .dev-health-badge {
      display: inline-block;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 1px;
      color: #ffa502;
      margin-bottom: 3px;
    }

    .dev-health-desc {
      font-size: 9.5px;
      color: #9da3ba;
      line-height: 1.25;
    }

    .dev-section {
      margin-top: 7px;
      padding-top: 5px;
      border-top: 1px dashed #202436;
      font-size: 10.5px;
      color: #8a8d9f;
    }

    .dev-section-title {
      color: #00e5ff;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 1px;
      margin-bottom: 3px;
      text-transform: uppercase;
    }

    .dev-row {
      display: flex;
      justify-content: space-between;
      margin-bottom: 2px;
    }

    .dev-val {
      color: #ffffff;
      font-weight: 600;
    }

    .btn-close-dev {
      margin-top: 12px;
      width: 100%;
      background: #1b1e32;
      border: 1px solid #333852;
      color: #ffffff;
      padding: 8px 0;
      font-size: 11px;
      letter-spacing: 1px;
      border-radius: 4px;
      cursor: pointer;
      font-family: ui-monospace, monospace;
    }

    .btn-close-dev:hover {
      background: #252a45;
      border-color: #ffa502;
    }

    /* Campaign Navigation & Badges */
    .hud-stage-badge {
      pointer-events: none;
      background: rgba(0, 229, 255, 0.15);
      border: 1px solid rgba(0, 229, 255, 0.45);
      color: #00e5ff;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 700;
      cursor: default;
      white-space: nowrap;
      transition: all 0.15s ease;
    }
    .hud-coins {
      background: rgba(255, 209, 59, 0.12);
      border: 1px solid rgba(255, 209, 59, 0.4);
      color: #ffd13b;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 800;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .game-coin-icon {
      display: inline-block;
      width: 17px;
      height: 17px;
      vertical-align: -2.5px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, #fff9be 0%, #ffd32a 40%, #e19e00 78%, #8a5300 100%);
      box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9),
                  inset 0 -1.5px 2px rgba(90, 45, 0, 0.8),
                  0 1px 3px rgba(0, 0, 0, 0.6);
      border: 1px solid #ffeaa7;
      position: relative;
      flex-shrink: 0;
      box-sizing: border-box;
    }
    .game-coin-icon::before {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      right: 2px;
      bottom: 2px;
      border: 1px dashed rgba(255, 245, 180, 0.85);
      border-radius: 50%;
      pointer-events: none;
      box-sizing: border-box;
    }
    .game-coin-icon::after {
      content: '✦';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 8.5px;
      color: #ffffff;
      text-shadow: 0 1px 1.5px rgba(130, 70, 0, 0.95);
      line-height: 1;
      font-weight: 900;
    }
    .game-coin-icon.large {
      width: 21px;
      height: 21px;
      vertical-align: -4px;
    }
    .game-coin-icon.large::after {
      font-size: 11px;
    }
    /* Mobile Asset Override: remove CSS radial background, borders, and pseudo-stars when hydrated with 3D mobile icon */
    .game-coin-icon.has-asset,
    .game-coin-icon:has(picture),
    .game-coin-icon:has(img) {
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      border-radius: 0 !important;
      width: auto !important;
      height: auto !important;
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      vertical-align: middle !important;
    }
    .game-coin-icon.has-asset::before,
    .game-coin-icon.has-asset::after,
    .game-coin-icon:has(picture)::before,
    .game-coin-icon:has(picture)::after,
    .game-coin-icon:has(img)::before,
    .game-coin-icon:has(img)::after {
      display: none !important;
      content: none !important;
      border: none !important;
    }
    .hud-nav-buttons {
      pointer-events: auto;
      display: flex;
      gap: 4px;
    }
    .hud-pause-btn {
      background: rgba(18, 24, 42, 0.85);
      border: 1px solid rgba(0, 229, 255, 0.4);
      color: #00e5ff;
      width: 32px;
      height: 32px;
      padding: 0;
      border-radius: 7px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 15px;
      transition: all 0.18s ease;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    .hud-pause-btn:hover {
      background: rgba(0, 229, 255, 0.2);
      border-color: #00e5ff;
      transform: scale(1.05);
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    }
    .hud-pause-btn:active {
      transform: scale(0.95);
    }
    #icon-hud-settings-box {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }
    .hud-pause-btn .mobile-asset-icon {
      width: 20px;
      height: 20px;
      object-fit: contain;
      pointer-events: none;
      filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.4));
    }

    /* HUD Live Score & Pause Group */
    .hud-score-pause-group {
      display: flex;
      align-items: center;
      gap: 6px;
      pointer-events: auto;
    }
    .hud-score {
      background: rgba(0, 229, 255, 0.12);
      border: 1px solid rgba(0, 229, 255, 0.4);
      color: #00e5ff;
      padding: 2px 8px;
      border-radius: 6px;
      font-size: 11.5px;
      font-weight: 800;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
      display: flex;
      align-items: center;
      gap: 4px;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    }
    .hud-score-label {
      font-size: 9px;
      color: #8bebf8;
      font-family: 'Estedad', sans-serif;
    }

    /* Upgrade Available Notification Red Dot */
    .btn-upgrade-indicator {
      position: relative;
    }
    .badge-red-dot,
    .btn-upgrade-indicator.has-upgrade::after,
    .has-upgrade-alert::after {
      content: '';
      position: absolute;
      top: -3px;
      left: -3px;
      width: 11px;
      height: 11px;
      background: #ff1744;
      border: 2px solid #ffffff;
      border-radius: 50%;
      box-shadow: 0 0 8px #ff1744;
      animation: alertDotPulse 0.85s infinite alternate ease-in-out;
      pointer-events: none;
      z-index: 10;
    }
    @keyframes alertDotPulse {
      from { transform: scale(0.9); opacity: 0.85; }
      to { transform: scale(1.25); opacity: 1.0; }
    }

    /* Daily Free Reward Notification Badge on Shop Tab */
    .upgrade-tab-btn {
      position: relative;
    }
    .upgrade-tab-btn.has-daily-reward::after,
    #btn-tab-shop.has-daily-reward::after,
    .btn-upgrade-indicator.has-daily-reward::after {
      content: '';
      position: absolute;
      top: -2px;
      left: 2px;
      width: 10px;
      height: 10px;
      background: #ff1744;
      border: 2px solid #ffffff;
      border-radius: 50%;
      box-shadow: 0 0 10px #ff1744, 0 0 16px rgba(255, 23, 68, 0.6);
      animation: alertDotPulse 0.85s infinite alternate ease-in-out;
      pointer-events: none;
      z-index: 10;
    }

    /* Daily Ready Card Highlighting */
    .daily-ready-pulse {
      animation: dailyRewardCardPulse 1.2s infinite alternate ease-in-out;
      border-color: #ffd13b !important;
      box-shadow: 0 0 20px rgba(255, 209, 59, 0.45) !important;
    }
    @keyframes dailyRewardCardPulse {
      from { transform: scale(1.0); box-shadow: 0 0 15px rgba(255, 209, 59, 0.3); }
      to { transform: scale(1.015); box-shadow: 0 0 25px rgba(255, 209, 59, 0.7); }
    }

    /* Smart Upgrade Focus Highlight */
    .smart-focus-highlight {
      animation: smartFocusGlow 1.4s ease-out 2;
      border-color: #00e5ff !important;
    }
    @keyframes smartFocusGlow {
      0% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
      50% { box-shadow: 0 0 28px rgba(0, 229, 255, 0.85), inset 0 0 12px rgba(0, 229, 255, 0.35); }
      100% { box-shadow: 0 0 8px rgba(0, 229, 255, 0.3); }
    }

    /* 3-Star Showcase Celebration */
    /* 3-Star Showcase Celebration (Integrated Objectives) */
    .res-stars-showcase {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      gap: 16px;
      margin: 4px 0 14px 0;
      direction: rtl;
    }
    .showcase-star-col {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      flex: 1;
      max-width: 92px;
    }
    .showcase-star-slot {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: rgba(22, 28, 48, 0.7);
      border: 1.5px solid #2e3859;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 28px;
      color: #3b4462;
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .showcase-star-slot .star-graphic {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .showcase-star-slot .showcase-star-img {
      width: 42px;
      height: 42px;
      object-fit: contain;
      filter: grayscale(100%) brightness(0.35) opacity(0.45);
      transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .showcase-star-slot.achieved {
      background: radial-gradient(circle, rgba(255, 209, 59, 0.35) 0%, rgba(255, 170, 0, 0.1) 70%);
      border-color: #ffd13b;
      box-shadow: 0 0 24px rgba(255, 209, 59, 0.65), inset 0 0 12px rgba(255, 209, 59, 0.3);
      animation: starPopIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }
    .showcase-star-slot.achieved .showcase-star-img {
      filter: grayscale(0%) brightness(1.2) drop-shadow(0 0 12px rgba(255, 209, 59, 0.95)) !important;
      opacity: 1 !important;
      transform: scale(1.15);
    }
    .star-col-desc {
      font-size: 11px;
      font-weight: 700;
      color: #64748b;
      text-align: center;
      line-height: 1.35;
      font-family: 'Estedad', sans-serif;
      transition: color 0.3s ease;
    }
    .showcase-star-col.achieved .star-col-desc {
      color: #ffd13b;
      text-shadow: 0 0 8px rgba(255, 209, 59, 0.35);
    }
    @keyframes starPopIn {
      0% { transform: scale(0.2) rotate(-45deg); opacity: 0; }
      60% { transform: scale(1.35) rotate(10deg); opacity: 1; }
      100% { transform: scale(1.0) rotate(0deg); opacity: 1; }
    }

    /* Coin Reward Card with Balanced Grid Proportion */
    .res-coin-reward-card {
      background: rgba(18, 22, 38, 0.95);
      border: 1px solid rgba(255, 209, 59, 0.28);
      border-radius: 12px;
      padding: 10px 12px;
      margin-bottom: 12px;
      box-shadow: inset 0 0 15px rgba(255, 209, 59, 0.04);
      width: 100%;
      box-sizing: border-box;
      direction: rtl;
    }
    .coin-reward-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      direction: rtl;
    }
    .coin-header-title {
      font-size: 12.5px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
    }
    .res-coin-reward-total {
      font-size: 18px;
      font-weight: 900;
      color: #ffd13b;
      font-family: 'Estedad-Mad', sans-serif;
      display: flex;
      align-items: center;
      gap: 5px;
      text-shadow: 0 0 10px rgba(255, 209, 59, 0.4);
    }
    .coin-breakdown-tiles {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      width: 100%;
      direction: rtl;
    }
    .coin-tile {
      background: rgba(10, 14, 26, 0.7);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 8px;
      padding: 6px 4px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      text-align: center;
    }
    .coin-tile-label {
      font-size: 9.5px;
      color: #94a3b8;
      font-family: 'Estedad', sans-serif;
      line-height: 1.2;
      white-space: nowrap;
    }
    .coin-tile-val {
      font-size: 12px;
      font-weight: 800;
      color: #ffd13b;
      font-family: 'Estedad-Mad', sans-serif;
    }
    .bounce-coin {
      display: inline-block;
      animation: coinBounce 0.8s ease-in-out infinite alternate;
    }
    @keyframes coinBounce {
      from { transform: translateY(0); }
      to { transform: translateY(-3px) scale(1.08); }
    }

    /* Stage Selection Star Badges */
    .stage-card-stars {
      display: flex;
      align-items: center;
      gap: 3px;
      font-size: 12px;
      letter-spacing: 1px;
      margin-top: 2px;
    }
    .star-badge-complete {
      font-size: 10px;
      color: #2ed573;
      background: rgba(46, 213, 115, 0.15);
      border: 1px solid rgba(46, 213, 115, 0.4);
      padding: 1px 6px;
      border-radius: 4px;
      margin-right: 6px;
    }
    .star-badge-incentive {
      font-size: 10px;
      color: #ffd13b;
      background: rgba(255, 209, 59, 0.15);
      border: 1px dashed rgba(255, 209, 59, 0.45);
      padding: 1px 6px;
      border-radius: 4px;
      margin-right: 6px;
    }
    .star-badge-dim {
      font-size: 10px;
      color: #718093;
      margin-right: 6px;
    }

    /* Button highlighting */
    .btn-campaign-action.highlight-upgrade {
      background: linear-gradient(180deg, #ff9f1a 0%, #d35400 100%);
      color: #ffffff;
      border: 1px solid #ffa502;
      box-shadow: 0 0 15px rgba(255, 165, 2, 0.35);
    }
    .btn-campaign-action.highlight-upgrade:hover {
      background: linear-gradient(180deg, #ffa502 0%, #e67e22 100%);
      box-shadow: 0 0 20px rgba(255, 165, 2, 0.55);
    }

    /* Results card state modifiers */
    #results-card.victory {
      border-color: rgba(0, 229, 255, 0.5);
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 229, 255, 0.18);
    }
    #results-card.defeat {
      border-color: rgba(255, 56, 56, 0.5);
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 56, 56, 0.22);
    }

    /* Campaign Modals Generic Layout */
    .campaign-modal-card {
      background: #090c16;
      border: 1px solid #1f2540;
      border-radius: 14px;
      padding: 18px;
      width: 92%;
      max-width: 480px;
      max-height: 88vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95), 0 0 1px rgba(0, 229, 255, 0.25);
      overflow: hidden;
      direction: rtl;
      text-align: right;
    }
    .campaign-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid #1a2035;
      padding-bottom: 10px;
      margin-bottom: 12px;
      direction: rtl;
    }
    .campaign-modal-title {
      font-size: 18.5px;
      font-weight: 800;
      color: #00e5ff;
      letter-spacing: 0;
      font-family: 'Lalezar', cursive;
    }
    .campaign-hub-badges {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .hud-stars {
      background: rgba(255, 71, 87, 0.15);
      border: 1px solid rgba(255, 71, 87, 0.4);
      color: #ff4757;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 800;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
    }
    .campaign-stage-list {
      position: relative;
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding-left: 4px;
      margin-bottom: 12px;
    }
    .stage-card {
      background: #101424;
      border: 1px solid #1e253e;
      border-radius: 10px;
      padding: 10px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: all 0.15s ease;
      cursor: pointer;
      direction: rtl;
    }
    .stage-card:hover:not(.locked) {
      background: #161c33;
      border-color: #00e5ff;
      transform: translateX(-3px);
    }
    .stage-card.locked {
      opacity: 0.45;
      cursor: not-allowed;
      border-color: #1a1e2e;
    }
    .stage-card.active {
      border-color: #ffd13b;
      box-shadow: 0 0 12px rgba(255, 209, 59, 0.25);
    }
    .stage-card-info {
      display: flex;
      flex-direction: column;
      gap: 3px;
      text-align: right;
    }
    .stage-card-title {
      font-size: 15px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
      letter-spacing: 0;
    }
    .stage-card-subtitle {
      font-size: 11px;
      color: #8395a7;
      font-family: 'Estedad', sans-serif;
    }
    .stage-card-stars {
      color: #ffd13b;
      font-size: 12px;
      letter-spacing: 2px;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
    }
    .stage-card-action {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
    }
    .stage-duration-tag {
      font-size: 10.5px;
      color: #718093;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
      font-weight: 700;
    }
    .btn-stage-play {
      background: #00e5ff;
      color: #030408;
      border: none;
      padding: 5px 12px;
      border-radius: 6px;
      font-size: 12.5px;
      font-weight: 800;
      font-family: 'Lalezar', cursive;
      cursor: pointer;
      transition: all 0.15s ease;
      letter-spacing: 0.5px;
    }
    .btn-stage-play:hover {
      background: #38ef7d;
      box-shadow: 0 0 10px rgba(56, 239, 125, 0.4);
    }

    /* National Iran Defense Command Map Modal Styling */
    .iran-map-modal {
      max-width: 520px;
      max-height: 90vh;
      padding: 16px 18px;
      background: radial-gradient(circle at 50% 20%, #0d1428 0%, #060914 100%);
      border: 1.5px solid #1f2b4c;
      box-shadow: 0 12px 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(0, 229, 255, 0.15);
    }

    .map-view-screen {
      display: flex;
      flex-direction: column;
      flex: 1;
      overflow: hidden;
      animation: screenFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes screenFadeIn {
      from { opacity: 0; transform: scale(0.97); }
      to { opacity: 1; transform: scale(1.0); }
    }

    .iran-tactical-map-wrapper {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 12px;
      overflow-y: auto;
      padding: 4px 2px;
    }

    .iran-map-graphic-box {
      position: relative;
      width: 100%;
      height: 250px;
      background: #050813;
      border: 1px solid #1a2544;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 229, 255, 0.05);
    }

    .iran-svg-img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
    }

    /* Tactical Sector Map Pins */
    .sector-map-pin {
      position: absolute;
      transform: translate(-50%, -50%);
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      z-index: 10;
    }
    .sector-map-pin:hover {
      transform: translate(-50%, -50%) scale(1.15);
    }

    .sector-map-pin.tehran { top: 29.6%; left: 44.0%; }
    .sector-map-pin.isfahan { top: 48.4%; left: 44.7%; }
    .sector-map-pin.shiraz { top: 67.4%; left: 47.1%; }
    .sector-map-pin.tabriz { top: 14.8%; left: 30.6%; }
    .sector-map-pin.mashhad { top: 25.8%; left: 65.5%; }

    .pin-core-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #00e5ff;
      border: 2px solid #ffffff;
      box-shadow: 0 0 10px #00e5ff;
    }
    .pin-core-dot.gold {
      background: #ffd13b;
      box-shadow: 0 0 10px #ffd13b;
    }
    .pin-core-dot.dim {
      width: 7px;
      height: 7px;
      background: #475569;
      border: 1px solid #1e293b;
      box-shadow: none;
      opacity: 0.6;
    }

    .pin-radar-ring {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 1.5px solid #00e5ff;
      opacity: 0.8;
      animation: pinPulse 2s infinite;
      pointer-events: none;
    }
    .pin-radar-ring.gold {
      border-color: #ffd13b;
    }

    @keyframes pinPulse {
      0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
      100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
    }

    .pin-tag {
      background: rgba(3, 7, 18, 0.85);
      border: 1px solid #283763;
      border-radius: 4px;
      padding: 1px 6px;
      font-size: 9.5px;
      font-family: 'Estedad-Mad', sans-serif;
      font-weight: 700;
      color: #ffffff;
      white-space: nowrap;
      margin-top: 3px;
      pointer-events: none;
      backdrop-filter: blur(4px);
    }

    /* Theater Cards Carousel / Row */
    .sector-cards-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .theater-select-card {
      background: #0d1222;
      border: 1.5px solid #1e2947;
      border-radius: 12px;
      padding: 11px 12px;
      display: flex;
      flex-direction: column;
      gap: 5px;
      cursor: pointer;
      transition: all 0.2s ease;
      text-align: right;
    }
    .theater-select-card:hover {
      border-color: #00e5ff;
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 229, 255, 0.2);
    }
    .theater-select-card.isfahan:hover {
      border-color: #ffd13b;
      box-shadow: 0 6px 20px rgba(255, 209, 59, 0.2);
    }

    .theater-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .theater-badge {
      font-size: 10px;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: 4px;
    }
    .theater-badge.cyan { background: rgba(0, 229, 255, 0.15); color: #00e5ff; }
    .theater-badge.gold { background: rgba(255, 209, 59, 0.15); color: #ffd13b; }

    .theater-status {
      font-size: 9.5px;
      color: #38ef7d;
      font-weight: 700;
    }

    .theater-title {
      font-size: 15px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
    }
    .theater-subtitle {
      font-size: 10.5px;
      color: #94a3b8;
    }
    .theater-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 4px;
      padding-top: 6px;
      border-top: 1px solid #1a223a;
    }
    .theater-stars {
      font-size: 11px;
      color: #ffd13b;
      font-family: 'Estedad-Mad', sans-serif;
      font-weight: 700;
    }
    .btn-theater-enter {
      background: #00e5ff;
      border: none;
      color: #030814;
      font-size: 11px;
      font-weight: 800;
      font-family: 'Estedad-Mad', sans-serif;
      padding: 4px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-theater-enter.gold {
      background: #ffd13b;
    }

    /* Province Screen Breadcrumb & Panorama Banner */
    .btn-back-map {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid #283763;
      color: #cbd5e1;
      border-radius: 6px;
      padding: 4px 9px;
      font-size: 11px;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-back-map:hover {
      background: rgba(0, 229, 255, 0.15);
      color: #00e5ff;
      border-color: #00e5ff;
    }

    .province-panorama-banner {
      width: 100%;
      height: 64px;
      border-radius: 8px;
      margin-bottom: 10px;
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: flex-end;
      padding: 8px 12px;
      background-size: cover;
      background-position: center bottom;
      border: 1px solid #1f2b4c;
    }
    .panorama-glow-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(3, 6, 15, 0.2) 0%, rgba(3, 6, 15, 0.88) 100%);
    }
    .panorama-info {
      position: relative;
      z-index: 2;
    }
    .panorama-tag {
      font-size: 9.5px;
      font-weight: 800;
      color: #38ef7d;
      background: rgba(56, 239, 125, 0.15);
      padding: 1px 6px;
      border-radius: 4px;
    }
    .panorama-title {
      font-size: 14px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
      margin-top: 1px;
    }

    /* Boss stage special card tag */
    .stage-card.boss-stage {
      border-color: #ff3838;
      background: linear-gradient(90deg, rgba(255, 56, 56, 0.08) 0%, #101424 100%);
    }
    .stage-card.boss-stage:hover:not(.locked) {
      box-shadow: 0 0 16px rgba(255, 56, 56, 0.35);
      border-color: #ff5252;
    }
    .stage-boss-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: rgba(255, 56, 56, 0.2);
      border: 1px solid #ff3838;
      color: #ff4757;
      padding: 1px 6px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 800;
      margin-right: 6px;
    }
    .campaign-modal-footer {
      border-top: 1px solid #1a2035;
      padding-top: 10px;
      display: flex;
      justify-content: space-between;
      gap: 8px;
    }
    .btn-campaign-nav {
      flex: 1;
      background: #141a2e;
      border: 1px solid #2e3b60;
      color: #00e5ff;
      padding: 8px 0;
      border-radius: 6px;
      font-size: 12.5px;
      font-weight: 700;
      font-family: 'Lalezar', cursive;
      cursor: pointer;
    }
    .btn-campaign-nav:hover {
      background: #1e2644;
      border-color: #00e5ff;
    }
    .btn-campaign-close {
      min-height: 44px;
      background: #1f2233;
      border: 1px solid #333852;
      color: #c8d6e5;
      padding: 8px 14px;
      border-radius: 6px;
      font-size: 12.5px;
      font-family: 'Lalezar', cursive;
      cursor: pointer;
    }

    /* Arcade Mode Specific Styling */
    .mode-selector-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 12px;
      background: rgba(10, 13, 24, 0.9);
      padding: 4px;
      border-radius: 8px;
      border: 1px solid #1e253e;
    }
    .btn-mode-tab {
      flex: 1;
      background: transparent;
      border: 1px solid transparent;
      color: #8395a7;
      padding: 6px 8px;
      border-radius: 6px;
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
      font-family: 'Lalezar', cursive;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
    }
    .btn-mode-tab:hover {
      color: #ffffff;
    }
    .btn-mode-tab.active[data-mode="CAMPAIGN"] {
      background: rgba(0, 229, 255, 0.15);
      border-color: #00e5ff;
      color: #00e5ff;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
    }
    .btn-mode-tab.active[data-mode="ARCADE"] {
      background: rgba(255, 56, 56, 0.2);
      border-color: #ff3838;
      color: #ff5252;
      box-shadow: 0 0 12px rgba(255, 56, 56, 0.4);
    }
    .stage-card.arcade {
      background: #140e1b;
      border-color: #3d1c3a;
    }
    .stage-card.arcade:hover {
      background: #20132b;
      border-color: #ff3838;
      box-shadow: 0 0 12px rgba(255, 56, 56, 0.25);
    }
    .stage-card.arcade.active {
      border-color: #ff5252;
      box-shadow: 0 0 14px rgba(255, 82, 82, 0.5);
    }
    .stage-card.arcade .stage-card-title {
      color: #ff9f1a;
      text-shadow: 0 0 8px rgba(255, 159, 26, 0.4);
    }
    .stage-card.arcade .btn-stage-play {
      background: #ff3838;
      color: #ffffff;
      box-shadow: 0 0 8px rgba(255, 56, 56, 0.5);
    }
    .hud-stage-badge.arcade-active {
      background: rgba(255, 56, 56, 0.15);
      border-color: #ff3838;
      color: #ff5252;
      box-shadow: 0 0 8px rgba(255, 56, 56, 0.4);
    }
    .hud-mode-btn {
      background: rgba(255, 56, 56, 0.22);
      border: 1px solid #ff3838;
      color: #ff5252;
      cursor: pointer;
      font-weight: 800;
      white-space: nowrap;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      box-shadow: 0 0 10px rgba(255, 56, 56, 0.35);
      transition: all 0.15s ease;
      flex-shrink: 0;
      user-select: none;
      font-family: 'Lalezar', cursive;
    }
    .hud-mode-btn:hover {
      background: rgba(255, 56, 56, 0.4);
      color: #ffffff;
      box-shadow: 0 0 14px rgba(255, 56, 56, 0.7);
      transform: scale(1.03);
    }
    .hud-mode-btn:active {
      transform: scale(0.96);
    }
    .hud-mode-btn.campaign-mode {
      background: rgba(0, 229, 255, 0.2);
      border-color: #00e5ff;
      color: #00e5ff;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
    }
    .hud-mode-btn.campaign-mode:hover {
      background: rgba(0, 229, 255, 0.38);
      color: #ffffff;
      box-shadow: 0 0 14px rgba(0, 229, 255, 0.7);
    }

    /* Floating Mode Switch Toast Notification */
    .mode-toast {
      position: absolute;
      top: 48px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(15, 18, 30, 0.96);
      border: 1.5px solid #ff3838;
      box-shadow: 0 0 20px rgba(255, 56, 56, 0.5);
      color: #ffffff;
      font-size: 12px;
      font-weight: 800;
      padding: 6px 16px;
      border-radius: 20px;
      z-index: 30;
      pointer-events: none;
      white-space: nowrap;
      animation: toastFadeIn 0.25s ease-out;
    }
    .mode-toast.campaign {
      border-color: #00e5ff;
      box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    }
    @keyframes toastFadeIn {
      from { opacity: 0; transform: translate(-50%, -10px); }
      to { opacity: 1; transform: translate(-50%, 0); }
    }

    /* Upgrade Modal Tabs (Systems vs Coin Shop) */
    .upgrade-tabs-row {
      display: flex;
      gap: 8px;
      width: 100%;
      margin-bottom: 12px;
      background: #090d1a;
      padding: 4px;
      border-radius: 12px;
      border: 1px solid #1c2642;
      box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
      direction: rtl;
    }
    .upgrade-tab-btn {
      flex: 1;
      padding: 9px 12px;
      background: transparent;
      border: 1px solid transparent;
      border-radius: 9px;
      color: #7d8ea6;
      font-family: 'Lalezar', cursive;
      font-size: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      min-width: 0;
      gap: 2px;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .upgrade-tab-btn * {
      pointer-events: none;
    }
    .upgrade-tab-btn .tab-icon,
    .upgrade-tab-btn .tab-icon picture {
      display: inline-flex;
      width: 48px;
      height: 48px;
      flex: none;
      align-items: center;
      justify-content: center;
    }
    .upgrade-tab-btn .tab-icon img {
      width: 48px;
      height: 48px;
    }
    .upgrade-tab-btn:hover {
      color: #ffffff;
      background: rgba(255, 255, 255, 0.04);
    }
    .upgrade-tab-btn.active {
      background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(0, 114, 255, 0.35) 100%);
      border-color: #00e5ff;
      color: #ffffff;
      font-weight: 900;
      box-shadow: 0 0 16px rgba(0, 229, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
      text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
      transform: translateY(-1px);
    }
    .shop-tab-badge {
      position: absolute;
      top: 8px;
      left: 12px;
      background: linear-gradient(135deg, #ff4757, #ff6b81);
      color: #ffffff;
      font-size: 9.5px;
      padding: 1px 6px;
      border-radius: 12px;
      font-family: 'Estedad-Mad', sans-serif;
      font-weight: 800;
      box-shadow: 0 0 8px rgba(255, 71, 87, 0.6);
      animation: pulseBadge 1.8s infinite ease-in-out;
    }
    @keyframes pulseBadge {
      0%, 100% { transform: scale(1); opacity: 0.95; }
      50% { transform: scale(1.08); opacity: 1; }
    }

    /* Coin Shop Package Cards */
    .shop-package-card {
      background: #101426;
      border: 1px solid #1e2848;
      border-radius: 12px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      direction: rtl;
      text-align: right;
      position: relative;
      overflow: hidden;
      flex-shrink: 0;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .shop-package-card:hover {
      border-color: rgba(255, 215, 0, 0.5);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 215, 0, 0.15);
      transform: translateY(-2px);
    }
    .shop-package-card.popular {
      border-color: #00e5ff;
      box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
    }
    .shop-package-card.strategic {
      border-color: #ffd700;
      box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
    }
    .shop-card-badge {
      position: absolute;
      top: 10px;
      left: 12px;
      font-size: 10px;
      font-weight: 800;
      font-family: 'Estedad-Mad', sans-serif;
      padding: 2px 8px;
      border-radius: 6px;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }
    .shop-card-badge.popular-badge {
      background: linear-gradient(135deg, #00e5ff, #0072ff);
      color: #02111b;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    }
    .shop-card-badge.value-badge {
      background: linear-gradient(135deg, #e040fb, #7c4dff);
      color: #ffffff;
      box-shadow: 0 0 10px rgba(224, 64, 251, 0.5);
    }
    .shop-card-badge.mega-badge {
      background: linear-gradient(135deg, #ffd700, #ff6b00);
      color: #120900;
      box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    }
    .shop-card-badge.free-badge {
      background: linear-gradient(135deg, #2ed573, #1e90ff);
      color: #021908;
      box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
    }
    .shop-card-header {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .shop-card-icon {
      font-size: 26px;
      width: 44px;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
      flex-shrink: 0;
    }
    .shop-card-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
      flex: 1;
    }
    .shop-card-title {
      font-size: 15px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
    }
    .shop-card-coins-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .shop-card-coins-amount {
      font-size: 18px;
      font-weight: 900;
      color: #ffd13b;
      font-family: 'Estedad-Mad', sans-serif;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      text-shadow: 0 0 10px rgba(255, 209, 59, 0.4);
    }
    .shop-bonus-tag {
      font-size: 11px;
      font-weight: 800;
      color: #2ed573;
      background: rgba(46, 213, 115, 0.15);
      border: 1px solid rgba(46, 213, 115, 0.35);
      padding: 1px 7px;
      border-radius: 6px;
      font-family: 'Estedad-Mad', sans-serif;
    }
    .shop-card-desc {
      font-size: 11.5px;
      color: #94a3b8;
      line-height: 1.5;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
    }
    .btn-shop-buy {
      margin-top: 4px;
      width: 100%;
      padding: 10px 14px;
      background: linear-gradient(135deg, #ffd700 0%, #ff9100 100%);
      color: #1a1000;
      font-family: 'Lalezar', cursive;
      font-size: 15px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-weight: 900;
      box-shadow: 0 3px 12px rgba(255, 165, 0, 0.35);
      transition: all 0.15s ease;
    }
    .btn-shop-buy:hover {
      filter: brightness(1.1);
      box-shadow: 0 4px 18px rgba(255, 165, 0, 0.55);
      transform: translateY(-1px);
    }
    .btn-shop-buy:active {
      transform: translateY(1px);
      box-shadow: 0 1px 6px rgba(255, 165, 0, 0.4);
    }
    .btn-shop-buy.free-claim {
      background: linear-gradient(135deg, #2ed573 0%, #10ac84 100%);
      color: #021a0d;
      box-shadow: 0 3px 12px rgba(46, 213, 115, 0.35);
    }
    .btn-shop-buy.free-claim:hover {
      box-shadow: 0 4px 18px rgba(46, 213, 115, 0.55);
    }
    .btn-shop-buy.daily-claimed,
    .btn-shop-buy.daily-claimed:hover {
      flex-direction: column;
      gap: 3px;
      padding: 8px 14px;
      background: linear-gradient(135deg, #172033 0%, #202a3f 100%);
      color: #cbd5e1;
      box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
      filter: none;
      transform: none;
      cursor: not-allowed;
    }
    .daily-airdrop-countdown {
      direction: ltr;
      color: #ffd13b;
      font: 900 16px/1.2 'Estedad-Mad', monospace;
      letter-spacing: 1px;
      text-shadow: 0 0 9px rgba(255, 209, 59, 0.35);
    }
    .daily-airdrop-countdown-wrap {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: #94a3b8;
      font: 700 10px/1.2 'Estedad-Mad', sans-serif;
    }

    /* Upgrade & Arsenal Cards */
    .upgrade-items-container {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 12px;
    }
    .item-card {
      background: #101424;
      border: 1px solid #1e253e;
      border-radius: 10px;
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      direction: rtl;
      text-align: right;
      flex-shrink: 0;
      transition: all 0.15s ease;
    }
    .item-card.equipped {
      border-color: #38ef7d;
      box-shadow: 0 0 14px rgba(56, 239, 125, 0.2);
    }
    .item-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      direction: rtl;
    }
    .item-card-title {
      font-size: 15px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
      letter-spacing: 0;
    }
    .item-card-cost {
      font-size: 13px;
      font-weight: 800;
      color: #ffd13b;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
    }
    .item-card-cost.item-equipped-tag {
      color: #38ef7d;
      font-size: 11.5px;
      font-weight: 800;
      background: rgba(56, 239, 125, 0.15);
      border: 1px solid rgba(56, 239, 125, 0.4);
      padding: 3px 8px;
      border-radius: 5px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .item-card-cost.item-owned-tag {
      color: #00e5ff;
      font-size: 11.5px;
      font-weight: 800;
      background: rgba(0, 229, 255, 0.15);
      border: 1px solid rgba(0, 229, 255, 0.4);
      padding: 3px 8px;
      border-radius: 5px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .item-card-desc {
      font-size: 11px;
      color: #a4b0be;
      line-height: 1.5;
      text-align: right;
      font-family: 'Estedad', sans-serif;
    }
    .btn-item-buy {
      background: #38ef7d;
      color: #04140a;
      border: none;
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 12.5px;
      font-weight: 800;
      font-family: 'Lalezar', cursive;
      cursor: pointer;
      align-self: flex-start;
      margin-top: 4px;
      transition: all 0.15s ease;
      letter-spacing: 0.5px;
    }
    .btn-item-buy:hover:not(:disabled) {
      background: #2ecc71;
      box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
    }
    .btn-item-buy:disabled {
      background: #2a3142;
      color: #636e72;
      cursor: not-allowed;
    }
    .btn-item-buy.btn-item-equip {
      background: rgba(0, 229, 255, 0.15);
      border: 1px solid #00e5ff;
      color: #00e5ff;
      font-size: 12.5px;
      font-weight: 800;
      cursor: pointer;
    }
    .btn-item-buy.btn-item-equip:hover {
      background: #00e5ff;
      color: #05101e;
      box-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
    }
    .badge-equipped {
      background: rgba(56, 239, 125, 0.15);
      border: 1px solid #38ef7d;
      color: #38ef7d;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 800;
      align-self: flex-start;
      font-family: 'Estedad', sans-serif;
    }

    /* Purchase Ceremony Modal */
    .ceremony-modal-card {
      background: #090e1f;
      border: 2px solid #ffd13b;
      box-shadow: 0 0 40px rgba(255, 209, 59, 0.35);
      border-radius: 14px;
      padding: 24px 20px;
      width: 88%;
      max-width: 420px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 12px;
      direction: rtl;
    }
    .ceremony-icon-glow {
      font-size: 40px;
      filter: drop-shadow(0 0 16px #ffd13b);
      animation: ceremonyGlow 1.2s infinite alternate;
    }
    @keyframes ceremonyGlow {
      from { transform: scale(1.0); }
      to { transform: scale(1.15); }
    }
    .ceremony-title {
      font-size: 20px;
      font-weight: 900;
      color: #ffd13b;
      font-family: 'Lalezar', cursive;
      letter-spacing: 0;
    }
    .ceremony-subtitle {
      font-size: 15px;
      font-weight: 700;
      color: #00e5ff;
      font-family: 'Lalezar', cursive;
      letter-spacing: 0;
    }
    .ceremony-desc {
      font-size: 11.5px;
      color: #ced6e0;
      line-height: 1.5;
      background: rgba(0, 0, 0, 0.4);
      padding: 10px 14px;
      border-radius: 8px;
      border: 1px solid #1a233a;
      font-family: 'Estedad', sans-serif;
    }
    .btn-ceremony-cta {
      background: #ffd13b;
      color: #120e02;
      border: none;
      padding: 10px 24px;
      border-radius: 6px;
      font-size: 14.5px;
      font-weight: 900;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(255, 209, 59, 0.4);
      margin-top: 6px;
      transition: all 0.15s ease;
      font-family: 'Lalezar', cursive;
      letter-spacing: 0.5px;
    }
    .btn-ceremony-cta:hover {
      background: #ffeaa7;
      transform: scale(1.04);
    }

    /* Results Stars & Coin Breakdown */
    .res-stars-grid {
      display: flex;
      flex-direction: column;
      gap: 6px;
      background: rgba(13, 16, 28, 0.85);
      border: 1px solid #1f253e;
      border-radius: 8px;
      padding: 8px 10px;
      margin-bottom: 8px;
      text-align: right;
    }
    .res-star-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      color: #a4b0be;
      font-family: 'Estedad', sans-serif;
    }
    .res-star-item.achieved {
      color: #ffffff;
    }
    .res-star-item.achieved .star-icon {
      color: #ffd13b;
      text-shadow: 0 0 6px #ffd13b;
    }
    .res-star-item .star-icon {
      font-size: 14px;
      color: #485460;
    }
    /* Clean Results Action Buttons with Perfect Alignment */
    .res-actions-container {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
      margin-top: 6px;
      box-sizing: border-box;
      direction: rtl;
    }
    .btn-results-hero {
      width: 100%;
      min-height: 52px;
      border: none;
      border-radius: 12px;
      font-family: 'Lalezar', cursive;
      font-size: 21px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      transition: all 0.15s ease;
      letter-spacing: 0.3px;
      box-sizing: border-box;
    }
    .btn-results-hero.btn-hero-victory {
      background: linear-gradient(180deg, #2ecc71 0%, #1b9e50 100%);
      color: #03180a;
      box-shadow: 0 4px 18px rgba(46, 204, 113, 0.45);
    }
    .btn-results-hero.btn-hero-victory:hover {
      background: linear-gradient(180deg, #38ef7d 0%, #22bb5f 100%);
      transform: translateY(-1px);
      box-shadow: 0 6px 22px rgba(46, 204, 113, 0.6);
    }
    .btn-results-hero.btn-hero-defeat {
      background: linear-gradient(180deg, #ff9f1a 0%, #d35400 100%);
      color: #ffffff;
      border: 1px solid #ffa502;
      box-shadow: 0 4px 18px rgba(255, 159, 26, 0.45);
      animation: alertPulseHero 1.8s infinite alternate;
    }
    @keyframes alertPulseHero {
      from { box-shadow: 0 4px 14px rgba(255, 159, 26, 0.35); }
      to { box-shadow: 0 6px 24px rgba(255, 159, 26, 0.65); transform: scale(1.01); }
    }
    .res-buttons-sub-row {
      display: flex;
      gap: 8px;
      width: 100%;
      direction: rtl;
    }
    .btn-results-sub {
      flex: 1;
      height: 42px;
      background: #141a2e;
      border: 1px solid #2e3b60;
      color: #00e5ff;
      border-radius: 9px;
      font-family: 'Lalezar', cursive;
      font-size: 13.5px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 0 4px;
      white-space: nowrap;
      transition: all 0.15s ease;
      box-sizing: border-box;
    }
    .btn-results-sub:hover {
      background: #1e2644;
      border-color: #00e5ff;
    }
    .btn-results-sub.retry-btn {
      background: #1c233a;
      border-color: #3d4f80;
      color: #cbd5e1;
    }
    .hero-btn-icon, .sub-btn-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      line-height: 1;
    }
    .hero-btn-icon {
      font-size: 18px;
    }

    /* ==================================================
       AUTHENTIC MOBILE GAME MAIN MENU & 3D UI
       ================================================== */
    .main-menu-card.mobile-game-menu {
      background: linear-gradient(180deg, rgba(14, 18, 34, 0.98) 0%, rgba(7, 9, 18, 0.98) 100%);
      border: 1.5px solid rgba(0, 229, 255, 0.5);
      border-radius: 18px;
      padding: 16px 16px 20px 16px;
      width: 94%;
      max-width: 440px;
      max-height: 100%;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      box-shadow: 0 0 35px rgba(0, 229, 255, 0.25), 0 15px 45px rgba(0, 0, 0, 0.95);
      direction: rtl;
    }

    .main-menu-card.mobile-game-menu > * { flex-shrink: 0; }

    /* Top Bar Header (Standardized Unified Heights & Tactical Spacing) */
    .menu-top-bar {
      width: 100%;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 10px;
      direction: ltr; /* Guaranteed Left-to-Right: Settings -> Coins -> Spacer -> Profile */
      box-sizing: border-box;
    }
    .menu-top-spacer {
      flex: 1;
      min-width: 8px;
    }
    .btn-tactical-icon {
      width: 56px;
      height: 56px;
      min-width: 56px;
      min-height: 56px;
      max-height: 56px;
      border-radius: 14px;
      background: linear-gradient(180deg, #1f2742 0%, #13192c 100%);
      border: 1.5px solid #2e3b60;
      color: #00e5ff;
      font-size: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 3px 0 #0c101d, 0 4px 10px rgba(0,0,0,0.5);
      transition: all 0.12s ease;
      touch-action: manipulation;
      box-sizing: border-box;
      flex-shrink: 0;
    }
    .btn-tactical-icon:hover {
      border-color: #00e5ff;
      box-shadow: 0 3px 0 #0c101d, 0 0 14px rgba(0, 229, 255, 0.4);
    }
    .btn-tactical-icon:active {
      transform: translateY(2px);
      box-shadow: 0 1px 0 #0c101d;
    }
    .menu-coins-badge {
      height: 56px;
      min-height: 56px;
      max-height: 56px;
      display: flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(180deg, #2b2310 0%, #191408 100%);
      border: 1.5px solid #ffd13b;
      border-radius: 14px;
      padding: 0 16px;
      box-shadow: 0 3px 0 #7a5e0b, 0 4px 12px rgba(0,0,0,0.5);
      cursor: pointer;
      box-sizing: border-box;
      flex-shrink: 0;
      transition: all 0.15s ease;
    }
    .menu-coins-badge:hover {
      box-shadow: 0 3px 0 #7a5e0b, 0 0 16px rgba(255, 209, 59, 0.4);
      transform: translateY(-1px);
    }
    .menu-coins-badge:active {
      transform: translateY(2px);
      box-shadow: 0 1px 0 #7a5e0b;
    }
    .menu-coins-badge .coin-icon {
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .menu-coins-badge .coin-num {
      font-size: 16px;
      font-weight: 900;
      color: #ffd13b;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
      letter-spacing: 0.5px;
    }
    .menu-profile-pill {
      height: 56px;
      min-height: 56px;
      max-height: 56px;
      display: flex;
      align-items: center;
      gap: 10px;
      background: linear-gradient(135deg, rgba(18, 26, 47, 0.95) 0%, rgba(10, 15, 29, 0.95) 100%);
      border: 1.5px solid #2e3d63;
      border-radius: 16px;
      padding: 0 4px 0 14px; /* in RTL: 4px padding near avatar on right, 14px padding near text on left */
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 3px 0 #0c101d, 0 4px 16px rgba(0, 0, 0, 0.45);
      box-sizing: border-box;
      direction: rtl;
      flex: 1;
      min-width: 190px;
    }
    .menu-profile-pill:hover {
      border-color: #ffd13b;
      box-shadow: 0 3px 0 #0c101d, 0 4px 22px rgba(255, 209, 59, 0.35);
      transform: translateY(-1px);
    }
    .menu-profile-pill:active {
      transform: translateY(2px);
      box-shadow: 0 1px 0 #0c101d;
    }
    .menu-profile-avatar {
      position: relative;
      width: 50px;
      height: 50px;
      min-width: 50px;
      min-height: 50px;
      border-radius: 50%;
      background: radial-gradient(circle, #1a2744 0%, #0b1120 100%);
      border: 2.5px solid #ffd13b;
      box-shadow: 0 0 16px rgba(255, 209, 59, 0.45), inset 0 0 8px rgba(0, 0, 0, 0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      cursor: pointer;
      box-sizing: border-box;
      transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    }
    .menu-profile-avatar:hover {
      transform: scale(1.08);
      border-color: #00e5ff;
      box-shadow: 0 0 22px rgba(0, 229, 255, 0.7);
    }
    .menu-profile-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      border-radius: 50%;
    }
    .menu-profile-details {
      min-width: 0;
      display: flex;
      flex-direction: column;
      text-align: right;
      justify-content: center;
      line-height: 1.2;
    }
    .menu-commander-name {
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 13.5px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Estedad', 'Vazirmatn', sans-serif;
      line-height: 1.2;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
      white-space: nowrap;
    }
    .menu-commander-title {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 10.5px;
      font-weight: 700;
      color: #ffd13b;
      font-family: 'Estedad', 'Vazirmatn', sans-serif;
      line-height: 1.2;
      white-space: nowrap;
    }
    .menu-commander-id {
      font-size: 9px;
      color: #00e5ff;
      font-family: 'Estedad-Mad', monospace;
      letter-spacing: 0.5px;
    }

    /* Hero Center */
    .menu-hero-center {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 4px 0 16px 0;
    }
    .menu-insignia-glow {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 6px;
      animation: floatInsignia 3s ease-in-out infinite;
    }
    .menu-hero-logo-img, .menu-hero-logo-picture img {
      max-width: 145px;
      width: 100%;
      height: auto;
      object-fit: contain;
      filter: drop-shadow(0 0 16px rgba(255, 177, 66, 0.45)) drop-shadow(0 4px 20px rgba(0, 0, 0, 0.7));
    }
    @keyframes floatInsignia {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-4px); }
    }
    .menu-hero-title {
      font-size: 40px;
      font-weight: 900;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
      line-height: 1.05;
      text-shadow: 0 0 20px rgba(0, 229, 255, 0.75), 0 3px 0 #005f73;
      margin-bottom: 2px;
    }
    .menu-hero-subtitle {
      font-size: 12.5px;
      color: #8395a7;
      font-family: 'Estedad', sans-serif;
      margin-bottom: 14px;
    }

    /* Mobile-Optimized Client-Adaptive Asset Icon Styles */
    .mobile-asset-icon {
      display: inline-block;
      vertical-align: middle;
      object-fit: contain;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none;
      filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
      transition: transform 0.12s ease;
    }
    .menu-settings-icon {
      width: 36px;
      height: 36px;
    }
    .menu-avatar-icon {
      width: 42px;
      height: 42px;
    }
    .menu-play-icon {
      width: 84px;
      height: 84px;
      margin-left: 6px;
      filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
    }
    .tile-graphic-icon {
      width: 58px;
      height: 58px;
      flex-shrink: 0;
    }
    .tile-pvp-icon {
      width: 58px;
      height: 58px;
      object-fit: contain;
      flex-shrink: 0;
    }
    .tile-waves-icon {
      width: 74px !important;
      height: 74px !important;
      margin: -8px -6px -8px -4px;
      flex-shrink: 0;
    }
    .sub-btn-graphic-icon {
      width: 26px;
      height: 26px;
      margin-left: 4px;
    }
    .hero-btn-graphic-icon {
      width: 38px;
      height: 38px;
      margin-left: 8px;
      vertical-align: middle;
    }
    .row-inline-icon {
      width: 32px;
      height: 32px;
      margin-left: 10px;
    }
    .badge-inline-icon {
      width: 26px;
      height: 26px;
      vertical-align: middle;
      display: inline-block;
      margin-left: 5px;
    }
    .header-inline-icon {
      width: 36px;
      height: 36px;
      vertical-align: middle;
      display: inline-block;
      margin-left: 8px;
    }
    .menu-wave-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 56, 56, 0.14);
      border: 1px solid rgba(255, 56, 56, 0.4);
      color: #ff6b6b;
      padding: 3px 12px;
      border-radius: 20px;
      font-size: 11.5px;
      font-family: 'Estedad-Mad', 'Estedad', sans-serif;
    }
    .pulse-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #ff4757;
      box-shadow: 0 0 8px #ff4757;
      animation: pulseDotAnim 1.2s infinite;
    }
    @keyframes pulseDotAnim {
      0%, 100% { transform: scale(0.9); opacity: 0.8; }
      50% { transform: scale(1.3); opacity: 1; }
    }

    /* 3D Hero Battle Button */
    .btn-3d-hero {
      width: 100%;
      min-height: 84px;
      padding: 10px 18px;
      background: linear-gradient(180deg, #2ed573 0%, #10ac84 100%);
      border: 2px solid #55efc4;
      border-radius: 14px;
      box-shadow: 0 6px 0 #0c6a50, 0 10px 22px rgba(0, 0, 0, 0.6);
      color: #031c13;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: all 0.1s ease;
      touch-action: manipulation;
      margin-bottom: 12px;
    }
    .btn-3d-hero:active {
      transform: translateY(4px);
      box-shadow: 0 2px 0 #0c6a50, 0 4px 10px rgba(0, 0, 0, 0.6);
    }
    .btn-3d-content {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .btn-3d-content.hero-battle-layout {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
      width: 100%;
    }
    .btn-hero-texts {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      text-align: right;
    }
    [dir="ltr"] .btn-hero-texts,
    html[lang="en"] .btn-hero-texts {
      text-align: left;
    }
    .btn-3d-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      flex-shrink: 0;
    }
    .btn-3d-text {
      font-size: 25px;
      font-weight: 900;
      font-family: 'Lalezar', cursive;
      letter-spacing: 0.5px;
      line-height: 1.15;
      color: #031c13;
    }
    .btn-3d-sub {
      font-size: 13px;
      font-weight: 800;
      font-family: 'Estedad', sans-serif;
      color: #043625;
      margin-top: 2px;
      line-height: 1.25;
      opacity: 0.95;
    }

    /* 2x2 Tactical Grid */
    .menu-tactical-grid {
      width: 100%;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 9px;
    }
    .btn-3d-tile {
      min-height: 78px;
      background: linear-gradient(180deg, #1d253f 0%, #12182b 100%);
      border: 1.5px solid #2e3c63;
      border-radius: 12px;
      box-shadow: 0 4px 0 #0b0f1c, 0 6px 14px rgba(0, 0, 0, 0.45);
      color: #ffffff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding: 9px 12px;
      gap: 12px;
      transition: all 0.1s ease;
      touch-action: manipulation;
      text-align: right;
    }
    .btn-3d-tile:active {
      transform: translateY(2.5px);
      box-shadow: 0 1.5px 0 #0b0f1c, 0 2px 6px rgba(0, 0, 0, 0.45);
    }
    .tile-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      flex-shrink: 0;
    }
    .tile-texts {
      display: flex;
      flex-direction: column;
    }
    .tile-title {
      font-size: 15.5px;
      font-weight: 800;
      font-family: 'Lalezar', cursive;
      line-height: 1.15;
    }
    .tile-desc {
      font-size: 11px;
      color: #8395a7;
      font-family: 'Estedad', sans-serif;
      line-height: 1.1;
    }
    .btn-3d-tile.gold-tile {
      border-color: rgba(255, 209, 59, 0.5);
    }
    .btn-3d-tile.gold-tile .tile-title {
      color: #ffd13b;
    }
    .btn-3d-tile.cyan-tile {
      border-color: rgba(0, 229, 255, 0.45);
    }
    .btn-3d-tile.cyan-tile .tile-title {
      color: #00e5ff;
    }
    #btn-menu-leaderboard .tile-title,
    #btn-menu-account .tile-title,
    #btn-menu-competitive .tile-title {
      color: #fff;
    }

    @keyframes spinRadar {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }

    #settings-overlay {
      justify-content: center;
      align-items: center;
      overscroll-behavior: contain;
    }
    #settings-overlay .campaign-modal-card {
      max-height: calc(100% - 16px);
      min-height: 0;
    }
    #settings-overlay .settings-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
    }
    #settings-overlay .campaign-modal-footer {
      flex: 0 0 auto;
      padding-top: 8px;
      background: #090c16;
    }
    #btn-setting-fps.auto-capped {
      opacity: 0.78;
      cursor: default;
      color: #9bd7a8;
    }

    @media (max-width: 380px) {
      #settings-row-language {
        flex-wrap: wrap;
        gap: 8px;
      }
      #settings-row-language > div:first-child,
      #settings-row-language .lang-selector-group {
        width: 100%;
      }
      #settings-row-language .lang-selector-group {
        justify-content: space-between;
      }
      #settings-row-language .btn-lang {
        flex: 1 1 0;
      }
    }

    /* Auth & Settings Tabs & Controls */
    .auth-tabs-row {
      display: flex;
      width: 100%;
      background: #0f1424;
      border-radius: 10px;
      padding: 3px;
      margin-bottom: 12px;
      border: 1px solid #252e4d;
    }
    .auth-tab-btn {
      flex: 1;
      padding: 8px 10px;
      background: transparent;
      border: none;
      color: #8395a7;
      font-family: 'Lalezar', cursive;
      font-size: 14px;
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.15s ease;
    }
    .auth-tab-btn.active {
      background: #00e5ff;
      color: #031219;
      font-weight: 900;
      box-shadow: 0 2px 8px rgba(0, 229, 255, 0.35);
    }
    .sync-guarantee-badge {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      text-align: right;
    }
    .btn-toggle {
      border: none;
      background: #252e4d;
      color: #8395a7;
      transition: all 0.15s ease;
    }
    .btn-toggle.active {
      background: #2ed573;
      color: #031407;
    }

    /* Audio Range Sliders (Music & SFX Volume) */
    .audio-range-slider {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 6px;
      background: #1e263d;
      border-radius: 4px;
      outline: none;
      cursor: pointer;
    }
    .audio-range-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #00e5ff;
      border: 2px solid #ffffff;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
      cursor: pointer;
      transition: transform 0.1s ease;
    }
    .audio-range-slider::-webkit-slider-thumb:hover {
      transform: scale(1.15);
    }
    .audio-range-slider::-moz-range-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #00e5ff;
      border: 2px solid #ffffff;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
      cursor: pointer;
    }
    #slider-setting-sfx::-webkit-slider-thumb {
      background: #ffd13b;
      box-shadow: 0 0 10px rgba(255, 209, 59, 0.7);
    }
    #slider-setting-sfx::-moz-range-thumb {
      background: #ffd13b;
      box-shadow: 0 0 10px rgba(255, 209, 59, 0.7);
    }

    /* 3-Language Selector Styles (Persian, Arabic, English) */
    .lang-selector-group {
      display: flex;
      background: #090d1a;
      padding: 3px;
      border-radius: 8px;
      border: 1px solid #1f2940;
      gap: 3px;
      direction: ltr;
    }
    .btn-lang {
      background: transparent;
      color: #8fa0be;
      border: none;
      font-family: inherit;
      font-size: 11px;
      font-weight: 700;
      padding: 5px 8px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .btn-lang:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.08);
    }
    .btn-lang.active {
      background: #00e5ff;
      color: #030814;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
      font-weight: 800;
    }

    /* Dynamic LTR / RTL Direction Rules */
    body.lang-ltr {
      direction: ltr !important;
      text-align: left !important;
    }
    body.lang-ltr .campaign-modal-card {
      direction: ltr !important;
      text-align: left !important;
    }
    body.lang-ltr .campaign-modal-title,
    body.lang-ltr .item-card-title,
    body.lang-ltr .item-card-desc,
    body.lang-ltr .tut-card,
    body.lang-ltr #tut-desc,
    body.lang-ltr .menu-commander-title,
    body.lang-ltr .menu-commander-name,
    body.lang-ltr .menu-commander-id,
    body.lang-ltr .tile-texts,
    body.lang-ltr .results-card-title,
    body.lang-ltr .res-stat-card {
      text-align: left !important;
    }
    body.lang-ltr .item-card-header,
    body.lang-ltr .settings-row,
    body.lang-ltr .menu-top-bar {
      flex-direction: row !important;
    }
    body.lang-ltr .tut-card {
      text-align: left !important;
      direction: ltr !important;
    }
    body.lang-ltr #tut-preview-box {
      order: -1;
    }
    body.lang-ltr .res-coin-reward-card,
    body.lang-ltr .coin-reward-header,
    body.lang-ltr .coin-breakdown-tiles,
    body.lang-ltr .res-stats-grid,
    body.lang-ltr .res-stat-box,
    body.lang-ltr .res-buttons-sub-row {
      direction: ltr !important;
      text-align: left !important;
    }
    body.lang-ltr .coin-reward-header,
    body.lang-ltr .res-stat-header {
      flex-direction: row !important;
    }
    body.lang-ltr .btn-results-sub {
      font-size: 11.5px !important;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
      font-weight: 700;
      white-space: nowrap;
      padding: 0 4px;
    }

    /* Give the commander profile its own row before the header becomes cramped. */
    @media (max-width: 760px) {
      #main-menu-overlay { overflow: hidden; }
      .menu-top-bar {
        display: grid;
        grid-template-columns: 56px auto minmax(0, 1fr);
        grid-template-rows: 56px;
        gap: 8px;
      }
      .menu-top-bar > .btn-tactical-icon { grid-column: 1; grid-row: 1; }
      .menu-top-bar > .menu-coins-badge { grid-column: 2; grid-row: 1; }
      .menu-top-spacer { display: none; }
      .menu-top-bar #menu-btn-profile-trigger {
        grid-column: 3;
        grid-row: 1;
        width: auto;
        min-width: 0;
        justify-content: flex-start;
      }
      .menu-top-bar .menu-profile-pill { min-width: 0; }
      .menu-profile-details { flex: 1; min-width: 0; }
    }

    @media (max-width: 540px) {
      #main-menu-overlay { overflow: hidden; }
      .menu-top-bar { grid-template-columns: 42px 94px minmax(0, 1fr); grid-template-rows: 46px; }
      .menu-top-bar #menu-btn-profile-trigger { grid-column: 3; grid-row: 1; width: auto; justify-content: flex-start; }
      .menu-top-bar .menu-profile-pill { min-width: 0; }
      .menu-profile-details { flex: 1; }
      .menu-top-bar { gap: 6px; }
      .menu-top-spacer { display: none; }
      .menu-top-bar .btn-tactical-icon { width: 44px; min-width: 44px; }
      .menu-top-bar .menu-coins-badge { padding: 0 6px; gap: 4px; max-width: 94px; }
      .menu-coins-badge .coin-num { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
      .menu-top-bar .menu-profile-pill { gap: 5px; padding: 0 4px; }
      .menu-commander-name { font-size: 11px; }
      .menu-commander-title { font-size: 9px; }
      .main-menu-card.mobile-game-menu { padding: 8px 10px 10px; gap: 0; }
      .menu-top-bar { margin-bottom: 6px; padding-bottom: 6px; }
      .menu-top-bar .btn-tactical-icon,
      .menu-top-bar .menu-coins-badge,
      .menu-top-bar .menu-profile-pill { height: 46px; min-height: 46px; max-height: 46px; }
      .menu-top-bar .menu-profile-avatar { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
      .menu-hero-center { margin: 0 0 5px; }
      .menu-insignia-glow { margin-bottom: 0; }
      .menu-hero-logo-img, .menu-hero-logo-picture img { width: 86px; max-width: 86px; }
      .menu-hero-title { font-size: 28px; margin-top: -3px; }
      .menu-hero-subtitle { font-size: 10px; margin-bottom: 5px; }
      .btn-3d-hero { min-height: 62px; padding: 6px 12px; margin-bottom: 7px; }
      .btn-3d-text { font-size: 20px; }
      .btn-3d-sub { font-size: 10px; }
      .menu-tactical-grid { gap: 6px; }
      .btn-3d-tile { min-height: 58px; padding: 5px 8px; gap: 8px; }
      .tile-title { font-size: 13px; }
      .tile-desc { font-size: 9px; }
      .tile-icon { font-size: 20px; }
      .menu-social-dock-row { margin-top: 7px; gap: 6px; }
      .social-dock-btn { padding: 4px; gap: 2px; }
      .social-dock-icon-wrap { width: 28px; height: 28px; }
      .social-dock-label { font-size: 9px; }
    }

    /* Red Super Nuke Button (Compact Tactical Pill at Bottom-Right next to Magazine) */
    .super-nuke-container {
      position: absolute;
      bottom: 12px;
      right: 14px;
      z-index: 20;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
    }
    /* Pulsing radar ripples expanding outwards to catch peripheral vision */
    .super-nuke-container.is-ready::before {
      content: '';
      position: absolute;
      inset: -6px -8px;
      border-radius: 25px;
      border: 2px solid #ff1744;
      background: radial-gradient(circle, rgba(255, 23, 68, 0.45) 0%, transparent 75%);
      box-shadow: 0 0 25px #ff1744;
      animation: nukeRadarPing 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
      pointer-events: none;
      z-index: -1;
    }
    .super-nuke-container.is-ready::after {
      content: '';
      position: absolute;
      inset: -12px -16px;
      border-radius: 30px;
      border: 1.5px solid rgba(255, 214, 0, 0.8);
      animation: nukeRadarPing 0.9s 0.35s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
      pointer-events: none;
      z-index: -2;
    }
    @keyframes nukeRadarPing {
      0% {
        transform: scale(0.85);
        opacity: 1;
      }
      100% {
        transform: scale(1.5, 1.8);
        opacity: 0;
      }
    }
    .btn-super-nuke {
      position: relative;
      height: 44px;
      min-height: 44px;
      width: 98px;
      padding: 3px 8px;
      background: #0c2337;
      overflow: hidden;
      flex-direction: column;
      border: 2px solid #ffffff;
      border-radius: 19px;
      color: #ffffff;
      font-family: 'Lalezar', cursive;
      font-size: 12px;
      letter-spacing: 0.4px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      cursor: pointer;
      box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
      touch-action: manipulation;
      white-space: nowrap;
      text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    }
    .btn-super-nuke .nuke-icon {
      font-size: 17px;
      animation: nukeIconSpin 0.76s infinite alternate ease-in-out;
      display: inline-block;
    }
    .btn-super-nuke:disabled { opacity: 1; cursor: default; border-color: #35718b; }
    .btn-super-nuke .nuke-text, .nuke-charge-value { position: relative; z-index: 1; }
    .nuke-charge-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #087f9c; transition: width 0.15s linear; }
    .super-nuke-container.is-ready .btn-super-nuke {
      /* Readiness must remain unmistakable even when the OS/browser suppresses
         animations. The red surface must not exist only inside keyframes. */
      background: linear-gradient(135deg, #ff1744 0%, #b71540 100%);
      border-color: #ffcdd2;
      box-shadow: 0 0 16px #ff1744, inset 0 0 6px rgba(255, 255, 255, 0.3);
      animation: nukeBeaconBlink 0.38s infinite alternate ease-in-out;
    }
    .super-nuke-container.is-ready .nuke-charge-fill { background: transparent; }
    .wallet-credit-toast { position: fixed; bottom: max(76px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 12000; background: #102238; border: 1px solid #ffd13b; border-radius: 14px; padding: 12px 18px; color: #ffd13b; font-weight: 700; text-align: center; white-space: nowrap; pointer-events: none; box-shadow: 0 0 18px #0009; transition: all 0.2s ease; }
    .wallet-credit-toast.is-debit { background: #261219; border-color: #ff4757; color: #ff6b81; box-shadow: 0 0 20px rgba(255, 71, 87, 0.45); }
    .wallet-credit-toast[hidden] { display: none; }
    .social-back-button { width: 100%; min-height: 44px; margin-top: 16px; flex-shrink: 0; }
    #btn-close-defense { min-height: 44px; }
    @media (max-width: 380px) {
      #capacity-hud { left: 6px; right: 112px; }
      #capacity-hud .capacity-hud-row { gap: 5px !important; }
      .city-health-hud { padding: 3px 5px; gap: 2px; }
      .charges-container { gap: 4px; width: calc(var(--magazine-slots, 4) * 20px + 8px); padding: 10px 6px; }
      .charge-slot { width: 16px; }
      .super-nuke-container { right: 8px; }
    }
    @media (prefers-reduced-motion: reduce) {
      .super-nuke-container.is-ready .btn-super-nuke, .super-nuke-container::before, .super-nuke-container::after { animation: none; }
      .nuke-charge-fill { transition: none; }
    }
    @keyframes nukeIconSpin {
      0% { transform: scale(1.0) rotate(-8deg); }
      100% { transform: scale(1.35) rotate(8deg); }
    }
    @keyframes nukeBeaconBlink {
      0% {
        transform: scale(0.96);
        background: linear-gradient(135deg, #ff1744 0%, #b71540 100%);
        border-color: #ffcdd2;
        box-shadow: 0 0 16px #ff1744, inset 0 0 6px rgba(255, 255, 255, 0.3);
        filter: brightness(1.0);
      }
      50% {
        transform: scale(1.06);
        background: linear-gradient(135deg, #ff0055 0%, #ff5252 50%, #ffd600 100%);
        border-color: #ffffff;
        box-shadow: 0 0 32px #ff1744, 0 0 50px rgba(255, 214, 0, 0.9), inset 0 0 14px #ffffff;
        filter: brightness(1.35);
      }
      100% {
        transform: scale(1.14);
        background: linear-gradient(135deg, #ffd600 0%, #ff1744 50%, #ffffff 100%);
        border-color: #ffffff;
        color: #ffffff;
        box-shadow: 0 0 45px #ff0055, 0 0 75px #ffd600, inset 0 0 20px #ffffff;
        filter: brightness(1.65);
      }
    }
    .btn-super-nuke:active {
      transform: scale(0.92);
      filter: brightness(0.9);
    }

    /* Leaderboard & Account Modals */
    .leaderboard-list-container {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 12px;
      max-height: 55vh;
    }
    .lb-row {
      background: #101424;
      border: 1px solid #1e253e;
      border-radius: 8px;
      padding: 8px 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      direction: rtl;
    }
    .lb-rank {
      font-family: 'Lalezar', cursive;
      font-size: 15px;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #1b2138;
      color: #a4b0be;
    }
    .lb-rank.gold { background: #ffd13b; color: #1a1503; font-weight: 900; }
    .lb-rank.silver { background: #dcdde1; color: #1e272e; font-weight: 900; }
    .lb-rank.bronze { background: #e67e22; color: #ffffff; font-weight: 900; }
    .lb-user-col {
      flex: 1;
      margin-right: 10px;
      text-align: right;
    }
    .lb-username {
      font-size: 13.5px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Estedad', sans-serif;
    }
    .lb-details {
      font-size: 11px;
      color: #718093;
      font-family: 'Estedad-Mad', sans-serif;
    }
    .lb-score-col {
      font-family: 'Estedad-Mad', sans-serif;
      font-size: 16px;
      font-weight: 900;
      color: #38ef7d;
    }

    .auth-modal-card {
      max-height: 94vh !important;
    }

    .account-modal-body {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 8px;
      text-align: right;
      direction: rtl;
      overflow-y: auto;
      max-height: calc(94vh - 110px);
      padding: 2px 4px;
    }
    .account-status-box {
      background: #121628;
      border: 1px solid #202742;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 13px;
      font-family: 'Estedad', sans-serif;
    }
    .account-form-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .account-label {
      font-size: 11.5px;
      color: #a4b0be;
      font-weight: 700;
      font-family: 'Estedad', sans-serif;
    }
    .account-input {
      background: #090c16;
      border: 1px solid #2e3752;
      color: #ffffff;
      height: 42px;
      padding: 0 10px;
      border-radius: 6px;
      font-size: 13px;
      font-family: 'Estedad', sans-serif;
      direction: rtl;
    }
    .account-input:focus {
      outline: none;
      border-color: #00e5ff;
      box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
    }
    .account-feedback {
      font-size: 12px;
      font-weight: 700;
      min-height: 18px;
      text-align: center;
      margin-top: 4px;
      font-family: 'Estedad', sans-serif;
    }

  
    /* Updated Tactical Iran Map Modal & Graphic Box */
    .iran-map-modal {
      max-width: 580px;
      width: 95%;
      max-height: 94vh;
      padding: 14px 16px;
      background: radial-gradient(circle at 50% 15%, #0d1428 0%, #060914 100%);
      border: 1.5px solid #1f2b4c;
      box-shadow: 0 12px 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(0, 229, 255, 0.15);
    }
    .iran-tactical-map-wrapper {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow-y: auto;
      padding: 2px;
    }
    .iran-map-graphic-box {
      position: relative;
      width: 100%;
      aspect-ratio: 808 / 737;
      max-height: 480px;
      background: #030713;
      border: 1.5px solid #1a2544;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 229, 255, 0.08);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .iran-map-graphic-box svg {
      width: 100%;
      height: 100%;
      display: block;
    }
    .iran-map-instruction-strip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 10px;
      background: rgba(13, 20, 40, 0.85);
      border: 1px solid #1e2c4c;
      border-radius: 8px;
      color: #8fa0bc;
      font-size: 11px;
      font-family: 'Estedad-Mad', sans-serif;
    }
    .iran-map-instruction-strip .pulse-indicator-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #00e5ff;
      box-shadow: 0 0 8px #00e5ff;
      animation: alertDotPulse 1.8s infinite;
      flex-shrink: 0;
    }

    /* Tactical Sector Navigator Bar */
    .iran-map-sector-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      padding: 6px 8px;
      background: linear-gradient(135deg, rgba(8, 14, 30, 0.94), rgba(14, 23, 46, 0.96));
      border: 1.5px solid #1f2e52;
      border-radius: 10px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
    .map-nav-arrow-btn {
      width: 32px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(18, 27, 54, 0.9);
      border: 1px solid #2d4273;
      border-radius: 8px;
      color: #00e5ff;
      font-size: 13px;
      font-weight: 700;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      flex-shrink: 0;
    }
    .map-nav-arrow-btn:hover {
      background: rgba(0, 229, 255, 0.15);
      border-color: #00e5ff;
      color: #ffffff;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
      transform: translateY(-1px);
    }
    .map-nav-arrow-btn:active {
      transform: translateY(1px);
    }
    .map-sector-pill {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: rgba(4, 8, 18, 0.75);
      border: 1px solid #1a2846;
      border-radius: 8px;
      padding: 4px 10px;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .map-sector-pill:hover {
      border-color: #38bdf8;
      background: rgba(14, 24, 52, 0.85);
    }
    .sector-indicator-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #00e5ff;
      box-shadow: 0 0 8px #00e5ff;
      animation: alertDotPulse 1.6s infinite;
      flex-shrink: 0;
    }
    .sector-indicator-dot.isfahan {
      background: #ffd13b;
      box-shadow: 0 0 8px #ffd13b;
    }
    .sector-indicator-dot.overview {
      background: #38bdf8;
      box-shadow: 0 0 8px #38bdf8;
    }
    .sector-pill-texts {
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      overflow: hidden;
    }
    .sector-pill-title {
      font-size: 11.5px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Estedad-Mad', sans-serif;
      white-space: nowrap;
    }
    .sector-pill-sub {
      font-size: 10px;
      font-weight: 700;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.14);
      border: 1px solid rgba(56, 189, 248, 0.28);
      padding: 1px 6px;
      border-radius: 4px;
      font-family: 'Estedad-Mad', sans-serif;
      white-space: nowrap;
    }
    .map-nav-overview-btn {
      display: flex;
      align-items: center;
      gap: 4px;
      background: rgba(22, 32, 60, 0.9);
      border: 1px solid #334b7f;
      border-radius: 8px;
      color: #ffd13b;
      font-size: 10.5px;
      font-weight: 700;
      font-family: 'Estedad-Mad', sans-serif;
      padding: 5px 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .map-nav-overview-btn:hover {
      background: rgba(255, 209, 59, 0.15);
      border-color: #ffd13b;
      box-shadow: 0 0 10px rgba(255, 209, 59, 0.3);
    }
    .map-nav-overview-btn.active {
      background: rgba(255, 209, 59, 0.25);
      border-color: #ffd13b;
      color: #ffffff;
      box-shadow: 0 0 10px rgba(255, 209, 59, 0.4);
    }
    .map-floating-arrow {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 34px;
      height: 44px;
      background: rgba(7, 12, 26, 0.82);
      border: 1.5px solid #23345a;
      border-radius: 8px;
      color: #00e5ff;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 5;
      backdrop-filter: blur(4px);
      transition: all 0.2s ease;
      user-select: none;
    }
    .map-floating-arrow:hover {
      background: rgba(0, 229, 255, 0.22);
      border-color: #00e5ff;
      box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
      color: #ffffff;
      transform: translateY(-50%) scale(1.08);
    }
    .map-float-prev {
      right: 10px;
    }
    .map-float-next {
      left: 10px;
    }
    .btn-enter-current-sector {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      background: linear-gradient(135deg, #0284c7, #0369a1);
      border: 1px solid #38bdf8;
      color: #ffffff;
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 11px;
      font-weight: 800;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    .btn-enter-current-sector:hover {
      background: linear-gradient(135deg, #00e5ff, #0284c7);
      box-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
      transform: translateY(-1px);
    }

    /* Only visible while returning to an interrupted battle. */
    .interruption-pause-overlay {
      --resume-accent: #00e5ff;
      position: absolute;
      inset: 0;
      z-index: 7000;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(2, 6, 16, 0.72);
      touch-action: none;
    }
    .interruption-pause-panel {
      width: min(100%, 320px);
      padding: 22px 16px;
      text-align: center;
      color: #fff;
      background: #090f20;
      border: 1px solid var(--resume-accent);
      border-radius: 18px;
      box-shadow: 0 0 25px rgba(0, 229, 255, 0.15);
      font-family: 'Estedad', sans-serif;
    }
    #interruption-pause-title { font-size: clamp(14px, 3.5vw, 19px); line-height: 1.8; }
    #interruption-pause-count {
      color: var(--resume-accent);
      font-family: 'Estedad-Mad', sans-serif;
      font-size: clamp(56px, 14vw, 84px);
      line-height: 1.4;
    }

    /* Fit stage navigation to its content, bounded by the available viewport. */
    #stage-select-overlay {
      position: fixed;
      inset: 0;
      height: 100vh;
      height: 100dvh;
      padding: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
      overflow: hidden;
      touch-action: pan-y;
    }
    #stage-select-card {
      width: 100%;
      height: auto;
      max-height: 100%;
      min-height: 0;
      padding: 12px;
    }
    #stage-select-card .map-view-screen {
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      min-width: 0;
      width: 100%;
      overflow: hidden;
    }
    #stage-select-card .campaign-modal-header {
      flex: 0 0 auto;
      gap: 8px;
      min-width: 0;
    }
    #stage-select-card .map-header-heading,
    #stage-select-card .map-header-copy { min-width: 0; }
    #stage-select-card .map-header-heading { flex: 1 1 auto; }
    #stage-select-card .campaign-modal-title { line-height: 1.5; }
    #stage-select-card .campaign-hub-badges {
      flex: 0 0 auto;
      flex-wrap: wrap;
      max-width: 100%;
      gap: 6px;
    }
    #stage-select-card .hud-coins,
    #stage-select-card .hud-stars { white-space: nowrap; }
    #stage-select-card #icon-map-screen-header { flex: 0 0 28px; }
    #stage-select-card #icon-map-screen-header img { width: 28px; height: 28px; object-fit: contain; }
    #stage-select-card .iran-tactical-map-wrapper,
    #stage-select-card .campaign-stage-list {
      flex: 1 1 auto;
      min-height: 0;
      min-width: 0;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
    }
    #stage-select-card .iran-tactical-map-wrapper > * { flex-shrink: 0; }
    #stage-select-card .iran-map-sector-nav { min-width: 0; }
    #stage-select-card .map-sector-pill { min-width: 0; padding: 4px 6px; }
    #stage-select-card .sector-pill-texts {
      min-width: 0;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
    }
    #stage-select-card .sector-pill-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    #stage-select-card .sector-pill-sub { font-size: 10px; padding: 1px 3px; }
    #stage-select-card .map-nav-arrow-btn { width: 40px; height: 44px; }
    #stage-select-card .map-floating-arrow { width: 40px; height: 44px; }
    #stage-select-card .iran-map-graphic-box { flex: 0 0 auto; }
    #stage-select-card .iran-map-instruction-strip {
      flex-direction: column;
      align-items: stretch;
      padding: 8px;
      gap: 8px;
    }
    #stage-select-card .map-instruction-copy { min-width: 0; line-height: 1.7; }
    #stage-select-card .btn-enter-current-sector { width: 100%; min-height: 44px; white-space: normal; }
    #stage-select-card .campaign-modal-footer { flex: 0 0 auto; margin-top: 8px; }
    #stage-select-card .btn-campaign-close { min-height: 44px; }
    #stage-select-card .province-panorama-banner { flex: 0 0 64px; }
    #stage-select-card .stage-card { flex: 0 0 auto; min-width: 0; gap: 8px; }
    #stage-select-card .stage-card-info { flex: 1 1 auto; min-width: 0; }
    #stage-select-card .stage-card-info > div:first-child { flex-wrap: wrap; gap: 4px; }
    #stage-select-card .stage-card-title { overflow-wrap: anywhere; }
    #stage-select-card .stage-card-stars-row,
    #stage-select-card .stage-card-action { flex-shrink: 0; }
    #stage-select-card .btn-stage-play { min-width: 44px; min-height: 44px; }
    @media (max-width: 540px) {
      #stage-select-card .campaign-modal-header { flex-direction: column; align-items: stretch; }
      #stage-select-card .campaign-hub-badges { justify-content: flex-start; }
      #stage-select-card .campaign-modal-title { font-size: 18px; }
      #stage-select-card .campaign-modal-header { padding-bottom: 8px; margin-bottom: 8px; }
      #stage-select-card .stage-card { padding: 8px; }
      #stage-select-card .stage-card-title { font-size: 14px; }
    }
    @media (max-height: 420px) {
      #stage-select-card .province-panorama-banner { flex-basis: 48px; height: 48px; margin-bottom: 6px; padding: 5px 8px; }
      #stage-select-card .campaign-modal-header { padding-bottom: 6px; margin-bottom: 6px; }
    }

    /* Player Profile & Overall Stats Dossier Styling */
    .profile-commander-header {
      display: flex;
      align-items: center;
      gap: 12px;
      background: #0d1527;
      border: 1px solid #1e2c4c;
      border-radius: 12px;
      padding: 12px 14px;
      margin-bottom: 12px;
    }
    .profile-avatar-box {
      position: relative;
      width: 60px;
      height: 60px;
      min-width: 60px;
      min-height: 60px;
      border-radius: 50%;
      background: radial-gradient(circle, #1a2744 0%, #0b1120 100%);
      border: 2.5px solid #ffd13b;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      box-shadow: 0 0 18px rgba(255, 209, 59, 0.45);
    }
    .profile-avatar-box img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      border-radius: 50%;
    }
    .dossier-rank-progress-card {
      background: linear-gradient(180deg, #111a33 0%, #0b1122 100%);
      border: 1.5px solid #23345d;
      border-radius: 14px;
      padding: 12px 14px;
      margin-bottom: 12px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    }
    .dossier-rank-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .dossier-rank-title-group {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .dossier-rank-label {
      font-size: 11px;
      color: #94a3b8;
    }
    .dossier-rank-current {
      font-size: 13px;
      font-weight: 800;
      color: #38ef7d;
    }
    .dossier-rank-score-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(0, 0, 0, 0.3);
      padding: 3px 10px;
      border-radius: 8px;
      border: 1px solid #1e2c4d;
    }
    .dossier-rank-score-val {
      font-family: 'Lalezar', cursive;
      font-size: 15px;
      color: #ffd13b;
    }
    .dossier-progress-bar-container {
      margin-bottom: 10px;
    }
    .dossier-progress-bar-track {
      width: 100%;
      height: 10px;
      background: #080d1a;
      border-radius: 6px;
      overflow: hidden;
      border: 1px solid #1a2746;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    .dossier-progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #38ef7d, #00e5ff);
      border-radius: 6px;
      transition: width 0.4s ease;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    }
    .dossier-progress-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 5px;
      font-size: 10.5px;
    }
    .dossier-next-target {
      color: #94a3b8;
    }
    .dossier-remaining-text {
      color: #00e5ff;
      font-weight: 700;
    }
    .dossier-avatar-action-row {
      border-top: 1px solid #18233f;
      padding-top: 8px;
      margin-top: 4px;
      display: flex;
      justify-content: flex-end;
    }
    .btn-dossier-change-avatar {
      background: linear-gradient(135deg, rgba(255, 209, 59, 0.15) 0%, rgba(255, 209, 59, 0.05) 100%);
      border: 1px solid #ffd13b;
      color: #ffd13b;
      border-radius: 8px;
      padding: 5px 14px;
      font-family: 'Estedad-Mad', sans-serif;
      font-size: 11.5px;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .btn-dossier-change-avatar:hover {
      background: #ffd13b;
      color: #0b101d;
      box-shadow: 0 0 14px rgba(255, 209, 59, 0.4);
      transform: translateY(-1px);
    }
    .profile-status-indicator.online {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 12px;
      height: 12px;
      background: #38ef7d;
      border: 2px solid #0b1120;
      border-radius: 50%;
      box-shadow: 0 0 6px #38ef7d;
    }
    .profile-commander-meta {
      min-width: 0;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .profile-name-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .profile-commander-name {
      margin: 0;
      font-size: 16px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Estedad-Mad', sans-serif;
    }
    .profile-role-badge {
      background: rgba(0, 229, 255, 0.15);
      border: 1px solid #00e5ff;
      color: #00e5ff;
      font-size: 10px;
      padding: 2px 7px;
      border-radius: 10px;
      font-weight: 700;
    }
    .profile-sub-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      color: #8fa0bc;
    }
    .profile-id-code {
      font-family: monospace;
      color: #ffd13b;
    }
    @media (max-width: 420px) {
      .city-public #btn-menu-account { grid-column: 1 / -1; }
      .city-public .profile-name-row,
      .city-public .profile-sub-meta,
      .city-public .dossier-rank-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }
      .city-public .profile-role-badge,
      .city-public .profile-id-code,
      .city-public .profile-sync-badge { overflow-wrap: anywhere; max-width: 100%; }
      .city-public .profile-commander-name { font-size: 14px; overflow-wrap: anywhere; }
      .city-public .dossier-rank-header { flex-wrap: wrap; gap: 10px; }
      .city-public .profile-status-indicator { display: none; }
    }
    .profile-sync-badge {
      color: #38ef7d;
      font-size: 10.5px;
    }
    .dossier-stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: 12px;
    }
    .dossier-stat-card {
      background: #0b1122;
      border: 1px solid #1c2742;
      border-radius: 10px;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      transition: all 0.2s ease;
    }
    .dossier-stat-card:hover {
      border-color: #00e5ff;
      transform: translateY(-1px);
    }
    .dossier-stat-icon {
      font-size: 18px;
      margin-bottom: 2px;
    }
    .dossier-stat-value {
      font-size: 15px;
      font-weight: 800;
      color: #ffffff;
      font-family: 'Estedad-Mad', sans-serif;
    }
    .dossier-stat-label {
      font-size: 10px;
      color: #7d8ea7;
    }
    .profile-treasury-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #111a30;
      border: 1px solid #233357;
      border-radius: 10px;
      padding: 10px 14px;
    }
    .btn-account-logout {
      background: rgba(255, 71, 87, 0.12);
      border: 1.5px solid #ff4757;
      color: #ff6b81;
      padding: 10px;
      border-radius: 8px;
      font-size: 13.5px;
      font-weight: 700;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 100%;
    }
    .btn-account-logout:hover {
      background: #ff4757;
      color: #ffffff;
      box-shadow: 0 0 14px rgba(255, 71, 87, 0.4);
    }
    .btn-account-cloud-link {
      background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(41, 128, 185, 0.25));
      border: 1.5px solid #00e5ff;
      color: #00e5ff;
      padding: 10px;
      border-radius: 8px;
      font-size: 13.5px;
      font-weight: 700;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 100%;
    }
    .btn-account-cloud-link:hover {
      background: #00e5ff;
      color: #0a0e17;
      box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
    }
    .btn-account-back {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid #334155;
      color: #94a3b8;
      border-radius: 8px;
      padding: 7px 12px;
      font-size: 12px;
      font-weight: 600;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 12px;
      width: fit-content;
    }
    .btn-account-back:hover {
      background: rgba(255, 255, 255, 0.12);
      color: #ffffff;
      border-color: #64748b;
    }


/* Tactical Map SVG Elements */
      .prov-poly {
        fill: #081022;
        stroke: #182846;
        stroke-width: 0.9;
        transition: fill 0.2s ease, stroke 0.2s ease;
        cursor: pointer;
      }
      .prov-poly:hover {
        fill: #132448;
        stroke: #38bdf8;
      }
      .national-border-path {
        fill: none;
        stroke: #00e5ff;
        stroke-width: 2.0;
        opacity: 0.85;
        stroke-linecap: round;
        stroke-linejoin: round;
        filter: url(#borderGlow);
      }
      .coastline-path {
        fill: none;
        stroke: #00e5ff;
        stroke-width: 1.8;
        opacity: 0.85;
        stroke-linecap: round;
        stroke-linejoin: round;
        filter: url(#borderGlow);
      }
      .center-pin {
        cursor: pointer;
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      }
      .center-pin:hover {
        filter: brightness(1.35);
      }
      .radar-pulse-ring {
        animation: radarRingPulse 2.4s ease-out infinite;
        transform-origin: center;
      }
      @keyframes radarRingPulse {
        0% { r: 6px; opacity: 1; stroke-width: 2.4px; }
        100% { r: 28px; opacity: 0; stroke-width: 0.5px; }
      }
      .pin-label-text {
        font-family: 'Estedad-Mad', 'Vazirmatn', 'Estedad', sans-serif;
        font-weight: 700;
        letter-spacing: normal !important;
        direction: rtl;
        unicode-bidi: isolate;
        text-rendering: geometricPrecision;
        pointer-events: none;
        user-select: none;
      }

      /* ================================================== */
      /* TACTICAL SOCIAL DOCK (CLAN, FRIENDS, MESSAGES)    */
      /* ================================================== */
      .menu-social-dock-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        margin-top: 12px;
      }
      .social-dock-btn {
        background: linear-gradient(180deg, #141a2e 0%, #0d1222 100%);
        border: 1.5px solid #233152;
        border-radius: 12px;
        padding: 8px 6px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
        position: relative;
        user-select: none;
      }
      .social-dock-btn:hover {
        border-color: #00e5ff;
        transform: translateY(-2px);
        background: linear-gradient(180deg, #1a233d 0%, #12182b 100%);
        box-shadow: 0 6px 18px rgba(0, 229, 255, 0.25);
      }
      .social-dock-btn:active {
        transform: translateY(1px) scale(0.97);
      }
      .social-dock-icon-wrap {
        width: 44px;
        height: 44px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .social-dock-icon-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
        transition: transform 0.2s ease;
      }
      .social-dock-btn:hover .social-dock-icon-img {
        transform: scale(1.08);
      }
      .social-dock-label {
        font-family: 'Estedad-Mad', sans-serif;
        font-size: 11.5px;
        font-weight: 800;
        color: #e2e8f0;
        letter-spacing: normal;
      }
      .social-dock-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: linear-gradient(135deg, #ff4757, #ff1744);
        color: #ffffff;
        border-radius: 10px;
        padding: 1px 6px;
        font-size: 10px;
        font-weight: 800;
        border: 1.5px solid #0f172a;
        box-shadow: 0 2px 6px rgba(255, 23, 68, 0.6);
        font-family: 'Estedad-Mad', sans-serif;
      }
      .social-dock-badge.clan-opportunity-dot {
        width: 10px;
        height: 10px;
        min-width: 10px;
        padding: 0;
        border-radius: 50%;
        top: -3px;
        right: -3px;
        background: #ff1744;
        border: 1.8px solid #080b14;
        box-shadow: 0 0 10px #ff1744;
        animation: pulseClanOpportunityDot 1.4s infinite alternate;
      }
      .clan-btn-opportunity-dot {
        position: absolute;
        top: -4px;
        right: -4px;
        width: 11px;
        height: 11px;
        background: #ff1744;
        border-radius: 50%;
        border: 2px solid #080b14;
        box-shadow: 0 0 10px #ff1744;
        animation: pulseClanOpportunityDot 1.4s infinite alternate;
        pointer-events: none;
      }
      @keyframes pulseClanOpportunityDot {
        0% { transform: scale(0.9); opacity: 0.85; box-shadow: 0 0 5px #ff1744; }
        100% { transform: scale(1.22); opacity: 1; box-shadow: 0 0 14px #ff1744; }
      }

      /* Modular Social Modal Panels */
      .social-modal-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(4, 7, 16, 0.88);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 14px;
      }
      .social-modal-card {
        max-height: calc(100dvh - 28px);
        overflow-y: auto;
        background: #0f1527;
        border: 1.5px solid #00e5ff;
        box-shadow: 0 0 35px rgba(0, 229, 255, 0.35);
        border-radius: 18px;
        max-width: 540px;
        width: 100%;
        padding: 20px;
        direction: rtl;
        color: #ffffff;
        font-family: 'Estedad-Mad', sans-serif;
        animation: tutPop 0.22s ease-out;
        box-sizing: border-box;
      }
      .social-modal-tabs {
        display: flex;
        gap: 6px;
        margin-bottom: 14px;
        border-bottom: 1px solid #1f2b48;
        padding-bottom: 10px;
      }
      .social-modal-tab-btn {
        flex: 1;
        padding: 8px 8px;
        border-radius: 8px;
        border: 1px solid #263554;
        background: #161f36;
        color: #94a3b8;
        font-weight: 800;
        font-family: 'Estedad-Mad', sans-serif;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.15s ease;
      }
      .social-modal-tab-btn.active {
        border-color: #00e5ff;
        background: rgba(0, 229, 255, 0.15);
        color: #00e5ff;
      }

    /* Keep the main menu fixed to the play area on compact phone screens. */
    @media (max-width: 380px) {
      #main-menu-overlay { overflow: hidden; }
      .main-menu-card.mobile-game-menu {
        box-sizing: border-box;
        min-height: min(86vh, 620px);
        min-height: min(86dvh, 620px);
        justify-content: space-evenly;
      }
      .menu-top-bar { grid-template-columns: 40px 72px minmax(0, 1fr); grid-template-rows: 46px; gap: 6px; }
      .menu-top-bar #menu-btn-profile-trigger { grid-column: 3; grid-row: 1; width: auto; justify-content: flex-start; }
      .menu-top-bar .btn-tactical-icon { width: 40px; min-width: 40px; height: 46px; min-height: 46px; }
      .menu-top-bar .menu-profile-pill { min-width: 0; height: 46px; min-height: 46px; max-height: 46px; gap: 4px; padding: 0 4px; }
      .menu-top-bar .menu-profile-avatar { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
      .menu-profile-details { flex: 1; }
      .menu-commander-name { font-size: 12px; }
      .menu-commander-title { display: none; }
      .menu-top-bar .menu-coins-badge { width: 72px; min-width: 72px; max-width: 72px; padding: 0 5px; gap: 4px; }
      .menu-coins-badge .coin-icon { font-size: 16px; }
      .menu-coins-badge .coin-num { font-size: 12px; }
      .menu-tactical-grid .tile-graphic-icon,
      .menu-tactical-grid .tile-pvp-icon { width: 44px; height: 44px; }
      .menu-tactical-grid .tile-waves-icon { width: 56px !important; height: 56px !important; margin: -5px -4px -5px -3px; }
    }

    @media (max-width: 380px) and (max-height: 700px) {
      .menu-hero-logo-img, .menu-hero-logo-picture img { width: 68px; max-width: 68px; }
      .menu-hero-title { font-size: 25px; }
      .menu-hero-subtitle { margin-bottom: 2px; }
      .btn-3d-hero { height: 58px; min-height: 58px; box-sizing: border-box; }
      .menu-tactical-grid .tile-graphic-icon,
      .menu-tactical-grid .tile-waves-icon,
      .menu-tactical-grid .tile-pvp-icon { width: 38px !important; height: 38px !important; margin: 0; }
      .btn-3d-tile { min-height: 52px; }
      .menu-social-dock-row { margin-top: 5px; }
      .social-dock-btn { height: 52px; min-height: 52px; padding: 2px; }
      .social-dock-icon-wrap { width: 24px; height: 24px; }
    }

    /* A dedicated footer rail keeps combat controls away from city platforms. */
    #bottom-hud {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      min-height: 64px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
      box-sizing: border-box;
      direction: ltr;
      z-index: 16;
      pointer-events: none;
      background: linear-gradient(180deg, rgba(8, 12, 24, 0.94), rgba(4, 7, 15, 0.98));
      border-top: 1px solid rgba(0, 229, 255, 0.24);
      border-radius: 12px 12px 0 0;
      box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.42);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    #bottom-hud > #city-health-hud {
      grid-column: 1;
      justify-self: start;
      z-index: 20;
    }

    #bottom-hud #capacity-hud {
      position: relative;
      left: auto;
      right: auto;
      bottom: auto;
      width: auto;
      min-width: 0;
      grid-column: 2;
      justify-self: center;
      flex: none;
      margin: 0;
      transform: none;
      z-index: 15;
    }

    #bottom-hud .super-nuke-container {
      position: relative;
      left: auto;
      right: auto;
      bottom: auto;
      grid-column: 3;
      justify-self: end;
      flex: none;
      pointer-events: auto;
      z-index: 20;
    }

    @media (max-width: 380px) {
      #bottom-hud { gap: 4px; padding-left: 6px; padding-right: 6px; }
      #bottom-hud .capacity-hud-row { gap: 5px !important; }
    }

    /* Short, focused rescue choice shown only after the city is lost. */
    .rescue-overlay {
      z-index: 130;
      background: rgba(3, 5, 13, 0.96);
    }

    .rescue-card {
      width: min(100%, 410px);
      padding: clamp(20px, 6vw, 30px);
      border: 1px solid rgba(0, 229, 255, 0.55);
      border-radius: 22px;
      background: radial-gradient(ellipse at 50% 0%, #182944 0%, #0d1323 48%, #090b14 100%);
      box-shadow: 0 0 38px rgba(0, 229, 255, 0.15), inset 0 0 28px rgba(0, 229, 255, 0.035);
      color: #f3f6ff;
      text-align: center;
    }

    .rescue-emblem {
      display: block;
      width: clamp(64px, 19vw, 88px);
      height: clamp(64px, 19vw, 88px);
      object-fit: contain;
      margin: 0 auto 8px;
      filter: drop-shadow(0 0 13px rgba(0, 229, 255, 0.6));
    }

    .rescue-title { margin: 0 0 8px; color: #00e5ff; font-size: clamp(23px, 6vw, 30px); font-weight: 900; }
    .rescue-description { margin: 0 auto 20px; max-width: 32ch; color: #c5ccdb; font-size: 15px; line-height: 1.7; }

    .rescue-countdown-wrap {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
      padding: 8px 17px;
      border: 1px solid #343b53;
      border-radius: 999px;
      background: rgba(5, 8, 17, 0.7);
      color: #c8d2e2;
      font-size: 13px;
    }

    #rescue-countdown { min-width: 1.5em; color: #ffd13b; font-size: 22px; font-variant-numeric: tabular-nums; }
    .rescue-wallet { display: flex; justify-content: center; align-items: baseline; gap: 7px; margin: 0 0 18px; color: #9ba8bc; font-size: 13px; }
    #rescue-wallet-balance { color: #ffd13b; font-size: 19px; font-variant-numeric: tabular-nums; }

    .rescue-actions { display: grid; gap: 10px; }
    .rescue-decision-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .rescue-action {
      min-height: 60px;
      padding: 11px 14px;
      border: 1px solid transparent;
      border-radius: 13px;
      color: white;
      font: inherit;
      font-size: 15px;
      font-weight: 800;
      cursor: pointer;
      transition: filter 150ms ease, transform 150ms ease;
    }
    .rescue-action:not(:disabled):active { transform: scale(0.98); }
    .rescue-action-coin { border-color: #ffd13b; background: linear-gradient(135deg, #f5a623, #d47710); color: #17100a; }
    .rescue-action-ad { border-color: #364055; background: #171c2a; color: #9ca7ba; }
    .rescue-action-skip { border-color: #34405b; background: #111827; color: #d8deea; }
    .rescue-action:disabled { cursor: not-allowed; filter: saturate(0.55); opacity: 0.62; }

    @media (max-width: 380px) {
      .rescue-overlay { padding: 12px; }
      .rescue-card { padding: 18px 15px; border-radius: 18px; }
      .rescue-description { margin-bottom: 14px; font-size: 14px; }
      .rescue-decision-row { gap: 8px; }
      .rescue-decision-row .rescue-action { min-height: 72px; padding: 8px 6px; font-size: 12px; line-height: 1.45; }
      .rescue-action-ad { min-height: 46px; font-size: 14px; }
    }

    /* ==========================================================================
       REDESIGNED MOBILE GAME MESSAGING & COMMS ARCHITECTURE
       Portrait Mobile Optimized, Gesture-Friendly, Game-Oriented Social UI
       ========================================================================== */
    .msg-modal-card {
      max-width: 460px;
      width: 100%;
      height: min(92dvh, 740px);
      max-height: min(92dvh, 740px);
      background: radial-gradient(ellipse at 50% 0%, #151e36 0%, #0d1325 55%, #070a16 100%);
      border: 1.5px solid #00e5ff;
      box-shadow: 0 0 35px rgba(0, 229, 255, 0.28), inset 0 0 20px rgba(0, 229, 255, 0.04);
      border-radius: 20px;
      padding: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      direction: rtl;
      color: #ffffff;
      font-family: 'Estedad-Mad', sans-serif;
      animation: tutPop 0.22s ease-out;
      box-sizing: border-box;
      position: relative;
    }

    /* Top Rail & Navigation */
    .msg-hub-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 16px 10px;
      background: rgba(11, 16, 32, 0.85);
      border-bottom: 1px solid rgba(0, 229, 255, 0.18);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      flex-shrink: 0;
    }

    .msg-hub-title-group {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .msg-hub-icon-badge {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: rgba(0, 229, 255, 0.12);
      border: 1px solid rgba(0, 229, 255, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .msg-hub-title {
      margin: 0;
      font-family: 'Lalezar', cursive;
      font-size: 20px;
      color: #38bdf8;
      line-height: 1.1;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .msg-hub-subtitle {
      margin: 2px 0 0;
      font-size: 11px;
      color: #94a3b8;
    }

    .msg-hub-unread-pill {
      background: #ff4757;
      color: #ffffff;
      font-size: 10px;
      font-weight: 900;
      padding: 1px 7px;
      border-radius: 12px;
      box-shadow: 0 0 10px rgba(255, 71, 87, 0.6);
      font-family: 'Estedad-Mad', sans-serif;
    }

    .msg-hub-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .msg-hub-tool-btn {
      background: rgba(22, 31, 54, 0.7);
      border: 1px solid #233152;
      color: #94a3b8;
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 11px;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .msg-hub-tool-btn:hover, .msg-hub-tool-btn:active {
      color: #00e5ff;
      border-color: #00e5ff;
      background: rgba(0, 229, 255, 0.1);
    }

    .msg-btn-close {
      background: none;
      border: none;
      color: #94a3b8;
      font-size: 26px;
      line-height: 1;
      cursor: pointer;
      padding: 4px 6px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Filter Segments / Chips */
    .msg-filter-rail {
      display: flex;
      gap: 6px;
      padding: 10px 14px;
      background: rgba(7, 11, 24, 0.6);
      border-bottom: 1px solid #1a243c;
      overflow-x: auto;
      flex-shrink: 0;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .msg-filter-rail::-webkit-scrollbar { display: none; }

    .msg-filter-chip {
      flex: 1;
      min-width: 78px;
      padding: 7px 10px;
      border-radius: 20px;
      border: 1px solid #233152;
      background: #10162a;
      color: #94a3b8;
      font-size: 11.5px;
      font-weight: 800;
      cursor: pointer;
      text-align: center;
      white-space: nowrap;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      font-family: 'Estedad-Mad', sans-serif;
    }

    .msg-filter-chip:hover {
      border-color: #38bdf8;
      color: #e2e8f0;
    }

    .msg-filter-chip.active {
      background: rgba(0, 229, 255, 0.18);
      border-color: #00e5ff;
      color: #00e5ff;
      box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
    }

    .msg-filter-count {
      background: rgba(0, 229, 255, 0.25);
      color: #00e5ff;
      font-size: 9.5px;
      padding: 0 5px;
      border-radius: 10px;
    }

    .msg-filter-chip.active .msg-filter-count {
      background: #00e5ff;
      color: #080a14;
    }

    /* Main Conversation Stream View */
    .msg-stream-body {
      flex: 1;
      overflow-y: auto;
      padding: 8px 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 7px;
      -webkit-overflow-scrolling: touch;
    }

    /* Clan Activity Banner inside stream */
    .msg-clan-ingress-card {
      background: linear-gradient(135deg, rgba(20, 31, 56, 0.85), rgba(12, 19, 36, 0.95));
      border: 1px solid rgba(255, 209, 59, 0.4);
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 4px;
      cursor: pointer;
      transition: all 0.18s ease;
    }

    .msg-clan-ingress-card:active {
      transform: scale(0.99);
      border-color: #ffd13b;
    }

    .msg-clan-ingress-info {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1;
      min-width: 0;
    }

    .msg-clan-ingress-badge {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: rgba(255, 209, 59, 0.15);
      border: 1.2px solid #ffd13b;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    .msg-clan-ingress-text {
      min-width: 0;
    }

    .msg-clan-ingress-title {
      font-size: 12.5px;
      font-weight: 800;
      color: #ffd13b;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .msg-clan-ingress-preview {
      font-size: 11px;
      color: #cbd5e1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-top: 1px;
    }

    .msg-clan-ingress-btn {
      background: linear-gradient(135deg, #ffd13b, #f39c12);
      color: #090c16;
      border: none;
      border-radius: 8px;
      padding: 6px 12px;
      font-size: 11px;
      font-weight: 900;
      font-family: 'Estedad-Mad', sans-serif;
      cursor: pointer;
      flex-shrink: 0;
      white-space: nowrap;
    }

    /* Interactive Conversation Row */
    .msg-conversation-row {
      background: #0f172a;
      border: 1px solid #1f2d4a;
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 11px;
      cursor: pointer;
      position: relative;
      transition: all 0.16s ease;
      touch-action: manipulation;
    }

    .msg-conversation-row:hover {
      background: #141f38;
      border-color: #38bdf8;
    }

    .msg-conversation-row:active {
      transform: scale(0.985);
      background: #162444;
    }

    .msg-conversation-row.unread {
      background: rgba(14, 30, 58, 0.85);
      border-color: rgba(0, 229, 255, 0.45);
      box-shadow: 0 0 14px rgba(0, 229, 255, 0.08);
    }

    .msg-row-avatar-wrap {
      position: relative;
      width: 42px;
      height: 42px;
      flex-shrink: 0;
    }

    .msg-row-avatar-img {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 1.5px solid #283755;
      object-fit: cover;
      display: block;
      background: #0b1020;
    }

    .msg-conversation-row.unread .msg-row-avatar-img {
      border-color: #00e5ff;
    }

    .msg-avatar-online-dot {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 11px;
      height: 11px;
      border-radius: 50%;
      background: #2ed573;
      border: 2px solid #0f172a;
      box-shadow: 0 0 6px #2ed573;
    }

    .msg-row-content {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .msg-row-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
    }

    .msg-row-name-group {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }

    .msg-row-name {
      font-size: 13px;
      font-weight: 700;
      color: #f1f5f9;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .msg-conversation-row.unread .msg-row-name {
      font-weight: 900;
      color: #00e5ff;
    }

    .msg-row-tag {
      font-size: 9.5px;
      padding: 1px 6px;
      border-radius: 4px;
      white-space: nowrap;
      font-weight: 700;
    }

    .msg-tag-friend { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
    .msg-tag-clan { background: rgba(255, 209, 59, 0.15); color: #ffd13b; border: 1px solid rgba(255, 209, 59, 0.3); }
    .msg-tag-system { background: rgba(0, 229, 255, 0.15); color: #00e5ff; border: 1px solid rgba(0, 229, 255, 0.3); }

    .msg-row-time {
      font-size: 10px;
      color: #64748b;
      white-space: nowrap;
    }

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

    .msg-row-preview {
      font-size: 11.5px;
      color: #94a3b8;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      min-width: 0;
      line-height: 1.4;
    }

    .msg-conversation-row.unread .msg-row-preview {
      color: #cbd5e1;
    }

    .msg-row-unread-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: #00e5ff;
      box-shadow: 0 0 8px #00e5ff;
      flex-shrink: 0;
    }

    /* Structured System Notification Card in stream */
    .msg-system-card {
      background: #11192e;
      border: 1px solid #233355;
      border-radius: 12px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      transition: all 0.16s ease;
    }

    .msg-system-card.has-reward {
      border-color: rgba(255, 209, 59, 0.5);
      background: radial-gradient(ellipse at 100% 0%, rgba(255, 209, 59, 0.1) 0%, #11192e 60%);
    }

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

    .msg-sys-title {
      font-size: 13px;
      font-weight: 800;
      color: #00e5ff;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .msg-sys-body {
      font-size: 11.5px;
      color: #cbd5e1;
      line-height: 1.6;
    }

    .msg-sys-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-top: 1px solid #1a2742;
      padding-top: 8px;
      margin-top: 2px;
    }

    .msg-sys-sender {
      font-size: 10.5px;
      color: #94a3b8;
    }

    .msg-btn-claim-reward {
      background: linear-gradient(135deg, #ffd13b, #f39c12);
      border: none;
      color: #080a14;
      border-radius: 8px;
      padding: 5px 14px;
      font-size: 11px;
      font-weight: 900;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
      box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
      transition: transform 0.1s ease;
    }

    .msg-btn-claim-reward:active {
      transform: scale(0.97);
    }

    .msg-reward-claimed-badge {
      font-size: 10.5px;
      color: #64748b;
      font-weight: 700;
    }

    /* ==========================================================================
       DEDICATED CONVERSATION SCREEN (View 2)
       ========================================================================== */
    .msg-conversation-screen {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
      background: #090e1d;
    }

    .msg-chat-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 14px;
      background: rgba(13, 19, 38, 0.95);
      border-bottom: 1px solid #1e2c4a;
      flex-shrink: 0;
      z-index: 10;
    }

    .msg-chat-header-user {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      padding: 3px 6px;
      border-radius: 8px;
      transition: background 0.15s ease;
    }

    .msg-chat-header-user:hover {
      background: rgba(0, 229, 255, 0.08);
    }

    .msg-chat-avatar {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      border: 1.5px solid #00e5ff;
      object-fit: cover;
      background: #0b1020;
    }

    .msg-chat-username {
      font-size: 13.5px;
      font-weight: 800;
      color: #ffffff;
      line-height: 1.2;
    }

    .msg-chat-status {
      font-size: 10.5px;
      color: #2ed573;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .msg-chat-status.offline {
      color: #64748b;
    }

    .msg-btn-back {
      background: rgba(22, 31, 54, 0.8);
      border: 1px solid #233152;
      color: #38bdf8;
      border-radius: 8px;
      width: 36px;
      height: 36px;
      font-size: 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .msg-btn-more {
      background: rgba(22, 31, 54, 0.8);
      border: 1px solid #233152;
      color: #94a3b8;
      border-radius: 8px;
      width: 36px;
      height: 36px;
      font-size: 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Message Bubbles Feed */
    .msg-chat-feed {
      flex: 1;
      overflow-y: auto;
      padding: 14px 14px 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      -webkit-overflow-scrolling: touch;
    }

    .msg-bubble-group {
      display: flex;
      flex-direction: column;
      gap: 3px;
      max-width: 85%;
    }

    .msg-bubble-group.outgoing {
      align-self: flex-start; /* RTL: outgoing to the right/start */
    }

    .msg-bubble-group.incoming {
      align-self: flex-end; /* RTL: incoming to the left/end */
    }

    .msg-bubble {
      padding: 8px 12px;
      border-radius: 12px;
      font-size: 12.5px;
      line-height: 1.5;
      color: #ffffff;
      position: relative;
      word-break: break-word;
    }

    .msg-bubble-group.outgoing .msg-bubble {
      background: #1e293b;
      border: 1px solid #38bdf8;
      border-bottom-right-radius: 3px;
    }

    .msg-bubble-group.incoming .msg-bubble {
      background: #141d33;
      border: 1px solid #233152;
      border-bottom-left-radius: 3px;
    }

    .msg-bubble-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 3px;
      font-size: 9.5px;
      color: #64748b;
    }

    .msg-bubble-group.outgoing .msg-bubble-meta {
      justify-content: flex-start;
    }

    .msg-bubble-group.incoming .msg-bubble-meta {
      justify-content: flex-end;
    }

    .msg-bubble-status-icon {
      font-size: 10px;
      color: #38bdf8;
    }

    .msg-unread-separator {
      display: flex;
      align-items: center;
      text-align: center;
      margin: 10px 0;
      color: #00e5ff;
      font-size: 10.5px;
      font-weight: 700;
    }

    .msg-unread-separator::before, .msg-unread-separator::after {
      content: '';
      flex: 1;
      border-bottom: 1px solid rgba(0, 229, 255, 0.3);
    }
    .msg-unread-separator:not(:empty)::before { margin-left: 10px; }
    .msg-unread-separator:not(:empty)::after { margin-right: 10px; }

    /* Structured Actionable Game Cards */
    .msg-card-invite {
      background: #131d36;
      border: 1.5px solid #ffd13b;
      border-radius: 14px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      box-shadow: 0 4px 16px rgba(255, 209, 59, 0.15);
      margin: 4px 0;
    }

    .msg-card-invite-head {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #ffd13b;
      font-weight: 900;
      font-size: 13px;
    }

    .msg-card-invite-body {
      font-size: 11.5px;
      color: #e2e8f0;
      line-height: 1.5;
    }

    .msg-card-invite-actions {
      display: flex;
      gap: 8px;
      margin-top: 4px;
    }

    .msg-btn-invite-accept {
      flex: 1;
      background: linear-gradient(135deg, #2ed573, #26af5f);
      border: none;
      color: #06150b;
      border-radius: 8px;
      padding: 8px;
      font-size: 11.5px;
      font-weight: 900;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
    }

    .msg-btn-invite-decline {
      flex: 1;
      background: #1e293b;
      border: 1px solid #475569;
      color: #94a3b8;
      border-radius: 8px;
      padding: 8px;
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
    }

    .msg-card-invite-state {
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 800;
      text-align: center;
    }

    .msg-card-invite-state.accepted { background: rgba(46, 213, 115, 0.15); color: #2ed573; border: 1px solid #2ed573; }
    .msg-card-invite-state.declined { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid #475569; }
    .msg-card-invite-state.expired { background: rgba(255, 71, 87, 0.15); color: #ff4757; border: 1px solid #ff4757; }

    /* Composer Section (Thumb-Friendly, Fixed Bottom) */
    .msg-composer-wrap {
      background: rgba(11, 16, 32, 0.95);
      border-top: 1px solid #1e2c4a;
      padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex-shrink: 0;
    }

    .msg-quick-orders-rail {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      scrollbar-width: none;
      padding-bottom: 2px;
    }
    .msg-quick-orders-rail::-webkit-scrollbar { display: none; }

    .msg-quick-order-chip {
      background: #141c33;
      border: 1px solid #283758;
      color: #cbd5e1;
      border-radius: 14px;
      padding: 3px 10px;
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
      transition: all 0.12s ease;
    }

    .msg-quick-order-chip:active {
      border-color: #00e5ff;
      color: #00e5ff;
      transform: scale(0.96);
    }

    .msg-composer-input-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .msg-composer-input {
      flex: 1;
      background: #080c18;
      border: 1.5px solid #263554;
      border-radius: 12px;
      padding: 9px 12px;
      color: #ffffff;
      font-family: 'Estedad-Mad', sans-serif;
      font-size: 12.5px;
      outline: none;
      transition: border-color 0.15s ease;
      min-height: 40px;
      box-sizing: border-box;
    }

    .msg-composer-input:focus {
      border-color: #00e5ff;
      box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    }

    .msg-btn-send {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      background: linear-gradient(135deg, #00e5ff, #0088cc);
      border: none;
      color: #050b18;
      font-size: 17px;
      font-weight: 900;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 10px rgba(0, 229, 255, 0.35);
      transition: transform 0.1s ease;
    }

    .msg-btn-send:active {
      transform: scale(0.93);
    }

    /* Blocked User Banner */
    .msg-blocked-banner {
      background: rgba(255, 71, 87, 0.12);
      border: 1px solid rgba(255, 71, 87, 0.4);
      border-radius: 10px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .msg-blocked-text {
      font-size: 11.5px;
      color: #ff6b81;
      font-weight: 700;
    }

    .msg-btn-unblock-direct {
      background: #ff4757;
      border: none;
      color: #ffffff;
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 10.5px;
      font-weight: 800;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
    }

    /* Contextual Action Sheet / Popover */
    .msg-context-sheet {
      position: absolute;
      top: 54px;
      left: 14px;
      background: #11182c;
      border: 1px solid #233152;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
      border-radius: 12px;
      padding: 6px;
      display: flex;
      flex-direction: column;
      gap: 3px;
      z-index: 100;
      min-width: 170px;
      animation: tutPop 0.15s ease-out;
    }

    .msg-context-item {
      background: none;
      border: none;
      color: #cbd5e1;
      padding: 8px 12px;
      font-size: 11.5px;
      font-weight: 700;
      text-align: right;
      cursor: pointer;
      border-radius: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: 'Estedad-Mad', sans-serif;
      transition: background 0.12s ease;
    }

    .msg-context-item:hover, .msg-context-item:active {
      background: rgba(0, 229, 255, 0.12);
      color: #00e5ff;
    }

    .msg-context-item.danger {
      color: #ff4757;
    }
    .msg-context-item.danger:hover, .msg-context-item.danger:active {
      background: rgba(255, 71, 87, 0.15);
      color: #ff6b81;
    }

    /* Empty Comms State */
    .msg-empty-comms {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 40px 20px;
      gap: 12px;
      margin: auto;
    }

    .msg-empty-radar-wrap {
      width: 72px;
      height: 72px;
      border-radius: 50%;
      background: rgba(0, 229, 255, 0.08);
      border: 1.5px solid rgba(0, 229, 255, 0.25);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 32px;
      box-shadow: 0 0 25px rgba(0, 229, 255, 0.15);
    }

    .msg-empty-title {
      font-family: 'Lalezar', cursive;
      font-size: 18px;
      color: #e2e8f0;
      margin: 0;
    }

    .msg-empty-desc {
      font-size: 12px;
      color: #94a3b8;
      max-width: 260px;
      line-height: 1.6;
      margin: 0;
    }

    .msg-empty-cta {
      background: linear-gradient(135deg, #00e5ff, #0099cc);
      color: #060d1a;
      border: none;
      border-radius: 10px;
      padding: 8px 18px;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      font-family: 'Estedad-Mad', sans-serif;
      box-shadow: 0 3px 12px rgba(0, 229, 255, 0.3);
      margin-top: 4px;
    }


/* =========================================================================
   FRIENDS SYSTEM: PORTRAIT MOBILE GAME UX/UI
   ========================================================================= */
.friends-modal-card {
  max-width: 480px;
  width: 100%;
  max-height: min(92vh, 820px);
  max-height: min(92dvh, 820px);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 14px;
  border-radius: 20px;
  background: #090e1b;
  border: 1.5px solid #00e5ff;
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.08);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.friends-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.friends-hub-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.friends-hub-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.friends-hub-title {
  margin: 0;
  font-family: 'Lalezar', cursive;
  font-size: 20px;
  color: #00e5ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.friends-hub-online-pill {
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(56, 239, 125, 0.15);
  border: 1px solid #38ef7d;
  color: #38ef7d;
  border-radius: 12px;
  padding: 1px 7px;
}

.friends-hub-subtitle {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: #94a3b8;
}

.friends-filter-rail {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: none;
  padding-bottom: 0;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.friends-filter-rail::-webkit-scrollbar { display: none; }

.friends-filter-chip {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  background: #11182c;
  border: 1px solid #202e4d;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.friends-filter-chip.active {
  background: rgba(0, 229, 255, 0.16);
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.22);
}
.friends-req-count-badge {
  background: #ff4757;
  color: #fff;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 9.5px;
  font-weight: 800;
}

.friends-stream-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 2px;
  padding-right: 2px;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #1f2b48 transparent;
}

.friends-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Individual Friend Row Card */
.friend-player-card {
  background: #11182a;
  border: 1px solid #1f2d4d;
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.friend-player-card:active {
  transform: scale(0.985);
  background: #162038;
}
.friend-player-card.is-online {
  border-color: rgba(56, 239, 125, 0.35);
}

.friend-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.friend-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #00e5ff;
  object-fit: cover;
  background: #080c18;
}
.friend-avatar-img.offline {
  border-color: #475569;
  filter: grayscale(0.2);
}
.friend-presence-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid #11182a;
}
.friend-presence-dot.online {
  background: #38ef7d;
  box-shadow: 0 0 6px #38ef7d;
}

.friend-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.friend-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.friend-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-rank-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.25);
  white-space: nowrap;
}
.friend-meta-row {
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Primary contextual action button on the card */
.friend-primary-action-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.friend-action-btn {
  font-family: 'Estedad-Mad', sans-serif;
  font-weight: 800;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.friend-action-btn:active {
  transform: scale(0.95);
}
.friend-action-btn.btn-invite-battle {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}
.friend-action-btn.btn-send-dm {
  background: #1e293b;
  border: 1px solid #38bdf8;
  color: #38bdf8;
}

/* Player Quick Action Sheet (Mobile Bottom Overlay inside modal) */
.player-action-sheet-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 7, 16, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.18s ease-out;
}
.player-action-sheet {
  width: 100%;
  background: #0f172a;
  border: 1.5px solid #00e5ff;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 16px 14px;
  box-shadow: 0 -10px 30px rgba(0, 229, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  animation: slideUp 0.22s ease-out;
}

.sheet-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e293b;
}
.sheet-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sheet-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #00e5ff;
  object-fit: cover;
}
.sheet-player-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}
.sheet-player-status {
  font-size: 11px;
  font-weight: 700;
  color: #38ef7d;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sheet-player-status.offline {
  color: #94a3b8;
}
.sheet-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.sheet-positive-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sheet-pos-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #ffffff;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
  font-family: 'Estedad-Mad', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.sheet-pos-btn:active {
  transform: scale(0.97);
}
.sheet-pos-btn.highlight {
  background: linear-gradient(135deg, rgba(0,229,255,0.25), rgba(0,229,255,0.1));
  border-color: #00e5ff;
  color: #00e5ff;
  grid-column: span 2;
  font-size: 13px;
  padding: 11px;
}

.sheet-destructive-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #1e293b;
  gap: 6px;
}
.sheet-destructive-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.sheet-destruct-btn {
  flex: 1;
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  padding: 7px;
  font-size: 10.5px;
  font-family: 'Estedad-Mad', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sheet-destruct-btn.danger {
  color: #ff4757;
  border-color: rgba(255, 71, 87, 0.3);
}

.sheet-confirm-bar {
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid #ff4757;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #fff;
}
.sheet-confirm-btn {
  background: #ff4757;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.sheet-cancel-btn {
  background: #334155;
  color: #cbd5e1;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}

/* Toast feedback */
.friend-inline-toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  z-index: 200;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  animation: fadeInDown 0.2s ease-out;
}

/* =========================================================================
   CLAN / SQUADRON SYSTEM: PORTRAIT MOBILE GAME UX/UI
   ========================================================================= */
.clan-modal-card {
  width: min(396px, calc(100vw - 16px)) !important;
  max-width: 396px !important;
  height: min(86vh, 700px) !important;
  height: min(86dvh, 700px) !important;
  max-height: 700px !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 14px 10px !important;
  border-radius: 18px !important;
  background: radial-gradient(circle at 50% 10%, #0d1526 0%, #070b14 100%) !important;
  border: 1.5px solid #1a2744 !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 229, 255, 0.12) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
}

.clan-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 209, 59, 0.18);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.clan-hub-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clan-hub-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 209, 59, 0.12);
  border: 1px solid #ffd13b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 209, 59, 0.25);
}

.clan-hub-title {
  margin: 0;
  font-family: 'Lalezar', cursive;
  font-size: 20px;
  color: #ffd13b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.clan-hub-rank-pill {
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 209, 59, 0.15);
  border: 1px solid #ffd13b;
  color: #ffd13b;
  border-radius: 12px;
  padding: 1px 7px;
}

.clan-hub-subtitle {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: #94a3b8;
}

.clan-filter-rail {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: none;
  padding-bottom: 0;
  flex-shrink: 0;
}

.clan-filter-chip {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  background: #11182c;
  border: 1px solid #202e4d;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.clan-filter-chip.active {
  background: rgba(255, 209, 59, 0.16);
  border-color: #ffd13b;
  color: #ffd13b;
  box-shadow: 0 0 12px rgba(255, 209, 59, 0.22);
}

.clan-tab-pane {
  display: none !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.clan-tab-pane.active,
.clan-tab-pane[style*="display: block"],
.clan-tab-pane[style*="display:block"] {
  display: flex !important;
}

.clan-tab-pane[style*="display: none"],
.clan-tab-pane[style*="display:none"] {
  display: none !important;
}

.clan-stream-body {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 4px 4px 14px 4px !important;
  box-sizing: border-box !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0, 229, 255, 0.3) rgba(10, 15, 26, 0.5) !important;
}

.clan-stream-body > * {
  flex-shrink: 0 !important;
}

.clan-stream-body::-webkit-scrollbar {
  width: 4px;
}
.clan-stream-body::-webkit-scrollbar-track {
  background: rgba(10, 15, 26, 0.5);
  border-radius: 4px;
}
.clan-stream-body::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}
.clan-stream-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.6);
}

/* Clan Identity Card */
.clan-identity-card {
  background: linear-gradient(135deg, #131a2e, #0e1526);
  border: 1.5px solid #ffd13b;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clan-identity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clan-emblem-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 209, 59, 0.12);
  border: 1.5px solid #ffd13b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.clan-identity-text {
  flex: 1;
  min-width: 0;
}

.clan-name-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffd13b;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-motto-text {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-role-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.clan-role-pill.leader {
  background: rgba(255, 209, 59, 0.15);
  color: #ffd13b;
  border: 1px solid #ffd13b;
}
.clan-role-pill.officer {
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
  border: 1px solid #00e5ff;
}
.clan-role-pill.member {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid #475569;
}

.clan-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  font-size: 11px;
}
.clan-stat-item {
  background: #090e1a;
  border-radius: 8px;
  padding: 5px 6px;
  text-align: center;
}
.clan-stat-label {
  font-size: 9.5px;
  color: #64748b;
  display: block;
}
.clan-stat-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 1px;
}

/* Cooperative Mission Card */
.clan-objective-card {
  background: #11182c;
  border: 1px solid #1e2e4f;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clan-objective-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  color: #00e5ff;
}
.clan-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #080c18;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #1f2b48;
}
.clan-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #38ef7d);
  border-radius: 6px;
}

/* Radio Chat Ingress Bar */
.clan-chat-ingress-bar {
  background: #111828;
  border: 1px solid rgba(56, 239, 125, 0.3);
  border-radius: 10px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.clan-chat-ingress-bar:active {
  background: #162035;
  transform: scale(0.985);
}
.clan-chat-ingress-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.clan-chat-ingress-title {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.clan-chat-ingress-snippet {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clan-chat-ingress-btn {
  background: #10b981;
  color: #ffffff;
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 11px;
  font-weight: 800;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Member Rows */
.clan-member-item {
  background: #111728;
  border: 1px solid #1e2b48;
  border-radius: 10px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.clan-member-item:active {
  background: #162038;
}
.clan-member-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.clan-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #00e5ff;
  object-fit: cover;
}
.clan-member-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Member Action Sheet */
.clan-member-sheet-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 7, 16, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.18s ease-out;
}
.clan-member-sheet {
  width: 100%;
  background: #0f172a;
  border: 1.5px solid #ffd13b;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 16px 14px;
  box-shadow: 0 -10px 30px rgba(255, 209, 59, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  animation: slideUp 0.22s ease-out;
}

.sheet-player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}
.sheet-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sheet-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #ffd13b;
  object-fit: cover;
  box-shadow: 0 0 12px rgba(255, 209, 59, 0.35);
}
.sheet-player-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Estedad-Mad', sans-serif;
}
.sheet-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 26px;
  cursor: pointer;
  padding: 4px;
}
.sheet-positive-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-pos-btn {
  width: 100%;
  background: #162035;
  border: 1px solid #28395a;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sheet-pos-btn:active {
  background: #1f2d4a;
  transform: scale(0.985);
}
.sheet-pos-btn.highlight {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(0, 229, 255, 0.05));
  border-color: #00e5ff;
  color: #00e5ff;
}
.sheet-mgmt-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.sheet-mgmt-btn {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  color: #ffd13b;
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sheet-destructive-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.sheet-destruct-btn {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 10px;
  color: #ef4444;
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sheet-confirm-bar {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
  color: #fca5a5;
  text-align: center;
}
.sheet-confirm-btn {
  flex: 1;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Estedad-Mad', sans-serif;
}
.sheet-cancel-btn {
  flex: 1;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Estedad-Mad', sans-serif;
}

/* =========================================================================
   CLAN COOPERATIVE GAMEPLAY & DUNGEON RAID STYLES
   ========================================================================= */
.clan-dungeon-hero-card {
  background: radial-gradient(ellipse at 50% 0%, #17223b 0%, #0d1526 65%, #080d1a 100%);
  border: 1.5px solid #00e5ff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.clan-dungeon-hero-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 120px; height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.clan-boss-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clan-boss-avatar-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.12);
  border: 1.5px solid #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  flex-shrink: 0;
}

.clan-boss-info {
  flex: 1;
  min-width: 0;
}

.clan-boss-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-boss-meta {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

.clan-boss-phase-badge {
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.clan-boss-phase-badge.phase-1 { background: rgba(56, 239, 125, 0.18); border: 1px solid #38ef7d; color: #38ef7d; }
.clan-boss-phase-badge.phase-2 { background: rgba(0, 229, 255, 0.18); border: 1px solid #00e5ff; color: #00e5ff; }
.clan-boss-phase-badge.phase-3 { background: rgba(255, 209, 59, 0.18); border: 1px solid #ffd13b; color: #ffd13b; }
.clan-boss-phase-badge.phase-4 { background: rgba(249, 115, 22, 0.2); border: 1px solid #f97316; color: #f97316; }
.clan-boss-phase-badge.phase-5 {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #ef4444;
  animation: pulseBerserk 1s infinite alternate;
}

@keyframes pulseBerserk {
  from { box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
  to { box-shadow: 0 0 16px rgba(239, 68, 68, 0.9); }
}

.clan-boss-hp-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clan-boss-hp-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
}

.clan-boss-hp-track {
  width: 100%;
  height: 12px;
  background: #080c16;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #1a2744;
  position: relative;
}

.clan-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 40%, #00e5ff 100%);
  border-radius: 6px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.clan-boss-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.clan-ticket-pill {
  font-size: 11px;
  color: #ffd13b;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.clan-btn-enter-raid {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 12.5px;
  font-weight: 900;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease;
}
.clan-btn-enter-raid:active {
  transform: scale(0.97);
}

/* Milestone Rail */
.clan-milestone-box {
  background: #101626;
  border: 1px solid #1e2c4a;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-milestones-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 2px;
}

.clan-milestone-node {
  background: #090e1b;
  border: 1px solid #202d4c;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}
.clan-milestone-node.is-claimed {
  border-color: #38ef7d;
  background: rgba(56, 239, 125, 0.08);
}
.clan-milestone-node.is-ready {
  border-color: #ffd13b;
  background: rgba(255, 209, 59, 0.12);
  box-shadow: 0 0 10px rgba(255, 209, 59, 0.25);
  cursor: pointer;
}

.clan-milestone-target {
  font-size: 10.5px;
  font-weight: 800;
  color: #cbd5e1;
}

.clan-milestone-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}
.clan-milestone-badge.claimed { background: rgba(56, 239, 125, 0.2); color: #38ef7d; }
.clan-milestone-badge.ready { background: #ffd13b; color: #080a14; }
.clan-milestone-badge.locked { background: #1e293b; color: #64748b; }

/* Clan Project Card */
.clan-project-box {
  background: #101626;
  border: 1px solid #283758;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clan-btn-donate {
  background: linear-gradient(135deg, #ffd13b, #f39c12);
  border: none;
  color: #080a14;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Estedad-Mad', sans-serif;
}

/* Activity Stream */
.clan-activity-box {
  background: #0d1322;
  border: 1px solid #1a2742;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clan-activity-item {
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.clan-activity-item:last-child {
  border-bottom: none;
}

/* 10 Dungeon Map */
.clan-dungeon-map-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clan-map-item {
  background: #111728;
  border: 1px solid #1e2b48;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.clan-map-item.is-current {
  border: 1.5px solid #00e5ff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), #111728);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}
.clan-map-item.is-locked {
  opacity: 0.6;
}

/* Clan Raid Combat Modal */
.clan-boss-raid-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 7, 16, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
}

.clan-raid-panel {
  width: 100%;
  max-width: 440px;
  background: #090e1c;
  border: 2px solid #00e5ff;
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.clan-raid-target-zone {
  background: #050812;
  border: 1px dashed #203154;
  border-radius: 14px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  position: relative;
}

.clan-raid-combat-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.clan-raid-action-btn {
  background: #131b2e;
  border: 1px solid #28395a;
  border-radius: 10px;
  padding: 10px;
  color: #fff;
  font-family: 'Estedad-Mad', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.1s ease;
}
.clan-raid-action-btn:active {
  transform: scale(0.96);
  background: #1e293b;
}
.clan-raid-action-btn.weakpoint {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255, 209, 59, 0.25), rgba(243, 156, 18, 0.15));
  border-color: #ffd13b;
  color: #ffd13b;
  box-shadow: 0 0 12px rgba(255, 209, 59, 0.3);
}

/* =========================================================================
   TACTICAL SCI-FI VECTOR ICON PACK & MINIMAL CLAN MODAL STYLES
   ========================================================================= */
.tactical-svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.clan-emblem-svg {
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
}

.tactical-boss-svg {
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.4));
}

.clan-modal-minimal {
  width: min(396px, calc(100vw - 16px)) !important;
  max-width: 396px !important;
  height: min(86vh, 700px) !important;
  height: min(86dvh, 700px) !important;
  max-height: 700px !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1.5px solid #1a2744 !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 229, 255, 0.12) !important;
  padding: 10px 12px 8px 12px !important;
  background: radial-gradient(circle at 50% 10%, #0d1526 0%, #070b14 100%) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Minimal Header */
.clan-header-minimal {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 2px 2px 6px 2px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  flex-shrink: 0 !important;
}

.clan-header-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
}

.clan-header-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.clan-header-emblem {
  flex-shrink: 0;
}

.clan-header-title-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.clan-header-title-line {
  display: flex;
  align-items: center;
  gap: 4px;
}

.clan-header-name {
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.clan-pill-level {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #00e5ff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.clan-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.clan-header-wallets {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 8px;
  padding: 2px 5px;
}

.clan-wallet-item {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 800;
}
.clan-wallet-item.clan-coins {
  color: #ffd13b;
}
.clan-wallet-item.clan-bp {
  color: #00e5ff;
}

.clan-wallet-divider {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, 0.15);
}

.clan-header-bottom-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  color: #94a3b8;
  padding-right: 2px;
}

.clan-pill-rank {
  color: #ffd13b;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.clan-pill-members {
  color: #00e5ff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.clan-pill-score {
  color: #38ef7d;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.clan-close-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 7px !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  padding: 0 !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0;
}
.clan-close-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

.clan-modal-card .social-back-button {
  width: 100% !important;
  min-height: 38px !important;
  height: 38px !important;
  margin-top: 6px !important;
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
  border-radius: 9px !important;
  font-family: 'Estedad-Mad', sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.clan-modal-card .social-back-button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

/* Nav Segmented Control */
.clan-nav-segmented {
  display: flex !important;
  gap: 4px !important;
  background: #060912 !important;
  padding: 3px !important;
  border-radius: 10px !important;
  border: 1px solid #141c2e !important;
  margin: 6px 0 !important;
}

.clan-nav-segmented .clan-filter-chip {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  color: #94a3b8 !important;
  font-family: 'Estedad-Mad', sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 5px 3px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.clan-nav-segmented .clan-filter-chip.active {
  background: #121a2c !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 229, 255, 0.35) !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.12) !important;
}

/* Boss Compact Card */
.clan-boss-compact-card {
  background: radial-gradient(ellipse at 50% 0%, #152037 0%, #0d1424 60%, #080d18 100%) !important;
  border: 1.5px solid #00e5ff !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.15) !important;
}

.clan-boss-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clan-boss-compact-card .clan-boss-avatar-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

.clan-boss-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.clan-boss-name {
  font-size: 12.5px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-boss-timer {
  font-size: 9px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
}

/* Weekly Milestone Connected Track */
.clan-milestones-track-card {
  background: #0d1322 !important;
  border: 1px solid #1a2742 !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.clan-track-title-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.clan-milestone-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #ffffff;
}

.clan-milestone-sub {
  font-size: 9.5px;
  color: #94a3b8;
}

.clan-track-myshare {
  font-size: 9.5px;
  color: #94a3b8;
}

.clan-road-track-wrap {
  position: relative;
  padding: 4px 0 2px 0;
}

.clan-road-line-back {
  position: absolute;
  top: 19px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: #17223b;
  border-radius: 2px;
  z-index: 1;
}

.clan-road-line-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #38ef7d);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
  transition: width 0.3s ease;
}

.clan-road-nodes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
  z-index: 2;
}

.clan-road-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.clan-road-node-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0b111e;
  border: 1.5px solid #233454;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.clan-road-node.claimed .clan-road-node-icon {
  border-color: #38ef7d;
  background: rgba(56, 239, 125, 0.15);
}

.clan-road-node.can-claim .clan-road-node-icon {
  border-color: #ffd13b;
  background: rgba(255, 209, 59, 0.2);
  box-shadow: 0 0 10px rgba(255, 209, 59, 0.6);
  animation: claimPulse 1.2s infinite alternate;
}

@keyframes claimPulse {
  from { transform: scale(1.0); }
  to { transform: scale(1.1); }
}

.clan-road-node-val {
  font-size: 9.5px;
  font-weight: 800;
  color: #cbd5e1;
  margin-top: 1px;
}

.clan-road-node-reward {
  font-size: 9px;
  font-weight: 700;
  color: #ffd13b;
  display: flex;
  align-items: center;
  gap: 2px;
}

.clan-road-claim-btn {
  background: #ffd13b !important;
  border: none !important;
  color: #080a14 !important;
  border-radius: 4px !important;
  padding: 1px 6px !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  font-family: 'Estedad-Mad', sans-serif !important;
  margin-top: 2px !important;
  box-shadow: 0 0 6px rgba(255, 209, 59, 0.4) !important;
}

.clan-road-claimed-tag {
  font-size: 9px;
  color: #38ef7d;
  font-weight: 800;
}

/* Base Project Compact Card */
.clan-project-compact-card {
  background: #0d1322 !important;
  border: 1px solid #1a2742 !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

.clan-project-title-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.clan-project-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #00e5ff;
}

.clan-project-perk {
  font-size: 9.5px;
  color: #94a3b8;
}

.clan-project-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 1px;
}

.clan-project-meta-text {
  font-size: 9.5px;
  color: #94a3b8;
}

/* Supply Delivery Actions */
.clan-supplies-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.clan-supply-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 8px 9px;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}
.clan-supply-card:hover {
  border-color: #00e5ff;
  background: #141f33;
}
.clan-supply-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.clan-supply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.clan-supply-badge {
  font-size: 11px;
  font-weight: 800;
  color: #00e5ff;
}
.clan-supply-badge.gold {
  color: #ffd13b;
}
.clan-supply-cost {
  font-size: 11px;
  font-weight: 800;
  color: #ffd13b;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.clan-supply-perk {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.35;
}

/* Battalion Shop (Boosters) */
.clan-shop-compact-card {
  background: #0c1220 !important;
  border: 1px solid rgba(0, 229, 255, 0.25) !important;
  border-radius: 12px !important;
  padding: 9px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
}

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

.clan-shop-title-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.clan-shop-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #00e5ff;
}

.clan-shop-subtitle {
  font-size: 9.5px;
  color: #94a3b8;
}

.clan-active-booster-banner {
  background: rgba(56, 239, 125, 0.1);
  border: 1px solid rgba(56, 239, 125, 0.35);
  border-radius: 8px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

.clan-active-booster-left {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #38ef7d;
  font-weight: 800;
}

.clan-active-booster-timer {
  color: #ffd13b;
  font-weight: 800;
}

.clan-shop-boosters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.clan-booster-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  min-height: 82px;
  transition: all 0.15s ease;
}
.clan-booster-card.active {
  border-color: #38ef7d;
  background: rgba(56, 239, 125, 0.06);
}
.clan-booster-card.locked {
  opacity: 0.55;
}

.clan-booster-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.clan-booster-name {
  font-size: 10.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-booster-active-tag {
  font-size: 8.5px;
  background: #10b981;
  color: #000;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

.clan-booster-locked-tag {
  font-size: 8.5px;
  color: #94a3b8;
  flex-shrink: 0;
}

.clan-booster-desc {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.3;
}

.clan-booster-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
}

.clan-booster-btn-coin {
  background: #1a2333;
  border: 1px solid #ffd13b;
  color: #ffd13b;
  border-radius: 5px;
  padding: 4px 2px;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'Estedad-Mad', sans-serif;
  transition: all 0.15s ease;
}
.clan-booster-btn-coin:hover:not(:disabled) {
  background: rgba(255, 209, 59, 0.2);
}

.clan-booster-btn-points {
  background: #1a2333;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  border-radius: 5px;
  padding: 4px 2px;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'Estedad-Mad', sans-serif;
  transition: all 0.15s ease;
}
.clan-booster-btn-points:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.2);
}

.clan-booster-btn-coin:disabled,
.clan-booster-btn-points:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Footer Comms & Radio Bar */
.clan-footer-comms-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #070b14;
  border: 1px solid #162035;
  border-radius: 10px;
  padding: 5px 8px;
  margin-top: 2px;
}

.clan-live-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #94a3b8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.clan-ticker-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.clan-comms-btn {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #00e5ff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Estedad-Mad', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Helper Elements */
.clan-tool-btn {
  background: #172238;
  border: 1px solid #2d3f66;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Estedad-Mad', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.clan-tool-btn.danger {
  color: #ff4757;
  border-color: rgba(255, 71, 87, 0.4);
  background: rgba(255, 71, 87, 0.08);
}

.clan-browse-card {
  background: #0f1628;
  border: 1px solid #1e2c4a;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.clan-card-emblem {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clan-join-btn {
  background: #17243c;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Estedad-Mad', sans-serif;
}

.clan-no-clan-hero {
  background: radial-gradient(ellipse at 50% 0%, #15223c 0%, #0c1424 70%, #070c18 100%);
  border: 1.5px solid #00e5ff;
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.clan-hero-cta {
  background: #00e5ff;
  border: none;
  color: #080a14;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Estedad-Mad', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.clan-hero-cta.gold {
  background: #ffd13b;
}

.clan-dungeon-banner {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.clan-boss-item-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-transfer-overlay {
  --transfer-accent: #00e5ff;
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(3, 5, 12, .94);
}
.account-transfer-overlay[hidden], .account-transfer-overlay [hidden] { display: none !important; }
.account-transfer-card {
  width: min(100%, 440px);
  max-height: 85dvh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid var(--transfer-accent);
  border-radius: 24px;
  background: #0c1224;
  box-shadow: 0 0 24px #00e5ff22;
  color: #e6eaf4;
  text-align: center;
  font-family: 'Estedad', sans-serif;
  line-height: 1.9;
}
.account-transfer-card h2 { color: var(--transfer-accent); font-size: clamp(19px, 5vw, 25px); margin: 0 0 12px; }
.account-transfer-card code { display: block; overflow-wrap: anywhere; font-size: 12px; color: #9aaac4; }
.account-transfer-card button { width: 100%; margin-top: 16px; min-height: 48px; }
