/* Idle Breakout - Authentic Retro Arcade Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
  --bg-retro: #ede0c8;
  --bg-panel: #e6d7bc;
  --border-color: #000000;
  --border-width: 2px;
  --green-money: #22c55e;
  --green-btn: #4be66a;
  --gray-btn: #b8b09f;
  --brick-blue: #42c2f7;
  --font-retro: 'VT323', 'Courier New', Courier, monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #d8caa9, #ede0c8, #e5d7ba, #f2e6cb, #dccca7);
  background-size: 400% 400%;
  animation: ambientBgFlow 22s ease-in-out infinite;
  color: #000000;
  font-family: var(--font-retro);
  font-size: 18px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

@keyframes ambientBgFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Subtle Background Animated Ambient Shapes (Behind Game Container) */
.ambient-bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ambient-shape {
  position: absolute;
  border: 2px solid rgba(0, 0, 0, 0.07);
  background: rgba(255, 255, 255, 0.04);
  animation: floatAmbient 28s infinite linear;
}

.ambient-shape:nth-child(1) {
  width: 90px;
  height: 90px;
  top: 15%;
  left: 8%;
  animation-duration: 35s;
  animation-delay: -5s;
}

.ambient-shape:nth-child(2) {
  width: 60px;
  height: 60px;
  top: 70%;
  left: 12%;
  animation-duration: 42s;
  animation-delay: -12s;
  border-radius: 50%;
}

.ambient-shape:nth-child(3) {
  width: 110px;
  height: 110px;
  top: 25%;
  right: 7%;
  animation-duration: 38s;
  animation-delay: -8s;
}

.ambient-shape:nth-child(4) {
  width: 75px;
  height: 75px;
  top: 75%;
  right: 10%;
  animation-duration: 30s;
  animation-delay: -18s;
  border-radius: 50%;
}

@keyframes floatAmbient {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-35px) rotate(180deg);
  }
  100% {
    transform: translateY(0px) rotate(360deg);
  }
}

/* 3-Column Desktop Layout (Leaderboard - Game - Breaker Pass) */
.page-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 1.8vw, 26px);
  width: 100vw;
  height: 100vh;
  max-height: 950px;
  padding: 14px clamp(14px, 1.5vw, 22px);
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

/* Master Game Container */
#game-container {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1120px;
  height: 100%;
  max-height: 890px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-retro);
  border: 4px solid var(--border-color);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 8px 8px 0px rgba(0, 0, 0, 0.85);
  position: relative;
  z-index: 10;
}

/* Desktop Sidebars (Leaderboard Left & Battle Pass Right - Frosted & Rounded) */
.desktop-sidebar {
  width: 300px;
  min-width: 278px;
  max-width: 312px;
  height: 100%;
  max-height: 890px;
  background: rgba(244, 234, 214, 0.54);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border: 2.5px solid rgba(20, 20, 20, 0.72);
  border-radius: 16px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.16),
    4px 4px 0px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

@media (min-width: 1251px) and (max-width: 1440px) {
  .page-layout {
    gap: 10px;
    padding: 10px;
  }

  .desktop-sidebar {
    width: 266px;
    min-width: 258px;
    max-width: 278px;
  }

  .leaderboard-table-header,
  .leaderboard-row {
    grid-template-columns: 32px minmax(0, 1fr) 36px 40px;
    gap: 3px;
    padding: 5px 5px;
    font-size: 13.5px;
  }

  .leaderboard-row .lb-name-txt {
    font-size: 12.2px;
  }

  .leaderboard-row .live-dot {
    font-size: 9px;
  }

  .leaderboard-row .guest-warn-badge {
    width: 13.5px;
    height: 13.5px;
    min-width: 13.5px;
    font-size: 9.5px;
    margin-left: 1px;
  }

  .leaderboard-row .badge-me {
    font-size: 9px;
    padding: 1px 4px;
    margin-left: 2px;
  }

  .player-locked-name {
    font-size: 14.5px;
  }

  .lb-auth-status-bar {
    font-size: 11.5px;
  }

  #game-container .top-bar {
    padding: 8px 10px;
    gap: 6px;
  }

  #game-container .currency-hud-box {
    min-width: 146px;
    padding: 3px 8px;
  }

  #game-container .ball-buy-slot {
    width: 31px;
    height: 50px;
  }

  #game-container .retro-icon-btn {
    width: 32px;
    height: 32px;
  }
}

/* Sidebar Headers */
.sidebar-header {
  background: linear-gradient(180deg, rgba(24, 22, 20, 0.92), rgba(41, 37, 36, 0.86));
  color: #fde047;
  border-bottom: 2px solid rgba(0, 0, 0, 0.72);
  box-shadow: inset 0 -1px 0 rgba(253, 224, 71, 0.18);
  padding: 9px 12px;
  text-align: center;
}

.sidebar-title {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sidebar-subtitle {
  font-size: 13px;
  color: #a8a29e;
  letter-spacing: 0.5px;
}

/* Player Profile Card (Leaderboard) */
.player-profile-card {
  background: rgba(249, 243, 230, 0.58);
  border: 1.5px solid rgba(0, 0, 0, 0.28);
  border-radius: 11px;
  margin: 7px 8px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.player-profile-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-profile-locked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 8px;
  min-height: 28px;
  background: rgba(255, 255, 255, 0.58);
  border: 1.5px solid rgba(22, 163, 74, 0.45);
  border-radius: 7px;
}

.player-locked-name {
  font-size: 16px;
  color: #14532d;
  letter-spacing: 0.4px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.profile-label {
  font-size: 15px;
  font-weight: bold;
}

.player-name-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  font-family: var(--font-retro);
  font-size: 16px;
  padding: 2px 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.65);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.player-name-input:focus {
  border-color: #000000;
  background: #ffffff;
}

.mini-save-btn {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 14px;
  background: var(--green-money);
  border-radius: 7px;
  border: 1.5px solid #000000;
}

.player-stats-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 11px;
  color: #3f3f46;
  background: rgba(255, 255, 255, 0.45);
  padding: 4px 6px;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 7px;
}

/* Leaderboard Table */
.leaderboard-table-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 40px 46px;
  gap: 4px;
  background: rgba(214, 198, 168, 0.48);
  border-top: 1px solid rgba(0, 0, 0, 0.16);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.35);
  padding: 5px 7px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}

.col-rank { text-align: center; }
.col-name {
  text-align: left;
  padding-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row .col-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}

.lb-name-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 3px;
  row-gap: 1px;
  min-width: 0;
  line-height: 1.12;
}

.lb-name-txt {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.guest-warn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  min-width: 15px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.5);
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
  cursor: help;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.45);
  transition: transform 0.1s ease, filter 0.12s ease;
}

.guest-warn-badge:hover {
  transform: scale(1.12);
  filter: brightness(1.1);
}

.lb-last-seen {
  font-size: 10.5px;
  font-weight: normal;
  line-height: 1.05;
  color: #64748b;
  padding-left: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-last-seen.is-online {
  color: #15803d;
  font-weight: bold;
}
.col-reb, .col-lvl {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-table-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 40px 46px;
  gap: 4px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 14.5px;
  align-items: center;
  transition: background 0.12s ease, transform 0.12s ease;
}

.leaderboard-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.24);
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.62);
}

.leaderboard-row.rank-top1 { background: rgba(254, 240, 138, 0.84) !important; border-color: rgba(234, 179, 8, 0.6); font-weight: bold; }
.leaderboard-row.rank-top2 { background: rgba(226, 232, 240, 0.84) !important; border-color: rgba(148, 163, 184, 0.6); font-weight: bold; }
.leaderboard-row.rank-top3 { background: rgba(254, 215, 170, 0.84) !important; border-color: rgba(249, 115, 22, 0.5); font-weight: bold; }

.leaderboard-row.player-row-me {
  background: rgba(187, 247, 208, 0.85) !important;
  border: 1.5px solid #16a34a !important;
  font-weight: bold;
}

.leaderboard-gap-divider {
  text-align: center;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 2px;
  color: #78716c;
  padding: 1px 0;
  opacity: 0.78;
}

.mobile-sheet-window .leaderboard-gap-divider {
  color: #94a3b8;
}

.badge-me {
  background: #16a34a;
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 4px;
}

/* Real-Time Multiplayer Leaderboard Status & Dots */
.lb-conn-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 2px 9px;
  font-size: 11px;
  font-family: var(--font-retro);
  margin-top: 4px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lb-conn-status.connected {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(15, 41, 30, 0.85);
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.lb-conn-status.connected .conn-dot {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-conn-dot 1.8s infinite;
}

@keyframes pulse-conn-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.live-dot {
  font-size: 9px;
  margin-right: 4px;
  vertical-align: middle;
}

.live-dot.online {
  color: #22c55e;
  display: inline-block;
  animation: pulse-conn-dot 1.5s infinite;
}

.live-dot.offline {
  color: #94a3b8;
  opacity: 0.6;
}

.leaderboard-empty-hint {
  padding: 12px 10px;
  font-size: 13px;
  color: #52525b;
  text-align: center;
  background: rgba(255, 255, 255, 0.35);
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  margin: 6px 4px;
  line-height: 1.35;
}

.leaderboard-self-filtered-notice {
  padding: 8px 10px;
  margin: 4px 4px 6px;
  font-size: 12.5px;
  line-height: 1.3;
  color: #991b1b;
  background: rgba(254, 226, 226, 0.85);
  border: 1.5px dashed #dc2626;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
}

.mobile-sheet-window .leaderboard-self-filtered-notice {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.48);
  border-color: rgba(248, 113, 113, 0.7);
}

.sidebar-footer-note {
  font-size: 12px;
  color: #52525b;
  padding: 6px 10px;
  border-top: 1.5px solid rgba(0, 0, 0, 0.22);
  background: rgba(226, 210, 180, 0.45);
  text-align: center;
  line-height: 1.2;
}

/* Battle Pass Progress Card */
.bp-progress-card {
  background: rgba(249, 243, 230, 0.58);
  border: 1.5px solid rgba(0, 0, 0, 0.28);
  border-radius: 11px;
  margin: 7px 8px 4px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.bp-stage-indicator {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
}

.highlight-stage {
  color: #d97706;
  font-size: 13.5px;
}

.bp-progress-bar-wrap {
  width: 100%;
  height: 20px;
  background: rgba(41, 37, 36, 0.88);
  border: 2px solid rgba(0, 0, 0, 0.82);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.bp-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #22c55e);
  transition: width 0.3s ease;
}

.bp-progress-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 1px 1px 0px #000;
}

.bp-premium-banner {
  margin-top: 2px;
}

.retro-btn.bp-premium-btn {
  width: 100%;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  color: #000;
  font-size: 13.5px;
  padding: 2px 6px;
  font-weight: bold;
  height: 32px;
  border: 2px solid rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.25), 2px 2px 0px rgba(0, 0, 0, 0.85);
}

.retro-btn.bp-premium-btn.premium-unlocked {
  background: #22c55e !important;
  color: #000;
  cursor: default;
}

.bp-tab-row {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.bp-tab-btn {
  flex: 1;
  min-height: 28px;
  padding: 3px 4px;
  font-family: var(--font-retro);
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
  font-weight: bold;
  background: rgba(214, 198, 168, 0.65);
  border: 1.5px solid rgba(0, 0, 0, 0.72);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.1s ease;
}

.bp-tab-btn.active {
  background: rgba(253, 224, 71, 0.92);
  border-color: #000000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 1px 1px 0 rgba(0, 0, 0, 0.65);
}

/* Stage Scroll & Cards */
.bp-stages-scroll,
.bp-armory-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.leaderboard-table-body::-webkit-scrollbar,
.bp-stages-scroll::-webkit-scrollbar,
.bp-armory-scroll::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-table-body::-webkit-scrollbar-track,
.bp-stages-scroll::-webkit-scrollbar-track,
.bp-armory-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.leaderboard-table-body::-webkit-scrollbar-thumb,
.bp-stages-scroll::-webkit-scrollbar-thumb,
.bp-armory-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.leaderboard-table-body::-webkit-scrollbar-thumb:hover,
.bp-stages-scroll::-webkit-scrollbar-thumb:hover,
.bp-armory-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.42);
}

.bp-stage-card {
  background: rgba(255, 252, 244, 0.68);
  border: 1.5px solid rgba(0, 0, 0, 0.62);
  border-radius: 11px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 2px 2px 0px rgba(0, 0, 0, 0.35);
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.bp-stage-card.stage-reached {
  border-color: #16a34a;
  background: rgba(240, 253, 244, 0.76);
}

.bp-stage-card.bp-stage-free-empty {
  background: rgba(255, 250, 240, 0.56);
}

.bp-stage-card.bp-stage-free-empty.stage-reached {
  background: rgba(240, 253, 244, 0.66);
}

/* Free Track Empty Intermediate Rows */
.bp-track-row.empty-free-row {
  background: rgba(0, 0, 0, 0.035);
  border: 1px dashed rgba(0, 0, 0, 0.16);
  color: #64748b;
  padding: 3px 6px;
}

.track-pill.pill-muted {
  opacity: 0.58;
}

.bp-empty-lock {
  font-size: 13px;
  opacity: 0.55;
  padding-right: 4px;
}

.bp-empty-text {
  font-style: italic;
  font-size: 12px;
  color: #64748b;
}

.bp-card-top-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
  padding-bottom: 3px;
}

.bp-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 7px;
  font-size: 13px;
}

.bp-track-row.premium-row {
  background: rgba(254, 252, 232, 0.78);
  border-color: rgba(234, 179, 8, 0.55);
}

.track-pill {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

.pill-free { background: rgba(147, 197, 253, 0.9); color: #1e3a8a; }
.pill-paid { background: rgba(253, 224, 71, 0.92); color: #78350f; }

.reward-info-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.reward-name {
  font-weight: bold;
  font-size: 13px;
}

.reward-tag {
  font-size: 11px;
  color: #52525b;
}

.btn-claim-reward {
  min-height: 24px;
  padding: 2px 8px;
  font-family: var(--font-retro);
  font-size: 12px;
  line-height: 1.05;
  font-weight: bold;
  background: var(--green-money);
  border: 1.5px solid #000;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-claim-reward:disabled {
  background: rgba(203, 213, 225, 0.8);
  cursor: not-allowed;
  opacity: 0.72;
}

.badge-claimed {
  color: #16a34a;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.badge-locked {
  color: #dc2626;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Armory / Ball Customizer Cards */
.armory-ball-card {
  background: rgba(255, 252, 244, 0.68);
  border: 1.5px solid rgba(0, 0, 0, 0.62);
  border-radius: 11px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 2px 2px 0px rgba(0, 0, 0, 0.35);
}

.armory-ball-header {
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.22);
  padding-bottom: 4px;
}

.armory-ball-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.armory-ball-title .ball-dot {
  width: 15px;
  height: 15px;
  border-width: 1.5px;
}

.armory-ball-sub {
  font-size: 11px;
  color: #57534e;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.armory-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
}

.armory-select {
  flex: 1;
  width: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-retro);
  font-size: 13px;
  padding: 2px 5px;
  border: 1.5px solid rgba(0, 0, 0, 0.65);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

/* Mobile Modal Dialog Extensions */
.modal-mobile-responsive {
  width: 95%;
  max-width: 520px;
  height: 85%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
}

.retro-modal-x-btn {
  background: #ff5555;
  color: #ffffff;
  border: 2px solid #000000;
  font-size: 16px;
  font-weight: bold;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-tab-group {
  display: none;
  align-items: stretch;
  gap: 0;
}

.mobile-action-btn {
  display: none;
  background: #fde047;
  color: #000000;
  font-weight: bold;
}

.mobile-i-btn {
  background: #38bdf8 !important;
  color: #000000 !important;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-style: italic;
  font-weight: bold !important;
  border-left: none !important;
  min-width: 20px !important;
  padding: 0 5px !important;
  justify-content: center;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.retro-info-i-btn {
  background: #38bdf8;
  color: #000000;
  border: 2px solid #000000;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 16px;
  font-weight: bold;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.retro-info-i-btn:hover {
  background: #7dd3fc;
}

/* December 24 Event Countdown Banner (Visible on PC sidebars, behind 'i' on mobile) */
.dec24-event-banner {
  background: linear-gradient(135deg, rgba(69, 10, 10, 0.88) 0%, rgba(127, 29, 29, 0.85) 55%, rgba(69, 26, 3, 0.88) 100%);
  color: #fef08a;
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  border-radius: 10px;
  margin: 7px 8px 0;
  padding: 6px 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 3px 10px rgba(69, 10, 10, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dec24-timer-row {
  font-size: 13px;
  letter-spacing: 0.3px;
  color: #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.dec24-timer-row strong {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  border: 1px solid rgba(250, 204, 21, 0.5);
  border-radius: 6px;
  white-space: nowrap;
}

.dec24-prize-text {
  font-size: 12px;
  line-height: 1.15;
  color: #fef3c7;
}

/* Top Navigation & Status Bar (2-Row Retro Layout) */
header.top-bar {
  background-color: var(--bg-retro);
  border-bottom: 3px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 5px 10px;
  gap: 5px;
  z-index: 20;
}

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

.top-bar-row-actions {
  border-top: 1px dashed rgba(0, 0, 0, 0.25);
  padding-top: 5px;
  min-height: 44px;
}

.top-left-section {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-left-section::-webkit-scrollbar {
  display: none;
}

/* Ball Buy Buttons (12 Distinct Ball Types) */
.ball-buy-slot {
  width: 34px;
  height: 55px;
  flex-shrink: 0;
  background: var(--bg-retro);
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 2px 0 0 0;
  transition: transform 0.08s, background 0.1s;
  position: relative;
}

.ball-buy-slot:hover {
  background: #f9efd9;
  transform: translateY(-1px);
}

.ball-buy-slot:active {
  transform: translateY(1px);
}

.ball-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  position: relative;
  flex-shrink: 0;
}

/* Distinctive visual styles per ball type */
.ball-icon-normal {
  background: #ffee00;
}

.ball-icon-speedy {
  background: radial-gradient(circle at 35% 35%, #e0ffff, #00d9ff);
  box-shadow: 0 0 6px rgba(0, 217, 255, 0.7);
}

.ball-icon-poison {
  background: radial-gradient(circle at 35% 35%, #b9ff8a, #22c55e);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}

.ball-icon-heavy {
  background: radial-gradient(circle at 35% 35%, #ff8a80, #b91c1c);
  border-width: 3px;
}

.ball-icon-smasher {
  background: radial-gradient(circle at 35% 35%, #fef08a, #f59e0b 60%, #b45309 100%);
  border: 2px solid #000000;
  box-shadow: 0 0 7px rgba(245, 158, 11, 0.8);
}

.ball-icon-multiply {
  background: radial-gradient(circle at 35% 35%, #ff99ee, #d900b8);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.ball-icon-ghost {
  background: rgba(200, 244, 255, 0.65);
  border: 2px dashed #0284c7;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.7);
}

.ball-icon-rocket {
  background: radial-gradient(circle at 35% 35%, #fef08a, #f97316 55%, #b91c1c 100%);
  border: 2px solid #000000;
  box-shadow: 0 0 7px rgba(249, 115, 22, 0.8);
}

.ball-icon-symbiot {
  background: radial-gradient(circle at 35% 35%, #c084fc, #3b0764 55%, #09090b 100%);
  border: 2px solid #ef4444;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.9), inset 0 0 4px rgba(239, 68, 68, 0.85);
}

.ball-slot-symbiot {
  border-color: #6b21a8;
  background: linear-gradient(180deg, #faf5ff 0%, var(--bg-retro) 100%);
}

.ball-icon-laser {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f43f5e 48%, #be123c 100%);
  border: 2px solid #06b6d4;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.9), 0 0 4px rgba(6, 182, 212, 0.85);
}

.ball-slot-laser {
  border-color: #e11d48;
  background: linear-gradient(180deg, #fff1f2 0%, var(--bg-retro) 100%);
}

.ball-icon-vortex {
  background: radial-gradient(circle at 50% 50%, #020617 0%, #09090b 45%, #7e22ce 80%, #fde047 100%);
  border: 2px solid #a855f7;
  box-shadow: 0 0 9px rgba(168, 85, 247, 0.95), inset 0 0 5px #000000;
}

.ball-slot-vortex {
  border-color: #4c1d95;
  background: linear-gradient(180deg, #f3e8ff 0%, var(--bg-retro) 100%);
}

.ball-icon-coin {
  background: radial-gradient(circle at 35% 35%, #fef9c3, #facc15 55%, #b45309 100%);
  border: 2px solid #78350f;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.9);
}

.ball-slot-coin {
  border-color: #b45309;
  background: linear-gradient(180deg, #fefce8 0%, var(--bg-retro) 100%);
}

.ball-slot-tag {
  font-size: 10.5px;
  line-height: 1;
  font-weight: bold;
  letter-spacing: 0.2px;
  color: #333;
}

.ball-price-box {
  width: 100%;
  height: 17px;
  background: var(--gray-btn);
  border-top: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: bold;
  letter-spacing: -0.4px;
  color: #000000;
}

.ball-buy-slot.affordable .ball-price-box {
  background: var(--green-money);
}

.ball-buy-slot.pirate-free .ball-price-box {
  background: #f59e0b;
  color: #000000;
}

.ball-buy-slot.maxed-slot {
  opacity: 0.78;
  cursor: not-allowed;
}

.ball-buy-slot.maxed-slot .ball-price-box {
  background: #1f2937;
  color: #fde047;
  font-size: 12px;
}

/* Boss Token HUD Pill */
.boss-token-hud {
  height: 54px;
  min-width: 58px;
  padding: 2px 8px;
  background: linear-gradient(180deg, #3b0a18 0%, #1c050c 100%);
  border: 2px solid #000000;
  color: #fde047;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: bold;
  cursor: help;
}

.boss-token-hud .bt-icon {
  font-size: 15px;
}

.boss-token-hud #hud-boss-tokens-text {
  font-size: 18px;
  color: #ffffff;
}

.boss-token-hud .bt-label {
  font-size: 11px;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

/* Middle Status Indicators */
.top-center-section {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.mobile-status-pair {
  display: contents;
}

.status-box {
  background: linear-gradient(180deg, #f3e8d2 0%, var(--bg-retro) 100%);
  border: 2px solid var(--border-color);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 2px 2px 0 rgba(0, 0, 0, 0.25);
  padding: 2px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 56px;
  height: 38px;
  font-size: 14px;
  line-height: 1;
  font-weight: bold;
}

.status-sub {
  font-size: 11px;
  color: #444;
}

.status-box-val {
  font-size: 18px;
}

/* Retro Action Buttons */
.retro-btn {
  background: linear-gradient(180deg, #f5ead4 0%, #e4d4b4 100%);
  border: 2px solid var(--border-color);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 2px 2px 0 rgba(0, 0, 0, 0.78);
  color: #000000;
  font-family: var(--font-retro);
  font-size: 15.5px;
  font-weight: bold;
  padding: 3px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  transition: background 0.1s, transform 0.06s, box-shadow 0.1s;
  white-space: nowrap;
}

.retro-btn:hover {
  background: linear-gradient(180deg, #fdf5e2 0%, #efe0c0 100%);
  transform: translateY(-1px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.75), 3px 3px 0 rgba(0, 0, 0, 0.85);
}

.retro-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2), 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.retro-btn.powerup-upg-btn {
  background: linear-gradient(180deg, #fde68a 0%, #f59e0b 100%);
  color: #000000;
  border-color: #000000;
}

.retro-btn.powerup-upg-btn:hover {
  background: linear-gradient(180deg, #fef08a 0%, #fbbf24 100%);
}

.retro-btn.rebirth-btn {
  background: #ff4444;
  color: #ffffff;
  animation: pulse-rebirth 1.5s infinite;
  display: flex;
}

.retro-btn.rebirth-btn.locked {
  background: var(--gray-btn);
  color: #444444;
  animation: none;
  border-color: #555555;
  opacity: 0.85;
  cursor: pointer;
}

@keyframes pulse-rebirth {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); background: #ff2222; }
  100% { transform: scale(1); }
}

/* Auth / Cloud Save Tab Button & Modal Styles */
.retro-btn.auth-btn {
  background: linear-gradient(180deg, #bae6fd 0%, #38bdf8 100%);
  color: #000000;
  border-color: #000000;
  min-width: max-content;
  padding: 3px 9px;
}

.retro-btn.auth-btn:hover {
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 100%);
}

.retro-btn.auth-btn.logged-in {
  background: linear-gradient(180deg, #86efac 0%, #22c55e 100%);
  color: #000000;
}

.lb-auth-status-bar {
  width: 100%;
  background: rgba(226, 232, 240, 0.72);
  border: 1.5px solid rgba(0, 0, 0, 0.55);
  border-radius: 7px;
  padding: 4px 5px;
  font-family: var(--font-retro);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1e293b;
  text-align: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.lb-auth-status-bar:hover {
  background: rgba(203, 213, 225, 0.88);
}

.lb-auth-status-bar.logged-in {
  background: rgba(220, 252, 231, 0.85);
  color: #14532d;
  border-color: #16a34a;
}

.auth-modal-window {
  width: 94%;
  max-width: 500px;
  height: auto;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
}

.auth-modal-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.auth-config-warning {
  background: #fef3c7;
  border: 2px solid #d97706;
  color: #78350f;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.25;
}

.auth-config-warning code {
  background: rgba(0, 0, 0, 0.1);
  padding: 0 4px;
  font-family: monospace;
  font-size: 12px;
}

.auth-error-box {
  background: #fee2e2;
  border: 2px solid #dc2626;
  color: #991b1b;
  padding: 7px 10px;
  font-size: 15px;
  font-weight: bold;
}

.auth-panel-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-tabs-row {
  display: flex;
  gap: 6px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid #000;
  padding: 10px;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 16px;
  font-weight: bold;
}

.auth-input {
  width: 100%;
  height: 32px;
  padding: 4px 8px;
  border: 2px solid #000;
  background: #fff;
  font-family: var(--font-retro);
  font-size: 17px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.auth-input:focus {
  background: #fefce8;
  border-color: #0284c7;
}

.auth-submit-btn {
  width: 100%;
  height: 36px;
  font-size: 17px;
  margin-top: 2px;
}

.auth-hint-text {
  font-size: 13px;
  color: #444;
  line-height: 1.2;
  text-align: center;
}

.auth-status-card {
  background: #f0fdf4;
  border: 2px solid #16a34a;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
}

.auth-status-header {
  font-size: 18px;
  font-weight: bold;
  color: #15803d;
  border-bottom: 1px dashed #16a34a;
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.auth-actions-grid {
  display: flex;
  gap: 8px;
}

.auth-delete-open-btn {
  width: 100%;
  background: #fee2e2;
  color: #991b1b;
  border-color: #991b1b;
  font-weight: bold;
}

.auth-delete-open-btn:hover {
  background: #fecaca;
}

.auth-delete-confirm-box {
  background: #fef2f2;
  border: 2px solid #dc2626;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 3px 3px 0 rgba(153, 27, 27, 0.35);
}

.auth-delete-title {
  font-size: 18px;
  font-weight: bold;
  color: #991b1b;
}

.auth-delete-desc {
  font-size: 14px;
  line-height: 1.25;
  color: #450a0a;
}

.auth-delete-confirm-btn {
  flex: 1.2;
  background: #dc2626;
  color: #ffffff;
  font-weight: bold;
}

.auth-delete-confirm-btn:hover {
  background: #b91c1c;
}

.auth-delete-cancel-btn {
  flex: 1;
  background: var(--gray-btn);
  color: #000000;
}

.auth-backup-box {
  background: rgba(0, 0, 0, 0.05);
  border: 1.5px dashed #666;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-backup-title {
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.auth-backup-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.auth-backup-row .auth-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  font-size: 14px;
}

.auth-mini-btn {
  height: 28px !important;
  padding: 0 8px !important;
  font-size: 13px !important;
  flex-shrink: 0;
}

/* Right Currency Displays */
.top-right-section {
  display: flex;
  align-items: center;
  gap: 6px;
}

.currency-hud-box {
  width: 132px;
  height: 54px;
  background: #000000;
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 2px;
  gap: 2px;
}

.currency-hud-row {
  display: flex;
  height: 23px;
  align-items: center;
}

.currency-label {
  width: 30px;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.currency-label.money-lbl {
  color: #4ade80;
}

.currency-label.bb-lbl {
  color: #fbbf24;
}

.currency-value-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 18px;
  font-weight: bold;
}

.currency-value-bar.gold-bar {
  background: var(--green-money);
  color: #000000;
}

.currency-value-bar.bb-bar {
  background: linear-gradient(90deg, #29200a, #4a370d);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

/* Active Power-ups Bar */
.powerups-hud-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.powerup-hud-badge {
  min-width: 38px;
  height: 40px;
  padding: 0 5px;
  background: var(--bg-retro);
  border: 2px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: help;
  font-size: 16px;
  line-height: 1;
  animation: badge-pulse 2.2s infinite ease-in-out;
}

.powerup-hud-badge.perm-badge {
  background: #fef3c7;
  border-color: #b45309;
}

.powerup-mini-tag {
  font-size: 11px;
  font-weight: bold;
  color: #111;
  margin-top: 1px;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.powerup-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--green-money);
  width: 100%;
}

/* Tooltip on hover */
.powerup-hud-badge .tooltip-box {
  position: absolute;
  top: 46px;
  right: 0;
  background: #000000;
  color: #ffffff;
  border: 2px solid var(--border-color);
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
  z-index: 1000;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.5);
  text-align: left;
}

.powerup-hud-badge:hover .tooltip-box {
  opacity: 1;
  visibility: visible;
}

/* Tool Buttons on Far Right */
.top-controls-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.retro-icon-btn {
  width: 34px;
  height: 54px;
  background: var(--bg-retro);
  border: 2px solid var(--border-color);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
}

.retro-icon-btn:hover {
  background: #fdf5e2;
}

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

.retro-icon-btn.sound-btn {
  background: var(--green-money);
}

.retro-icon-btn.muted {
  background: #ff5555;
  color: #fff;
}

.retro-icon-btn.mail-btn {
  position: relative;
  background: #fef08a;
}

.mail-unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  border: 1.5px solid #000000;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* Arena Viewport with Subtle Retro Graph Design */
#arena-wrapper {
  flex: 1;
  position: relative;
  background-color: var(--bg-retro);
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.03) 0%, transparent 80%),
    radial-gradient(#c8b896 1.5px, transparent 1.5px);
  background-size: 100% 100%, 24px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(100, 80, 45, 0.14);
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* ============================================================ */
/* UPGRADES POPUP OVERLAY (Matches Image 2 Exactly)             */
/* ============================================================ */
.overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 12, 8, 0.48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.overlay-backdrop.open {
  display: flex;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.retro-modal-window {
  width: 90%;
  max-width: 820px;
  height: 86%;
  background: linear-gradient(180deg, #f1e6cf 0%, var(--bg-retro) 100%);
  border: 3px solid var(--border-color);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 7px 7px 0px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  position: relative;
  overflow-y: auto;
  animation: modalPopIn 0.16s ease-out;
}

.rebirth-dialog-box {
  animation: modalPopIn 0.16s ease-out;
}

/* Clean custom retro scrollbars inside modals */
.bb-modal-scroll::-webkit-scrollbar,
.upgrades-content-grid::-webkit-scrollbar,
.rebirth-desc-text::-webkit-scrollbar,
.bb-phase-tooltip::-webkit-scrollbar {
  width: 8px;
}

.bb-modal-scroll::-webkit-scrollbar-track,
.upgrades-content-grid::-webkit-scrollbar-track,
.rebirth-desc-text::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
  border-left: 1px solid rgba(0, 0, 0, 0.2);
}

.bb-modal-scroll::-webkit-scrollbar-thumb,
.upgrades-content-grid::-webkit-scrollbar-thumb,
.rebirth-desc-text::-webkit-scrollbar-thumb,
.bb-phase-tooltip::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid #000000;
}

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

.modal-title-box {
  border: 2px solid var(--border-color);
  padding: 4px 14px;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 1px;
  background: var(--bg-retro);
}

.mult-toggle-btn {
  border: 2px solid var(--border-color);
  padding: 4px 10px;
  font-size: 18px;
  font-weight: bold;
  background: var(--bg-retro);
  cursor: pointer;
}

.upgrades-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  grid-auto-rows: max-content;
  gap: 10px;
  flex: 1;
  align-items: stretch;
  align-content: start;
  overflow-y: auto;
  padding: 6px 2px;
}

.upgrades-mobile-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.upg-nav-arrow {
  min-width: 44px;
  height: 34px;
  padding: 0 10px;
  font-size: 17px;
  font-weight: bold;
  background: #fde047;
  color: #000000;
  border: 2px solid var(--border-color);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.upg-nav-arrow:disabled {
  opacity: 0.4;
  cursor: default;
}

.upg-mobile-indicator {
  flex: 1;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.58);
  border: 2px solid var(--border-color);
  border-radius: 7px;
  font-size: 14px;
  font-weight: bold;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upgrades-content-grid.mobile-carousel-mode {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow: hidden !important;
  touch-action: pan-x;
  padding: 2px 0;
  gap: 0;
  min-height: 0;
}

.upgrades-content-grid.mobile-carousel-mode .ball-upgrade-section {
  height: auto !important;
  min-height: 0 !important;
  width: 100%;
  margin: 0;
  overflow: hidden;
  flex-shrink: 1;
}

/* Individual Ball Upgrade Column Card + Stat Column Chart */
.ball-upgrade-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  height: 100%;
  min-height: 340px;
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 9px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.14);
}

.ball-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
}

.ball-title-label {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.ball-count-badge {
  font-size: 12.5px;
  color: #57534e;
}

.ball-card-name {
  font-size: 17px;
  line-height: 1.1;
  color: #000000;
}

.ball-card-desc {
  font-size: 12px;
  font-weight: normal;
  color: #44403c;
  line-height: 1.2;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ball-stat-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: rgba(15, 23, 42, 0.08);
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 7px 8px 6px;
}

.ball-stat-chart.single-col {
  grid-template-columns: 1fr;
}

.stat-col-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-col-val {
  font-size: 14px;
  font-weight: bold;
  color: #0f172a;
  line-height: 1.1;
}

.stat-col-track {
  width: 28px;
  height: 54px;
  background: rgba(15, 23, 42, 0.14);
  border: 1.5px solid #1e293b;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.stat-col-preview {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transition: height 0.22s ease;
  opacity: 0.42;
}

.stat-col-preview.speed-preview {
  background: #38bdf8;
}

.stat-col-preview.power-preview {
  background: #fb923c;
}

.stat-col-preview.coin-preview {
  background: rgba(250, 204, 21, 0.45);
}

.stat-col-fill {
  position: relative;
  z-index: 1;
  width: 100%;
  transition: height 0.22s ease;
  border-top: 1.5px solid rgba(255, 255, 255, 0.65);
}

.stat-col-fill.speed-fill {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
}

.stat-col-fill.power-fill {
  background: linear-gradient(180deg, #fb923c 0%, #dc2626 100%);
}

.stat-col-fill.coin-fill {
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
}

.stat-col-label {
  font-size: 11px;
  font-weight: bold;
  color: #334155;
  line-height: 1;
}

.stat-col-gain {
  font-size: 11px;
  font-weight: bold;
  color: #15803d;
  background: rgba(187, 247, 208, 0.85);
  border: 1px solid rgba(22, 163, 74, 0.45);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.3;
}

.ball-upg-btn-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.ball-bt-wrap {
  width: 100%;
}

.ball-upgrade-btn {
  width: 100%;
  border: 2px solid var(--border-color);
  background: var(--bg-retro);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.05s;
}

.ball-upgrade-btn > *,
.ball-bt-btn > * {
  pointer-events: none;
}

.ball-upgrade-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ball-upgrade-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-top-info {
  padding: 4px 6px;
  font-size: 13.5px;
  text-align: center;
  font-weight: bold;
  line-height: 1.15;
}

.btn-cost-bottom {
  border-top: 2px solid var(--border-color);
  background: var(--gray-btn);
  padding: 3px 6px;
  font-size: 14.5px;
  text-align: center;
  font-weight: bold;
}

.ball-upgrade-btn.affordable .btn-cost-bottom {
  background: var(--green-money);
}

.delete-ball-btn {
  width: 100%;
  border: 2px solid var(--border-color);
  background: var(--bg-retro);
  padding: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  margin-top: auto;
}

.delete-ball-btn:hover {
  background: #ffcccc;
}

/* Bottom Close Button */
.modal-footer {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.close-btn {
  border: 2px solid var(--border-color);
  background: var(--bg-retro);
  font-size: 22px;
  font-weight: bold;
  padding: 6px 40px;
  cursor: pointer;
}

.close-btn:hover {
  background: #fdf5e2;
}

/* ============================================================ */
/* REBIRTH CONFIRMATION MODAL                                   */
/* ============================================================ */
.rebirth-dialog-box {
  width: 90%;
  max-width: 480px;
  max-height: 92%;
  max-height: 92dvh;
  background: var(--bg-retro);
  border: 3px solid var(--border-color);
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.7);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
}

.rebirth-dialog-title {
  font-size: 28px;
  font-weight: bold;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 6px;
  flex-shrink: 0;
}

.rebirth-desc-text {
  font-size: 19px;
  line-height: 1.35;
  text-align: left;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
}

.rebirth-highlight {
  font-weight: bold;
  color: #d90429;
}

.rebirth-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
  flex-shrink: 0;
}

.rebirth-status-banner {
  padding: 5px 9px;
  border: 2px solid #000000;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  flex-shrink: 0;
}

.rebirth-status-banner.ready {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.rebirth-status-banner.locked {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

#btn-confirm-rebirth:disabled {
  background: var(--gray-btn) !important;
  color: #444444 !important;
  cursor: not-allowed;
  opacity: 0.78;
}

/* ============================================================ */
/* POWERUP UPGRADES (BB) MODAL & DISCOUNT BANNER                */
/* ============================================================ */
.bb-modal-window {
  max-width: 940px;
  height: 88%;
}

.bb-title-box {
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
}

.bb-balance-pill {
  background: #1a1507;
  color: #fde047;
  border: 2px solid #000000;
  padding: 5px 14px;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.5px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.bb-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.token-exchange-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2b0b14;
  border: 2px solid #000000;
  padding: 3px 8px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}

.token-count-pill {
  color: #fde047;
  font-size: 17px;
  white-space: nowrap;
}

.token-exchange-btn {
  background: var(--gray-btn);
  color: #000000;
  border: 2px solid #000000;
  font-family: var(--font-retro);
  font-size: 16px;
  font-weight: bold;
  padding: 2px 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, transform 0.05s;
}

.token-exchange-btn.affordable {
  background: #f59e0b;
  color: #000000;
}

.token-exchange-btn.affordable:hover {
  background: #fbbf24;
}

.token-exchange-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.token-exchange-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.money-balance-pill {
  background: linear-gradient(180deg, #1ea344 0%, #147a37 100%);
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
  border: 2px solid #000000;
  padding: 4px 11px;
  font-size: 19px;
  font-weight: bold;
  letter-spacing: 0.3px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 2px 2px 0 rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

[data-currency-tip] {
  cursor: help;
}

/* Floating All-Phases & Currency Tooltip (slightly translucent + close X button!) */
.bb-phase-tooltip {
  position: fixed;
  z-index: 2000;
  width: 310px;
  max-width: 88vw;
  max-height: 78vh;
  max-height: 78dvh;
  overflow-y: auto;
  background: rgba(18, 18, 22, 0.87);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #f8fafc;
  border: 2px solid #f59e0b;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.65);
  padding: 9px 11px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  font-family: var(--font-retro);
  font-size: 16px;
  line-height: 1.28;
}

.bb-phase-tooltip.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bb-phase-tooltip-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed rgba(250, 204, 21, 0.45);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.bb-phase-tooltip-title {
  font-size: 19px;
  font-weight: bold;
  color: #fde047;
  line-height: 1.15;
}

.tooltip-close-x {
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border: 1.5px solid #000000;
  font-family: var(--font-retro);
  font-size: 15px;
  font-weight: bold;
  width: 24px;
  height: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.tooltip-close-x:hover {
  background: #ef4444;
}

.bb-phase-row {
  padding: 3px 5px;
  margin-bottom: 3px;
  border-left: 3px solid #475569;
  color: #cbd5e1;
}

.bb-phase-row.unlocked {
  border-left-color: #2cd64e;
  color: #bbf7d0;
  background: rgba(44, 214, 78, 0.12);
}

.bb-phase-row.next-phase {
  border-left-color: #f59e0b;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.16);
}

.discount-banner {
  background: #f59e0b;
  color: #000000;
  border: 2px solid #000000;
  padding: 4px 12px;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.6);
}

.discount-banner.pirate-active {
  background: #111111;
  color: #fde047;
  border-color: #f59e0b;
  animation: pulse-rebirth 0.9s infinite;
}

.bb-modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bb-section-heading {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.6px;
  padding: 5px 10px;
  background: #e2d2b1;
  border: 2px solid #000000;
  color: #111111;
}

.bt-section-heading {
  background: linear-gradient(90deg, #3b0a18, #581224);
  color: #fde047;
  margin-top: 4px;
}

.non-upgradable-heading {
  background: linear-gradient(90deg, #1e293b, #334155);
  color: #e2e8f0;
  border-color: #0f172a;
  margin-top: 10px;
}

.bb-upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 2px;
}

.non-upgradable-card {
  background: #e9e4da;
  border: 2px dashed #475569;
  box-shadow: 2px 2px 0 rgba(15, 23, 42, 0.25);
}

.non-upgradable-card.gold-level-card {
  background: linear-gradient(145deg, #fef9c3 0%, #fef08a 100%);
  border: 2px solid #ca8a04;
  box-shadow: 3px 3px 0 rgba(161, 98, 7, 0.35);
}

.bb-nonupg-tag {
  font-size: 12px;
  font-weight: bold;
  background: #334155;
  color: #e2e8f0;
  padding: 2px 7px;
  white-space: nowrap;
}

.gold-level-card .bb-nonupg-tag {
  background: #78350f;
  color: #fde047;
}

.bb-nonupg-rarity {
  font-size: 13px;
  font-weight: bold;
  color: #475569;
  margin: 4px 0 6px;
}

.gold-level-card .bb-nonupg-rarity {
  color: #92400e;
}

.bb-nonupg-status {
  font-size: 14px;
  font-weight: bold;
  padding: 5px 8px;
  background: rgba(15, 23, 42, 0.08);
  border-left: 3px solid #475569;
  color: #1e293b;
}

.bb-nonupg-status.locked-status {
  border-left-color: #dc2626;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.1);
}

.bt-upgrade-card {
  border-color: #7f1d1d;
  background: #f8ecd9;
}

.ball-bt-btn {
  width: 100%;
  max-width: 140px;
  border: 2px solid #000000;
  background: #2b0b14;
  color: #fde047;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.05s;
}

.ball-bt-btn .btn-top-info {
  color: #fde047;
}

.ball-bt-btn .btn-cost-bottom {
  background: var(--gray-btn);
  color: #000000;
}

.ball-bt-btn.affordable .btn-cost-bottom {
  background: #f59e0b;
  color: #000000;
}

.ball-bt-btn.maxed-upg-btn .btn-cost-bottom {
  background: #2cd64e;
  color: #000000;
}

.ball-bt-btn:disabled:not(.maxed-upg-btn) {
  opacity: 0.65;
  cursor: not-allowed;
}

.bb-upgrade-card {
  background: #f3e8d2;
  border: 2px solid #000000;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.1s;
}

.bb-upgrade-card:hover {
  transform: translateY(-1px);
}

.bb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.3);
  padding-bottom: 5px;
  gap: 6px;
}

.bb-card-title {
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bb-card-lvl-tag {
  font-size: 15px;
  font-weight: bold;
  background: #000000;
  color: #fde047;
  padding: 1px 7px;
}

.bb-pips-row {
  display: flex;
  gap: 4px;
}

.bb-pip {
  flex: 1;
  height: 7px;
  background: #c7bca5;
  border: 1px solid #000000;
}

.bb-pip.filled {
  background: #2cd64e;
}

.bb-pip.filled.maxed {
  background: #f59e0b;
}

.bb-card-desc {
  font-size: 15px;
  line-height: 1.25;
  color: #222222;
}

.bb-card-next {
  font-size: 15px;
  line-height: 1.25;
  color: #111111;
  background: rgba(255, 255, 255, 0.55);
  border-left: 3px solid #f59e0b;
  padding: 4px 7px;
}

.bb-buy-btn {
  width: 100%;
  border: 2px solid #000000;
  background: var(--gray-btn);
  color: #000000;
  font-family: var(--font-retro);
  font-size: 18px;
  font-weight: bold;
  padding: 5px 8px;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
}

.bb-buy-btn.affordable {
  background: var(--green-money);
}

.bb-buy-btn.affordable:hover {
  background: #4be66a;
}

.bb-buy-btn.maxed-btn {
  background: #f59e0b;
  color: #000000;
  cursor: default;
}

.bb-buy-btn:disabled:not(.maxed-btn) {
  opacity: 0.7;
  cursor: not-allowed;
}

.ball-upgrade-btn.pirate-free .btn-cost-bottom {
  background: #f59e0b;
  color: #000000;
}

.ball-upgrade-btn.maxed-upg-btn {
  opacity: 1;
  cursor: default;
}

.ball-upgrade-btn.maxed-upg-btn .btn-cost-bottom {
  background: #f59e0b;
  color: #000000;
}

/* ============================================================ */
/* MOBILE PORTRAIT ROTATE OVERLAY                               */
/* ============================================================ */
.rotate-phone-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rotate-phone-card {
  background: var(--bg-retro);
  border: 4px solid #000000;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
  padding: 28px 22px;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rotate-phone-icon {
  font-size: 64px;
  line-height: 1;
  animation: rotatePhoneHint 2.2s ease-in-out infinite;
}

@keyframes rotatePhoneHint {
  0%, 20% { transform: rotate(0deg); }
  50%, 75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.rotate-phone-title {
  font-size: 28px;
  font-weight: bold;
  color: #000000;
  border-bottom: 2px solid #000000;
  padding-bottom: 6px;
}

.rotate-phone-desc {
  font-size: 20px;
  line-height: 1.3;
  color: #222222;
}

/* ============================================================ */
/* OFFLINE PROGRESS TOAST BANNER                                */
/* ============================================================ */
.offline-toast {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1a1a1a;
  color: #ffffff;
  border: 2px solid #000000;
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  padding: 8px 14px;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.3px;
  max-width: min(560px, calc(100% - 24px));
  width: max-content;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  z-index: 160;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

/* ============================================================ */
/* FLOATING MONEY & CLICK TEXTS                                 */
/* ============================================================ */
.floating-text-canvas {
  pointer-events: none;
}

/* ============================================================ */
/* MOBILE & TABLET REDESIGN: DARK-GLASS ARCADE SHELL + MODALS   */
/* ============================================================ */
@media (max-width: 1250px), (hover: none) and (pointer: coarse) and (max-width: 1380px) {
  .page-layout {
    padding: 0;
    gap: 0;
    max-height: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #070b14;
  }

  .desktop-sidebar,
  .dec24-event-banner {
    display: none !important;
  }

  #game-container {
    background: #090d16;
    border-color: rgba(250, 204, 21, 0.24);
    border-radius: 0;
  }

  #arena-wrapper {
    background: #060911;
  }

  header.top-bar {
    background: linear-gradient(180deg, #111827 0%, #0b1120 100%);
    border-bottom: 1.5px solid rgba(250, 204, 21, 0.34);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  }

  .top-bar-row-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Modern Mobile Currency & Utility Controls */
  .boss-token-hud {
    background: linear-gradient(180deg, #4c0519 0%, #270712 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.45);
    border-radius: 9px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.35);
  }

  .currency-hud-box {
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .currency-label {
    color: #e2e8f0;
  }

  .currency-value-bar {
    border-radius: 5px;
  }

  .retro-icon-btn {
    background: rgba(30, 41, 59, 0.94);
    color: #f8fafc;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  }

  /* Modern Dark-Glass Ball Shop Cards */
  .ball-buy-slot {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .ball-buy-slot.ball-slot-coin {
    background: rgba(250, 204, 21, 0.09);
    border-color: rgba(250, 204, 21, 0.45);
  }

  .ball-buy-slot.ball-slot-symbiot {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(192, 132, 252, 0.5);
  }

  .ball-buy-slot.ball-slot-laser {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(251, 113, 133, 0.55);
  }

  .ball-buy-slot.ball-slot-vortex {
    background: rgba(88, 28, 135, 0.22);
    border-color: rgba(168, 85, 247, 0.65);
  }

  .ball-buy-slot:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .ball-slot-tag {
    color: #e2e8f0;
  }

  .ball-price-box {
    background: rgba(15, 23, 42, 0.92);
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .ball-buy-slot.affordable {
    border-color: rgba(74, 222, 128, 0.72);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.24);
  }

  .ball-buy-slot.affordable .ball-price-box {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #052e16;
    font-weight: bold;
  }

  .ball-buy-slot.pirate-free .ball-price-box {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    color: #111827;
  }

  /* Modern Mobile Status & Action Pills */
  .status-box {
    background: rgba(30, 41, 59, 0.88);
    border: 1.5px solid rgba(148, 163, 184, 0.28);
    border-radius: 9px;
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }

  .status-sub {
    color: #94a3b8;
  }

  .status-box-val {
    color: #fde047;
  }

  .top-center-section .retro-btn {
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    text-shadow: none;
  }

  #btn-open-upgrades {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    color: #f8fafc;
    border: 1.5px solid rgba(148, 163, 184, 0.45);
  }

  #btn-open-powerup-upgrades {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    color: #111827;
    border: 1.5px solid #fde047;
  }

  #btn-rebirth-trigger {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    border: 1.5px solid rgba(252, 165, 165, 0.75);
  }

  #btn-rebirth-trigger.locked {
    background: rgba(30, 41, 59, 0.85);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.28);
  }

  #btn-open-auth {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    border: 1.5px solid rgba(125, 211, 252, 0.75);
  }

  #btn-open-auth.logged-in {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #ffffff;
    border: 1.5px solid rgba(134, 239, 172, 0.78);
  }

  .powerup-hud-badge {
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #f8fafc;
  }

  .mobile-tab-group {
    display: inline-flex !important;
    border-radius: 9px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
  }

  .mobile-action-btn {
    display: inline-flex !important;
  }

  #btn-open-leaderboard.mobile-action-btn {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    color: #fde047 !important;
    border: 1.5px solid #f59e0b !important;
    border-radius: 9px 0 0 9px;
    padding: 2px 8px;
    text-shadow: 1px 1px 0 #000;
  }

  #btn-open-battlepass.mobile-action-btn {
    background: linear-gradient(180deg, #4c1d95 0%, #2e1065 100%) !important;
    color: #fde047 !important;
    border: 1.5px solid #c084fc !important;
    border-radius: 9px 0 0 9px;
    padding: 2px 8px;
    text-shadow: 1px 1px 0 #000;
  }

  #btn-hud-lb-info.mobile-i-btn {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    border: 1.5px solid #f59e0b !important;
    border-left: none !important;
    border-radius: 0 9px 9px 0;
  }

  #btn-hud-bp-info.mobile-i-btn {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    border: 1.5px solid #c084fc !important;
    border-left: none !important;
    border-radius: 0 9px 9px 0;
  }

  .guest-retention-float {
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid rgba(245, 158, 11, 0.6);
    border-radius: 11px;
    color: #fef3c7;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  }

  /* Unified Dark-Glass Theme Across ALL Mobile Modals */
  #upgrades-modal .retro-modal-window,
  #powerup-upgrades-modal .retro-modal-window,
  #settings-modal .retro-modal-window,
  #mail-modal .retro-modal-window,
  #offline-summary-modal .retro-modal-window,
  .rebirth-dialog-box {
    background: linear-gradient(165deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
    border: 1.5px solid rgba(250, 204, 21, 0.42);
    border-radius: 16px;
    color: #f8fafc;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  #upgrades-modal .modal-title-box,
  #powerup-upgrades-modal .modal-title-box,
  #settings-modal .modal-title-box,
  #mail-modal .modal-title-box,
  #offline-summary-modal .modal-title-box {
    background: rgba(250, 204, 21, 0.14);
    border: 1.5px solid rgba(250, 204, 21, 0.45);
    border-radius: 9px;
    color: #fde047;
    box-shadow: none;
  }

  #upgrades-modal .ball-upgrade-section,
  #powerup-upgrades-modal .bb-upgrade-card,
  #powerup-upgrades-modal .non-upgradable-card,
  #settings-modal .settings-toggle-row,
  #mail-modal .mail-card,
  #offline-summary-modal .offline-sum-chip,
  .rebirth-milestones-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    color: #f8fafc;
    box-shadow: none;
  }

  #upgrades-modal .ball-card-name,
  #powerup-upgrades-modal .bb-card-title,
  #mail-modal .mail-card-title,
  .rebirth-dialog-title {
    color: #fde047;
    border-bottom-color: rgba(255, 255, 255, 0.16);
  }

  #upgrades-modal .ball-count-badge,
  #upgrades-modal .ball-card-desc,
  #upgrades-modal .stat-col-label,
  #powerup-upgrades-modal .bb-card-desc,
  #powerup-upgrades-modal .bb-card-next,
  #powerup-upgrades-modal .bb-card-phases-mini,
  #powerup-upgrades-modal .bb-nonupg-rarity,
  #powerup-upgrades-modal .bb-nonupg-status,
  #mail-modal .mail-card-body,
  #mail-modal .mail-card-meta,
  #offline-summary-modal .offline-sum-sub,
  #offline-summary-modal .offline-sum-lbl,
  .rebirth-desc-text,
  .reb-ms-item {
    color: #cbd5e1;
  }

  .rebirth-desc-text small {
    color: #94a3b8 !important;
    border-top-color: rgba(255, 255, 255, 0.18) !important;
  }

  #upgrades-modal .ball-stat-chart {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(255, 255, 255, 0.14);
  }

  #upgrades-modal .stat-col-val {
    color: #f8fafc;
  }

  #upgrades-modal .stat-col-track {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.38);
  }

  #upgrades-modal .ball-upgrade-btn,
  #upgrades-modal .ball-bt-btn {
    background: rgba(30, 41, 59, 0.92);
    border: 1.5px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    color: #f8fafc;
    overflow: hidden;
  }

  #upgrades-modal .btn-cost-bottom {
    background: rgba(15, 23, 42, 0.92);
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  #upgrades-modal .ball-upgrade-btn.affordable .btn-cost-bottom {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #052e16;
  }

  #upgrades-modal .delete-ball-btn {
    background: rgba(127, 29, 29, 0.42);
    border: 1.5px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    color: #fecaca;
  }

  #upgrades-modal .upg-mobile-indicator,
  #powerup-upgrades-modal .upg-mobile-indicator {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: #fde047;
  }

  #upgrades-modal .upg-nav-arrow,
  #powerup-upgrades-modal .upg-nav-arrow {
    background: rgba(30, 41, 59, 0.92);
    border: 1.5px solid rgba(250, 204, 21, 0.45);
    border-radius: 8px;
    color: #fde047;
  }

  #powerup-upgrades-modal .bb-section-heading {
    background: rgba(250, 204, 21, 0.14);
    border: 1.5px solid rgba(250, 204, 21, 0.35);
    border-radius: 8px;
    color: #fde047;
  }

  #powerup-upgrades-modal .bb-modal-tabs .bp-tab-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
  }

  #powerup-upgrades-modal .bb-modal-tabs .bp-tab-btn.active {
    background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
    color: #000000;
    border-color: #fde047;
  }

  #settings-modal .settings-section-title {
    color: #7dd3fc;
    border-bottom-color: rgba(125, 211, 252, 0.25);
  }

  #mail-modal .mail-card.is-unread {
    background: rgba(250, 204, 21, 0.14);
    border-color: #f59e0b;
  }

  #mail-modal .mail-empty-state {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
  }

  #upgrades-modal .close-btn,
  #powerup-upgrades-modal .close-btn,
  #settings-modal .close-btn,
  #mail-modal .close-btn,
  #offline-summary-modal .close-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.32);
    border-radius: 9px;
    font-size: 16px;
    padding: 5px 26px;
  }
}

/* Portrait Phones: Clean Modern Native Playable Layout */
@media (max-width: 900px) and (orientation: portrait) {
  .rotate-phone-overlay {
    display: none !important;
  }

  html, body {
    height: 100dvh;
    overflow: hidden;
  }

  #game-container {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-width: 0;
    box-shadow: none;
  }

  header.top-bar {
    padding: max(5px, env(safe-area-inset-top)) 7px 6px;
    gap: 5px;
    border-bottom-width: 1.5px;
  }

  .top-bar-row:first-child {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 5px;
  }

  .top-right-section {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .boss-token-hud {
    height: 34px;
    min-width: 50px;
    flex-direction: row;
    gap: 4px;
    padding: 2px 8px;
  }

  .boss-token-hud .bt-icon {
    font-size: 13px;
  }

  .boss-token-hud #hud-boss-tokens-text {
    font-size: 15px;
  }

  .boss-token-hud .bt-label {
    font-size: 10px;
  }

  .currency-hud-box {
    flex: 1;
    max-width: 224px;
    height: 34px;
    padding: 2px 4px;
    gap: 2px;
  }

  .currency-hud-row {
    height: 14px;
  }

  .currency-label {
    width: 22px;
    font-size: 12.5px;
  }

  .currency-value-bar {
    font-size: 13px;
    padding-right: 4px;
  }

  .retro-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .top-left-section {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px 4px;
    width: 100%;
  }

  .ball-buy-slot {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding-top: 2px;
  }

  .ball-dot {
    width: 11px;
    height: 11px;
    border-width: 1.5px;
  }

  .ball-slot-tag {
    font-size: 7.5px;
    letter-spacing: 0.1px;
  }

  .ball-price-box {
    height: 14px;
    font-size: 8px;
  }

  .top-bar-row-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 4px;
    min-height: 0;
  }

  .top-center-section {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    align-items: stretch;
  }

  .mobile-status-pair {
    display: contents;
  }

  .status-box {
    height: 29px;
    min-width: 0;
    padding: 1px 4px;
    font-size: 11px;
  }

  .top-center-section .status-box:nth-of-type(1) {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .top-center-section .status-box:nth-of-type(2) {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .status-sub {
    font-size: 8.5px;
  }

  .status-box-val {
    font-size: 13px;
  }

  .top-center-section > .retro-btn {
    height: 29px;
    padding: 2px 5px;
    font-size: 10.5px;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    min-width: 0;
  }

  #btn-open-upgrades {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  #btn-open-powerup-upgrades {
    grid-column: 2 / 3;
    grid-row: 2;
    font-size: 9px;
  }

  #btn-rebirth-trigger {
    grid-column: 1 / 3;
    grid-row: 3;
  }

  #btn-open-quests {
    grid-column: 3 / 5;
    grid-row: 3;
    height: 29px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .mobile-lb-group {
    grid-column: 3 / 5;
    grid-row: 1;
    height: 29px;
    min-width: 0;
  }

  .mobile-bp-group {
    grid-column: 3 / 5;
    grid-row: 2;
    height: 29px;
    min-width: 0;
  }

  #btn-open-playercard {
    grid-column: 1 / 3;
    grid-row: 4;
    height: 29px;
    min-width: 0;
    max-width: none;
    justify-content: center;
  }

  #btn-open-auth {
    grid-column: 3 / 5;
    grid-row: 4;
    height: 29px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    padding: 2px 6px;
  }

  .top-center-section > .mobile-tab-group .mobile-action-btn {
    height: 29px;
    font-size: 11px;
    justify-content: center;
  }

  #btn-open-leaderboard,
  #btn-open-battlepass {
    flex: 1;
    min-width: 0;
  }

  .mobile-i-btn {
    width: 24px !important;
    min-width: 24px !important;
    height: 29px !important;
    font-size: 12.5px !important;
  }

  .powerups-hud-bar {
    min-height: 0;
    gap: 4px;
    flex-wrap: wrap;
  }

  .retro-modal-window {
    width: 96%;
    height: auto;
    max-height: 92dvh;
    padding: 12px;
  }

  .modal-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 10px;
  }

  .modal-title-box {
    font-size: 18px;
    padding: 4px 10px;
    text-align: center;
  }

  .bb-header-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    width: 100%;
  }

  .upgrades-content-grid,
  .bb-upgrades-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 10px;
  }

  #upgrades-modal .retro-modal-window {
    overflow: hidden;
  }

  .ball-upgrade-section {
    padding: 9px;
    gap: 7px;
    height: auto;
    min-height: 0;
  }

  .ball-upg-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .ball-stat-chart {
    padding: 6px;
  }

  .stat-col-track {
    height: 44px;
  }

  .rebirth-dialog-box {
    width: 94%;
    max-height: 92dvh;
    padding: 12px 14px;
    gap: 10px;
  }
}

/* ============================================================ */
/* MOBILE LANDSCAPE: SLEEK COMPACT BAR & MODAL FIT              */
/* ============================================================ */
@media (max-width: 980px) and (orientation: landscape), (max-height: 540px) and (orientation: landscape) {
  html, body {
    height: 100dvh;
    overflow: hidden;
  }

  #game-container {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-width: 0;
    box-shadow: none;
  }

  header.top-bar {
    padding: 4px 7px;
    gap: 4px;
    border-bottom-width: 1.5px;
  }

  .top-bar-row {
    gap: 5px;
  }

  .top-bar-row-actions {
    padding-top: 4px;
    min-height: 30px;
  }

  .top-left-section {
    gap: 3px;
    flex-wrap: nowrap;
  }

  .ball-buy-slot {
    width: 39px;
    height: 43px;
    padding-top: 2px;
  }

  .ball-dot {
    width: 15px;
    height: 15px;
  }

  .ball-slot-tag {
    font-size: 8.5px;
  }

  .ball-price-box {
    height: 14px;
    font-size: 9.5px;
  }

  .boss-token-hud {
    height: 43px;
    min-width: 44px;
    padding: 1px 6px;
  }

  .boss-token-hud .bt-icon {
    font-size: 12px;
  }

  .boss-token-hud #hud-boss-tokens-text {
    font-size: 14px;
  }

  .boss-token-hud .bt-label {
    font-size: 9px;
  }

  .currency-hud-box {
    width: 124px;
    height: 43px;
  }

  .currency-hud-row {
    height: 17px;
  }

  .currency-label {
    width: 22px;
    font-size: 12.5px;
  }

  .currency-value-bar {
    font-size: 13.5px;
    padding-right: 4px;
  }

  .retro-icon-btn {
    width: 30px;
    height: 43px;
    font-size: 14px;
  }

  .top-center-section {
    gap: 4px;
    flex-wrap: wrap;
  }

  .status-box {
    min-width: 42px;
    height: 29px;
    padding: 1px 5px;
    font-size: 11px;
  }

  .status-sub {
    font-size: 9px;
  }

  .status-box-val {
    font-size: 13.5px;
  }

  .retro-btn {
    height: 29px;
    padding: 2px 6px;
    font-size: 11px;
  }

  #btn-open-auth {
    min-width: max-content;
    padding: 2px 8px;
  }

  .mobile-i-btn {
    width: 18px !important;
    min-width: 18px !important;
    padding: 0 2px !important;
    font-size: 13px !important;
  }

  .powerups-hud-bar {
    min-height: 28px;
    gap: 4px;
  }

  .powerup-hud-badge {
    min-width: 28px;
    height: 28px;
    font-size: 12.5px;
  }

  .powerup-mini-tag {
    font-size: 9px;
  }

  .retro-modal-window,
  .bb-modal-window {
    width: 96%;
    height: 94%;
    padding: 8px 12px;
  }

  .modal-header-row {
    margin-bottom: 6px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .modal-title-box {
    font-size: 17px;
    padding: 3px 9px;
  }

  .money-balance-pill,
  .bb-balance-pill,
  .token-count-pill,
  .token-exchange-btn {
    font-size: 13.5px;
    padding: 2px 7px;
  }

  .bb-phase-tooltip {
    width: 248px;
    max-width: 58vw;
    max-height: 68%;
    max-height: 68dvh;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.18;
    background: rgba(18, 18, 22, 0.9);
  }

  .bb-phase-tooltip-title {
    font-size: 15px;
  }

  .bb-phase-row {
    padding: 2px 4px;
    margin-bottom: 2px;
  }

  .tooltip-close-x {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .bb-upgrades-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
  }

  #powerup-upgrades-modal .bb-modal-window.has-bb-carousel,
  #powerup-upgrades-modal .bb-modal-window.has-bb-carousel .bb-modal-scroll {
    overflow: hidden;
  }

  .bb-modal-window.has-bb-carousel .modal-header-row {
    margin-bottom: 4px;
    gap: 4px;
  }

  .bb-modal-window.has-bb-carousel .bb-modal-tabs {
    margin-bottom: 4px;
  }

  .bb-upgrades-grid.mobile-carousel-mode {
    grid-template-columns: 1fr !important;
    display: flex !important;
    justify-content: center;
    align-items: stretch;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-upgrade-card {
    width: 100%;
    max-width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-card-main-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-card-action-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    min-width: 0;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-card-title {
    font-size: 14.5px;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-card-desc,
  .bb-upgrades-grid.mobile-carousel-mode .bb-card-next {
    font-size: 12px;
    line-height: 1.2;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-card-phases-mini {
    font-size: 11px;
    line-height: 1.18;
    max-height: 82px;
    overflow-y: auto;
  }

  #upgrades-modal .retro-modal-window {
    overflow: hidden;
  }

  .upgrades-mobile-nav {
    margin-bottom: 4px;
    gap: 6px;
  }

  .upg-nav-arrow {
    height: 28px;
    min-width: 38px;
    font-size: 15px;
  }

  .upg-mobile-indicator {
    height: 28px;
    font-size: 13px;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-upgrade-section {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-card-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-card-actions-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-card-head {
    min-height: 0;
    gap: 4px;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-card-name {
    font-size: 14px;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-card-desc {
    display: none;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-stat-chart {
    padding: 4px 6px;
  }

  .upgrades-content-grid.mobile-carousel-mode .stat-col-track {
    height: 24px;
  }

  .upgrades-content-grid.mobile-carousel-mode .stat-col-val,
  .upgrades-content-grid.mobile-carousel-mode .stat-col-label,
  .upgrades-content-grid.mobile-carousel-mode .stat-col-gain {
    font-size: 11px;
    line-height: 1.05;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-upg-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .upgrades-content-grid.mobile-carousel-mode .ball-upgrade-btn,
  .upgrades-content-grid.mobile-carousel-mode .ball-bt-btn {
    padding: 3px 5px;
    font-size: 12px;
    min-height: 0;
  }

  .upgrades-content-grid.mobile-carousel-mode .btn-top-info {
    font-size: 10.5px;
  }

  .upgrades-content-grid.mobile-carousel-mode .btn-cost-bottom {
    font-size: 13px;
  }

  .upgrades-content-grid.mobile-carousel-mode .delete-ball-btn {
    padding: 3px 6px;
    font-size: 12px;
    margin-top: 0;
  }

  .bb-upgrade-card {
    padding: 7px 9px;
    gap: 5px;
  }

  .bb-card-title {
    font-size: 16px;
  }

  .bb-card-desc,
  .bb-card-next {
    font-size: 13px;
  }

  .bb-buy-btn {
    font-size: 15px;
    padding: 3px 6px;
  }

  .close-btn {
    font-size: 16px;
    padding: 4px 24px;
  }

  .offline-toast {
    top: 12px;
    font-size: 15px;
    padding: 5px 12px;
  }

  .rebirth-dialog-box {
    width: 92%;
    max-width: 560px;
    max-height: 92%;
    max-height: 92dvh;
    padding: 10px 14px;
    gap: 8px;
  }

  .rebirth-dialog-title {
    font-size: 20px;
    padding-bottom: 4px;
  }

  .rebirth-status-banner {
    font-size: 13.5px;
    padding: 3px 7px;
  }

  .rebirth-desc-text {
    font-size: 15px;
    line-height: 1.2;
  }

  .rebirth-actions-row {
    margin-top: 2px;
    gap: 10px;
  }

  .rebirth-actions-row .retro-btn {
    height: 34px;
    font-size: 16px;
  }

  .dev-modal-header {
    padding: 5px 10px;
    gap: 6px;
  }

  .dev-panel-body {
    padding: 5px 8px;
    gap: 5px;
  }

  .dev-toolbar-row {
    gap: 4px;
  }

  .dev-modal-window .bp-tab-btn {
    min-height: 24px;
    font-size: 11.5px;
    padding: 2px 6px;
  }

  .dev-quick-actions {
    gap: 4px;
  }

  .dev-tool-btn {
    height: 24px;
    font-size: 11.5px;
    padding: 0 6px;
  }

  .dev-add-bar {
    padding: 4px 6px;
    gap: 4px;
  }

  .dev-modal-footer {
    padding: 4px 10px;
  }

  .bb-modal-tabs .bp-tab-btn {
    font-size: 12px;
    padding: 3px 6px;
  }
}

@media (max-width: 780px) and (orientation: landscape) {
  .top-left-section {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 3px;
  }

  .top-left-section::-webkit-scrollbar {
    display: none;
  }

  .ball-buy-slot {
    width: 39px;
    min-width: 39px;
    flex-shrink: 0;
  }

  .top-center-section {
    flex: 1;
    min-width: 0;
    gap: 3px;
  }
}

/* ============================================================ */
/* DEDICATED MOBILE LEADERBOARD & BATTLE PASS SHEET DESIGN      */
/* ============================================================ */
.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px;
}

#welcome-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(15, 12, 8, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 12px;
}

.retro-modal-window.welcome-menu-window {
  width: 96%;
  max-width: 440px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-header {
  text-align: center;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.25);
  padding-bottom: 10px;
}

.welcome-title {
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 0.8px;
  color: #1c1917;
  line-height: 1.1;
}

.welcome-subtitle {
  margin-top: 5px;
  font-size: 14px;
  color: #44403c;
  line-height: 1.3;
}

.welcome-guest-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.welcome-label {
  font-size: 14px;
  font-weight: bold;
  color: #1c1917;
}

.welcome-name-input {
  font-size: 16px;
  padding: 8px 10px;
}

.welcome-start-btn {
  background: #22c55e;
  color: #052e16;
  font-size: 17px;
  font-weight: bold;
  padding: 9px 12px;
  margin-top: 2px;
}

.welcome-start-btn:hover {
  background: #4ade80;
}

.welcome-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: bold;
  color: #57534e;
  text-align: center;
}

.welcome-divider::before,
.welcome-divider::after {
  content: "";
  flex: 1;
  border-top: 1.5px dashed rgba(0, 0, 0, 0.28);
}

.welcome-auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.welcome-login-btn {
  background: #38bdf8;
  color: #082f49;
  font-size: 15px;
  font-weight: bold;
  padding: 8px 10px;
}

.welcome-login-btn:hover {
  background: #7dd3fc;
}

.welcome-register-btn {
  background: #fbbf24;
  color: #451a03;
  font-size: 15px;
  font-weight: bold;
  padding: 8px 10px;
}

.welcome-register-btn:hover {
  background: #fde047;
}

.welcome-footer-note {
  font-size: 12.5px;
  color: #57534e;
  text-align: center;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.45);
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 6px 8px;
}

#auth-modal,
#premium-checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 170;
}

.retro-modal-window.mobile-sheet-window {
  width: 97%;
  max-width: 920px;
  height: 92dvh;
  max-height: 92dvh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 2px solid rgba(250, 204, 21, 0.45);
  background: linear-gradient(165deg, #131722 0%, #1c1917 55%, #0f172a 100%);
  color: #f8fafc;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.retro-modal-window.mobile-bp-sheet {
  border-color: rgba(192, 132, 252, 0.5);
  background: linear-gradient(165deg, #1b122b 0%, #161522 55%, #0f172a 100%);
}

/* Top Sheet Header */
.mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.mobile-sheet-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-sheet-title {
  font-size: 21px;
  font-weight: bold;
  color: #fde047;
  letter-spacing: 0.7px;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.mobile-sheet-header .lb-conn-status {
  margin-top: 0;
}

.mobile-bp-season-pill {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(216, 180, 254, 0.45);
  color: #e9d5ff;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.mobile-sheet-actions {
  gap: 6px;
}

.mobile-switch-pill {
  border-radius: 999px;
  padding: 3px 10px;
  height: 28px;
  font-family: var(--font-retro);
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: transform 0.08s ease, filter 0.14s ease;
}

.mobile-switch-pill:hover {
  filter: brightness(1.12);
}

.mobile-switch-pill:active {
  transform: scale(0.97);
}

.mobile-switch-pill.bp-pill {
  background: linear-gradient(180deg, rgba(109, 40, 217, 0.85), rgba(76, 29, 149, 0.9));
  border: 1.5px solid #c084fc;
  color: #fef08a;
}

.mobile-switch-pill.lb-pill {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.85), rgba(146, 64, 14, 0.9));
  border: 1.5px solid #facc15;
  color: #ffffff;
}

.mobile-sheet-i-btn,
.mobile-sheet-x-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border-width: 1.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Main Body (Portrait Stacked Default) */
.mobile-sheet-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  overflow: hidden;
}

.mobile-sheet-aside {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-sheet-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  overflow: hidden;
}

/* Left Cards Dark Glass Override */
.mobile-sheet-window .mobile-profile-card,
.mobile-sheet-window .mobile-bp-progress-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  margin: 0;
  padding: 8px 9px;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mobile-sheet-window .profile-label,
.mobile-sheet-window .bp-stage-indicator {
  color: #e2e8f0;
}

.mobile-sheet-window .highlight-stage {
  color: #fde047;
}

.mobile-sheet-window .player-name-input {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  height: 30px;
}

.mobile-sheet-window .player-name-input:focus {
  background: rgba(15, 23, 42, 0.98);
  border-color: #fde047;
}

.mobile-sheet-window .player-profile-locked-row {
  background: rgba(22, 163, 74, 0.18);
  border: 1.5px solid rgba(74, 222, 128, 0.55);
}

.mobile-sheet-window .player-locked-name {
  color: #86efac;
}

.mobile-sheet-window .mini-save-btn {
  height: 30px;
  background: #22c55e;
  color: #000000;
}

.mobile-sheet-window .mobile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0;
}

.mobile-stat-chip {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 4px;
  text-align: center;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  gap: 2px;
}

.mobile-stat-chip strong {
  font-size: 14px;
  color: #fde047;
}

.mobile-sheet-window .mobile-auth-pill {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  border-radius: 8px;
  padding: 5px 6px;
}

.mobile-sheet-window .mobile-auth-pill.logged-in {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(74, 222, 128, 0.6);
  color: #86efac;
}

.mobile-dec24-mini-card {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.72), rgba(69, 26, 3, 0.72));
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: 10px;
  padding: 5px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-dec24-top {
  font-size: 12.5px;
  color: #fde047;
}

.mobile-dec24-top strong {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.mobile-dec24-sub {
  font-size: 11.5px;
  color: #fef3c7;
  line-height: 1.15;
}

/* Mobile Battle Pass Controls Dark Theme */
.mobile-sheet-window .mobile-bp-tab-row {
  gap: 6px;
}

.mobile-sheet-window .bp-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  min-height: 30px;
  font-size: 12.5px;
}

.mobile-sheet-window .bp-tab-btn.active {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
  color: #000000;
  border-color: #fde047;
}

.mobile-sheet-window .mobile-bp-premium-btn {
  height: 32px;
  font-size: 13.5px;
}

/* Right Main Pane: Leaderboard Rows */
.mobile-sheet-window .mobile-lb-table-header {
  grid-template-columns: 34px minmax(0, 1fr) 38px 44px;
  background: rgba(255, 255, 255, 0.08);
  color: #fde047;
  border: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  padding: 6px 8px;
  font-size: 13px;
}

.mobile-sheet-window .mobile-lb-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 7px 8px;
  gap: 5px;
}

.mobile-sheet-window .leaderboard-row {
  grid-template-columns: 34px minmax(0, 1fr) 38px 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 14.5px;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: 10px;
}

.mobile-sheet-window .leaderboard-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.mobile-sheet-window .leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.11);
}

.mobile-sheet-window .leaderboard-row .col-reb {
  color: #fde047;
}

.mobile-sheet-window .leaderboard-row .col-lvl {
  color: #7dd3fc;
}

.mobile-sheet-window .leaderboard-row .lb-last-seen {
  color: #94a3b8;
}

.mobile-sheet-window .leaderboard-row .lb-last-seen.is-online {
  color: #4ade80;
}

.mobile-sheet-window .leaderboard-row.rank-top1 {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.24), rgba(234, 179, 8, 0.12)) !important;
  border-color: rgba(250, 204, 21, 0.68);
}

.mobile-sheet-window .leaderboard-row.rank-top2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.24), rgba(100, 116, 139, 0.12)) !important;
  border-color: rgba(203, 213, 225, 0.55);
}

.mobile-sheet-window .leaderboard-row.rank-top3 {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.24), rgba(194, 65, 12, 0.12)) !important;
  border-color: rgba(251, 146, 60, 0.55);
}

.mobile-sheet-window .leaderboard-row.player-row-me {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.28), rgba(22, 163, 74, 0.14)) !important;
  border: 1.5px solid #4ade80 !important;
  color: #ffffff;
}

.mobile-sheet-window .leaderboard-empty-hint {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}

/* Right Main Pane: Battle Pass Stages & Armory */
.mobile-sheet-window .mobile-bp-stages-scroll,
.mobile-sheet-window .mobile-bp-armory-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  gap: 8px;
}

.mobile-sheet-window .bp-stage-card,
.mobile-sheet-window .armory-ball-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  min-width: 0;
  max-width: 100%;
}

.mobile-sheet-window .bp-stage-card.stage-reached {
  border-color: #22c55e;
  background: rgba(22, 163, 74, 0.15);
}

.mobile-sheet-window .bp-card-top-row,
.mobile-sheet-window .armory-ball-header {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: #fde047;
}

.mobile-sheet-window .bp-card-top-row span {
  color: #94a3b8 !important;
}

.mobile-sheet-window .bp-track-row {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.mobile-sheet-window .bp-track-row.premium-row {
  background: rgba(120, 53, 15, 0.3);
  border-color: rgba(250, 204, 21, 0.35);
}

.mobile-sheet-window .bp-track-row.empty-free-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.mobile-sheet-window .reward-tag,
.mobile-sheet-window .bp-empty-text {
  color: #94a3b8;
}

.mobile-sheet-window .badge-claimed {
  color: #4ade80;
}

.mobile-sheet-window .badge-locked {
  color: #fca5a5;
}

.mobile-sheet-window .bp-progress-bar-wrap {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(250, 204, 21, 0.42);
}

.mobile-sheet-window .btn-claim-reward {
  min-height: 28px;
  padding: 3px 10px;
}

.mobile-sheet-window .btn-claim-reward:disabled {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.18);
}

.mobile-sheet-window .mobile-bp-armory-scroll > div:not(.armory-ball-card) {
  color: #cbd5e1 !important;
  width: 100%;
  flex: 0 0 auto;
}

.mobile-sheet-window .armory-select {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-color: rgba(192, 132, 252, 0.5);
  min-height: 30px;
  font-size: 14px;
}

/* Sheet Footer */
.mobile-sheet-footer {
  margin-top: 0;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-footer-hint {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.15;
}

.mobile-close-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 3px 16px;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.mobile-close-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* 2-Column Split & 2-Column Cards in Mobile Landscape */
@media (min-width: 620px) and (orientation: landscape), (min-width: 720px) {
  .mobile-sheet-body {
    display: grid;
    grid-template-columns: 248px 1fr;
    gap: 10px;
    padding: 9px 12px;
  }

  .mobile-sheet-aside {
    min-height: 0;
    overflow-y: auto;
  }

  .mobile-sheet-window .mobile-bp-stages-scroll,
  .mobile-sheet-window .mobile-bp-armory-scroll {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
  }

  .mobile-sheet-window .mobile-bp-armory-scroll > div:not(.armory-ball-card) {
    flex: 0 0 100%;
  }

  .mobile-sheet-window .bp-stage-card,
  .mobile-sheet-window .armory-ball-card {
    flex: 1 1 calc(50% - 4px);
    min-width: 220px;
  }
}

@media (max-width: 619px) {
  .mobile-sheet-header {
    padding: 7px 9px;
    gap: 5px;
  }

  .mobile-sheet-header .lb-conn-status {
    font-size: 10px;
    padding: 1px 6px;
  }

  .mobile-footer-hint {
    display: none;
  }

  .mobile-sheet-footer {
    justify-content: center;
  }

  .mobile-close-btn {
    width: 100%;
  }

  .mobile-switch-pill {
    font-size: 12.5px;
    padding: 2px 8px;
  }

  .mobile-sheet-title {
    font-size: 18px;
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  .retro-modal-window.mobile-sheet-window {
    height: 95dvh;
    max-height: 95dvh;
  }

  .mobile-sheet-header {
    padding: 5px 10px;
    gap: 6px;
  }

  .mobile-sheet-title {
    font-size: 18px;
  }

  .mobile-sheet-body {
    padding: 6px 10px;
    gap: 8px;
  }

  .mobile-sheet-window .mobile-profile-card,
  .mobile-sheet-window .mobile-bp-progress-card {
    padding: 6px 8px;
    gap: 4px;
  }

  .mobile-dec24-mini-card {
    padding: 4px 7px;
  }

  .mobile-dec24-sub {
    font-size: 10.5px;
  }

  .mobile-sheet-footer {
    padding: 4px 10px;
  }

  .mobile-close-btn {
    padding: 2px 14px;
    font-size: 14px;
  }
}

/* ============================================================ */
/* ZERO-SCROLL AUTH / CLOUD LOGIN & ACCOUNT MANAGEMENT MODAL    */
/* ============================================================ */
.retro-modal-window.auth-modal-window {
  width: 96%;
  max-width: 780px;
  height: auto;
  max-height: 95dvh;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-modal-window .auth-modal-header {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.auth-modal-window .auth-modal-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 0;
}

@media (min-width: 620px) {
  .auth-modal-window .auth-modal-scroll {
    display: grid;
    grid-template-columns: 1.38fr 0.82fr;
    gap: 10px;
    align-items: stretch;
  }
}

.auth-main-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.auth-modal-window .auth-panel-section {
  gap: 6px;
}

.auth-fields-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-modal-window .auth-form {
  padding: 8px 10px;
  gap: 6px;
}

.auth-modal-window .auth-field-group {
  font-size: 14.5px;
  gap: 2px;
  min-width: 0;
}

.auth-modal-window .auth-input {
  height: 30px;
  font-size: 15px;
  padding: 2px 7px;
}

.auth-modal-window .auth-submit-btn {
  height: 32px;
  font-size: 16px;
  margin-top: 2px;
}

.auth-modal-window .auth-hint-text {
  font-size: 12px;
  line-height: 1.15;
}

.auth-modal-window .auth-status-card {
  padding: 7px 9px;
  gap: 3px;
  font-size: 14px;
}

.auth-modal-window .auth-status-header {
  font-size: 16px;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

.auth-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
}

.auth-status-span2 {
  grid-column: 1 / -1;
  word-break: break-word;
}

.auth-modal-window .auth-action-btn {
  height: 32px;
  font-size: 14.5px;
  padding: 2px 6px;
}

.auth-modal-window .auth-action-btn:disabled,
.auth-modal-window .auth-submit-btn:disabled,
.auth-modal-window .auth-delete-confirm-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-modal-window .auth-delete-confirm-box {
  padding: 8px 9px;
  gap: 5px;
}

.auth-modal-window .auth-delete-title {
  font-size: 16px;
}

.auth-modal-window .auth-delete-desc {
  font-size: 12.5px;
  line-height: 1.15;
}

.auth-modal-window .auth-backup-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
}

.auth-backup-sub {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.2;
}

.auth-backup-btns {
  display: flex;
  gap: 6px;
}

.auth-modal-window .auth-mini-btn {
  flex: 1;
  height: 30px !important;
  font-size: 13.5px !important;
  padding: 0 6px !important;
}

.auth-modal-window .auth-modal-footer {
  margin-top: 8px;
  flex-shrink: 0;
}

.auth-modal-window .auth-modal-footer .close-btn {
  padding: 3px 28px;
  font-size: 17px;
}

/* Dedicated Mobile Dark-Glass Style for Auth / Account Sheet */
@media (max-width: 1250px), (hover: none) and (pointer: coarse) and (max-width: 1380px) {
  .retro-modal-window.auth-modal-window {
    background: linear-gradient(165deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
    border: 2px solid rgba(56, 189, 248, 0.55);
    border-radius: 16px;
    color: #f8fafc;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    padding: 9px 12px;
  }

  .auth-modal-window .modal-title-box {
    background: rgba(56, 189, 248, 0.16);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 8px;
    color: #bae6fd;
    font-size: 17px;
    padding: 2px 10px;
  }

  .auth-modal-window .retro-modal-x-btn {
    border-radius: 8px;
  }

  .auth-modal-window .bp-tab-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-height: 28px;
    font-size: 13px;
  }

  .auth-modal-window .bp-tab-btn.active {
    background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 100%);
    color: #000000;
    border-color: #7dd3fc;
  }

  .auth-modal-window .auth-form,
  .auth-modal-window .auth-backup-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 11px;
  }

  .auth-modal-window .auth-input {
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 7px;
  }

  .auth-modal-window .auth-input:focus {
    background: #0f172a;
    border-color: #fde047;
  }

  .auth-modal-window .auth-hint-text,
  .auth-modal-window .auth-backup-sub {
    color: #94a3b8;
  }

  .auth-modal-window .auth-backup-title {
    color: #fde047;
  }

  .auth-modal-window .auth-status-card {
    background: rgba(22, 163, 74, 0.16);
    border: 1.5px solid rgba(74, 222, 128, 0.5);
    border-radius: 11px;
    color: #e2e8f0;
  }

  .auth-modal-window .auth-status-header {
    color: #4ade80;
    border-bottom-color: rgba(74, 222, 128, 0.35);
  }

  .auth-modal-window .auth-delete-confirm-box {
    background: rgba(127, 29, 29, 0.35);
    border: 1.5px solid #ef4444;
    border-radius: 11px;
  }

  .auth-modal-window .auth-delete-title {
    color: #fca5a5;
  }

  .auth-modal-window .auth-delete-desc {
    color: #fee2e2;
  }

  .auth-modal-window .auth-modal-footer .close-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    font-size: 15px;
    padding: 3px 20px;
  }
}

/* Compact Short Landscape: Guarantee ZERO scroll even at 360-390px height */
@media (max-height: 450px) and (orientation: landscape) {
  .retro-modal-window.auth-modal-window {
    padding: 7px 11px;
    max-height: 96dvh;
  }

  .auth-modal-window .auth-modal-header {
    margin-bottom: 5px;
  }

  .auth-modal-window .auth-modal-scroll {
    gap: 8px;
  }

  .auth-modal-window .auth-form,
  .auth-modal-window .auth-backup-box {
    padding: 6px 8px;
    gap: 4px;
  }

  .auth-modal-window .auth-field-group {
    font-size: 13px;
  }

  .auth-modal-window .auth-input {
    height: 27px;
    font-size: 13.5px;
  }

  .auth-modal-window .auth-submit-btn,
  .auth-modal-window .auth-action-btn,
  .auth-modal-window .auth-mini-btn {
    height: 28px !important;
    font-size: 13.5px !important;
  }

  .auth-modal-window .auth-hint-text,
  .auth-modal-window .auth-backup-sub {
    font-size: 11px;
  }

  .auth-modal-window .auth-modal-footer {
    margin-top: 5px;
  }

  /* When delete confirm is opened on short landscape, replace status+buttons in-place so zero scroll happens */
  .auth-modal-window #auth-logged-in-view:has(#auth-delete-confirm-box[style*="flex"]) .auth-status-card,
  .auth-modal-window #auth-logged-in-view:has(#auth-delete-confirm-box[style*="flex"]) > .auth-actions-grid {
    display: none;
  }
}

@media (max-width: 619px) {
  .auth-modal-window .auth-modal-footer .close-btn {
    width: 100%;
  }
}

/* ============================================================ */
/* DEVELOPER LEADERBOARD CONTROL PANEL                          */
/* ============================================================ */
.leaderboard-sidebar .sidebar-header {
  position: relative;
}

.dev-trigger-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fde047;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.08s ease;
}

.dev-trigger-btn:hover,
.dev-trigger-btn:focus-visible {
  opacity: 1;
  background: rgba(250, 204, 21, 0.22);
  border-color: rgba(250, 204, 21, 0.65);
}

.dev-trigger-btn.mobile-dev-btn {
  position: static;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  opacity: 0.72;
}

.dev-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 185;
  background: rgba(6, 9, 16, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px;
}

.retro-modal-window.dev-modal-window {
  width: 97%;
  max-width: 860px;
  height: auto;
  max-height: calc(100dvh - 16px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.62);
  background: linear-gradient(165deg, #0f172a 0%, #171717 55%, #090d16 100%);
  color: #f8fafc;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dev-sync-pill {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #86efac;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.dev-lock-pill {
  background: rgba(239, 68, 68, 0.2);
  border: 1.5px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

/* Lock Screen Gate */
.dev-auth-gate {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.dev-lock-card {
  width: 100%;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(250, 204, 21, 0.38);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dev-lock-icon {
  font-size: 36px;
  line-height: 1;
}

.dev-lock-title {
  font-size: 20px;
  font-weight: bold;
  color: #fde047;
  letter-spacing: 0.7px;
}

.dev-lock-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.25;
}

.dev-pin-form {
  display: flex;
  gap: 6px;
}

.dev-pin-form .auth-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  border: 1.5px solid rgba(250, 204, 21, 0.5);
  border-radius: 8px;
  height: 34px;
}

.dev-unlock-btn {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%) !important;
  color: #000000 !important;
  border-radius: 8px;
  height: 34px;
  font-size: 15px;
  padding: 0 12px;
}

.dev-lock-hint {
  font-size: 12px;
  color: #94a3b8;
}

.dev-lock-hint code {
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  color: #fde047;
}

/* Unlocked Body */
.dev-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  overflow: hidden;
}

.dev-toolbar-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex-shrink: 0;
}

.dev-tabs-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.dev-modal-window .bp-tab-btn {
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  min-height: 30px;
  font-size: 13.5px;
}

.dev-modal-window .bp-tab-btn.active {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
  color: #000000;
  border-color: #fde047;
}

.dev-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.dev-tool-btn {
  flex: 1 1 auto;
  min-width: max-content;
  white-space: nowrap;
  height: 29px;
  font-size: 12.5px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.dev-tool-btn.sync-accent {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border-color: #7dd3fc;
}

.dev-tool-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.dev-actions-divider {
  color: rgba(255, 255, 255, 0.28);
  align-self: center;
  font-weight: bold;
  user-select: none;
  padding: 0 2px;
}

@media (max-width: 619px) {
  .dev-actions-divider {
    display: none;
  }
}

.dev-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.dev-add-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px 8px;
  flex-shrink: 0;
}

.dev-add-label {
  font-size: 13px;
  font-weight: bold;
  color: #fde047;
}

.dev-modal-window .auth-input {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  height: 28px;
  font-size: 14px;
  padding: 2px 7px;
}

.dev-sm-input {
  flex: 1;
  min-width: 110px;
}

.dev-num-input {
  width: 68px !important;
  flex: 0 0 68px;
}

.dev-money-input {
  width: 112px !important;
  flex: 0 0 112px;
}

.dev-add-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: 7px;
  background: #22c55e;
  color: #000000;
}

.dev-ban-add-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: 7px;
  background: #ef4444;
  color: #ffffff;
}

/* Inline Edit Drawer */
.dev-edit-drawer {
  background: rgba(56, 189, 248, 0.14);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: 10px;
  padding: 7px 10px;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.dev-edit-title {
  font-size: 14px;
  color: #bae6fd;
}

.dev-edit-fields {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.dev-edit-currency-row {
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.22);
}

.dev-edit-actions-row {
  justify-content: flex-end;
}

.dev-edit-fields label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dev-save-edit-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 13.5px;
  background: #22c55e;
  color: #000;
  border-radius: 7px;
}

.dev-cancel-edit-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 7px;
}

/* Player Moderation Mini-Cards Grid */
.dev-players-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  gap: 9px;
  align-content: start;
  padding-right: 3px;
}

.dev-rules-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 3px;
}

.dev-player-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  padding: 9px 10px;
}

.dev-player-card.is-filtered {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(248, 113, 113, 0.38);
}

.dev-pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
}

.dev-pc-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.dev-pc-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.dev-stat-chip {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dev-stat-lbl {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-stat-val {
  font-size: 13px;
  font-weight: bold;
  color: #f8fafc;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-stat-chip.chip-money .dev-stat-val { color: #4ade80; }
.dev-stat-chip.chip-bb .dev-stat-val { color: #fde047; }
.dev-stat-chip.chip-bt .dev-stat-val { color: #fbbf24; }
.dev-stat-chip.chip-reb .dev-stat-val { color: #c084fc; }
.dev-stat-chip.chip-lvl .dev-stat-val { color: #38bdf8; }
.dev-stat-chip.chip-brk .dev-stat-val { color: #a5f3fc; }

.dev-stat-chip.is-editable {
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, transform 0.1s;
  position: relative;
}

.dev-stat-chip.is-editable:hover {
  border-color: rgba(250, 204, 21, 0.6);
  background: rgba(30, 41, 59, 0.85);
}

.dev-stat-chip.is-editable .dev-stat-lbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.dev-stat-chip.is-editable .dev-stat-lbl::after {
  content: '✎';
  font-size: 9.5px;
  opacity: 0.42;
  transition: opacity 0.14s;
}

.dev-stat-chip.is-editable:hover .dev-stat-lbl::after {
  opacity: 1;
  color: #fde047;
}

.dev-stat-chip.is-editing {
  border-color: #facc15;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.3);
}

.dev-pc-name-editable {
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
  padding-bottom: 1px;
  transition: color 0.14s, border-color 0.14s;
}

.dev-pc-name-editable:hover {
  color: #fde047;
  border-bottom-color: #fde047;
}

.dev-inline-edit-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  margin-top: 1px;
}

.dev-inline-edit-wrap.is-name-edit {
  display: inline-flex;
  width: 145px;
  max-width: 100%;
  margin-top: 0;
}

.dev-inline-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 22px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(250, 204, 21, 0.65);
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--font-retro);
  font-size: 12.5px;
  font-weight: bold;
  outline: none;
}

.dev-inline-btn {
  flex: 0 0 auto;
  width: 20px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.dev-inline-btn.ok {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(74, 222, 128, 0.55);
  color: #86efac;
}

.dev-inline-btn.ok:hover {
  background: rgba(34, 197, 94, 0.45);
}

.dev-inline-btn.cancel {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.dev-inline-btn.cancel:hover {
  background: rgba(239, 68, 68, 0.38);
}

.dev-pc-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #94a3b8;
  word-break: break-all;
}

.dev-pc-id code {
  color: #cbd5e1;
}

.dev-src-tag,
.dev-vis-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: bold;
}

.src-te { background: #16a34a; color: #fff; }
.src-cloud { background: rgba(56, 189, 248, 0.25); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.45); }
.src-mqtt { background: rgba(168, 85, 247, 0.25); color: #e9d5ff; border: 1px solid rgba(192, 132, 252, 0.45); }
.src-custom { background: rgba(245, 158, 11, 0.25); color: #fde047; border: 1px solid rgba(250, 204, 21, 0.45); }

.vis-shown { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.vis-hidden { background: rgba(239, 68, 68, 0.24); color: #fca5a5; }

.dev-pc-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  flex-wrap: wrap;
}

.dev-act-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-family: var(--font-retro);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.dev-act-btn:hover { filter: brightness(1.18); }
.dev-act-btn.act-wl-on { background: rgba(34, 197, 94, 0.28); border-color: #4ade80; color: #bbf7d0; }
.dev-act-btn.act-ban { background: rgba(239, 68, 68, 0.25); border-color: rgba(248, 113, 113, 0.55); color: #fecaca; }
.dev-act-btn.act-unban { background: rgba(56, 189, 248, 0.28); border-color: #38bdf8; color: #e0f2fe; }
.dev-act-btn.act-del { background: rgba(127, 29, 29, 0.55); border-color: #ef4444; color: #fecaca; }

/* Rules & Lists Tab */
.dev-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 6px;
}

.dev-toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 7px 9px;
  cursor: pointer;
}

.dev-toggle-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #f59e0b;
  flex-shrink: 0;
}

.dev-toggle-card div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  line-height: 1.15;
}

.dev-toggle-card strong {
  color: #fde047;
  font-size: 13.5px;
}

.dev-toggle-card span {
  color: #94a3b8;
  font-size: 11.5px;
}

.dev-lists-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dev-list-box {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dev-list-box.ban-box {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(248, 113, 113, 0.35);
}

.dev-list-title {
  font-size: 14px;
  font-weight: bold;
  color: #f8fafc;
}

.dev-list-input-row {
  display: flex;
  gap: 5px;
}

.dev-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dev-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.wl-chip { background: rgba(34, 197, 94, 0.25); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, 0.5); }
.ban-chip { background: rgba(239, 68, 68, 0.25); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.5); }

.dev-chip-x {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
}

.dev-empty-chips {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}

.dev-security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 7px 9px;
}

.dev-pin-change {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}

.dev-danger-btn {
  height: 30px;
  font-size: 13px;
  padding: 0 10px;
  border-radius: 8px;
  background: #dc2626;
  color: #ffffff;
}

.dev-modal-footer {
  margin-top: 0;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.field-limit-warn {
  font-size: 11.5px;
  font-weight: bold;
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.92);
  border: 1px solid #ef4444;
  border-radius: 6px;
  padding: 2px 6px;
  margin-top: 2px;
  line-height: 1.2;
}

.mobile-sheet-window .field-limit-warn,
.auth-modal-window .field-limit-warn {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.25);
  border-color: rgba(248, 113, 113, 0.7);
}

.input-over-limit {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1.5px rgba(239, 68, 68, 0.45) !important;
}

@media (max-width: 619px) {
  .dev-modal-header {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .dev-modal-window .bp-tab-btn {
    font-size: 11.5px;
    padding: 4px;
    white-space: normal;
    text-align: center;
  }

  .dev-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  #btn-dev-maintenance-toggle {
    grid-column: 1 / -1;
  }

  .dev-tool-btn {
    min-width: 0;
    width: 100%;
    font-size: 11.5px;
    padding: 0 6px;
    height: 28px;
  }

  .bb-modal-tabs .bp-tab-btn {
    font-size: 11.5px;
    padding: 5px 6px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }

  .dev-modal-footer {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }

  .dev-lists-split {
    grid-template-columns: 1fr;
  }

  .dev-player-card {
    flex-direction: column;
    align-items: stretch;
  }

  .dev-pc-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 440px) {
  .dev-pc-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================ */
/* 3-DAY GUEST RETENTION WARNING & ACCOUNT PROTECTION NOTICES   */
/* ============================================================ */
.guest-retention-float {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(24, 18, 12, 0.88);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1.5px solid rgba(250, 204, 21, 0.65);
  color: #fef3c7;
  font-size: 13.5px;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.guest-float-text strong {
  color: #fde047;
}

.guest-float-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.guest-float-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: 7px;
  padding: 2px 9px;
  font-family: var(--font-retro);
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.guest-float-btn:hover {
  filter: brightness(1.12);
}

.guest-float-x {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Leaderboard Compact Retention Status Pill */
.lb-retention-note {
  width: 100%;
  border-radius: 7px;
  padding: 3px 6px;
  font-family: var(--font-retro);
  font-size: 11.5px;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}

.lb-retention-note.is-guest {
  background: rgba(254, 243, 199, 0.88);
  border-color: rgba(217, 119, 6, 0.55);
  color: #92400e;
}

.lb-retention-note.is-protected {
  background: rgba(220, 252, 231, 0.85);
  border-color: rgba(22, 163, 74, 0.45);
  color: #166534;
}

.mobile-sheet-window .mobile-retention-note.is-guest {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde68a;
}

.mobile-sheet-window .mobile-retention-note.is-protected {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
  color: #86efac;
}

/* Auth Modal Retention Notice (replaces static subtext cleanly with zero extra scroll) */
.auth-retention-notice {
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 12px;
  line-height: 1.2;
}

.auth-retention-notice.is-guest {
  background: rgba(254, 243, 199, 0.85);
  border: 1px solid #d97706;
  color: #78350f;
}

.auth-retention-notice.is-protected {
  background: rgba(220, 252, 231, 0.85);
  border: 1px solid #16a34a;
  color: #14532d;
}

@media (max-width: 1250px), (hover: none) and (pointer: coarse) and (max-width: 1380px) {
  .auth-modal-window .auth-retention-notice.is-guest {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(250, 204, 21, 0.48);
    color: #fef3c7;
  }

  .auth-modal-window .auth-retention-notice.is-protected {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(74, 222, 128, 0.5);
    color: #bbf7d0;
  }
}

@media (max-height: 450px) and (orientation: landscape) {
  .auth-modal-window .auth-retention-notice {
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.14;
  }

  .guest-retention-float {
    bottom: 5px;
    padding: 3px 8px;
    gap: 6px;
    font-size: 11.5px;
    max-width: calc(100% - 14px);
  }

  .guest-float-btn {
    font-size: 11.5px;
    padding: 1px 7px;
  }

  .guest-float-x {
    width: 19px;
    height: 19px;
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .dev-players-scroll {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 619px) {
  .guest-retention-float {
    bottom: 6px;
    left: 7px;
    transform: none;
    width: calc(100% - 14px);
    max-width: none;
    padding: 5px 8px;
    gap: 6px;
    font-size: 12px;
    flex-wrap: wrap;
  }

  .guest-float-text {
    flex: 1 1 200px;
  }

  .guest-float-actions {
    margin-left: auto;
  }
}

/* Player Mail Inbox Modal & Dev Panel Mail Tab */
.mail-modal-window {
  max-width: 520px;
  width: 94%;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
}

.mail-inbox-list {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
}

.mail-empty-state {
  text-align: center;
  padding: 28px 14px;
  font-size: 15px;
  color: #57534e;
  background: rgba(255, 255, 255, 0.4);
  border: 1.5px dashed rgba(0, 0, 0, 0.25);
  border-radius: 9px;
}

.mail-card {
  background: rgba(255, 255, 255, 0.65);
  border: 2px solid var(--border-color);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.14);
}

.mail-card.is-unread {
  background: rgba(254, 249, 195, 0.94);
  border-color: #d97706;
}

.mail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mail-card-title {
  font-size: 16px;
  font-weight: bold;
  color: #111827;
}

.mail-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mail-pill-new {
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #000000;
}

.mail-pill-scope {
  background: rgba(15, 23, 42, 0.12);
  color: #1e293b;
  font-size: 11px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 999px;
}

.mail-pill-scope.is-personal {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.mail-card-meta {
  font-size: 11.5px;
  color: #64748b;
}

.mail-card-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.35;
  color: #1f2937;
}

.dev-mail-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.dev-mail-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 10px;
}

.dev-mail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-mail-lbl {
  font-size: 13px;
  font-weight: bold;
  color: #e2e8f0;
}

.dev-mail-select {
  flex: 1;
  min-width: 180px;
}

.dev-mail-textarea {
  resize: vertical;
  min-height: 66px;
  font-family: inherit;
  line-height: 1.3;
}

.dev-mail-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-sent-mails-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dev-sent-mail-item {
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dev-sent-mail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-sent-mail-title {
  font-size: 13.5px;
  font-weight: bold;
  color: #f8fafc;
}

.dev-sent-mail-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
}

.dev-sent-mail-body {
  font-size: 12.5px;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.dev-act-btn.act-mail {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.dev-act-btn.act-mail:hover {
  background: rgba(250, 204, 21, 0.34);
}

/* Mobile Upgrades Side-by-Side Helpers (Desktop & Portrait keep normal column flow) */
.ball-card-info-col,
.ball-card-actions-col {
  display: contents;
}

/* Settings, Performance, Rebirth Milestones & Offline Summary Modals */
.settings-modal-window {
  max-width: 500px;
  width: 94%;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
}

.settings-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: bold;
  color: #1e293b;
  border-bottom: 1.5px dashed rgba(0, 0, 0, 0.22);
  padding-bottom: 3px;
  margin-top: 2px;
}

.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.56);
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  border-radius: 7px;
  font-size: 13.5px;
  color: #111827;
  cursor: pointer;
}

.settings-toggle-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #16a34a;
  flex-shrink: 0;
}

.settings-toggle-row.is-locked {
  opacity: 0.58;
  cursor: not-allowed;
}

.settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-action-btn {
  flex: 1 1 140px;
  font-size: 13px !important;
  padding: 6px 10px !important;
}

.rebirth-milestones-box {
  margin: 8px 0 6px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.08);
  border: 1.5px dashed rgba(0, 0, 0, 0.24);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  text-align: left;
}

.reb-ms-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #334155;
}

.reb-ms-item.is-unlocked {
  color: #15803d;
  font-weight: bold;
}

.offline-summary-window {
  max-width: 440px;
  width: 92%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offline-sum-sub {
  font-size: 14px;
  color: #1f2937;
  line-height: 1.3;
}

.offline-sum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.offline-sum-chip {
  background: rgba(255, 255, 255, 0.65);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.offline-sum-lbl {
  font-size: 12px;
  color: #475569;
}

.offline-sum-val {
  font-size: 17px;
  color: #15803d;
}

/* ============================================================ */
/* POWERUP UPGRADES TABS, MOBILE CAROUSEL & MULTI-BALL BADGE    */
/* ============================================================ */
.bb-modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.bb-modal-tabs .bp-tab-btn {
  flex: 1;
  font-size: 14px;
  padding: 5px 8px;
}

.bb-card-main-col,
.bb-card-action-col {
  display: contents;
}

.bb-card-phases-mini {
  display: none;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 11.5px;
  line-height: 1.22;
  color: #334155;
}

.bb-upgrades-grid.mobile-carousel-mode {
  display: flex;
  grid-template-columns: 1fr;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}

.bb-upgrades-grid.mobile-carousel-mode .bb-upgrade-card {
  width: 100%;
  max-width: 560px;
}

.bb-upgrades-grid.mobile-carousel-mode .bb-card-phases-mini {
  display: block;
}

.bb-fixed-cat-tag {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.bb-fixed-cat-tag.is-perm {
  background: #14532d;
  color: #bbf7d0;
}

.bb-fixed-cat-tag.is-drop {
  background: #334155;
  color: #e2e8f0;
}

.armory-multi-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-size: 10.5px;
  font-weight: bold;
  border: 1px solid #000000;
}

@media (max-width: 900px) and (orientation: portrait) {
  #powerup-upgrades-modal .bb-modal-window.has-bb-carousel {
    height: auto;
    max-height: 92dvh;
    overflow: hidden;
  }

  .bb-modal-window.has-bb-carousel .bb-modal-scroll {
    overflow-y: auto;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-upgrade-card {
    padding: 10px 12px;
    gap: 8px;
  }

  .bb-upgrades-grid.mobile-carousel-mode .bb-card-phases-mini {
    max-height: 110px;
    overflow-y: auto;
  }
}

/* ============================================================ */
/* INSTANT GLOBAL TECHNICAL MAINTENANCE OVERLAY                 */
/* ============================================================ */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #1e293b 0%, #090d16 78%);
}

.maintenance-overlay.active {
  display: flex;
}

.maintenance-card {
  max-width: 440px;
  width: 92%;
  background: var(--bg-retro);
  border: 4px solid #000000;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.maintenance-icon {
  font-size: 52px;
  line-height: 1;
  user-select: none;
  cursor: default;
}

.maintenance-title {
  font-size: 24px;
  font-weight: bold;
  color: #111111;
  border-bottom: 2px solid #000000;
  padding-bottom: 6px;
  width: 100%;
}

.maintenance-desc {
  font-size: 16px;
  line-height: 1.4;
  color: #1e293b;
  margin: 0;
}

.maintenance-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0f172a;
  color: #e2e8f0;
  border: 2px solid #000000;
  padding: 5px 12px;
  font-size: 13.5px;
  font-weight: bold;
  border-radius: 999px;
}

.maint-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

#dev-leaderboard-modal {
  z-index: 21000;
}

.dev-maint-btn {
  background: #f59e0b !important;
  color: #111827 !important;
}

.dev-maint-btn.is-active {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #bbf7d0 !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

/* ==========================================================================
   v9.8: Napi & Heti Küldetések, 30 Napos Breaker Pass Timer & Egzotikus Drop
   ========================================================================== */

/* 30-Day Breaker Pass Countdown Banner */
.bp-season-countdown-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%);
  color: #f8fafc;
  border-bottom: 2px solid #000000;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: bold;
}

.bp-season-countdown-banner .bp-countdown-lbl {
  color: #c4b5fd;
  letter-spacing: 0.3px;
}

.bp-season-countdown-banner .bp-30d-countdown-text {
  color: #fde047;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.bp-season-countdown-banner.mobile-bp-30d {
  border: 1.5px solid rgba(168, 85, 247, 0.55);
  border-radius: 8px;
  margin-bottom: 6px;
  padding: 5px 9px;
}

/* HUD Quests Button & Claim Badge */
.retro-btn.quests-btn {
  background: linear-gradient(180deg, #6ee7b7 0%, #10b981 100%);
  color: #052e16;
  border-color: #000000;
  position: relative;
  gap: 5px;
}

.retro-btn.quests-btn:hover {
  background: linear-gradient(180deg, #a7f3d0 0%, #34d399 100%);
}

.retro-btn.quests-btn.has-claim {
  animation: pulse-quest-btn 1.5s infinite ease-in-out;
}

@keyframes pulse-quest-btn {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 2px 2px 0 rgba(0,0,0,0.85); }
  50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.85), 2px 2px 0 rgba(0,0,0,0.85); }
}

.quests-claim-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  border: 1.5px solid #000000;
  line-height: 1;
}

@media (max-width: 900px) and (orientation: portrait) {
  #btn-open-quests {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: 1.5px solid rgba(110, 231, 183, 0.75);
  }
}

/* Quests Modal Window */
.quests-modal-window {
  max-width: 720px;
  width: 94vw;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
}

.quests-title-box {
  background: linear-gradient(90deg, #059669, #0284c7);
  color: #ffffff;
}

.quests-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quests-timer-strip {
  background: #0f172a;
  color: #e2e8f0;
  border: 2px solid #000000;
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 8px;
  font-size: 13.5px;
  text-align: center;
  flex-shrink: 0;
}

.quests-timer-strip strong {
  color: #fde047;
  letter-spacing: 0.5px;
}

.quests-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 4px 6px 2px;
}

.quests-list-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-card {
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid #000000;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.75);
}

.quest-card.is-ready {
  background: linear-gradient(90deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #059669;
}

.quest-card.is-claimed {
  opacity: 0.72;
  background: rgba(226, 232, 240, 0.7);
}

.quest-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quest-card-title {
  font-size: 15.5px;
  font-weight: bold;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-card-desc {
  font-size: 13px;
  color: #334155;
}

.quest-progress-wrap {
  position: relative;
  height: 16px;
  background: #1e293b;
  border: 1.5px solid #000000;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981);
  transition: width 0.2s ease;
}

.quest-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 1px 2px #000000;
}

.quest-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.quest-reward-tag {
  font-size: 12.5px;
  font-weight: bold;
  color: #92400e;
  background: #fef3c7;
  border: 1.5px solid #d97706;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

.quest-claim-btn {
  background: #22c55e;
  color: #052e16;
  border: 2px solid #000000;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000000;
}

.quest-claim-btn:disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  box-shadow: none;
}

.quest-claimed-pill {
  font-size: 12.5px;
  font-weight: bold;
  color: #15803d;
  padding: 4px 8px;
}

.quests-bonus-chest-wrap {
  margin-top: 2px;
}

.quests-bonus-chest {
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
  color: #f8fafc;
  border: 2px solid #f59e0b;
  border-radius: 9px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.quests-bonus-title {
  font-size: 15px;
  font-weight: bold;
  color: #fde047;
}

.quests-bonus-sub {
  font-size: 12.5px;
  color: #cbd5e1;
}

/* Exotic 0.0004% Drop Relics Showcase inside Armory */
.exotic-relics-box {
  background: linear-gradient(135deg, #18181b 0%, #2e1065 60%, #1e1b4b 100%);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  color: #f8fafc;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.28);
}

.exotic-relics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: bold;
  color: #fde047;
  border-bottom: 1px dashed rgba(253, 224, 71, 0.35);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.exotic-relics-chance {
  font-size: 11px;
  color: #f0abfc;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(216, 180, 254, 0.45);
  padding: 1px 6px;
  border-radius: 999px;
}

.exotic-relic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
  font-size: 12px;
}

.exotic-relic-row:last-child {
  margin-bottom: 0;
}

.exotic-relic-row.is-owned {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.55);
}

.exotic-relic-name {
  font-weight: bold;
  color: #f1f5f9;
}

.exotic-relic-status {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  color: #94a3b8;
}

.exotic-relic-row.is-owned .exotic-relic-status {
  color: #4ade80;
}

/* Password Reset Button & Success Notice in Auth Modal */
.auth-forgot-btn {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  border: 1.5px dashed #0284c7;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: center;
}

.auth-forgot-btn:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.24);
  color: #075985;
}

.auth-forgot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-success-box {
  background: #dcfce7;
  color: #14532d;
  border: 2px solid #16a34a;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .quest-card,
  .quests-bonus-chest {
    flex-direction: column;
    align-items: stretch;
  }
  .quest-card-side {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ============================================================ */
/* PLAYER CARD, CUSTOMIZATION MODAL & LEADERBOARD HOVER CARD    */
/* ============================================================ */
.playercard-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 155px;
  padding: 2px 9px !important;
  border-width: 2px;
  transition: transform 0.1s ease, filter 0.12s ease;
}

.playercard-nav-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.hud-pc-avatar {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.hud-pc-name {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.player-name-card-link {
  cursor: pointer;
  text-decoration: underline dotted rgba(0, 0, 0, 0.45);
}

.player-name-card-link:hover {
  filter: brightness(1.1);
}

.leaderboard-row .col-name {
  cursor: pointer;
}

.leaderboard-row .col-name:hover .lb-name-txt {
  text-decoration: underline;
}

.playercard-modal-window {
  width: 94%;
  max-width: 520px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
}

.playercard-modal-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.playercard-preview-stage {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.player-card-visual {
  width: 100%;
  border: 3px solid #27272a;
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card-visual.is-full {
  max-width: 440px;
  padding: 14px 16px;
}

.player-card-visual.is-mini {
  width: 245px;
  padding: 10px 11px;
  border-width: 2.5px;
  gap: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
}

.pc-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.is-mini .pc-card-top {
  gap: 9px;
}

.pc-avatar-frame {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 2.5px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.16);
}

.is-mini .pc-avatar-frame {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border-width: 2px;
}

.pc-avatar-emoji {
  font-size: 30px;
  line-height: 1;
}

.is-mini .pc-avatar-emoji {
  font-size: 22px;
}

.pc-identity-col {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.pc-name-line {
  font-size: 23px;
  font-weight: bold;
  line-height: 1.05;
  word-break: break-word;
}

.is-mini .pc-name-line {
  font-size: 17px;
}

.pc-name-rainbow {
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #38bdf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent !important;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
}

.pc-title-line {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 1px 7px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.is-mini .pc-title-line {
  font-size: 10px;
  padding: 1px 5px;
}

.pc-card-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 7px 8px;
  border-radius: 7px;
  text-align: center;
}

.is-mini .pc-card-stats-grid {
  padding: 5px 6px;
}

.pc-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 13.5px;
}

.is-mini .pc-stat-item {
  font-size: 11.5px;
}

.pc-stat-lbl {
  font-size: 9.5px;
  font-weight: bold;
  letter-spacing: 0.4px;
}

.is-mini .pc-stat-lbl {
  font-size: 8px;
}

.playercard-custom-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-custom-group {
  background: rgba(0, 0, 0, 0.05);
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 7px;
  padding: 8px 10px;
}

.pc-custom-group-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #18181b;
}

.pc-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pc-option-pill {
  background: #f8fafc;
  color: #0f172a;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  padding: 4px 9px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}

.pc-option-pill:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #2563eb;
}

.pc-option-pill.is-selected {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  box-shadow: 0 0 0 1px #16a34a;
}

.pc-option-pill.is-locked {
  opacity: 0.58;
  cursor: not-allowed;
  background: #e2e8f0;
}

.pc-lock-stage {
  font-size: 10.5px;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
  padding: 0 4px;
  border-radius: 4px;
}

/* Floating Mini Player Card on Leaderboard Hover */
.lb-mini-playercard {
  position: fixed;
  z-index: 2600;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.97);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.lb-mini-playercard.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ============================================================ */
/* UNIFIED DARK-GLASS ARCADE THEME (DESKTOP + MOBILE IDENTICAL) */
/* ============================================================ */
html, body {
  background: linear-gradient(-45deg, #060913, #0b1120, #090e1c, #111827, #070b14);
  background-size: 400% 400%;
  color: #f8fafc;
}

.ambient-shape {
  border-color: rgba(56, 189, 248, 0.12);
  background: rgba(56, 189, 248, 0.03);
}

#game-container {
  background-color: #090d16;
  border: 2.5px solid rgba(250, 204, 21, 0.34);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#arena-wrapper {
  background-color: #060911;
  background-image: none;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.65);
}

/* Top Navigation Bar (Desktop matches Mobile Dark Glass) */
header.top-bar {
  background: linear-gradient(180deg, #111827 0%, #0b1120 100%);
  border-bottom: 1.5px solid rgba(250, 204, 21, 0.34);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.top-bar-row-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.boss-token-hud {
  background: linear-gradient(180deg, #4c0519 0%, #270712 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.48);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.currency-hud-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.currency-label {
  color: #e2e8f0;
}

.currency-value-bar {
  border-radius: 5px;
}

.retro-icon-btn {
  background: rgba(30, 41, 59, 0.94);
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.retro-icon-btn:hover {
  background: rgba(51, 65, 85, 0.98);
}

/* Dark-Glass Ball Shop Cards */
.ball-buy-slot {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ball-buy-slot.ball-slot-coin {
  background: rgba(250, 204, 21, 0.09);
  border-color: rgba(250, 204, 21, 0.45);
}

.ball-buy-slot.ball-slot-symbiot {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(192, 132, 252, 0.5);
}

.ball-buy-slot.ball-slot-laser {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(251, 113, 133, 0.55);
}

.ball-buy-slot.ball-slot-vortex {
  background: rgba(88, 28, 135, 0.22);
  border-color: rgba(168, 85, 247, 0.65);
}

.ball-buy-slot:hover {
  background: rgba(255, 255, 255, 0.13);
}

.ball-slot-tag {
  color: #e2e8f0;
}

.ball-price-box {
  background: rgba(15, 23, 42, 0.92);
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ball-buy-slot.affordable {
  border-color: rgba(74, 222, 128, 0.72);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.24);
}

.ball-buy-slot.affordable .ball-price-box {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #052e16;
  font-weight: bold;
}

.ball-buy-slot.pirate-free .ball-price-box {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #111827;
}

.ball-buy-slot.maxed-slot .ball-price-box {
  background: rgba(15, 23, 42, 0.95);
  color: #fde047;
}

/* Status & Action Pills */
.status-box {
  background: rgba(30, 41, 59, 0.88);
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  border-radius: 9px;
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.status-sub {
  color: #94a3b8;
}

.status-box-val {
  color: #fde047;
}

.retro-btn {
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.top-center-section .retro-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

#btn-open-upgrades {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #f8fafc;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
}

#btn-open-upgrades:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
}

#btn-open-powerup-upgrades {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #111827;
  border: 1.5px solid #fde047;
}

#btn-open-quests {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1.5px solid rgba(110, 231, 183, 0.75);
}

#btn-open-quests:hover {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

#btn-rebirth-trigger {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border: 1.5px solid rgba(252, 165, 165, 0.75);
}

#btn-rebirth-trigger.locked {
  background: rgba(30, 41, 59, 0.85);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.28);
}

#btn-open-auth {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border: 1.5px solid rgba(125, 211, 252, 0.75);
}

#btn-open-auth.logged-in {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
  border: 1.5px solid rgba(134, 239, 172, 0.78);
}

.powerup-hud-badge {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #f8fafc;
}

/* Desktop Sidebars (Leaderboard + Breaker Pass — Dark Glass) */
.desktop-sidebar {
  background: linear-gradient(165deg, #131722 0%, #0f172a 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.36);
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.desktop-sidebar.battlepass-sidebar {
  background: linear-gradient(165deg, #1b122b 0%, #111827 55%, #0f172a 100%);
  border-color: rgba(192, 132, 252, 0.44);
}

.sidebar-header {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.9));
  border-bottom: 1.5px solid rgba(250, 204, 21, 0.28);
}

.sidebar-subtitle {
  color: #94a3b8;
}

.player-profile-card,
.bp-progress-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-label,
.bp-stage-indicator {
  color: #e2e8f0;
}

.highlight-stage {
  color: #fde047;
}

.player-name-input {
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  border: 1.5px solid rgba(250, 204, 21, 0.45);
}

.player-name-input:focus {
  background: #0f172a;
  border-color: #fde047;
}

.mini-save-btn {
  background: #22c55e;
  color: #052e16;
  border: 1.5px solid rgba(74, 222, 128, 0.8);
}

.player-profile-locked-row {
  background: rgba(22, 163, 74, 0.18);
  border: 1.5px solid rgba(74, 222, 128, 0.55);
}

.player-locked-name {
  color: #86efac;
}

.player-name-card-link {
  text-decoration: underline dotted rgba(134, 239, 172, 0.65);
}

.player-stats-mini {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.player-stats-mini strong {
  color: #fde047;
}

.lb-auth-status-bar {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

.lb-auth-status-bar:hover {
  background: rgba(56, 189, 248, 0.24);
}

.lb-auth-status-bar.logged-in {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(74, 222, 128, 0.6);
  color: #86efac;
}

.lb-retention-note.is-guest {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde68a;
}

.lb-retention-note.is-protected {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
  color: #86efac;
}

.leaderboard-table-header {
  background: rgba(255, 255, 255, 0.08);
  color: #fde047;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.14);
}

.leaderboard-row {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.leaderboard-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.12);
}

.leaderboard-row .col-reb {
  color: #fde047;
}

.leaderboard-row .col-lvl {
  color: #7dd3fc;
}

.leaderboard-row .lb-last-seen {
  color: #94a3b8;
}

.leaderboard-row .lb-last-seen.is-online {
  color: #4ade80;
}

.leaderboard-row.rank-top1 {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.24), rgba(234, 179, 8, 0.12)) !important;
  border-color: rgba(250, 204, 21, 0.68);
}

.leaderboard-row.rank-top2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.24), rgba(100, 116, 139, 0.12)) !important;
  border-color: rgba(203, 213, 225, 0.55);
}

.leaderboard-row.rank-top3 {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.24), rgba(194, 65, 12, 0.12)) !important;
  border-color: rgba(251, 146, 60, 0.55);
}

.leaderboard-row.player-row-me {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.28), rgba(22, 163, 74, 0.14)) !important;
  border: 1.5px solid #4ade80 !important;
  color: #ffffff;
}

.leaderboard-gap-divider {
  color: #94a3b8;
}

.leaderboard-empty-hint {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}

.leaderboard-self-filtered-notice {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.48);
  border-color: rgba(248, 113, 113, 0.7);
}

.sidebar-footer-note {
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

/* Desktop Breaker Pass Sidebar Dark Glass */
.bp-progress-bar-wrap {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(250, 204, 21, 0.42);
}

.bp-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.bp-tab-btn.active {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
  color: #000000;
  border-color: #fde047;
  box-shadow: none;
}

.bp-stage-card,
.armory-ball-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.bp-stage-card.stage-reached {
  border-color: #22c55e;
  background: rgba(22, 163, 74, 0.15);
}

.bp-stage-card.bp-stage-free-empty {
  background: rgba(255, 255, 255, 0.04);
}

.bp-stage-card.bp-stage-free-empty.stage-reached {
  background: rgba(22, 163, 74, 0.14);
}

.bp-card-top-row,
.armory-ball-header {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: #fde047;
}

.bp-card-top-row span {
  color: #94a3b8 !important;
}

.bp-track-row {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.bp-track-row.premium-row {
  background: rgba(120, 53, 15, 0.3);
  border-color: rgba(250, 204, 21, 0.35);
}

.bp-track-row.empty-free-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.reward-tag,
.bp-empty-text {
  color: #94a3b8;
}

.badge-claimed {
  color: #4ade80;
}

.badge-locked {
  color: #fca5a5;
}

.btn-claim-reward:disabled {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.18);
}

.bp-armory-scroll > div:not(.armory-ball-card) {
  color: #cbd5e1 !important;
}

.armory-ball-sub {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.1);
}

.armory-select {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-color: rgba(192, 132, 252, 0.5);
}

.leaderboard-table-body::-webkit-scrollbar-thumb,
.bp-stages-scroll::-webkit-scrollbar-thumb,
.bp-armory-scroll::-webkit-scrollbar-thumb,
.bb-modal-scroll::-webkit-scrollbar-thumb,
.upgrades-content-grid::-webkit-scrollbar-thumb,
.rebirth-desc-text::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Guest Bottom Float Pill */
.guest-retention-float {
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  border-radius: 11px;
  color: #fef3c7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* ALL Desktop Modals Dark-Glass Parity */
.overlay-backdrop {
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.retro-modal-window,
.rebirth-dialog-box {
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.42);
  border-radius: 16px;
  color: #f8fafc;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.retro-modal-window.auth-modal-window {
  border: 2px solid rgba(56, 189, 248, 0.55);
}

.modal-title-box {
  background: rgba(250, 204, 21, 0.14);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  border-radius: 9px;
  color: #fde047;
}

.auth-modal-window .modal-title-box {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

.quests-title-box {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.35), rgba(14, 165, 233, 0.35)) !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  color: #6ee7b7 !important;
}

.retro-modal-x-btn {
  border-radius: 8px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 9px;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Upgrades & Powerup Upgrades Modal Dark Glass */
.mult-toggle-btn {
  background: rgba(30, 41, 59, 0.9);
  color: #fde047;
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  border-radius: 8px;
}

.upg-mobile-indicator {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: #fde047;
}

.upg-nav-arrow {
  background: rgba(30, 41, 59, 0.92);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
}

#upgrades-modal .ball-upgrade-section,
#powerup-upgrades-modal .bb-upgrade-card,
#powerup-upgrades-modal .non-upgradable-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 11px;
  color: #f8fafc;
  box-shadow: none;
}

#upgrades-modal .ball-upgrade-section.bt-upgrade-card {
  background: rgba(88, 28, 135, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
}

#powerup-upgrades-modal .non-upgradable-card.gold-level-card {
  background: linear-gradient(145deg, rgba(161, 98, 7, 0.28) 0%, rgba(113, 63, 18, 0.22) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.58);
}

#upgrades-modal .ball-card-name,
#powerup-upgrades-modal .bb-card-title {
  color: #fde047;
}

#upgrades-modal .ball-count-badge,
#upgrades-modal .ball-card-desc,
#upgrades-modal .stat-col-label,
#powerup-upgrades-modal .bb-card-desc,
#powerup-upgrades-modal .bb-nonupg-rarity {
  color: #cbd5e1;
}

#powerup-upgrades-modal .bb-card-header {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

#powerup-upgrades-modal .bb-card-lvl-tag {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 6px;
}

#powerup-upgrades-modal .bb-pip {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.22);
}

#powerup-upgrades-modal .bb-pip.filled {
  background: #22c55e;
}

#powerup-upgrades-modal .bb-pip.filled.maxed {
  background: #f59e0b;
}

#powerup-upgrades-modal .bb-card-next {
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
  border-radius: 6px;
}

#powerup-upgrades-modal .bb-card-phases-mini {
  color: #94a3b8;
}

#powerup-upgrades-modal .bb-nonupg-status {
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  border-radius: 6px;
}

#powerup-upgrades-modal .bb-nonupg-status.locked-status {
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

#powerup-upgrades-modal .gold-level-card .bb-nonupg-rarity {
  color: #fde68a;
}

#powerup-upgrades-modal .bb-buy-btn {
  background: rgba(30, 41, 59, 0.95);
  color: #cbd5e1;
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
}

#powerup-upgrades-modal .bb-buy-btn.affordable {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #052e16;
  border-color: #4ade80;
}

#powerup-upgrades-modal .bb-buy-btn.maxed-btn {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #111827;
  border-color: #fde047;
}

#powerup-upgrades-modal .bb-section-heading {
  background: rgba(250, 204, 21, 0.14);
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  border-radius: 8px;
  color: #fde047;
}

#powerup-upgrades-modal .non-upgradable-heading {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
}

#upgrades-modal .ball-stat-chart {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
}

#upgrades-modal .stat-col-val {
  color: #f8fafc;
}

#upgrades-modal .stat-col-gain {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.45);
}

#upgrades-modal .stat-col-track {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.38);
}

#upgrades-modal .ball-upgrade-btn,
#upgrades-modal .ball-bt-btn {
  background: rgba(30, 41, 59, 0.92);
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  color: #f8fafc;
  overflow: hidden;
}

#upgrades-modal .btn-cost-bottom {
  background: rgba(15, 23, 42, 0.92);
  color: #cbd5e1;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

#upgrades-modal .ball-upgrade-btn.affordable .btn-cost-bottom {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #052e16;
}

#upgrades-modal .ball-upgrade-btn.pirate-free .btn-cost-bottom,
#upgrades-modal .ball-upgrade-btn.maxed-upg-btn .btn-cost-bottom,
#upgrades-modal .ball-bt-btn.affordable .btn-cost-bottom {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #111827;
}

#upgrades-modal .ball-bt-btn.maxed-upg-btn .btn-cost-bottom {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #052e16;
}

#upgrades-modal .delete-ball-btn {
  background: rgba(127, 29, 29, 0.42);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  color: #fecaca;
}

#upgrades-modal .delete-ball-btn:hover {
  background: rgba(153, 27, 27, 0.65);
}

/* Quests Modal Dark Glass */
.quests-timer-strip {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.quest-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.quest-card.is-ready {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0.16) 100%);
  border-color: #34d399;
}

.quest-card.is-claimed {
  background: rgba(255, 255, 255, 0.03);
}

.quest-card-title {
  color: #f8fafc;
}

.quest-card-desc {
  color: #cbd5e1;
}

.quest-reward-tag {
  background: rgba(250, 204, 21, 0.16);
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.45);
}

.quest-claim-btn:disabled {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.18);
}

.quest-claimed-pill {
  color: #4ade80;
}

/* Player Card Modal Dark Glass */
.pc-custom-group {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.pc-custom-group-title {
  color: #fde047;
}

.pc-option-pill {
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.4);
}

.pc-option-pill:hover:not(:disabled) {
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 0.96);
}

.pc-option-pill.is-selected {
  background: rgba(22, 163, 74, 0.28);
  border-color: #4ade80;
  color: #bbf7d0;
  box-shadow: 0 0 0 1px #4ade80;
}

.pc-option-pill.is-locked {
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
}

.pc-lock-stage {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
}

/* Auth, Welcome, Rebirth, Settings, Mail, Offline Modals Dark Glass */
.auth-modal-window .auth-form,
.auth-modal-window .auth-backup-box,
#settings-modal .settings-toggle-row,
#mail-modal .mail-card,
#offline-summary-modal .offline-sum-chip,
.rebirth-milestones-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 11px;
  color: #f8fafc;
  box-shadow: none;
}

.auth-modal-window .auth-input,
.welcome-name-input {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 7px;
}

.auth-modal-window .auth-input:focus,
.welcome-name-input:focus {
  background: #0f172a;
  border-color: #fde047;
}

.auth-modal-window .auth-hint-text,
.auth-modal-window .auth-backup-sub,
.welcome-subtitle,
.welcome-divider,
#mail-modal .mail-card-body,
#mail-modal .mail-card-meta,
#offline-summary-modal .offline-sum-sub,
#offline-summary-modal .offline-sum-lbl,
.rebirth-desc-text,
.reb-ms-item {
  color: #cbd5e1;
}

.auth-modal-window .auth-backup-title,
#mail-modal .mail-card-title,
.rebirth-dialog-title,
.welcome-title,
.welcome-label,
.rebirth-highlight {
  color: #fde047;
}

.rebirth-dialog-title {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

#rebirth-slots-info {
  color: #7dd3fc !important;
}

.rebirth-desc-text small {
  color: #94a3b8 !important;
  border-top-color: rgba(255, 255, 255, 0.18) !important;
}

.rebirth-status-banner.ready {
  background: rgba(22, 163, 74, 0.22);
  border-color: #4ade80;
  color: #bbf7d0;
}

.rebirth-status-banner.locked {
  background: rgba(127, 29, 29, 0.38);
  border-color: #f87171;
  color: #fecaca;
}

.reb-ms-item.is-unlocked {
  color: #4ade80;
}

.auth-modal-window .auth-status-card {
  background: rgba(22, 163, 74, 0.16);
  border: 1.5px solid rgba(74, 222, 128, 0.5);
  border-radius: 11px;
  color: #e2e8f0;
}

.auth-modal-window .auth-status-header {
  color: #4ade80;
  border-bottom-color: rgba(74, 222, 128, 0.35);
}

.auth-modal-window .auth-retention-notice.is-guest {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(250, 204, 21, 0.48);
  color: #fef3c7;
}

.auth-modal-window .auth-retention-notice.is-protected {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
  color: #bbf7d0;
}

.auth-forgot-btn {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.5);
}

.auth-forgot-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.24);
  color: #bae6fd;
}

.auth-modal-window .auth-delete-confirm-box {
  background: rgba(127, 29, 29, 0.35);
  border: 1.5px solid #ef4444;
  border-radius: 11px;
}

.auth-modal-window .auth-delete-title {
  color: #fca5a5;
}

.auth-modal-window .auth-delete-desc {
  color: #fee2e2;
}

.welcome-header {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.welcome-divider::before,
.welcome-divider::after {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.welcome-footer-note {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
}

#settings-modal .settings-section-title {
  color: #7dd3fc;
  border-bottom-color: rgba(125, 211, 252, 0.25);
}

#mail-modal .mail-card.is-unread {
  background: rgba(250, 204, 21, 0.14);
  border-color: #f59e0b;
}

#mail-modal .mail-pill-scope {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

#mail-modal .mail-pill-scope.is-personal {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
}

#mail-modal .mail-empty-state {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}

#offline-summary-modal .offline-sum-val {
  color: #4ade80;
}

.auth-modal-window .bp-tab-btn.active {
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 100%);
  color: #000000;
  border-color: #7dd3fc;
}

.retro-icon-btn.mail-btn {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.28) 0%, rgba(120, 53, 15, 0.65) 100%);
  border-color: rgba(251, 191, 36, 0.72);
  color: #fde047;
}

.retro-icon-btn.mail-btn:hover {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.42) 0%, rgba(146, 64, 14, 0.78) 100%);
}

.powerup-hud-badge.perm-badge {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.85) 0%, rgba(69, 26, 3, 0.94) 100%);
  border-color: rgba(251, 191, 36, 0.72);
  color: #fde047;
}

.powerup-mini-tag {
  color: #fde047;
}

#btn-auth-submit-login {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border-color: rgba(125, 211, 252, 0.75);
}

#btn-export-save-code {
  background: rgba(30, 41, 59, 0.94);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.45);
}

@media (max-width: 1250px), (hover: none) and (pointer: coarse) and (max-width: 1380px) {
  #game-container {
    border-radius: 0;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  #game-container {
    border-width: 0;
    border-radius: 0;
  }
}
