/* ============================================================================
   KARKACHA 3D — Photorealistic 3D UI, Buttons, Icons, Cards & Screens Layer
   - Visual-only 3D enhancement: preserves 100% of existing layout dimensions,
     flex/grid rules, mobile portrait/landscape viewport locks, and Admin Panel
     inline/theme overrides (applyHudBarTheme, iconOverrides, backgrounds).
   ============================================================================ */

/* 1. 3D CANVAS CONTAINER — Pure seamless floating WebGL stage */
canvas#karkachaBoard {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 18px;
}

/* 2. TOP HUD BAR & STYLE STRIP — Sculpted metallic glass bevels */
header.top-hud,
.top-hud {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(10px) saturate(1.25);
}

.style-strip {
  box-shadow:
    inset 0 1px 0 rgba(254, 240, 138, 0.24),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.52) !important;
}

/* 3. EVERY BUTTON IN THE GAME — Real 3D extruded bevel, specular top rim & press depth */
.action-btn,
.shop-green-btn,
.round-hud-btn,
.lobby-icon-sq,
.carpet-arrow-btn,
.arrow-nav-btn,
.tab-btn,
.play-cta-btn,
.auth-social-btn,
.login-btn,
button[class*="btn"]:not(.modal-close-x-btn) {
  position: relative;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.48),
    0 3px 0 rgba(4, 7, 15, 0.88),
    0 6px 14px rgba(0, 0, 0, 0.58) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.12s ease, filter 0.14s ease !important;
}

/* 3B. GLOBAL HD CLEAN TOP-RIGHT CLOSE (✕) BUTTON — Locked to Top-Right Across ALL Screens */
.modal-close-x-btn {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  z-index: 60 !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(255, 255, 255, 0.48) !important;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, #f43f5e 0%, #be123c 58%, #881337 100%) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.55),
    inset 0 -2.5px 3px rgba(69, 10, 10, 0.72),
    0 0 0 2px rgba(15, 23, 42, 0.85),
    0 4px 12px rgba(0, 0, 0, 0.78) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75) !important;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), filter 0.14s ease, box-shadow 0.14s ease !important;
}
.modal-close-x-btn:hover {
  transform: scale(1.09) !important;
  filter: brightness(1.14) !important;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    0 0 0 2px rgba(250, 204, 21, 0.75),
    0 0 14px rgba(244, 63, 94, 0.6),
    0 6px 16px rgba(0, 0, 0, 0.85) !important;
}
.modal-close-x-btn:active {
  transform: scale(0.94) !important;
}

.action-btn:hover,
.shop-green-btn:hover,
.round-hud-btn:hover,
.lobby-icon-sq:hover,
.carpet-arrow-btn:hover,
.arrow-nav-btn:hover,
.tab-btn:hover,
.big-tile-btn:hover {
  filter: brightness(1.1) contrast(1.04);
}

.action-btn:active,
.shop-green-btn:active,
.round-hud-btn:active,
.lobby-icon-sq:active,
.carpet-arrow-btn:active,
.arrow-nav-btn:active,
.tab-btn:active {
  transform: translateY(1.5px) scale(0.98) !important;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(4, 7, 15, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.65) !important;
}

/* Smallest Round HUD Buttons & Lobby Square Icons — Gem-cut 3D Metallic Bezel */
.round-hud-btn,
.lobby-icon-sq {
  background-image:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(165deg, rgba(30, 41, 59, 0.95) 0%, rgba(9, 13, 24, 0.98) 100%);
  border-color: rgba(250, 204, 21, 0.58) !important;
}

.round-hud-btn svg,
.lobby-icon-sq svg,
.big-tile-btn svg,
.fiery-logo-box svg,
.action-btn svg,
.shop-green-btn svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 6px rgba(250, 204, 21, 0.28));
}

/* 4. STYLE SWATCHES (Table & Border Selectors) — Sculpted 3D Gem Buttons */
.carpet-swatch,
.swatch-pill,
.carpet-swatches > button,
.carpet-swatches > div {
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    inset 0 -2px 2px rgba(0, 0, 0, 0.52),
    0 2px 6px rgba(0, 0, 0, 0.6) !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}

.carpet-swatch.active,
.carpet-swatches > .active {
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    0 0 0 1.5px #fef08a,
    0 0 12px rgba(250, 204, 21, 0.65),
    0 3px 8px rgba(0, 0, 0, 0.75) !important;
}

/* 5. MAIN LOBBY BIG MODE TILES & MYSTERY GIFT CARDS — Deep Sculpted 3D Relief */
.big-tile-btn,
.lobby-mode-card,
.mystery-box-card,
.mystery-slot-card,
.lobby-gift-card {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.36),
    inset 0 -4px 0 rgba(0, 0, 0, 0.48),
    inset 0 0 22px rgba(255, 255, 255, 0.06),
    0 6px 0 rgba(5, 8, 17, 0.85),
    0 12px 24px rgba(0, 0, 0, 0.68) !important;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease, filter 0.16s ease !important;
}

.big-tile-btn:active,
.mystery-box-card:active {
  transform: translateY(3px) scale(0.985) !important;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(5, 8, 17, 0.9),
    0 4px 10px rgba(0, 0, 0, 0.7) !important;
}

/* 6. LAUNCH / LOGIN SCREEN & LOBBY HERO CARDS + SLEEK LUXURY ROYAL CREST */
.fiery-logo-box {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(7, 11, 24, 0.97) 100%) !important;
  border: 1.5px solid rgba(250, 204, 21, 0.78) !important;
  border-radius: 999px !important;
  padding: 6px 20px !important;
  box-shadow:
    inset 0 1px 0 rgba(254, 249, 195, 0.35),
    inset 0 -1px 0 rgba(250, 204, 21, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(250, 204, 21, 0.22) !important;
  backdrop-filter: blur(10px);
}

.fiery-logo-title {
  font-family: 'Cinzel', 'Montserrat', serif !important;
  font-weight: 800 !important;
  letter-spacing: 3.4px !important;
  line-height: 1.15 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85) !important;
  background: linear-gradient(180deg, #fffbeb 0%, #fde047 52%, #d97706 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)) !important;
}

.fiery-logo-sub {
  font-family: 'Outfit', 'Poppins', sans-serif !important;
  font-size: 8.5px !important;
  font-weight: 700 !important;
  letter-spacing: 2.8px !important;
  line-height: 1.2 !important;
  margin-top: 2px !important;
  color: rgba(226, 232, 240, 0.9) !important;
  text-transform: uppercase !important;
}

/* Prevent Free Coins Ad & all Lobby Sub-Action buttons from wrapping into multiple lines */
.lobby-subaction-bar button,
.weekly-comp-blue-btn,
.free-coins-green-btn,
#btnWatchAdTop,
#btnWatchAdTop span {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.15 !important;
}

/* =========================================================================
   UNIFORM PRECISION TOP LOBBY HEADER (Row 1 + Modern Luxury Bet +/- + Row 2)
   ========================================================================= */
#topProfileBar.lobby-profile-topstrip {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  padding: 5px 10px !important;
  min-height: 44px !important;
  border-radius: 13px !important;
}
#topProfileBar .lobby-currency-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
}
/* Uniform 30px height across Search, Bet, Coins, Shop, Guide, Support & Close */
#topProfileBar .top-friend-search-box,
#topProfileBar #lobbyBetControlPill,
#topProfileBar #lobbyCoinsWalletPill,
#topProfileBar #btnLobbyShopTop,
#topProfileBar #btnLobbyGuide,
#topProfileBar #btnLobbySupportTop,
#topProfileBar #btnLobbyBackToLogin {
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 9px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  vertical-align: middle !important;
}
#topProfileBar .top-friend-search-box {
  padding: 0 3px 0 8px !important;
  gap: 4px !important;
  border-radius: 9px !important;
  background: rgba(9, 13, 24, 0.92) !important;
  border: 1.5px solid rgba(250, 204, 21, 0.55) !important;
}
#topProfileBar .top-friend-search-box input {
  height: 24px !important;
  font-size: 10px !important;
  padding: 0 4px !important;
  min-width: 82px !important;
  width: 96px !important;
}
#topProfileBar .top-friend-search-box button {
  height: 22px !important;
  padding: 0 8px !important;
  font-size: 10px !important;
  border-radius: 6px !important;
}
#topProfileBar #lobbyBetControlPill {
  padding: 0 6px !important;
  gap: 5px !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(6, 10, 20, 0.98)) !important;
  border: 1.5px solid rgba(250, 204, 21, 0.42) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 3px 10px rgba(0,0,0,0.55) !important;
}
/* Modern Luxury Circular Beveled Bet - / + Controls */
#topProfileBar #lobbyBetControlPill .currency-plus {
  width: 21px !important;
  height: 21px !important;
  min-width: 21px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease !important;
  background: linear-gradient(180deg, #34d399 0%, #059669 58%, #064e3b 100%) !important;
  border: 1.5px solid #a7f3d0 !important;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 0 2px 6px rgba(16,185,129,0.55) !important;
}
#topProfileBar #lobbyBetControlPill .currency-plus:first-of-type {
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 58%, #881337 100%) !important;
  border: 1.5px solid #fecdd3 !important;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.55), 0 2px 6px rgba(244,63,94,0.55) !important;
}
#topProfileBar #lobbyBetControlPill .currency-plus:hover {
  transform: scale(1.1) !important;
}
#topProfileBar #lobbyStakeLabel {
  min-width: 28px !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums !important;
  font-size: 11.5px !important;
  font-weight: 900 !important;
  color: #fef08a !important;
}
#topProfileBar #lobbyCoinsWalletPill {
  padding: 0 9px 0 6px !important;
  gap: 5px !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(6, 10, 20, 0.98)) !important;
  border: 1.5px solid rgba(250, 204, 21, 0.45) !important;
}
#topProfileBar #lobbyCoinsWalletPill svg { width: 20px !important; height: 17px !important; }
#topProfileBar #lobbyCoinsLabel { font-size: 11.5px !important; font-variant-numeric: tabular-nums !important; }
#topProfileBar #btnLobbyShopTop {
  padding: 0 10px 0 7px !important;
  gap: 4px !important;
  font-size: 10.5px !important;
  font-weight: 900 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 3px 10px rgba(22,163,74,0.45) !important;
}
#topProfileBar #btnLobbyShopTop svg { width: 16px !important; height: 15px !important; }
#topProfileBar #btnLobbyGuide,
#topProfileBar #btnLobbySupportTop {
  padding: 0 9px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}
#topProfileBar #btnLobbyBackToLogin {
  width: 30px !important;
  padding: 0 !important;
  font-size: 11.5px !important;
}
/* Row 2: 100% Responsive Single-Line Bar — NEVER overflows mobile or desktop! Notification ✉️ at absolute far-right! */
#lobbySubActionBar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(3px, 0.5vw, 6px) !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 40 !important;
}
#lobbySubActionBar .lobby-subaction-left,
#lobbySubActionBar .lobby-subaction-right {
  display: flex !important;
  align-items: center !important;
  gap: clamp(3px, 0.5vw, 6px) !important;
  min-width: 0 !important;
  overflow: visible !important;
}
#lobbySubActionBar .lobby-subaction-left { flex: 1 1 auto !important; justify-content: flex-start !important; }
#lobbySubActionBar .lobby-subaction-right { flex: 0 1 auto !important; justify-content: flex-end !important; }
#lobbySubActionBar .weekly-comp-blue-btn,
#lobbySubActionBar .free-coins-green-btn,
#lobbySubActionBar #passRankCard,
#lobbySubActionBar #btnFriendListDropdown {
  height: 28px !important;
  min-height: 28px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: clamp(3px, 0.4vw, 5px) !important;
  padding: 0 clamp(5px, 0.8vw, 9px) !important;
  border-radius: 9px !important;
  font-size: clamp(8.2px, 1.05vw, 10px) !important;
  white-space: nowrap !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}
#lobbySubActionBar #passRankCard {
  background: linear-gradient(90deg, #f59e0b, #eab308) !important;
  border: 1.5px solid #fef08a !important;
  color: #0f172a !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65) !important;
}
#lobbySubActionBar #btnInboxNotif {
  width: 29px !important;
  min-width: 29px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  border-radius: 9px !important;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  border: 1.5px solid rgba(250, 204, 21, 0.78) !important;
  box-shadow: inset 0 1px 0 rgba(254, 240, 138, 0.35), 0 3px 9px rgba(0, 0, 0, 0.7) !important;
  position: relative !important;
  overflow: visible !important;
  cursor: pointer !important;
}
#lobbySubActionBar #btnInboxNotif .notif-badge-count {
  top: -6px !important;
  right: -5px !important;
}
#lobbySubActionBar #lobbyFriendsOnlineBar {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 28px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}
/* Compact mobile/tablet landscape fit (<= 960px): guaranteed ZERO overlap on Row 1 Search & ZERO clipping on Row 2 & Bottom Bar! */
#topProfileBar #topFriendSearchBox {
  flex: 1 1 90px !important;
  min-width: 88px !important;
  max-width: 215px !important;
  height: 30px !important;
  box-sizing: border-box !important;
  padding: 0 4px 0 7px !important;
  overflow: visible !important;
}
#topProfileBar #topBarFriendSearchInput {
  flex: 1 1 30px !important;
  min-width: 0 !important;
  width: 100% !important;
  font-size: 10px !important;
}
#topProfileBar #topFriendSearchBox > button.action-btn {
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 7px !important;
  font-size: 9.5px !important;
  flex-shrink: 0 !important;
}
#topProfileBar .lobby-currency-cluster {
  flex-shrink: 0 !important;
  gap: clamp(3px, 0.45vw, 6px) !important;
}
#lobbyBottomBar {
  width: 100% !important;
  max-width: 920px !important;
  margin: 0 auto !important;
  padding-bottom: 4px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: clamp(5px, 0.7vw, 10px) !important;
  flex-wrap: nowrap !important;
}
#lobbyBottomBar #lobbyBottomLeftBtns {
  display: flex !important;
  align-items: center !important;
  gap: clamp(4px, 0.55vw, 7px) !important;
  flex-shrink: 0 !important;
}
#lobbyBottomBar #mysteryBoxesRow {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(62px, 106px)) !important;
  gap: clamp(4px, 0.55vw, 7px) !important;
  justify-content: center !important;
  align-items: stretch !important;
}
#lobbyBottomBar #lobbyBottomRightBtns {
  display: flex !important;
  align-items: center !important;
  gap: clamp(4px, 0.55vw, 7px) !important;
  flex-shrink: 0 !important;
}
@media (max-height: 640px) {
  .login-lobby-overlay {
    padding: 4px 12px 14px !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    box-sizing: border-box !important;
    overflow-y: hidden !important;
  }
  #lobbyBottomBar {
    padding-bottom: 4px !important;
    margin-bottom: 2px !important;
  }
  #lobbyBottomBar #mysteryBoxesRow .mystery-chest-card {
    padding: 3px 4px !important;
  }
  #lobbyBottomBar #mysteryBoxesRow .mystery-chest-card img,
  #lobbyBottomBar #mysteryBoxesRow .mystery-chest-card svg {
    max-height: 34px !important;
  }
  #lobbyBottomBar .lobby-icon-sq {
    width: 34px !important;
    height: 34px !important;
  }
  #lobbyBottomBar #btnLobbyColors,
  #lobbyBottomBar #btnLobbyTables {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }
}
@media (max-width: 960px) {
  #topProfileBar { padding: 4px 6px !important; gap: 4px !important; }
  #topProfileBar #lobbyXpBarFillWrap { width: 58px !important; }
  #topProfileBar #lobbyProfileName { font-size: 10.5px !important; }
  #topProfileBar #lobbyUsernameTag { font-size: 8.5px !important; }
  #topProfileBar #lobbyXpText { font-size: 8px !important; }
  #topProfileBar #topFriendSearchBox { max-width: 112px !important; min-width: 78px !important; padding: 0 3px 0 5px !important; }
  #topProfileBar #topFriendSearchBox > button.action-btn { padding: 0 5px !important; font-size: 8.5px !important; }
  #topProfileBar #lobbyBetControlPill { padding: 0 4px !important; gap: 3px !important; }
  #topProfileBar #lobbyBetControlPill > span:first-child { font-size: 9px !important; }
  #topProfileBar #lobbyStakeLabel { min-width: 22px !important; font-size: 10px !important; }
  #topProfileBar #lobbyCoinsWalletPill { padding: 0 6px 0 4px !important; gap: 3px !important; }
  #topProfileBar #lobbyCoinsLabel { font-size: 10px !important; }
  #topProfileBar #btnLobbyShopTop,
  #topProfileBar #btnLobbyGuide,
  #topProfileBar #btnLobbySupportTop { padding: 0 6px !important; font-size: 9px !important; }
  #topProfileBar #btnLobbyBackToLogin { width: 26px !important; min-width: 26px !important; }
  #lobbySubActionBar .weekly-comp-blue-btn,
  #lobbySubActionBar .free-coins-green-btn,
  #lobbySubActionBar #passRankCard,
  #lobbySubActionBar #btnFriendListDropdown {
    padding: 0 5px !important;
    font-size: 8.5px !important;
    gap: 3px !important;
  }
  #lobbyBottomBar { max-width: min(920px, 100%) !important; }
  #lobbyBottomBar #lobbyBottomLeftBtns { gap: 4px !important; flex-shrink: 0 !important; }
  #lobbyBottomBar #lobbyBottomLeftBtns .lobby-icon-sq { width: 32px !important; height: 32px !important; }
  #lobbyBottomBar #mysteryBoxesRow {
    grid-template-columns: repeat(4, minmax(56px, 96px)) !important;
    gap: 4px !important;
  }
  #lobbyBottomBar #mysteryBoxesRow .mystery-chest-card {
    min-width: 0 !important;
    padding: 3px 4px !important;
  }
  #lobbyBottomBar #btnLobbyColors,
  #lobbyBottomBar #btnLobbyTables {
    padding: 6px 7px !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
}

/* Guarantee Lobby Bottom Bar (3 left icons + 4 Mystery Chests + Shop & 20 Tables) fits 100% on rotated phones */
html.landscape-auto-rotated #lobbyBottomBar.lobby-bottom-bar {
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
}
html.landscape-auto-rotated #lobbyBottomLeftBtns {
  flex-shrink: 0 !important;
  gap: 5px !important;
}
html.landscape-auto-rotated #mysteryBoxesRow {
  width: auto !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 430px !important;
  grid-template-columns: repeat(4, minmax(56px, 1fr)) !important;
  gap: 5px !important;
}
html.landscape-auto-rotated #lobbyBottomRightBtns {
  flex-shrink: 0 !important;
  gap: 5px !important;
}
html.landscape-auto-rotated #lobbyBottomRightBtns button {
  padding: 6px 10px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
}
html.landscape-auto-rotated .modal-card,
html.landscape-auto-rotated .friends-hub-card {
  width: 96% !important;
  max-width: 96% !important;
  max-height: 94% !important;
}
html.landscape-auto-rotated .grid-2 {
  grid-template-columns: 1fr 1fr !important;
}

#btnRecordMatchTop {
  overflow: hidden !important;
  box-sizing: border-box !important;
}
#btnRecordMatchTop.recording-active {
  background: linear-gradient(135deg, #dc2626, #7f1d1d) !important;
  border-color: #fecaca !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.95) !important;
  padding: 0 !important;
  gap: 0 !important;
  justify-content: center !important;
  align-items: center !important;
  animation: k3dRecPulse 1.1s ease-in-out infinite;
}
#btnRecordMatchTop.recording-active #recBtnDot {
  display: none !important;
}
#btnRecordMatchTop #recBtnTimerTxt {
  font-size: 8.5px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: -0.35px !important;
  font-variant-numeric: tabular-nums !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  text-align: center !important;
  max-width: 100% !important;
  padding: 0 1px !important;
}
@media (max-width: 960px), (max-height: 520px) {
  #btnRecordMatchTop #recBtnTimerTxt {
    font-size: 7px !important;
    letter-spacing: -0.45px !important;
  }
}
html.landscape-auto-rotated #btnRecordMatchTop #recBtnTimerTxt {
  font-size: 7px !important;
  letter-spacing: -0.45px !important;
}
@keyframes k3dRecPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(239,68,68,0.75); }
  50% { box-shadow: 0 0 18px rgba(248,113,113,1); }
}

#loginHeroCenterBox {
  box-shadow:
    inset 0 1.5px 0 rgba(254, 240, 138, 0.38),
    inset 0 -3px 0 rgba(0, 0, 0, 0.62),
    0 12px 32px rgba(0, 0, 0, 0.82),
    0 0 28px rgba(250, 204, 21, 0.16) !important;
  backdrop-filter: blur(12px) saturate(1.3);
}

/* 7. MODALS, FEATURE BOXES, SHOP CARDS, PROFILE, FRIENDS & CHAT — 3D Luxury Glass */
.modal-card,
.feature-box,
.victory-card,
.tournament-tree-card,
.prematch-dp-card,
.prematch-pot-box,
.notif-popover-panel,
.lobby-minichat-float,
.corner-rules-popover {
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.24),
    inset 0 -3px 0 rgba(0, 0, 0, 0.55),
    0 12px 30px rgba(0, 0, 0, 0.78) !important;
}

.feature-box {
  background-image:
    linear-gradient(168deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, 0.22) 100%);
}

/* 8. AVATAR BOXES, COINS PILLS, TURN BADGES & STAR BADGES — 3D Metallic Medallions */
.square-avatar-box,
.coin-pill,
.prematch-stake-pill,
.prematch-star-badge,
.hud-turn-pill,
.toast-banner {
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.36),
    inset 0 -2px 0 rgba(0, 0, 0, 0.58),
    0 4px 12px rgba(0, 0, 0, 0.65) !important;
}

/* 9. INPUTS & SELECTS — Recessed 3D Engraved Fields */
.input-field,
select.input-field,
#quickChatInput {
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.72),
    0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

/* 10. 3D GRAPHICS QUALITY & CAMERA SETTINGS PILL BAR */
.k3d-settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, #facc15, #b45309);
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.5);
}

.k3d-new-tag {
  display: inline-block;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  background: linear-gradient(90deg, #22c55e, #06b6d4);
  color: #050811;
  vertical-align: middle;
}

/* ============================================================================
   11. AAA 3D MYSTERY VAULT BOXES (Inspired by 8BP Surprise / Lobby Vault Cards)
   Each of the 4 boxes has its own distinct color, style & animated neon glow!
   ============================================================================ */
@keyframes k3dNeonSweep {
  0% { transform: translateX(-140%) skewX(-24deg); opacity: 0; }
  35% { opacity: 0.75; }
  70% { opacity: 0.75; }
  100% { transform: translateX(240%) skewX(-24deg); opacity: 0; }
}
@keyframes k3dGoldPulse {
  0%, 100% { box-shadow: inset 0 1.5px 0 rgba(254,249,195,0.6), 0 0 12px rgba(250,204,21,0.45), 0 6px 16px rgba(0,0,0,0.75); }
  50% { box-shadow: inset 0 1.5px 0 rgba(254,249,195,0.9), 0 0 22px rgba(250,204,21,0.88), 0 6px 18px rgba(0,0,0,0.85); }
}
@keyframes k3dEmeraldOrbit {
  0%, 100% { border-color: #22c55e; box-shadow: inset 0 1.5px 0 rgba(187,247,208,0.6), 0 0 12px rgba(34,197,94,0.5), 0 6px 16px rgba(0,0,0,0.75); }
  50% { border-color: #a3e635; box-shadow: inset 0 1.5px 0 rgba(254,240,138,0.85), 0 0 22px rgba(74,222,128,0.88), 0 6px 18px rgba(0,0,0,0.85); }
}
@keyframes k3dDiamondPrism {
  0% { border-color: #38bdf8; box-shadow: inset 0 1.5px 0 rgba(224,242,254,0.75), 0 0 14px rgba(56,189,248,0.6), 0 6px 16px rgba(0,0,0,0.78); }
  33% { border-color: #c084fc; box-shadow: inset 0 1.5px 0 rgba(243,232,255,0.85), 0 0 22px rgba(192,132,252,0.8), 0 6px 18px rgba(0,0,0,0.82); }
  66% { border-color: #00f5ff; box-shadow: inset 0 1.5px 0 rgba(207,250,254,0.85), 0 0 24px rgba(0,245,255,0.88), 0 6px 18px rgba(0,0,0,0.82); }
  100% { border-color: #38bdf8; box-shadow: inset 0 1.5px 0 rgba(224,242,254,0.75), 0 0 14px rgba(56,189,248,0.6), 0 6px 16px rgba(0,0,0,0.78); }
}
@keyframes k3dChestFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-2.5px) scale(1.04); }
}

.mystery-chest-card.k3d-vault-card {
  position: relative;
  overflow: hidden;
  border-radius: 11px !important;
  padding: 2px 5px 4px !important;
  min-width: 78px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1px !important;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.14s ease, filter 0.14s ease !important;
}
.mystery-chest-card.k3d-vault-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  pointer-events: none;
  animation: k3dNeonSweep 3.2s ease-in-out infinite;
}
.mystery-chest-card.k3d-vault-card:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.12);
}
.mystery-chest-card.k3d-vault-0 {
  border: 2px solid #94a3b8 !important;
  background: linear-gradient(180deg, rgba(30,41,59,0.94) 0%, rgba(15,23,42,0.98) 65%, rgba(7,12,24,0.99) 100%) !important;
  box-shadow: inset 0 1.5px 0 rgba(226,232,240,0.55), 0 0 12px rgba(56,189,248,0.42), 0 5px 14px rgba(0,0,0,0.8) !important;
}
.mystery-chest-card.k3d-vault-1 {
  border: 2px solid #facc15 !important;
  background: linear-gradient(180deg, rgba(69,26,3,0.92) 0%, rgba(28,12,2,0.97) 65%, rgba(12,6,2,0.99) 100%) !important;
  animation: k3dGoldPulse 2.4s ease-in-out infinite;
}
.mystery-chest-card.k3d-vault-1::after { animation-delay: 0.75s; }
.mystery-chest-card.k3d-vault-2 {
  border: 2px solid #22c55e !important;
  background: linear-gradient(180deg, rgba(6,78,59,0.92) 0%, rgba(2,44,34,0.97) 65%, rgba(2,24,20,0.99) 100%) !important;
  animation: k3dEmeraldOrbit 2.6s ease-in-out infinite;
}
.mystery-chest-card.k3d-vault-2::after { animation-delay: 1.5s; }
.mystery-chest-card.k3d-vault-3 {
  border: 2px solid #38bdf8 !important;
  background: linear-gradient(180deg, rgba(14,116,144,0.92) 0%, rgba(12,35,77,0.97) 65%, rgba(5,12,32,0.99) 100%) !important;
  animation: k3dDiamondPrism 3.4s linear infinite;
}
.mystery-chest-card.k3d-vault-3::after { animation-delay: 2.2s; }

.mystery-chest-card.k3d-vault-ready {
  border: 2px solid #86efac !important;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 52%, #14532d 100%) !important;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.65), 0 0 22px rgba(74,222,128,0.85), 0 6px 16px rgba(0,0,0,0.8) !important;
}
.k3d-vault-top-pill {
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 0 0 7px 7px;
  margin-top: -2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 5px rgba(0,0,0,0.65);
  white-space: nowrap;
}
.k3d-vault-icon-wrap {
  line-height: 0;
  margin: 1px 0;
  animation: k3dChestFloat 2.8s ease-in-out infinite;
}
.k3d-vault-title {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  white-space: nowrap;
}
.k3d-vault-timer {
  font-size: 8.5px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 5px rgba(0,0,0,0.65);
  white-space: nowrap;
}

/* ============================================================================
   12. FUTURISTIC 3D PAUSE, VICTORY, PRE-MATCH & NOTIFICATION OVERLAYS
   ============================================================================ */
.k3d-futuristic-pause-card {
  position: relative;
  max-width: 400px;
  width: 100%;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.24) 0%, transparent 56%),
    linear-gradient(170deg, rgba(22, 33, 62, 0.96) 0%, rgba(9, 14, 28, 0.98) 65%, rgba(4, 7, 15, 0.99) 100%);
  border: 2px solid #facc15;
  border-radius: 20px;
  padding: 20px 22px 18px;
  text-align: center;
  color: #fff;
  box-shadow:
    inset 0 2px 0 rgba(254, 249, 195, 0.52),
    inset 0 -4px 0 rgba(0, 0, 0, 0.65),
    0 0 38px rgba(56, 189, 248, 0.24),
    0 24px 65px rgba(0, 0, 0, 0.95);
}
.k3d-pause-badge-pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.9px;
  color: #fef08a;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}
@keyframes k3dPauseOrbitSpin {
  0% { transform: rotate(0deg) scale(1); opacity: 0.8; }
  50% { transform: rotate(180deg) scale(1.07); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 0.8; }
}
.k3d-pause-emblem-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 10px auto 6px;
}
.k3d-pause-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px dashed rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.35), inset 0 0 18px rgba(250, 204, 21, 0.2);
  animation: k3dPauseOrbitSpin 7s linear infinite;
}

/* Futuristic 3D Victory Card — Warm Amber-Gold Arena Spotlight matching Reference */
.victory-overlay {
  background: radial-gradient(circle at 50% 32%, rgba(180, 83, 9, 0.45) 0%, rgba(12, 8, 5, 0.88) 74%) !important;
  backdrop-filter: blur(6px);
}
.victory-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 204, 21, 0.32) 0%, transparent 58%),
    linear-gradient(175deg, rgba(42, 22, 8, 0.94) 0%, rgba(12, 10, 16, 0.97) 100%) !important;
  border: 2.5px solid #facc15 !important;
  box-shadow:
    inset 0 2px 0 rgba(254, 249, 195, 0.55),
    inset 0 -4px 0 rgba(0, 0, 0, 0.72),
    0 0 48px rgba(250, 204, 21, 0.34),
    0 24px 64px rgba(0, 0, 0, 0.95) !important;
}
.victory-player-panel.winner {
  background: linear-gradient(170deg, rgba(20, 83, 45, 0.62) 0%, rgba(6, 18, 16, 0.88) 100%) !important;
  border: 2px solid #4ade80 !important;
  box-shadow: inset 0 1.5px 0 rgba(187, 247, 208, 0.45), 0 0 22px rgba(74, 222, 128, 0.3), 0 8px 20px rgba(0,0,0,0.75) !important;
}
.victory-player-panel.loser {
  background: linear-gradient(170deg, rgba(69, 10, 10, 0.56) 0%, rgba(15, 10, 18, 0.88) 100%) !important;
  border: 2px solid rgba(248, 113, 113, 0.7) !important;
  box-shadow: inset 0 1.5px 0 rgba(254, 202, 202, 0.28), 0 8px 20px rgba(0,0,0,0.75) !important;
}
.victory-dp-img {
  border-radius: 12px !important;
  border: 2.5px solid #facc15 !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.55), 0 4px 12px rgba(0,0,0,0.85) !important;
}

/* Futuristic 3D Toast Notifications & Live Notification Banners */
.toast-banner,
#toastBanner,
.live-notif-banner {
  background: linear-gradient(165deg, rgba(15, 27, 56, 0.96) 0%, rgba(6, 10, 22, 0.98) 100%) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.65) !important;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.28),
    0 0 20px rgba(56, 189, 248, 0.3),
    0 10px 26px rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(10px);
}

/* Crisp Neon Framed Top HUD Player Avatars (matching reference sleek neon-square avatar look) */
.square-avatar-box {
  border-radius: 10px !important;
  border: 2px solid #38bdf8 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 12px rgba(56, 189, 248, 0.52),
    0 4px 10px rgba(0, 0, 0, 0.8) !important;
}
.square-avatar-box.active-turn {
  border-color: #4ade80 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 0 16px rgba(74, 222, 128, 0.78),
    0 4px 12px rgba(0, 0, 0, 0.85) !important;
}

/* ============================================================================
   13. AAA VICTORY PODIUM (Gold-Crested Square Frames & Center Coin Stack Pot)
   ============================================================================ */
.k3d-winner-crown-txt {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.4px;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 45%, #eab308 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.95));
}
.k3d-gold-square-frame {
  position: relative;
  padding: 4px !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #fef9c3 0%, #facc15 45%, #b45309 100%) !important;
  box-shadow: 0 0 26px rgba(250, 204, 21, 0.72), 0 8px 20px rgba(0,0,0,0.88) !important;
}
.k3d-frame-diamond-top {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #e0f2fe, #38bdf8, #0284c7);
  border: 1.5px solid #fef9c3;
  box-shadow: 0 0 10px #38bdf8;
  z-index: 4;
}
.k3d-bronze-square-frame {
  padding: 4px !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #fde68a 0%, #b45309 50%, #451a03 100%) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.85) !important;
}
.k3d-victory-vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.k3d-vs-emblem {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(180deg, #fef9c3 0%, #facc15 55%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(250,204,21,0.75)) drop-shadow(0 3px 6px rgba(0,0,0,0.95));
}
.k3d-victory-pot-cube {
  background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(5,8,17,0.96));
  border: 1.5px solid rgba(250,204,21,0.58);
  border-radius: 12px;
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 6px 16px rgba(0,0,0,0.85);
}

/* ============================================================================
   14. GLOSSY MULTI-COLOR 3D LOBBY TILES (Vibrant Acrylic Bevel Depth)
   ============================================================================ */
.big-tile-btn.green {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 52%, #15803d 100%) !important;
  border: 2.5px solid #bbf7d0 !important;
}
.big-tile-btn.blue {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 52%, #1e40af 100%) !important;
  border: 2.5px solid #bae6fd !important;
}
.big-tile-btn.gold,
.big-tile-btn.amber {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 52%, #b45309 100%) !important;
  border: 2.5px solid #fef9c3 !important;
}
.big-tile-btn.purple,
.big-tile-btn.cyan {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 52%, #115e59 100%) !important;
  border: 2.5px solid #99f6e4 !important;
}
.big-tile-btn.orange,
.big-tile-btn.red {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 52%, #9a3412 100%) !important;
  border: 2.5px solid #fed7aa !important;
}

/* ============================================================================
   15. REALISTIC 3D POST-LOGIN LOBBY HEADER (Segmented Metallic-Glass Bar)
   Matches reference realism while strictly preserving existing responsive layout
   ============================================================================ */
#topProfileBar.lobby-profile-topstrip {
  background:
    linear-gradient(180deg, rgba(64, 72, 86, 0.92) 0%, rgba(30, 36, 48, 0.95) 48%, rgba(16, 20, 30, 0.98) 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.85) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.65),
    0 8px 22px rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(12px) saturate(1.3);
}
#topProfileBar .currency-pill {
  background: linear-gradient(180deg, rgba(24, 29, 40, 0.95) 0%, rgba(9, 12, 19, 0.98) 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.75),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.6) !important;
}
#lobbyCoinsWalletPill {
  border-color: rgba(250, 204, 21, 0.42) !important;
  background: linear-gradient(180deg, rgba(44, 34, 14, 0.92) 0%, rgba(15, 13, 10, 0.98) 100%) !important;
}
#lobbyCoinsLabel {
  font-family: 'Orbitron', 'Inter', sans-serif !important;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 8px rgba(250, 204, 21, 0.35);
}
#btnLobbyShopTop.shop-green-btn {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 52%, #14532d 100%) !important;
  border: 1.5px solid #bbf7d0 !important;
}
#lobbyLevelStar {
  background: radial-gradient(circle at 35% 25%, #fca5a5 0%, #dc2626 48%, #7f1d1d 100%) !important;
  border: 1.5px solid #fef08a !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.78) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
#lobbyXpBarFillWrap {
  background: linear-gradient(180deg, #050811, #111827) !important;
  border: 1px solid rgba(250, 204, 21, 0.52) !important;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.9);
}
#lobbyXpBarFill {
  background: linear-gradient(180deg, #fef08a 0%, #facc15 48%, #ca8a04 100%) !important;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.65);
}
#btnInboxNotif {
  flex-shrink: 0 !important;
  min-width: 36px !important;
  width: 36px !important;
  height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#btnVaultBonus {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 55%, #b45309 100%) !important;
  border: 1.5px solid #fef9c3 !important;
  color: #1c1002 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}
#btnVaultBonus #vaultBonusRewardTag {
  color: #451a03 !important;
  background: rgba(255, 255, 255, 0.45);
  padding: 1px 5px;
  border-radius: 5px;
}
#passRankCard {
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 54%, #b45309 100%) !important;
  border: 2px solid #fef9c3 !important;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.65), 0 4px 0 #78350f, 0 8px 18px rgba(0, 0, 0, 0.72) !important;
}

/* ============================================================================
   16. FULL-SCREEN HD LIGHTBOX PREVIEW (DP + Animated Frame, Rings, Swords, Neon FX)
   ============================================================================ */
@keyframes k3dLightboxZoomIn {
  0% { opacity: 0; transform: scale(0.86); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes k3dItemHeroFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-7px) scale(1.03); }
}
.k3d-preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100250;
  background: radial-gradient(circle at 50% 42%, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 17, 0.98) 78%);
  backdrop-filter: blur(14px) saturate(1.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.k3d-preview-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background:
    radial-gradient(circle at 50% 18%, rgba(250, 204, 21, 0.2) 0%, transparent 56%),
    linear-gradient(170deg, rgba(24, 34, 58, 0.96) 0%, rgba(9, 14, 28, 0.98) 65%, rgba(4, 7, 16, 0.99) 100%);
  border: 2px solid rgba(250, 204, 21, 0.78);
  border-radius: 22px;
  padding: 20px 22px 18px;
  text-align: center;
  color: #f8fafc;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.3),
    0 0 44px rgba(56, 189, 248, 0.22),
    0 26px 72px rgba(0, 0, 0, 0.96);
  animation: k3dLightboxZoomIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.k3d-preview-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 12px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.k3d-preview-rays {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(250, 204, 21, 0.22) 0deg 8deg, transparent 8deg 22deg);
  animation: dpRingSunRays 16s linear infinite;
  pointer-events: none;
}
.k3d-preview-hero {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: k3dItemHeroFloat 3s ease-in-out infinite;
}
.k3d-clickable-showcase-card {
  cursor: pointer !important;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.k3d-clickable-showcase-card:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.38), 0 8px 18px rgba(0, 0, 0, 0.8) !important;
}

/* ============================================================================
   17. SETTINGS, SHOP & MODAL VERTICAL SCROLLING + MOBILE APP STABILITY FIX
   Guarantees rock-solid background game lock & 100% responsive Settings/Shop
   across Desktop, Mobile Landscape, and Portrait Auto-Rotated Mobile Phones!
   ============================================================================ */
html,
body,
#gameplayTableArena,
.table-stage-wrap {
  overscroll-behavior: none !important;
}
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overscroll-behavior: contain !important;
  touch-action: none !important;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
  box-sizing: border-box !important;
}
.modal-card {
  position: relative !important;
  width: min(100%, 900px) !important;
  height: 92% !important;
  max-height: 96% !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  touch-action: auto !important;
  box-sizing: border-box !important;
}
.modal-header {
  padding: 9px 48px 9px 14px !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  min-width: 0 !important;
}
.modal-tabs {
  overscroll-behavior-x: contain !important;
  touch-action: pan-x !important;
  flex-shrink: 0 !important;
}
.modal-body,
#menuBody,
#shopBody {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding-bottom: 26px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(250, 204, 21, 0.55) rgba(9, 13, 22, 0.45) !important;
  box-sizing: border-box !important;
}
.modal-body::-webkit-scrollbar,
#menuBody::-webkit-scrollbar,
#shopBody::-webkit-scrollbar {
  display: block !important;
  width: 6px !important;
  height: 6px !important;
}
.modal-body::-webkit-scrollbar-track,
#menuBody::-webkit-scrollbar-track,
#shopBody::-webkit-scrollbar-track {
  background: rgba(9, 13, 22, 0.45);
  border-radius: 99px;
}
.modal-body::-webkit-scrollbar-thumb,
#menuBody::-webkit-scrollbar-thumb,
#shopBody::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #facc15, #0ea5e9);
  border-radius: 99px;
}
/* Never squash flex children or cause horizontal shift inside Settings / Shop modal bodies! */
.modal-body > *,
#menuBody > *,
#shopBody > * {
  flex-shrink: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* Allow BOTH horizontal swipe & natural vertical page scrolling over slide tracks on touch/trackpad */
.futuristic-slide-track {
  touch-action: pan-x pan-y !important;
  overscroll-behavior-x: contain !important;
}
/* Responsive wrapping grids inside Shop & Settings when browsing many items */
.k3d-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
  width: 100%;
  padding-bottom: 8px;
  box-sizing: border-box;
}
/* Fullscreen HD Preview Lightbox — always fits inside short mobile landscape screens too */
.k3d-preview-lightbox {
  overscroll-behavior: contain !important;
  touch-action: none !important;
}
.k3d-preview-card {
  max-height: 94% !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
}
@media (max-width: 680px) {
  .modal-body .grid-2,
  .modal-body .grid-3 {
    grid-template-columns: 1fr !important;
  }
  .k3d-shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 8px;
  }
}
@media (max-height: 520px), (max-width: 760px) {
  .modal-card {
    height: 95% !important;
    max-height: 97% !important;
    border-radius: 14px !important;
  }
  .modal-header {
    padding: 6px 44px 6px 10px !important;
  }
  .modal-tabs {
    padding: 5px 8px !important;
    gap: 5px !important;
  }
  .tab-btn {
    padding: 4px 9px !important;
    font-size: 10px !important;
  }
  .modal-body,
  #menuBody,
  #shopBody {
    padding: 8px 10px 24px !important;
    gap: 8px !important;
  }
  .k3d-preview-card {
    padding: 12px 14px !important;
    max-width: min(94%, 380px) !important;
  }
  .k3d-preview-stage {
    width: 156px !important;
    height: 156px !important;
    margin: 6px auto !important;
  }
}
html.landscape-auto-rotated .modal-card {
  width: min(98%, 900px) !important;
  height: 95% !important;
  max-height: 97% !important;
  border-radius: 14px !important;
}
html.landscape-auto-rotated .modal-header {
  padding: 6px 44px 6px 10px !important;
}
html.landscape-auto-rotated .modal-tabs {
  padding: 5px 8px !important;
}
html.landscape-auto-rotated .tab-btn {
  padding: 4px 9px !important;
  font-size: 10px !important;
}
html.landscape-auto-rotated .modal-body,
html.landscape-auto-rotated #menuBody,
html.landscape-auto-rotated #shopBody {
  padding: 8px 10px 24px !important;
}
html.landscape-auto-rotated .k3d-preview-stage {
  width: 148px !important;
  height: 148px !important;
  margin: 4px auto !important;
}

/* ============================================================================
   18. UNIVERSAL MOBILE FULL-SCREEN FIT (320px Nokia/S7 Edge -> iPhone 16/18 Pro Max)
   Exact edge-to-edge rotated 100% viewport fit + compact top HUD + maximum crisp
   proportional Karkacha board (ZERO stretching, ZERO empty half-screen, ZERO clipping!)
   ============================================================================ */
html.landscape-auto-rotated body {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: var(--rot-w, 100dvh) !important;
  max-width: none !important;
  height: var(--rot-h, 100dvw) !important;
  max-height: var(--rot-h, 100dvw) !important;
  transform: rotate(90deg) translateY(calc(-1 * var(--rot-h, 100dvw))) !important;
  transform-origin: top left !important;
  padding: 2px max(6px, env(safe-area-inset-top)) 3px max(6px, env(safe-area-inset-bottom)) !important;
  gap: 2px !important;
  overflow: hidden !important;
}
html.landscape-auto-rotated body #topHudBar.top-hud-bar {
  width: 100% !important;
  max-width: 100% !important;
  padding: 2px 7px 3px !important;
  gap: 2px !important;
  border-radius: 9px !important;
  flex-shrink: 0 !important;
}
html.landscape-auto-rotated body #topHudBar .hud-tier-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  padding-bottom: 2px !important;
  gap: 6px !important;
}
html.landscape-auto-rotated body #topHudBar .hud-tier-bottom {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 6px !important;
}
html.landscape-auto-rotated body #topHudBar .green-menu-btn,
html.landscape-auto-rotated body #topHudBar .round-hud-btn {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 2 !important;
}
html.landscape-auto-rotated body #gameplayStyleStrip.style-strip {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 5px !important;
  padding: 2px 6px !important;
  flex-shrink: 0 !important;
}
html.landscape-auto-rotated body #stripRightBorderGroup {
  border-top: none !important;
  border-left: 1px solid rgba(250, 204, 21, 0.25) !important;
  padding-top: 0 !important;
  padding-left: 6px !important;
}
html.landscape-auto-rotated body #gameplayTableArena {
  width: 100% !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  padding: 2px 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
html.landscape-auto-rotated body #gameplayTableWrap.table-stage-wrap {
  width: min(98%, calc((var(--rot-h, 100dvw) - 74px) * 1080 / 610)) !important;
  max-width: 98% !important;
  max-height: 100% !important;
  aspect-ratio: 1080 / 610 !important;
  height: auto !important;
  margin: 0 auto !important;
}
html.landscape-auto-rotated body #karkachaBoard {
  width: 100% !important;
  height: 100% !important;
  border-radius: 16px !important;
  display: block !important;
}
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 2px max(6px, env(safe-area-inset-right)) 3px max(6px, env(safe-area-inset-left)) !important;
    gap: 2px !important;
  }
  body #topHudBar.top-hud-bar {
    width: 100% !important;
    max-width: 100% !important;
    padding: 2px 7px 3px !important;
    gap: 2px !important;
    border-radius: 9px !important;
  }
  body #gameplayStyleStrip.style-strip {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: 1fr 1fr !important;
    padding: 2px 6px !important;
  }
  body #gameplayTableWrap.table-stage-wrap {
    width: min(98%, calc((100dvh - 74px) * 1080 / 610)) !important;
    max-width: 98% !important;
    max-height: 100% !important;
    aspect-ratio: 1080 / 610 !important;
    height: auto !important;
  }
  body #karkachaBoard {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px !important;
  }
}

/* ============================================================================
   19. CINEMATIC FULL-SCREEN VS VICTORY SCREEN (EXACT REFERENCE MATCH!)
   ID-level specificity guarantees ZERO yellow box & ZERO green/red card frames!
   ============================================================================ */
#victoryOverlay.victory-overlay {
  background:
    radial-gradient(ellipse 68% 48% at 50% 24%, rgba(245, 158, 11, 0.34) 0%, transparent 65%),
    linear-gradient(180deg, rgba(24, 14, 44, 0.78) 0%, rgba(72, 28, 38, 0.56) 40%, rgba(5, 14, 28, 0.70) 100%) !important;
  backdrop-filter: blur(2.5px) !important;
  padding: 0 !important;
  overflow: hidden !important;
}
#victoryOverlay #victoryCardEl.victory-card,
#victoryOverlay #victoryCardEl.victory-card.v-transparent {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 10px 18px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  overflow: hidden !important;
}
#victoryOverlay #victoryWinnerPanel.victory-player-panel,
#victoryOverlay #victoryLoserPanel.victory-player-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px !important;
  overflow: visible !important;
}
.k3d-v-crest-header {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-top: 2px;
  padding: 0 116px;
  max-width: 100%;
  box-sizing: border-box;
}
.k3d-v-top-right {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}
.k3d-v-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.86);
  border: 1.5px solid rgba(250, 204, 21, 0.62);
  color: #fef9c3;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0,0,0,0.75);
}
.k3d-v-close-btn {
  position: static !important;
  width: 30px !important;
  height: 30px !important;
}
.k3d-v-crest-header {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-top: 2px;
}
.k3d-v-crest-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.92), rgba(69, 26, 3, 0.95));
  border: 2px solid #fde047;
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.55), 0 8px 20px rgba(0,0,0,0.85);
}
.k3d-v-crest-crown { font-size: 18px; }
.k3d-v-crest-brand {
  font-family: 'Orbitron', 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.92);
}
.k3d-v-reason-sub {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #f1f5f9;
  text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}
.k3d-v-duel-stage {
  position: relative;
  z-index: 5;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(14px, 4vw, 48px) !important;
  width: 100%;
  max-width: 780px;
  margin: auto 0;
}
.k3d-v-player-col {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px !important;
  min-width: 132px;
}
.k3d-v-winner-glow-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 240px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.52) 0%, rgba(250, 204, 21, 0.18) 42%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  animation: k3dWinPulseAura 2.4s ease-in-out infinite;
}
@keyframes k3dWinPulseAura {
  0%, 100% { opacity: 0.78; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
.k3d-v-winner-headline {
  position: relative;
  z-index: 2;
  margin-bottom: 10px;
  font-family: 'Poppins', 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 42%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.95)) drop-shadow(0 0 12px rgba(250,204,21,0.55));
}
.k3d-v-opp-headline {
  font-size: 12px;
  font-weight: 900;
  color: #cbd5e1;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0,0,0,0.95);
  margin-bottom: 10px;
}
.k3d-v-avatar-box {
  position: relative;
  z-index: 2;
  width: 118px;
  height: 118px;
  border-radius: 16px;
  padding: 5px;
  background: #0f172a;
  box-shadow: 0 14px 32px rgba(0,0,0,0.88);
}
.k3d-v-avatar-box.winner-box {
  background: linear-gradient(145deg, #fef08a 0%, #22c55e 38%, #facc15 72%, #b45309 100%);
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.72), 0 14px 34px rgba(0,0,0,0.9);
}
.k3d-v-avatar-box.loser-box {
  background: linear-gradient(145deg, #94a3b8 0%, #475569 55%, #1e293b 100%);
  border: 1.5px solid rgba(148, 163, 184, 0.55);
}
.k3d-v-dp-img {
  width: 100%;
  height: 100%;
  border-radius: 11px;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: #090d16;
}
.k3d-v-star-badge {
  position: absolute;
  top: -12px;
  z-index: 5;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #38bdf8, #1d4ed8);
  border: 2px solid #e0f2fe;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0,0,0,0.85);
}
.k3d-v-star-badge.left { left: -12px; }
.k3d-v-star-badge.right { right: -12px; }
.k3d-v-top-gem, .k3d-v-bot-gem {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #4ade80, #15803d);
  border: 2px solid #fef08a;
  z-index: 4;
}
.k3d-v-top-gem { top: -7px; }
.k3d-v-bot-gem { bottom: -7px; background: linear-gradient(135deg, #fef08a, #ca8a04); }
.k3d-v-name-plate {
  position: relative;
  z-index: 2;
  padding: 3px 16px;
  border-radius: 8px;
  background: rgba(5, 9, 20, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.95);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k3d-v-reward-chip {
  position: relative;
  z-index: 2;
  padding: 2px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e, #15803d);
  border: 1.5px solid #bbf7d0;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(22,163,74,0.55);
}
.k3d-v-lose-sub {
  font-size: 10px;
  font-weight: 800;
  color: #cbd5e1;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}
.k3d-v-center-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.k3d-v-vs-text {
  font-family: 'Orbitron', 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #fef9c3 0%, #facc15 50%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.95));
}
.k3d-v-pot-glass {
  width: 96px;
  padding: 8px 10px 6px;
  border-radius: 14px;
  background: rgba(6, 10, 22, 0.72);
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  box-shadow: 0 10px 26px rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.k3d-v-pot-num {
  font-family: 'Orbitron', 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}
.k3d-v-fly-coins {
  position: absolute;
  top: 58%;
  left: -36px;
  display: flex;
  gap: 4px;
  font-size: 14px;
  pointer-events: none;
  animation: k3dCoinsFlyLeft 1.4s ease-in-out infinite;
}
@keyframes k3dCoinsFlyLeft {
  0% { transform: translateX(30px) scale(0.8); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateX(-34px) translateY(-10px) scale(1.08); opacity: 0; }
}
.k3d-v-mini-stats {
  position: relative;
  z-index: 5;
  background: rgba(6, 10, 22, 0.65) !important;
  border: 1px solid rgba(250, 204, 21, 0.25) !important;
  border-radius: 10px !important;
  padding: 4px 12px !important;
  max-width: 440px !important;
  margin: 0 auto !important;
}
.k3d-v-back-red-btn {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  border: 2px solid #fca5a5;
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.85);
}
.k3d-v-actions-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-left: 56px;
}
.k3d-v-play-btn {
  padding: 7px 18px !important;
  font-size: 12.5px !important;
  background: linear-gradient(180deg, #4ade80, #16a34a) !important;
  color: #ffffff !important;
  border: 1.5px solid #bbf7d0 !important;
  box-shadow: 0 5px 16px rgba(34,197,94,0.5) !important;
}
.k3d-v-shop-btn {
  padding: 7px 14px !important;
  font-size: 12px !important;
  background: linear-gradient(180deg, #facc15, #d97706) !important;
  color: #0f172a !important;
  border: 1.5px solid #fef08a !important;
}
.k3d-v-util-btn {
  padding: 6px 10px !important;
  font-size: 10.5px !important;
}
.k3d-v-rate-btn {
  padding: 6px 10px !important;
  font-size: 10.5px !important;
  background: linear-gradient(180deg, #facc15, #b45309) !important;
  color: #0f172a !important;
}
/* Compact mobile-landscape & rotated-phone Victory fit (ZERO clipping on 360px-430px tall screens!) */
@media (max-height: 460px), (max-width: 720px) {
  .k3d-v-crest-brand { font-size: 13px; }
  .k3d-v-reason-sub { font-size: 9.5px; }
  .k3d-v-winner-headline { font-size: 21px; }
  .k3d-v-avatar-box { width: 84px; height: 84px; border-radius: 12px; padding: 4px; }
  .k3d-v-vs-text { font-size: 24px; }
  .k3d-v-pot-glass { width: 80px; padding: 5px 7px; }
  .k3d-v-pot-glass svg { width: 42px; height: 32px; }
  .k3d-v-mini-stats { display: none !important; }
  .k3d-v-name-plate { font-size: 11.5px; padding: 2px 10px; }
  .k3d-v-reward-chip { font-size: 9.5px; }
  .k3d-v-back-red-btn { width: 36px; height: 36px; font-size: 16px; left: 10px; bottom: 8px; }
  .k3d-v-play-btn { padding: 5px 14px !important; font-size: 11px !important; }
  .k3d-v-shop-btn { padding: 5px 11px !important; font-size: 11px !important; }
  .k3d-v-util-btn, .k3d-v-rate-btn { padding: 4px 8px !important; font-size: 9.5px !important; }
}
html.landscape-auto-rotated .k3d-v-crest-brand { font-size: 13px; }
html.landscape-auto-rotated .k3d-v-reason-sub { font-size: 9.5px; }
html.landscape-auto-rotated .k3d-v-winner-headline { font-size: 20px; }
html.landscape-auto-rotated .k3d-v-avatar-box { width: 82px; height: 82px; border-radius: 12px; padding: 4px; }
html.landscape-auto-rotated .k3d-v-vs-text { font-size: 23px; }
html.landscape-auto-rotated .k3d-v-pot-glass { width: 78px; padding: 5px 6px; }
html.landscape-auto-rotated .k3d-v-pot-glass svg { width: 40px; height: 30px; }
html.landscape-auto-rotated .k3d-v-mini-stats { display: none !important; }
html.landscape-auto-rotated .k3d-v-back-red-btn { width: 36px; height: 36px; font-size: 16px; left: 10px; bottom: 8px; }
html.landscape-auto-rotated .k3d-v-play-btn { padding: 5px 13px !important; font-size: 11px !important; }
html.landscape-auto-rotated .k3d-v-shop-btn { padding: 5px 10px !important; font-size: 10.5px !important; }
html.landscape-auto-rotated .k3d-v-util-btn,
html.landscape-auto-rotated .k3d-v-rate-btn { padding: 4px 8px !important; font-size: 9.5px !important; }

/* =========================================================================
   SECTION 20: 8-PLAYER KNOCKOUT TOURNAMENT BRACKET — PERFECT MOBILE FIT
   Fixes squashed star pills (line-height:1.15), full-screen rotated phone
   edge-to-edge fit, zero clipping on iPhone 16 (393x852) & small Androids.
   ========================================================================= */
#tournamentBracketOverlay {
  padding: 6px !important;
  overflow: hidden !important;
}
#tournamentBracketOverlay #tournamentBracketCardBody {
  width: 100% !important;
  max-width: 960px !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: 8px 11px !important;
  gap: 6px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 16px !important;
}
.tb-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(5,9,18,0.98));
  border: 2px solid #facc15;
  border-radius: 11px;
  padding: 5px 10px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 6px 16px rgba(0,0,0,0.85);
}
.tb-header-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #fef08a;
  font-family: 'Orbitron', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-header-next {
  font-size: 10px;
  color: #bae6fd;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}
.tb-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.tb-btn { padding: 4px 10px !important; font-size: 10.5px !important; }
.tb-btn-enter {
  background: linear-gradient(180deg, #4ade80, #16a34a) !important;
  color: #fff !important;
  border: 1px solid #bbf7d0 !important;
}
.tb-btn-close {
  background: linear-gradient(180deg, #ef4444, #991b1b) !important;
  color: #fff !important;
  border-color: #fca5a5 !important;
  padding: 4px 8px !important;
}
.tb-scroll-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px 0;
}
.tb-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.14fr 1.05fr 0.14fr 1.05fr;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
}
.tb-col-qf {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  height: 100%;
}
.tb-col-sf {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
  height: 100%;
}
.tb-col-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
}
.tb-conn-qf {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 76%;
}
.tb-conn-arm {
  height: 30%;
  border-top: 2.5px solid #ffffff;
  border-right: 2.5px solid #ffffff;
  border-bottom: 2.5px solid #ffffff;
  border-radius: 0 7px 7px 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}
.tb-conn-sf {
  height: 48%;
  border-top: 2.5px solid #ffffff;
  border-right: 2.5px solid #ffffff;
  border-bottom: 2.5px solid #ffffff;
  border-radius: 0 7px 7px 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}
.tb-match-box {
  padding: 4px 6px;
  border-radius: 10px;
  border: 1.8px solid #94a3b8;
  background: linear-gradient(175deg, rgba(44,54,74,0.94), rgba(15,23,42,0.97));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 5px 12px rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tb-match-box.tb-active {
  border-color: #4ade80;
  background: linear-gradient(175deg, rgba(20,83,45,0.92), rgba(11,17,32,0.97));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 0 14px rgba(74,222,128,0.5), 0 5px 12px rgba(0,0,0,0.75);
}
.tb-match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(5,8,17,0.72);
  padding: 1.5px 6px;
  border-radius: 5px;
  line-height: 1.25;
}
.tb-match-box.tb-active .tb-match-head { color: #86efac; }
.tb-live-pill {
  background: linear-gradient(180deg, #4ade80, #16a34a);
  color: #052e16;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 7px;
  line-height: 1.3;
}
.tb-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.tb-player-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  flex: 1;
  position: relative;
}
.tb-player-slot.tb-lost { opacity: 0.36; filter: grayscale(0.75); }
.tb-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tb-avatar-img,
.tb-avatar-tbd {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  box-shadow: 0 3px 7px rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  color: #94a3b8;
  font-weight: 900;
  font-size: 14px;
}
.tb-big .tb-avatar-img,
.tb-big .tb-avatar-tbd { width: 42px; height: 42px; }
.tb-avatar-img.tb-won-border { border-color: #facc15; }
.tb-star-pill {
  position: absolute;
  top: -5px;
  color: #ffffff;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1.2 !important;
  padding: 1px 4px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.85);
  z-index: 3;
  white-space: nowrap;
}
.tb-star-left { left: -6px; background: linear-gradient(180deg, #38bdf8, #1d4ed8); }
.tb-star-right { right: -6px; background: linear-gradient(180deg, #4ade80, #15803d); }
.tb-won-pill {
  position: absolute;
  bottom: -4px;
  left: -4px;
  background: linear-gradient(180deg, #fef08a, #ca8a04);
  color: #451a03;
  font-size: 6.5px;
  font-weight: 900;
  line-height: 1.2 !important;
  padding: 1px 4px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.85);
  z-index: 3;
}
.tb-player-name {
  font-size: 8.5px;
  font-weight: 900;
  color: #fff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 82px;
  background: rgba(5,8,17,0.68);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.25;
}
.tb-vs {
  font-size: 10px;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74,222,128,0.8), 0 2px 4px #000;
  flex-shrink: 0;
}
.tb-big .tb-vs { font-size: 12px; }
.tb-round-banner {
  background: linear-gradient(180deg, #fde047, #ca8a04);
  color: #451a03;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 12px;
  border-radius: 6px;
  border: 1.5px solid #fef9c3;
  box-shadow: 0 3px 8px rgba(0,0,0,0.75);
  letter-spacing: 0.5px;
}
.tb-prize-pill {
  font-size: 11px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(15,23,42,0.92);
  padding: 2px 11px;
  border-radius: 999px;
  border: 1.5px solid #facc15;
  box-shadow: 0 3px 8px rgba(0,0,0,0.7);
}

/* Mobile landscape & iPhone 16 rotated auto-fit: ALL 4 QF + 2 SF + Grand Final + Trophy fit 100% with ZERO scroll/clip! */
html.landscape-auto-rotated #tournamentBracketOverlay {
  padding: 4px !important;
}
html.landscape-auto-rotated #tournamentBracketOverlay #tournamentBracketCardBody {
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: 5px 8px !important;
  gap: 4px !important;
  border-radius: 12px !important;
}
html.landscape-auto-rotated .tb-header-bar { padding: 4px 8px; border-radius: 9px; }
html.landscape-auto-rotated .tb-header-title { font-size: 10.5px; }
html.landscape-auto-rotated .tb-btn { padding: 3px 8px !important; font-size: 9.5px !important; }
html.landscape-auto-rotated .tb-col-qf { gap: 3px; }
html.landscape-auto-rotated .tb-match-box { padding: 3px 5px; gap: 2px; border-radius: 8px; }
html.landscape-auto-rotated .tb-match-head { font-size: 7.5px; padding: 1px 5px; }
html.landscape-auto-rotated .tb-qf .tb-avatar-img,
html.landscape-auto-rotated .tb-qf .tb-avatar-tbd { width: 26px; height: 26px; border-radius: 6px; font-size: 11px; }
html.landscape-auto-rotated .tb-big .tb-avatar-img,
html.landscape-auto-rotated .tb-big .tb-avatar-tbd { width: 34px; height: 34px; border-radius: 7px; font-size: 13px; }
html.landscape-auto-rotated .tb-star-pill { font-size: 6.5px; padding: 1px 3.5px; top: -4px; }
html.landscape-auto-rotated .tb-player-name { font-size: 7.5px; max-width: 72px; margin-top: 1px; padding: 0.5px 4px; }
html.landscape-auto-rotated .tb-trophy-svg { width: 42px; height: 38px; }
html.landscape-auto-rotated .tb-round-banner { font-size: 8.5px; padding: 1.5px 10px; }
html.landscape-auto-rotated .tb-prize-pill { font-size: 9.5px; padding: 1.5px 9px; }
@media (max-height: 460px) {
  #tournamentBracketOverlay #tournamentBracketCardBody { padding: 5px 8px !important; gap: 4px !important; border-radius: 12px !important; }
  .tb-header-bar { padding: 4px 8px; }
  .tb-header-title { font-size: 10.5px; }
  .tb-col-qf { gap: 3px; }
  .tb-match-box { padding: 3px 5px; gap: 2px; border-radius: 8px; }
  .tb-qf .tb-avatar-img, .tb-qf .tb-avatar-tbd { width: 26px; height: 26px; border-radius: 6px; }
  .tb-big .tb-avatar-img, .tb-big .tb-avatar-tbd { width: 34px; height: 34px; border-radius: 7px; }
  .tb-star-pill { font-size: 6.5px; padding: 1px 3.5px; top: -4px; }
  .tb-player-name { font-size: 7.5px; max-width: 72px; }
  .tb-trophy-svg { width: 42px; height: 38px; }
}

/* ============================================================================
   TURBO PERFORMANCE LAYER (Zero-Lag Modals, Settings, Notifications & HUD!)
   Eliminates full-screen GPU backdrop-filter stalls on VPS / mobile / desktop
   ============================================================================ */
.modal-backdrop,
.friends-hub-backdrop,
.tournament-bracket-backdrop,
.friend-card-popup,
.notif-popover-panel,
.victory-overlay,
#inactivityPauseOverlay,
#topProfileBar.lobby-profile-topstrip,
.fiery-logo-box,
header.top-hud,
.top-hud {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.modal-backdrop,
.friends-hub-backdrop,
.friend-card-popup {
  background: rgba(2, 6, 18, 0.88) !important;
}
.modal-card,
.friends-hub-card,
#lobbyFriendListMenu,
#lobbyNotifDropdownMenu {
  contain: style;
}
img {
  image-rendering: auto;
}

/* ============================================================================
   UNIVERSAL SMOOTH SCROLLING & SLIDING FIX (Desktop + Native Mobile + Rotated 90deg!)
   ============================================================================ */
.modal-body,
#menuBody,
#shopBody,
#friendsHubBody,
#genericActionSheetBody,
.pool-player-card,
.modal-tabs,
#shopTabsRow,
#menuTabs,
.futuristic-slide-track,
#lobbyFriendListMenu,
#lobbyNotifDropdownMenu {
  touch-action: pan-x pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}
.modal-tabs,
#shopTabsRow,
#menuTabs,
.futuristic-slide-track {
  cursor: grab;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  scroll-behavior: auto !important;
}
.modal-tabs:active,
#shopTabsRow:active,
#menuTabs:active,
.futuristic-slide-track:active {
  cursor: grabbing;
}
.k3d-shop-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  margin: 4px 0 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* ============================================================================
   100% RESPONSIVE GAMEPLAY TOP HUD BAR (ALL PHONES & ROTATED LANDSCAPE)
   Preserves EXACT original 2-Tier order & positions while preventing ANY overlap or clipping!
   ============================================================================ */
#topHudBar.top-hud-bar {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: min(1100px, 100%) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
#topHudBar .hud-tier-top {
  display: grid !important;
  grid-template-columns: minmax(0, 0.90fr) auto minmax(0, 1.48fr) !important;
  align-items: center !important;
  gap: clamp(3px, 0.65vw, 8px) !important;
  width: 100% !important;
  min-width: 0 !important;
}
#topHudBar .hud-tier-bottom {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: clamp(4px, 0.7vw, 8px) !important;
  width: 100% !important;
  min-width: 0 !important;
}
#topHudBar .left-top-group,
#topHudBar .brand-center-pill,
#topHudBar .right-top-group,
#topHudBar #p2SlotsWrap,
#topHudBar .center-attached-cluster,
#topHudBar #p1SlotsWrap {
  grid-column: auto !important;
  grid-row: auto !important;
}
#topHudBar .left-top-group,
#topHudBar .right-top-group {
  display: flex !important;
  align-items: center !important;
  gap: clamp(3px, 0.45vw, 6px) !important;
  min-width: 0 !important;
  overflow: visible !important;
}
#topHudBar .right-top-group {
  justify-content: flex-end !important;
}
#topHudBar .name-bar-row {
  min-width: 0 !important;
  flex: 1 1 0 !important;
  max-width: 310px !important;
  padding: 0 clamp(4px, 0.6vw, 7px) !important;
  gap: clamp(3px, 0.4vw, 5px) !important;
  overflow: hidden !important;
}
#topHudBar .right-hud-controls {
  display: flex !important;
  align-items: center !important;
  gap: clamp(2px, 0.35vw, 5px) !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}
@media (max-width: 960px), (max-height: 520px) {
  #topHudBar.top-hud-bar {
    padding: 3px 6px 4px !important;
    gap: 2.5px !important;
    max-width: 100% !important;
  }
  #topHudBar .hud-tier-top {
    grid-template-columns: minmax(0, 0.78fr) auto minmax(0, 1.62fr) !important;
    gap: 4px !important;
    padding-bottom: 2px !important;
  }
  #topHudBar .green-menu-btn {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }
  #topHudBar .name-bar-row {
    height: 22px !important;
    min-width: 0 !important;
    padding: 0 4px !important;
    gap: 3px !important;
  }
  #topHudBar .player-name-txt {
    font-size: 9px !important;
    min-width: 28px !important;
  }
  #topHudBar .lines-pill {
    font-size: 7.5px !important;
    padding: 0.5px 3.5px !important;
  }
  #topHudBar .star-badge {
    font-size: 8px !important;
    padding: 0.5px 3.5px !important;
  }
  #topHudBar .brand-center-pill {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 8px !important;
    padding: 1px 5px !important;
    letter-spacing: 0.3px !important;
  }
  #topHudBar .brand-center-pill svg {
    width: 11px !important;
    height: 11px !important;
    margin-right: 2px !important;
  }
  #topHudBar .right-hud-controls {
    gap: 2px !important;
  }
  #topHudBar .round-hud-btn {
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
    border-radius: 6px !important;
    padding: 0 !important;
  }
  #topHudBar .round-hud-btn svg {
    width: 11px !important;
    height: 11px !important;
  }
  #topHudBar .slots-row-wrap {
    min-width: 0 !important;
    padding: 1px 4px !important;
    height: 20px !important;
  }
  #topHudBar .nine-slots-canvas {
    min-width: 48px !important;
    height: 15px !important;
  }
  #topHudBar .square-avatar-box {
    width: 30px !important;
    height: 30px !important;
  }
  #topHudBar .center-coins-box {
    min-width: 62px !important;
    min-height: 28px !important;
    height: auto !important;
    padding: 1px 5px !important;
  }
}
@media (max-width: 720px) {
  #topHudBar .lines-pill { display: none !important; }
  #topHudBar .hud-tier-top {
    grid-template-columns: minmax(0, 0.72fr) auto minmax(0, 1.78fr) !important;
  }
}
html.landscape-auto-rotated #topHudBar.top-hud-bar {
  display: flex !important;
  flex-direction: column !important;
  padding: 2px 6px 3px !important;
  gap: 2px !important;
  max-width: 100% !important;
}
html.landscape-auto-rotated #topHudBar .hud-tier-top {
  grid-template-columns: minmax(0, 0.80fr) auto minmax(0, 1.62fr) !important;
  gap: 4px !important;
}
html.landscape-auto-rotated #topHudBar .hud-tier-bottom {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
}
html.landscape-auto-rotated #topHudBar .brand-center-pill {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 8px !important;
  padding: 1px 5px !important;
}
html.landscape-auto-rotated #topHudBar .round-hud-btn {
  width: 21px !important;
  height: 21px !important;
  min-width: 21px !important;
  border-radius: 6px !important;
}
html.landscape-auto-rotated #topHudBar .round-hud-btn svg {
  width: 11px !important;
  height: 11px !important;
}
html.landscape-auto-rotated #topHudBar .name-bar-row {
  height: 22px !important;
  min-width: 0 !important;
}

/* ============================================================================
   ZERO WHITE-SCREEN KEYBOARD LOCK + COMPACT GAMING MINI-KEYBOARD + DOCKED CHAT
   ============================================================================ */
html {
  background: #050814 !important;
  background-color: #050814 !important;
  min-height: 100% !important;
  overscroll-behavior: none !important;
}
body {
  background-color: #050814 !important;
}

/* Keyboard-Docked Chat Mode (keeps Header, Messages, Input & Send 100% visible above keyboard!) */
#compactChatPopover.k3d-kb-docked,
#lobbyFriendMiniChatBox.k3d-kb-docked {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: var(--k3d-kb-top, 6px) !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  width: min(440px, calc(100% - 16px)) !important;
  max-height: var(--k3d-kb-maxh, 170px) !important;
  padding: 5px 8px !important;
  gap: 4px !important;
  z-index: 2147483645 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
#compactChatPopover.k3d-kb-docked .chat-mini-history,
#lobbyFriendMiniChatBox.k3d-kb-docked #friendMiniChatLog {
  min-height: 30px !important;
  max-height: var(--k3d-kb-logh, 58px) !important;
  padding: 3px 6px !important;
  font-size: 10px !important;
}
#compactChatPopover.k3d-kb-docked .quick-chat-grid {
  padding: 1px 0 !important;
  gap: 3px !important;
}
#lobbyFriendMiniChatBox.k3d-kb-docked .k3d-minichat-footer-actions {
  display: none !important;
}

/* Sleek Ultra-Compact In-Game Mini Keyboard (~114px tall — 60% smaller than Android Gboard!) */
#k3dMiniKeyboard {
  position: fixed;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 10px));
  background: linear-gradient(180deg, rgba(13, 21, 42, 0.98) 0%, rgba(5, 8, 20, 0.99) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.58);
  border-radius: 12px;
  padding: 4px 5px 5px;
  box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.92), 0 0 18px rgba(56, 189, 248, 0.2);
  z-index: 2147483647;
  display: none;
  flex-direction: column;
  gap: 3px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#k3dMiniKeyboard.open {
  display: flex;
}
.k3d-mk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 2px 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.k3d-mk-emojis {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  flex: 1;
}
.k3d-mk-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  width: 100%;
}
.k3d-mk-key {
  flex: 1 1 0;
  min-width: 0;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 2px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.72) !important;
}
.k3d-mk-key:active {
  transform: translateY(1px) scale(0.96) !important;
  background: #334155;
}
.k3d-mk-key.fn {
  flex: 1.35 1 0;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #fde047;
  font-size: 9.5px;
}
.k3d-mk-key.space {
  flex: 3.6 1 0;
  font-size: 9.5px;
  color: #cbd5e1;
}
.k3d-mk-key.send {
  flex: 1.85 1 0;
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  border-color: #fef08a;
  color: #090d16;
  font-weight: 900;
  font-size: 10px;
}
.k3d-mk-chip {
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.92);
  color: #e0f2fe;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: none !important;
}

/* ============================================================================
   UNIVERSAL TACTILE BUTTON PRESS FEEDBACK (ALL GAME & LOGIN BUTTONS — ZERO LAYOUT CHANGE)
   ============================================================================ */
button,
[role="button"],
.lobby-icon-sq,
.big-tile-btn,
.currency-plus,
.swatch-pill,
.tab-btn,
.k3d-clickable-showcase-card {
  transition: transform 0.09s cubic-bezier(0.22, 1, 0.36, 1), filter 0.09s ease, box-shadow 0.09s ease !important;
}
button:not(:disabled):active,
[role="button"]:active,
.k3d-btn-pressing {
  transform: translateY(2px) scale(0.945) !important;
  filter: brightness(1.16) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.58), 0 0 12px rgba(250, 204, 21, 0.5) !important;
}
.k3d-tap-ripple {
  position: fixed;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.72) 0%, rgba(250, 204, 21, 0.28) 55%, rgba(250, 204, 21, 0) 75%);
  pointer-events: none;
  z-index: 2147483647;
  transform: scale(0.4);
  opacity: 0.95;
  animation: k3dTapRippleAnim 0.28s ease-out forwards;
}
@keyframes k3dTapRippleAnim {
  0% { transform: scale(0.4); opacity: 0.95; }
  100% { transform: scale(2.4); opacity: 0; }
}









