/* ==========================================================================
   ToonTaggest Authentic Toontown Styling & Theme
   ========================================================================== */

:root {
  --screen-dim: rgba(0, 0, 0, 0.53);
  --menu-edge: 24px;
  --menu-header-top: 16px;
  --menu-action-gap: 10px;
  --menu-small-button-height: 40px;
  --menu-small-button-font: 18px;
  --menu-small-button-padding: 7px 16px;
}

@font-face {
  font-family: Impress;
  src: url(/assets/ui/impress.ttf) format("truetype");
  font-display: swap;
}

@font-face {
  font-family: Minnie;
  src: url(/assets/ui/minnie.ttf) format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body {
  color: #25335b;
  background: #94ceff;
  font-family: Impress, "Trebuchet MS", sans-serif;
  cursor: url(/assets/ui/toontown/toon-cursor.cur) 1 2, auto;
}

button, input, select, textarea, a, label {
  font: inherit;
  cursor: url(/assets/ui/toontown/toon-cursor.cur) 1 2, auto;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

button {
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: url(/assets/ui/toontown/toon-cursor.cur) 1 2, not-allowed;
  opacity: 0.55;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

input:focus-visible {
  outline: 3px solid #518bd4;
}

[hidden] {
  display: none !important;
}

.btn-action-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
}

/* 3D Canvas */
#world {
  width: 100vw;
  height: 100vh;
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  transition: filter 0.8s;
}

body.at-title #world {
  filter: none;
}

body.in-menu #world {
  filter: none;
}

#scene-fade {
  pointer-events: none;
  opacity: 0;
  background: #000;
  position: fixed;
  inset: 0;
  z-index: 10;
  transition: opacity 0.4s ease;
}

/* App Container */
#app {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

#app button,
#app input,
#app a,
#app dialog,
#app .clickable,
.auth-screen,
.auth-card,
.menu,
.play-card,
.lobby-panel,
.main-map-carousel,
.map-carousel,
.map-card,
.character-select-row,
.bot-controls-row {
  pointer-events: auto;
}

#quick-play > *,
#ranked-play > *,
#practice-btn > *,
#create-private > *,
#join-private > *,
#open-cosmetics-btn > *,
#customize-toon-btn > *,
#add-bot > *,
#remove-bot > *,
#ready > *,
#lobby-leave > *,
#results-continue > *,
#results-quit-btn > *,
.auth-toon-card > * {
  pointer-events: none;
}

/* Authentic Toontown Yellow Pill Buttons (explicitly excluding .map-card, .mode-card, .character-card-btn) */
.primary:not(.map-card):not(.mode-card),
.secondary-btn:not(.map-card):not(.mode-card),
.leave:not(.map-card):not(.mode-card),
.icon-button:not(.map-card):not(.mode-card),
#results-quit-btn:not(.map-card),
#menu button:not(.icon-button):not(.map-card):not(.practice):not(.mode-card):not(.character-card-btn),
#lobby button:not(#lobby-copy):not(.model-target):not(.map-card):not(.character-card-btn) {
  text-shadow: none;
  background: linear-gradient(#ffffad 0%, #ffff43 16%, #f5f51b 46%, #e9e507 76%, #c7bc08 100%);
  border: 2px solid #999414;
  border-radius: 19px;
  padding: 8px 16px;
  box-shadow: inset 0 2px 3px #ffffe8, inset 3px 0 5px #d2cd2580, inset -3px 0 5px #9d990a70, inset 0 -3px 4px #8e850977, 0 3px 4px #0004;
  color: #000 !important;
  font-family: Impress, sans-serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, filter 0.08s ease;
}

.primary:not(.map-card):not(.mode-card):hover:not(:disabled),
.secondary-btn:not(.map-card):not(.mode-card):hover:not(:disabled),
.leave:not(.map-card):not(.mode-card):hover:not(:disabled),
.icon-button:not(.map-card):not(.mode-card):hover:not(:disabled),
#results-quit-btn:not(.map-card):hover:not(:disabled),
#menu button:not(.icon-button):not(.map-card):not(.practice):not(.mode-card):not(.character-card-btn):hover:not(:disabled),
#lobby button:not(#lobby-copy):not(.model-target):not(.map-card):not(.character-card-btn):hover:not(:disabled) {
  background: linear-gradient(#fffed3, #ffff67 22%, #ffff2e 57%, #e9d51e);
  border-color: #b9a819;
  box-shadow: inset 0 2px 3px #fffde7, inset 0 -3px 4px #a8992580, 0 4px 6px #0004;
  transform: translateY(-1px);
}

.primary:not(.map-card):not(.mode-card):active:not(:disabled),
.secondary-btn:not(.map-card):not(.mode-card):active:not(:disabled),
.leave:not(.map-card):not(.mode-card):active:not(:disabled),
.icon-button:not(.map-card):not(.mode-card):active:not(:disabled),
#results-quit-btn:not(.map-card):active:not(:disabled),
#menu button:not(.icon-button):not(.map-card):not(.practice):not(.mode-card):not(.character-card-btn):active:not(:disabled),
#lobby button:not(#lobby-copy):not(.model-target):not(.map-card):not(.character-card-btn):active:not(:disabled) {
  background: linear-gradient(#bab116, #e7dc13 24%, #f7ef29 78%, #ffff78);
  border-color: #8c8615;
  box-shadow: inset 0 3px 5px #615b2477, 0 1px 1px #0003;
  transform: translateY(1px);
}

/* Dialog & Card Panels */
.play-card, .lobby-panel, dialog, .toon-card {
  background: radial-gradient(at 35% 20%, rgba(255, 254, 241, 0.26) 15%, rgba(239, 243, 220, 0.22) 65%, rgba(207, 221, 186, 0.28) 100%);
  border: 4px solid rgba(23, 150, 63, 0.78);
  border-radius: 15px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), 0 4px rgba(7, 108, 42, 0.65), 0 8px 14px rgba(0, 0, 0, 0.22);
  padding: 16px;
}

/* Close & OK buttons */
.close-dialog, #game-exit {
  width: 48px;
  height: 48px;
  background: url(/assets/ui/toontown/mat-close-up.png) center/contain no-repeat;
  border: 0;
  font-size: 0;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px #0004);
}

.close-dialog:hover, #game-exit:hover {
  filter: brightness(1.15) drop-shadow(0 3px 4px #0006);
}

.close-dialog:active, #game-exit:active {
  background-image: url(/assets/ui/toontown/mat-close-down.png);
}

/* Topbar */
.topbar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

.top-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  padding: 0 !important;
}

.icon-button.is-muted {
  filter: grayscale(1) opacity(0.7);
}

/* ==========================================================================
   Epic Animated Intro & Title Screen
   ========================================================================== */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 2.5vh, 28px);
  background: radial-gradient(circle at center, rgba(148, 206, 255, 0.25) 0%, rgba(20, 35, 60, 0.65) 100%);
  backdrop-filter: blur(2px);
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.8s cubic-bezier(0.2, 0.9, 0.3, 1), transform 0.8s ease;
  overflow: hidden;
  user-select: none;
}

.title-screen.fade-out {
  opacity: 0;
  transform: scale(1.15);
  pointer-events: none;
}

/* Sunburst background rays */
.intro-sunburst {
  position: absolute;
  width: 250vmax;
  height: 250vmax;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    rgba(255, 235, 59, 0.12) 0deg 15deg,
    rgba(255, 255, 255, 0.02) 15deg 30deg
  );
  animation: sunburst-spin 50s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes sunburst-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Spotlight glow */
.intro-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 236, 153, 0.06) 0%, rgba(15, 25, 45, 0.42) 80%);
  pointer-events: none;
  z-index: 2;
}

/* Stage 1: WELCOME TO bouncing letters */
.intro-welcome {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Minnie, "Trebuchet MS", sans-serif;
  font-size: clamp(20px, 3.8vw, 42px);
  color: #ffeb3b;
  letter-spacing: clamp(2px, 0.5vw, 6px);
  text-shadow:
    3px 3px 0 #b71c1c,
    -2px -2px 0 #b71c1c,
    2px -2px 0 #b71c1c,
    -2px 2px 0 #b71c1c,
    0 8px 16px rgba(0, 0, 0, 0.6);
  opacity: 1;
  transform: translateY(0);
  animation: intro-welcome-drop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.intro-welcome.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes intro-welcome-drop {
  0% { opacity: 0; transform: translateY(-24px) scale(0.85); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-letter {
  display: inline-block;
  animation: welcome-bounce 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}

@keyframes welcome-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-8px) rotate(-3deg); }
  60% { transform: translateY(2px) rotate(2deg); }
}

/* Stage 2: Main Logo Container */
.intro-logo-container {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.logo-wrapper {
  position: relative;
  display: inline-block;
  transform: scale(1) rotate(0deg);
  opacity: 1;
  animation: intro-logo-slam 0.72s cubic-bezier(0.175, 0.885, 0.32, 1.275) both, logo-float 3.2s ease-in-out 0.75s infinite;
}

.logo-wrapper.slam-in {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

@keyframes intro-logo-slam {
  0% { transform: scale(0.25) rotate(-14deg); opacity: 0; }
  65% { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.intro-logo {
  width: min(580px, 56vh, 90vw);
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 28px rgba(255, 215, 64, 0.55));
  user-select: none;
}

.intro-logo-container.shaking {
  animation: logo-shudder 0.45s ease-out;
}

@keyframes logo-shudder {
  0% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-8px, 6px) scale(1.08); }
  40% { transform: translate(7px, -5px) scale(0.97); }
  60% { transform: translate(-5px, -3px) scale(1.03); }
  80% { transform: translate(3px, 2px) scale(0.99); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Stage 3: Arcade Attract Prompt */
.intro-prompt-wrap {
  position: relative;
  z-index: 10;
  margin-top: 8px;
  opacity: 1;
  transform: scale(1);
  animation: intro-prompt-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.18s both;
}

.intro-prompt-wrap.active {
  opacity: 1;
  transform: scale(1);
}

@keyframes intro-prompt-pop {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.arcade-start-btn {
  font-family: Minnie, "Trebuchet MS", sans-serif;
  font-size: clamp(20px, 3.2vw, 36px);
  color: #ffffff;
  background: linear-gradient(180deg, #ff9800 0%, #e65100 100%);
  border: 4px solid #fff;
  border-radius: 999px;
  padding: 12px 32px;
  box-shadow:
    0 6px 0 #bf360c,
    0 12px 20px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.6);
  text-shadow: 2px 2px 0 #25335b, 0 3px 6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: prompt-glow 1.4s ease-in-out infinite alternate;
}

.arcade-start-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 9px 0 #bf360c,
    0 16px 24px rgba(0, 0, 0, 0.6),
    inset 0 2px 6px rgba(255, 255, 255, 0.8);
}

.arcade-start-btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow:
    0 2px 0 #bf360c,
    0 4px 8px rgba(0, 0, 0, 0.4);
}

@keyframes prompt-glow {
  0% {
    filter: drop-shadow(0 0 6px rgba(255, 235, 59, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 152, 0, 0.95)) drop-shadow(0 0 30px rgba(255, 235, 59, 0.8));
  }
}

/* Skip Intro button */
.skip-intro-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 20;
  font-family: Impress, "Trebuchet MS", sans-serif;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  backdrop-filter: blur(4px);
}

.skip-intro-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: #ffeb3b;
  transform: scale(1.05);
}

/* Confetti particles canvas */
.intro-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

@keyframes logo-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

/* ==========================================================================
   Initial Login / Registration Screen (#auth-screen)
   ========================================================================== */
.auth-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: radial-gradient(circle at 50% 30%, rgba(25, 75, 138, 0.24) 0%, rgba(10, 22, 44, 0.46) 100%);
  pointer-events: auto;
  overflow: hidden;
}

.auth-stage {
  width: min(540px, 94vw);
  max-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-logo-showcase {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px 10px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 248, 196, 0.44) 0%, rgba(30, 64, 175, 0.34) 68%, rgba(15, 23, 42, 0.42) 100%);
  border: 3.5px solid rgba(245, 158, 11, 0.9);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  flex-shrink: 0;
}

.auth-logo-sunburst {
  position: absolute;
  width: 160%;
  height: 260%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    rgba(255, 235, 59, 0.16) 0deg 15deg,
    rgba(255, 255, 255, 0.02) 15deg 30deg
  );
  animation: sunburst-spin 45s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.auth-logo-aura {
  position: absolute;
  width: 420px;
  height: 190px;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 235, 59, 0.62) 0%, rgba(245, 158, 11, 0.22) 58%, transparent 76%);
  pointer-events: none;
  z-index: 0;
}

.auth-logo {
  position: relative;
  z-index: 1;
  width: clamp(320px, 36vw, 440px);
  height: clamp(140px, 21vh, 185px);
  max-height: 185px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 26px rgba(255, 215, 64, 0.65));
  animation: logo-float 3.2s ease-in-out infinite;
  flex-shrink: 0;
}

.auth-logo-tagline {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  border: 1.5px solid #f59e0b;
  color: #fef08a;
  font-family: Impress, sans-serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.8px;
}

.auth-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 20px 14px;
  text-align: center;
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  border-bottom: 2px solid #bdd4b7;
  padding-bottom: 5px;
}

.auth-header-text h2 {
  font: 20px / 1.1 Minnie, sans-serif;
  color: #175429;
  margin: 0 0 2px;
  text-shadow: 1px 1px #fff;
}

.auth-header-text p {
  font-size: 12.5px;
  color: #25335b;
  margin: 0;
  line-height: 1.2;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #d8e6c7;
  padding: 3px;
  border-radius: 11px;
  border: 2px solid #8ba482;
}

.auth-tab {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  color: #25335b;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tab.active {
  background: linear-gradient(180deg, #ffeb3b 0%, #f59e0b 100%);
  color: #1e293b;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-field label {
  font-size: 11.5px;
  font-weight: bold;
  color: #175429;
  letter-spacing: 0.4px;
}

.auth-field input {
  width: 100%;
  font-size: 15px;
  padding: 5px 10px;
  border: 2px solid #8d9eac;
  border-radius: 8px;
  background: #ffffff;
  color: #25335b;
}

.auth-toon-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.auth-toon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: #ffffff;
  border: 2px solid #8ba482;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.auth-toon-card.selected {
  background: #fff8e1;
  border-color: #e9604b;
  box-shadow: 0 0 10px rgba(233, 96, 75, 0.55);
  transform: translateY(-1px);
}

.auth-toon-card img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.auth-toon-card span {
  font-family: Minnie, sans-serif;
  font-size: 12px;
  color: #25335b;
}

.auth-submit-btn {
  width: 100%;
  min-height: 38px;
  font-size: 16.5px;
  margin-top: 2px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4b6344;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.8px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: #bdd4b7;
}

.auth-guest-btn {
  width: 100%;
  min-height: 36px;
  font-size: 15.5px !important;
}

/* ==========================================================================
   Full-Screen Interactive Main Menu Hub (#menu - 100vw x 100vh)
   ========================================================================== */
.menu {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 8px 16px 10px;
  background: linear-gradient(180deg, rgba(15, 32, 62, 0.16) 0%, rgba(15, 32, 62, 0.04) 50%, rgba(15, 32, 62, 0.18) 100%);
  pointer-events: auto;
}

/* Top Header Bar (Full Width, leaving space on far right for .topbar #sound/#help/#credits) */
.menu-hub-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  padding-right: 162px;
  background: radial-gradient(at 35% 20%, rgba(255, 254, 241, 0.3) 15%, rgba(239, 243, 220, 0.25) 65%, rgba(207, 221, 186, 0.3) 100%);
  border: 3.5px solid rgba(23, 150, 63, 0.8);
  border-radius: 13px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), 0 4px rgba(7, 108, 42, 0.65), 0 6px 12px rgba(0, 0, 0, 0.2);
}

.hub-brand-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 35, 59, 0.82);
  color: #ffffff;
  border: 2px solid #38bdf8;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

#menu-player-count {
  margin: 0;
  font-size: 12px;
  color: #ffffff;
  text-shadow: none;
}

/* Account Profile Card in Header */
.hub-profile-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, rgba(37, 51, 91, 0.68) 0%, rgba(23, 34, 64, 0.74) 100%);
  border: 2.5px solid #f39c12;
  border-radius: 11px;
  padding: 4px 12px;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
}

.hub-profile-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.hub-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hub-name-wrap label {
  font-size: 11px;
  color: #fef08a;
  font-weight: bold;
  white-space: nowrap;
}

#nickname {
  width: 112px;
  font-size: 13.5px;
  font-weight: bold;
  padding: 2px 7px;
  border: 2px solid #f59e0b;
  border-radius: 6px;
  background: #ffffff;
  color: #25335b;
}

.account-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(180deg, #ffeb3b 0%, #f59e0b 100%);
  color: #25335b;
  border: 1.5px solid #fffef0;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}

.account-level-title {
  font-family: Minnie, "Trebuchet MS", sans-serif;
  font-size: 12px;
  color: #ffeb29;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hub-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1.5px solid #93c5fd;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: bold;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

.hub-profile-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-xp-track {
  flex: 1;
  height: 8px;
  background: #0f172a;
  border: 1.5px solid #64748b;
  border-radius: 999px;
  overflow: hidden;
}

.account-xp-fill {
  height: 100%;
  min-width: 4px;
  background: linear-gradient(90deg, #22c55e 0%, #86efac 100%);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.account-xp-text {
  font-size: 11px;
  font-weight: bold;
  color: #e2e8f0;
  white-space: nowrap;
}

.hub-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hub-locker-btn {
  padding: 5px 12px !important;
  font-size: 13px !important;
  white-space: nowrap;
}

.lootbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: bold;
  border: 1.5px solid #ffffff;
}

.hub-small-btn {
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  white-space: nowrap;
}

#watch-trailer {
  position: static;
  width: auto;
  min-height: 32px;
}

/* Main Hub 2-Column Content Grid */
.menu-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
}

/* Left Column Stack: Prominent ToonTaggest Logo Showcase + Compact Playlist Mode Box */
.menu-left-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.menu-logo-showcase {
  position: relative;
  flex: 1 1 auto;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px 10px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 44%, rgba(255, 248, 196, 0.45) 0%, rgba(25, 75, 138, 0.3) 65%, rgba(15, 23, 42, 0.38) 100%);
  border: 3.5px solid rgba(245, 158, 11, 0.92);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.45), 0 6px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  pointer-events: auto;
}

.menu-logo-sunburst {
  position: absolute;
  width: 150%;
  height: 240%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    rgba(255, 235, 59, 0.15) 0deg 15deg,
    rgba(255, 255, 255, 0.02) 15deg 30deg
  );
  animation: sunburst-spin 50s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.menu-logo-aura {
  position: absolute;
  width: 460px;
  height: 220px;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 235, 59, 0.62) 0%, rgba(245, 158, 11, 0.22) 58%, transparent 76%);
  pointer-events: none;
  z-index: 0;
}

.menu-logo-heading {
  position: relative;
  z-index: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-showcase-logo,
.hero-logo {
  width: clamp(340px, 40vw, 490px);
  height: clamp(150px, 26vh, 230px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 26px rgba(255, 215, 64, 0.65));
  animation: logo-float 3.2s ease-in-out infinite;
  pointer-events: auto;
}

.menu-logo-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-logo-tagline {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #f59e0b;
  color: #fef08a;
  font-family: Impress, sans-serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.8px;
}

/* Reduced-Size Playlist Mode Box (Bottom of Left Column) */
.hub-modes-panel,
.menu-col-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px 10px;
  flex: 0 1 auto;
  height: clamp(320px, 46vh, 385px);
  max-height: 385px;
  min-height: 0;
  overflow: hidden;
}

.hub-character-panel,
.menu-col-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  padding: 10px 14px;
  min-height: 0;
  overflow: hidden;
}

.hub-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 2px solid #bdd4b7;
  padding-bottom: 3px;
  flex-shrink: 0;
}

.hub-section-heading h2 {
  font: 15px / 1.1 Minnie, sans-serif;
  color: #175429;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hub-section-heading span {
  font-size: 11.5px;
  color: #1e3a29;
  font-weight: bold;
  white-space: nowrap;
}

/* Compact 2x2 Interactive Game Mode Cards Grid */
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2.5px solid rgba(107, 142, 168, 0.88);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.48) 0%, rgba(241, 247, 237, 0.38) 100%);
  color: #0f172a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.92), 0 0 6px rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45), 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  min-height: 0;
  overflow: hidden;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: #f59e0b;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}

.mode-quick {
  border-color: rgba(22, 163, 74, 0.9);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(220, 252, 231, 0.4) 100%);
}

.mode-ranked {
  border-color: rgba(217, 119, 6, 0.9);
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.5) 0%, rgba(254, 243, 199, 0.4) 100%);
}

.mode-practice {
  border-color: rgba(2, 132, 199, 0.9);
  background: linear-gradient(145deg, rgba(240, 249, 255, 0.5) 0%, rgba(224, 242, 254, 0.4) 100%);
}

.mode-private {
  border-color: rgba(124, 58, 237, 0.9);
  background: linear-gradient(145deg, rgba(250, 245, 255, 0.5) 0%, rgba(243, 232, 255, 0.4) 100%);
  cursor: default;
}

.mode-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.mode-card-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}

.mode-card-tag {
  font-size: 9.5px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 51, 91, 0.18);
  color: #1e293b;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.mode-card-tag.ranked-tag {
  background: #92400e;
  color: #fef08a;
}

.mode-card-title {
  font-family: Minnie, sans-serif;
  font-size: 16.5px;
  color: #1e293b;
  line-height: 1.08;
  margin: 1px 0 0;
}

.mode-card-desc {
  font-size: 11.5px;
  line-height: 1.2;
  color: #1e293b;
  font-weight: 600;
  margin: 1px 0 3px;
}

.mode-card-cta {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: #25335b;
  color: #ffeb3b;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.4px;
  align-self: flex-start;
  text-shadow: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.private-card-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 1px;
}

.private-host-btn {
  width: 100%;
  min-height: 25px !important;
  font-size: 12px !important;
  padding: 2px 10px !important;
}

.private-join-row {
  display: flex;
  gap: 5px;
  width: 100%;
}

#room-code {
  flex: 1;
  min-width: 0;
  height: 25px;
  font-size: 12px;
  text-transform: uppercase;
  text-align: center;
  padding: 2px 6px;
  border: 2px solid #7c3aed;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  color: #1e293b;
  font-weight: bold;
}

.private-join-btn {
  min-height: 25px !important;
  font-size: 12px !important;
  padding: 2px 11px !important;
}

/* ==========================================================================
   Right Panel: Live 3D Toon Showcase Stage, Compact Selector & Career Stats
   ========================================================================== */
.menu-toon-preview-stage {
  position: relative;
  flex: 1;
  min-height: 210px;
  width: 100%;
  border-radius: 14px;
  border: 3px solid #f59e0b;
  background: radial-gradient(circle at 50% 42%, #2563eb 0%, #1e3a8a 62%, #0f172a 100%);
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

.menu-toon-preview-stage.is-dragging {
  cursor: grabbing;
  border-color: #ffeb3b;
}

.menu-toon-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}

.menu-toon-stage-top-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}

.menu-preview-skin-pill {
  background: rgba(15, 23, 42, 0.84);
  color: #fef08a;
  border: 1.5px solid #f59e0b;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: bold;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.menu-preview-drag-pill {
  background: rgba(15, 23, 42, 0.76);
  color: #bae6fd;
  border: 1.5px solid #38bdf8;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: bold;
}

.menu-toon-stage-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 2;
}

.menu-toon-stage-nameplate {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#menu-preview-char-name {
  font-family: Minnie, sans-serif;
  font-size: 17px;
  line-height: 1.05;
  color: #ffeb3b;
  text-shadow: 1px 1px 0 #000;
}

#menu-preview-char-desc {
  font-size: 11px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-preview-title-pill {
  background: rgba(30, 58, 138, 0.9);
  color: #fde047;
  border: 1.5px solid #38bdf8;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 4 Compact Character Selector Buttons Below 3D Stage */
.hub-toon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  flex-shrink: 0;
}

.hub-toon-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 5px 6px !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  border: 2.5px solid rgba(107, 142, 168, 0.9) !important;
  text-align: center;
}

.hub-toon-card.selected {
  background: #fff8e1 !important;
  border-color: #e9604b !important;
  box-shadow: 0 0 10px rgba(233, 96, 75, 0.72) !important;
  transform: translateY(-1px);
}

.hub-toon-card .character-card-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.hub-toon-card .character-card-name {
  font-family: Minnie, sans-serif;
  font-size: 13px;
  line-height: 1.05;
  color: #25335b;
}

.hub-customize-btn {
  width: 100%;
  min-height: 34px;
  font-size: 13.5px !important;
  padding: 5px 12px !important;
  flex-shrink: 0;
}

.career-stats-box {
  background: rgba(255, 255, 255, 0.48);
  border: 2px solid rgba(139, 164, 130, 0.85);
  border-radius: 11px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.career-stats-box h3 {
  font: 13px / 1.1 Minnie, sans-serif;
  color: #175429;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.career-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.career-stat-item {
  background: rgba(248, 250, 252, 0.65);
  border: 1.5px solid rgba(203, 213, 225, 0.85);
  border-radius: 7px;
  padding: 3px 7px;
  display: flex;
  flex-direction: column;
}

.career-stat-item span {
  font-size: 9.5px;
  color: #334155;
  font-weight: bold;
  text-transform: uppercase;
}

.career-stat-item strong {
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.practice {
  width: 100%;
  margin-top: 0;
  min-height: 34px;
  font-size: 15px;
  padding: 4px 12px;
  background: linear-gradient(#dcf2be, #c7e69b) !important;
  border: 2px solid #5a8e32 !important;
  border-radius: 12px !important;
  color: #244b2c !important;
  font-family: Impress, sans-serif;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.practice:hover {
  background: linear-gradient(#e9f9d2, #d5efad) !important;
  color: #0b691d !important;
}

/* ==========================================================================
   Map Cards (Shared between Main Menu & CoD Pre-Game Lobby)
   ========================================================================== */
.map-card {
  position: relative;
  background: rgba(255, 255, 255, 0.62) !important;
  border: 2px solid #8ba482 !important;
  border-radius: 8px !important;
  padding: 4px !important;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px !important;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12) !important;
  color: #25335b !important;
}

/* Ensure document.elementFromPoint(centerX, centerY) hits the <button class="map-card"> directly */
.map-card > * {
  pointer-events: none;
}

.map-card:hover:not(:disabled) {
  background: rgba(255, 254, 245, 0.85) !important;
  border-color: #f7a600 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22) !important;
}

.map-card.active,
.map-card.selected {
  background: rgba(255, 253, 226, 0.85) !important;
  border: 2.5px solid #ff9900 !important;
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.7), 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.map-card.voted {
  border-color: #16a34a !important;
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.65), 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.map-card-thumb-wrap {
  position: relative;
  width: 100%;
}

.map-card-img {
  height: 38px;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid #8ba482;
  display: block;
}

.map-card.active .map-card-img,
.map-card.selected .map-card-img {
  border-color: #ff9900;
}

.map-card-name,
.map-name {
  font-size: 11px;
  font-weight: bold;
  color: #25335b;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding: 0 2px;
}

.map-card-desc {
  font-size: 9.5px;
  color: #526656;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.map-vote-count {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffeb3b;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.map-voted-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: #16a34a;
  color: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: bold;
}

.map-leading-badge,
.map-trolley-badge,
.map-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 8.5px;
  background: rgba(254, 240, 138, 0.96);
  color: #854d0e;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.map-voted-badge[hidden],
.map-leading-badge[hidden],
.map-trolley-badge[hidden],
.map-badge[hidden] {
  display: none !important;
}

/* ==========================================================================
   Call of Duty-Style Full-Screen Pre-Game Lobby (#lobby)
   ========================================================================== */
.lobby.cod-lobby {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 16px 12px;
  pointer-events: none;
}

.cod-lobby-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 14px;
  margin-right: 162px;
  background: rgba(15, 23, 42, 0.85);
  border: 2.5px solid #f59e0b;
  border-radius: 12px;
  color: #ffffff;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cod-lobby-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cod-mode-badge {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 1.5px solid #fef08a;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.cod-mode-badge.is-ranked {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
}

.room-code-tag {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
}

.room-code-badge {
  background: #ffffff;
  color: #1e293b;
  border: 2px solid #38bdf8;
  border-radius: 6px;
  padding: 1px 7px;
  letter-spacing: 1.2px;
  font-family: Impress, monospace;
}

.cod-lobby-status-wrap {
  text-align: center;
}

.choose-title {
  font: 20px / 1.05 Minnie, sans-serif;
  color: #ffeb29;
  text-shadow: 2px 2px #71531b, 0 3px 5px #000a;
  letter-spacing: 0.04em;
  margin: 0;
}

#lobby-status {
  font-size: 13px;
  line-height: 1.15;
  color: #e2e8f0;
  margin: 2px 0 0;
}

.cod-lobby-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.bot-controls-label {
  font-size: 13px;
  color: #fef08a;
  font-weight: bold;
}

.bot-btn-group {
  display: flex;
  gap: 5px;
}

.bot-btn {
  font-size: 12.5px !important;
  padding: 3px 9px !important;
  border-radius: 9px !important;
  background: linear-gradient(#e0f2fe, #bae6fd) !important;
  border: 2px solid #38bdf8 !important;
  color: #0369a1 !important;
}

.room-actions {
  display: flex;
  gap: 5px;
}

.room-copy-btn {
  font-size: 12px !important;
  padding: 3px 8px !important;
  border-radius: 8px !important;
}

/* Character Switcher Pill Strip */
.choose-heading {
  position: relative;
  text-align: center;
  pointer-events: none;
  z-index: 4;
  margin-top: 2px;
}

.character-select-row {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.58);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.character-card-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 11px;
  background: rgba(255, 255, 255, 0.94);
  border: 2.5px solid #6b8ea8;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.character-card-btn > * {
  pointer-events: none;
}

.character-card-btn:hover {
  transform: translateY(-1px) scale(1.03);
  border-color: #ffeb29;
  background: #ffffff;
}

.character-card-btn.selected {
  border-color: #e9604b;
  border-width: 3px;
  background: #fff8e7;
  box-shadow: 0 0 10px rgba(233, 96, 75, 0.8);
}

.character-card-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.character-card-name {
  font-family: Minnie, "Trebuchet MS", sans-serif;
  font-size: 13px;
  color: #25335b;
}

/* Bottom CoD Dock: Map Voting (Left) + 4-Toon Roster (Right) + Action Footer */
.lobby-panel.cod-lobby-dock {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  width: min(1248px, calc(100vw - 32px));
  margin: auto auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-width: 4px;
  z-index: 2;
  pointer-events: auto;
}

.cod-dock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.map-selector-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.map-selector-title {
  font-size: 12px;
  color: #175429;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.leading-map-pill {
  background: #1e293b;
  color: #fef08a;
  border: 1.5px solid #f59e0b;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  text-transform: none;
}

.map-carousel.cod-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  pointer-events: auto;
}

.cod-roster-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Common UI & Button Icons */
.btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  margin-right: 4px;
}

.badge-icon {
  width: 11px;
  height: 11px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

.stat-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  margin-right: 4px;
}

.gag-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

/* 4-Toon Calling Card Roster Slots */
.slots.cod-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.slot {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(235, 245, 230, 0.92) 100%);
  border: 2px solid #8ba482;
  border-radius: 9px;
  padding: 5px 8px;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-height: 54px;
  position: relative;
}

.slot.ready {
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.slot-portrait {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  position: relative;
  border: 2px solid var(--toon, #b5ccb0);
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.slot-portrait img.portrait-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slot-portrait .ready-mark {
  position: absolute;
  bottom: -3px;
  right: -4px;
  width: 15px;
  height: 15px;
}

.slot-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.slot strong {
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-character {
  font-size: 11px;
  color: #3f6212;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}

.slot-level-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, #fff59d 0%, #fbc02d 100%);
  color: #3e2723;
  border: 1px solid #f57f17;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: bold;
  line-height: 1.25;
}

.slot-title-tag {
  font-size: 10px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-vote-tag {
  font-size: 10px;
  color: #0369a1;
  font-weight: bold;
}

.slot-status-pill {
  font-size: 9.5px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  flex-shrink: 0;
}

.slot-status-pill.is-ready {
  background: #16a34a;
  color: #ffffff;
}

/* Lobby Action Footer inside Dock */
.cod-lobby-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 2px solid #bdd4b7;
  padding-top: 6px;
}

#ready {
  position: static;
  transform: none;
  min-width: 190px;
  min-height: 40px;
  font-size: 18px;
}

#ready.is-ready {
  background: linear-gradient(#bbf7d0, #4ade80 40%, #22c55e) !important;
  border-color: #15803d !important;
}

#lobby-leave {
  position: static;
  min-height: 38px;
  font-size: 15px;
}

#lobby-customize-btn {
  min-height: 38px;
  font-size: 14.5px;
}

/* Model Click Targets for 3D Character Selection */
.model-targets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.model-target {
  position: absolute;
  pointer-events: auto;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.model-target:focus-visible {
  outline: 3px dashed #ffeb29;
  border-radius: 16px;
}

/* ==========================================================================
   Lobby 5-Second Starting Overlay (#lobby-start & body.lobby-starting)
   ========================================================================== */
body.lobby-starting #app::before {
  content: "";
  z-index: 10;
  background: var(--screen-dim);
  pointer-events: auto;
  animation: 0.65s ease-out both results-backdrop-in;
  position: fixed;
  inset: 0;
}

body.lobby-starting .model-targets,
body.lobby-starting .choose-heading,
body.lobby-starting .lobby-panel {
  visibility: hidden;
}

#lobby-start {
  z-index: 26;
  text-align: center;
  color: #fff;
  text-shadow: 0 3px #25335b, 0 6px 8px #0009;
  pointer-events: none;
  width: 94%;
  font: clamp(44px, 7vw, 94px) / 1.2 Impress, sans-serif;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#lobby-start .countdown-label {
  margin: 0 0 28px;
}

#countdown-slots {
  width: min(calc(var(--participant-count, 4) * 235px), 100%);
  grid-template-columns: repeat(var(--participant-count, 4), minmax(0, 1fr));
  gap: 20px;
  margin: 0 auto 32px;
  font: 26px / 1.2 Impress, sans-serif;
}

#countdown-slots .slot {
  text-align: center;
  color: #fff;
  background: transparent;
  border: 0;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
}

#countdown-slots .slot-info {
  align-items: center;
}

#countdown-slots .slot strong {
  font-size: 28px;
  color: #fff;
}

#countdown-slots .slot-character {
  font-size: 22px;
  color: #fff7a0;
  justify-content: center;
}

#countdown-slots .slot-level-badge {
  font-size: 16px;
  padding: 1px 8px;
}

#countdown-slots .slot-portrait {
  width: 80px;
  height: 80px;
}

#lobby-start #ready {
  pointer-events: auto;
  width: max-content;
  max-width: 300px;
  min-height: 58px;
  margin: 0 auto;
  font-size: 28px;
  display: flex;
  position: static;
  transform: none;
}

#lobby-start.entering {
  animation: 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both lobby-start-in;
}

#lobby-start.leaving {
  animation: 0.3s ease-in both lobby-start-out;
}

@keyframes lobby-start-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes lobby-start-out {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 50px)) scale(0.65); }
}

@keyframes results-backdrop-in {
  0% { background-color: transparent; }
  100% { background-color: var(--screen-dim); }
}

/* ==========================================================================
   Vote to Skip Selection (#selection-skip) & Round Countdown (#round-countdown)
   ========================================================================== */
#selection-skip {
  left: auto;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 35;
  width: max-content;
  min-width: 180px;
  max-width: 90vw;
  min-height: 44px;
  padding: 8px 16px;
  font-size: clamp(18px, 2vw, 22px);
  position: fixed;
  transform: none;
  pointer-events: auto;
}

#selection-skip:hover,
#selection-skip:active {
  transform: none;
}

.round-countdown {
  z-index: 25;
  pointer-events: none;
  color: #fff595;
  text-align: center;
  text-shadow: 0 4px #67672b;
  filter: drop-shadow(0 7px 4px #000b);
  font-family: Minnie, sans-serif;
  font-size: clamp(100px, 18vmin, 190px);
  line-height: 1.15;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.round-countdown.times-up {
  width: 94%;
  font-size: clamp(40px, 10vmin, 112px);
}

/* ==========================================================================
   In-Game HUD, Trolley Hop-Off & Gag Tray
   ========================================================================== */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#trolley-hop-off {
  left: 50%;
  top: max(calc(env(safe-area-inset-top) + 12px), 6vh);
  width: clamp(180px, 27vh, 290px);
  height: clamp(62px, 9.4vh, 100px);
  box-shadow: none;
  color: #ffffa6;
  pointer-events: auto;
  z-index: 12;
  filter: none;
  background: url(/assets/ui/toontown/hop-off-up.png) 50% / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  padding: 0;
  font: clamp(26px, 4.8vh, 48px) / 1 Impress, sans-serif;
  position: absolute;
  transform: translate(-50%);
}

@media (hover: hover) {
  #trolley-hop-off:hover:not(:disabled) {
    background-image: url(/assets/ui/toontown/hop-off-hover.png);
    transform: translate(-50%);
  }
}

#trolley-hop-off:active:not(:disabled) {
  background-image: url(/assets/ui/toontown/hop-off-down.png);
  transform: translate(-50%);
}

#trolley-hop-off:disabled {
  opacity: 0.65;
  cursor: default;
}

.opponent-treasures {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  gap: 10px;
  transform: scale(var(--hud-scale, 1));
  transform-origin: 0 0;
}

.local-treasure {
  position: absolute;
  bottom: 12px;
  right: 14px;
  transform: scale(var(--hud-scale, 1));
  transform-origin: 100% 100%;
}

.treasure-card {
  width: 130px;
  height: 160px;
  position: relative;
  background: radial-gradient(#fff, #fef4cf);
  border: 4px solid #f39c12;
  border-radius: 12px;
  box-shadow: 0 4px 6px #0004;
}

.treasure-card.own {
  border-color: #27ae60;
  background: radial-gradient(#fff, #e8f8f5);
}

.treasure-art {
  width: 90px;
  height: 90px;
  object-fit: contain;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.treasure-count {
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-size: 46px;
  font-weight: bold;
  color: #d35400;
  text-shadow: 1px 1px #fff;
}

.treasure-portrait {
  width: 48px;
  height: 48px;
  object-fit: contain;
  position: absolute;
  bottom: 8px;
  right: 8px;
}

/* Original Alarm Clock */
.original-clock {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 170px;
  height: 170px;
  cursor: pointer;
  pointer-events: none;
  transform: scale(var(--hud-scale, 1));
  transform-origin: 100% 0;
}

.original-clock img {
  width: 100%;
  height: 100%;
}

.original-clock canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* IT Status */
#it-status {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#it-text {
  width: 100%;
  height: 100%;
}

/* GAG TRAY (Slot 1 & Slot 2) */
.gag-tray {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) scale(var(--hud-scale, 1));
  transform-origin: 50% 100%;
  display: flex;
  gap: 16px;
  pointer-events: auto;
  z-index: 10;
}

.gag-slot {
  width: 110px;
  height: 110px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #eef5e6);
  border: 4px solid #17963f;
  border-radius: 16px;
  box-shadow: inset 0 2px 4px #fff, 0 6px 12px #0006;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.gag-slot:hover:not(.empty) {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 16px #0007;
  border-color: #ff9900;
}

.gag-slot:active:not(.empty) {
  transform: translateY(2px) scale(0.98);
}

.gag-slot.empty {
  opacity: 0.5;
  cursor: default;
  border-style: dashed;
  border-color: #8da68f;
}

.gag-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.gag-name {
  font-size: 13px;
  font-weight: bold;
  color: #1b4d24;
  text-align: center;
  line-height: 1.1;
  margin-top: 2px;
}

.gag-keybind-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ffec3d;
  border: 2px solid #8c6b00;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  color: #4a3800;
  padding: 2px 6px;
  box-shadow: 0 2px 4px #0004;
}

/* Screen Pie Splat Overlay */
#splat-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-image: radial-gradient(circle at 45% 40%, rgba(255, 255, 230, 0.95) 0%, rgba(255, 250, 205, 0.8) 45%, transparent 70%),
                    radial-gradient(circle at 65% 55%, rgba(255, 255, 230, 0.9) 0%, rgba(255, 250, 205, 0.75) 40%, transparent 65%),
                    radial-gradient(circle at 30% 65%, rgba(255, 255, 230, 0.85) 0%, rgba(255, 250, 205, 0.7) 35%, transparent 60%);
  filter: drop-shadow(0 6px 12px rgba(90, 60, 20, 0.4));
}

#splat-overlay.active {
  opacity: 1;
}

/* Mobile Touch Joystick */
.joystick {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  z-index: 10;
}

.joystick span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 4px #0004;
  pointer-events: none;
}

@media (pointer: coarse) {
  body.in-match .joystick {
    display: flex;
  }
}

/* 3D Projected Nametags */
.nametags {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.nametag {
  position: absolute;
  transform: translate(-50%, -100%);
  font-family: Impress, sans-serif;
  font-size: 20px;
  color: #ffffff;
  -webkit-text-stroke: 3px #15354a;
  paint-order: stroke fill;
  text-shadow: 0 2px 4px #000a;
  white-space: nowrap;
  font-weight: bold;
}

.nametag.is-local {
  color: #fff078;
}

.nametag.is-it {
  color: #ff4d4d;
}

/* ==========================================================================
   Results Screen & Post-Game XP Progression Panel (Compact 1280x720 Fit)
   ========================================================================== */
#original-results {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 15;
  background: rgba(10, 20, 38, 0.78);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: auto;
  padding: 10px 16px;
}

.results-stage {
  width: min(980px, 96vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.results-header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.results-stage h2 {
  font: clamp(30px, 4vw, 46px) / 1.05 Minnie, sans-serif;
  color: #ffeb29;
  text-shadow: 4px 4px #71531b, 0 6px 10px #000c;
  margin: 0;
  animation: result-title 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

.results-rp-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: bold;
  background: linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #fef08a;
  border: 2px solid #60a5fa;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.results-rp-badge.rp-gain {
  border-color: #4ade80;
}

.results-rp-badge.rp-loss {
  border-color: #f87171;
}

#winner-detail {
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 2px 4px #000a;
  margin: 0;
}

#results-scores {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 2px 0;
  flex-wrap: wrap;
}

.result-card {
  background: radial-gradient(#fff, #fef4cf);
  border: 3.5px solid #f39c12;
  border-radius: 12px;
  padding: 7px 12px;
  width: 192px;
  color: #25335b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 5px 10px #0006;
}

.result-card.winner {
  border-color: #27ae60;
  box-shadow: 0 0 14px #2ecc71;
  transform: scale(1.02);
}

.result-card > img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.result-card-name {
  font-size: 16px;
  line-height: 1.15;
}

.result-stat {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.result-stat .stat-icon {
  width: 15px;
  height: 15px;
  margin-right: 4px;
}

.result-stat strong {
  color: #d35400;
}

/* Post-Game XP Progression & Level-Up Panel */
.xp-progression-panel {
  width: min(860px, 95vw);
  background: radial-gradient(at 35% 20%, #fffef1 15%, #eff3dc 65%, #cfddba 100%);
  border: 4px solid #17963f;
  border-radius: 14px;
  padding: 9px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #25335b;
  box-shadow: inset 0 2px 4px #fff9, 0 4px #076c2a, 0 8px 16px rgba(0, 0, 0, 0.45);
}

.xp-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.xp-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #25335b 0%, #16203d 100%);
  color: #ffeb29;
  border: 2px solid #f39c12;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 14.5px;
  font-weight: bold;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.xp-level-badge.level-up-pulse {
  animation: levelUpPop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  border-color: #fef08a;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.9), 0 2px 4px rgba(0, 0, 0, 0.25);
}

.level-up-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #ffeb3b 0%, #ff9800 100%);
  color: #4a1500;
  border: 2.5px solid #ffffff;
  border-radius: 999px;
  padding: 4px 16px;
  font-family: Minnie, "Trebuchet MS", sans-serif;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 0 #bf360c, 0 4px 12px rgba(255, 152, 0, 0.65);
  animation: level-up-pulse 0.9s ease-in-out infinite alternate;
}

.level-up-banner.is-pending {
  opacity: 0.15;
  transform: scale(0.85);
  animation: none;
}

.level-up-banner.is-active {
  opacity: 1;
  animation: levelUpPop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) both, level-up-pulse 0.9s ease-in-out 0.5s infinite alternate;
}

.postgame-lootbox-btn {
  padding: 4px 12px !important;
  font-size: 13.5px !important;
}

@keyframes levelUpPop {
  0% { transform: scale(0.8); opacity: 0.35; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes level-up-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes xpBarShimmer {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 28px 0, 0 0; }
}

.xp-earned-total {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
  color: #ffffff;
  border: 2px solid #1e8449;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 15px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xp-bar-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.xp-bar-track {
  width: 100%;
  height: 18px;
  background: #1e293b;
  border: 2px solid #0f172a;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65);
}

.xp-bar-track.level-up-pulse {
  animation: levelUpPop 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.9), inset 0 2px 4px rgba(0, 0, 0, 0.65);
}

.xp-bar-fill {
  height: 100%;
  min-width: 10px;
  position: relative;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #fef08a 100%);
  background-image: repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.28) 0px,
      rgba(255, 255, 255, 0.28) 10px,
      transparent 10px,
      transparent 20px
    ),
    linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #fef08a 100%);
  background-size: 28px 28px, 100% 100%;
  animation: xpBarShimmer 0.65s linear infinite;
  border-radius: 999px;
  transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.85), inset 0 2px 3px rgba(255, 255, 255, 0.65);
}

.xp-bar-fill::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  width: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, #ffffff 0%, #fef08a 55%, rgba(251, 191, 36, 0) 100%);
  box-shadow: 0 0 10px 3px rgba(254, 240, 138, 0.95);
  pointer-events: none;
}

.xp-bar-label {
  font-size: 13px;
  font-weight: bold;
  color: #1b4d24;
  text-align: center;
}

.xp-breakdown-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.xp-breakdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #8ba482;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: bold;
  color: #25335b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.xp-breakdown-pill.bonus {
  background: #fff8e1;
  border-color: #f59e0b;
  color: #92400e;
}

/* Post-Game Lobby Continuity Footer */
.results-lobby-continuity {
  width: min(860px, 95vw);
  background: rgba(15, 23, 42, 0.85);
  border: 2.5px solid #38bdf8;
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.results-next-status {
  margin: 0;
  font-size: 14.5px;
  font-weight: bold;
  color: #fef08a;
}

.results-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

#results-continue {
  font-size: 17px;
  padding: 8px 20px;
  min-height: 42px;
  background: linear-gradient(#bbf7d0, #4ade80 40%, #22c55e) !important;
  border-color: #15803d !important;
}

#results-quit-btn {
  font-size: 16px;
  padding: 8px 18px;
  min-height: 42px;
}

@keyframes result-title {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Toast, Dialogs, Trailer Player & Bouncing DVD Logo Screensaver
   ========================================================================== */
.toast {
  position: fixed;
  top: 84px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
  max-width: min(520px, 90vw);
  padding: 12px 24px;
  font-size: 20px;
  text-align: center;
  font-weight: bold;
  background: radial-gradient(at 35% 20%, #fffef1 15%, #eff3dc 65%, #cfddba 100%);
  border: 5px solid #17963f;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

dialog {
  border-radius: 18px;
  width: min(480px, 90vw);
  max-width: 480px;
  position: relative;
}

dialog .close-dialog {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

dialog h2 {
  font: 32px / 1 Minnie, sans-serif;
  color: #1b4d24;
  margin: 0 0 14px;
}

dialog p {
  font-size: 20px;
  line-height: 1.35;
  color: #25335b;
  margin: 0 0 16px;
}

.toon-dialog-choices {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 20px;
}

.toon-dialog-yes {
  width: 58px;
  height: 58px;
  background: url(/assets/ui/toontown/mat-ok-up.png) center/contain no-repeat;
  cursor: pointer;
  font-size: 0;
}

.toon-dialog-yes:hover {
  filter: brightness(1.15);
}

.toon-dialog-yes:active {
  background-image: url(/assets/ui/toontown/mat-ok-down.png);
}

.toon-dialog-no {
  width: 58px;
  height: 58px;
  background: url(/assets/ui/toontown/mat-close-up.png) center/contain no-repeat;
  cursor: pointer;
  font-size: 0;
}

.toon-dialog-no:hover {
  filter: brightness(1.15);
}

.toon-dialog-no:active {
  background-image: url(/assets/ui/toontown/mat-close-down.png);
}

/* Trailer Player Dialog */
dialog.trailer-dialog {
  width: min(960px, 100vw - 24px);
  max-width: 960px;
  max-height: calc(100dvh - 24px);
  padding: 56px 20px 20px;
  overflow: auto;
}

.trailer-frame {
  pointer-events: auto;
  background: #000;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

#trailer-player {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 180px);
  object-fit: contain;
  pointer-events: auto;
  border: 0;
  display: block;
}

.trailer-controls {
  color: #fff;
  opacity: 0;
  visibility: hidden;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  align-items: center;
  gap: 8px;
  padding: 22px 8px 6px;
  font: 12px / 1.2 Arial, sans-serif;
  transition: opacity 0.15s, visibility 0.15s;
  display: flex;
  position: absolute;
  inset: auto 0 0;
}

.trailer-frame.controls-visible .trailer-controls,
.trailer-frame.playback-paused .trailer-controls,
.trailer-frame:hover .trailer-controls {
  opacity: 1;
  visibility: visible;
}

.trailer-controls button {
  color: #fff !important;
  width: 36px;
  height: 36px;
  box-shadow: none !important;
  background: rgba(0, 0, 0, 0.35) !important;
  border: 0 !important;
  border-radius: 6px !important;
  flex: none;
  padding: 0 !important;
}

.trailer-controls button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

.trailer-controls button svg {
  fill: currentColor;
  pointer-events: none;
  width: 22px;
  height: 22px;
  margin: auto;
  display: block;
}

.trailer-controls [aria-label="Play"] .pause-icon,
.trailer-controls [aria-label="Pause"] .play-icon {
  display: none;
}

.trailer-controls .speaker-icon,
.trailer-controls .sound-waves,
.trailer-controls .mute-mark,
.trailer-controls [data-trailer="fullscreen"] path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trailer-controls [aria-pressed="false"] .mute-mark,
.trailer-controls [aria-pressed="true"] .sound-waves,
.trailer-controls [aria-label="Fullscreen"] .collapse-icon,
.trailer-controls [aria-label="Exit fullscreen"] .expand-icon {
  display: none;
}

.trailer-controls input {
  accent-color: #fff;
  pointer-events: auto;
  flex: 1;
  width: 100%;
  min-width: 24px;
  margin: 0;
  padding: 0;
}

.trailer-controls.trailer-volume-control {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  inset: 8px 8px auto auto;
}

.trailer-volume-control input {
  flex: none;
  width: 76px;
  height: 28px;
}

.trailer-time {
  white-space: nowrap;
}

.trailer-error {
  color: #fff;
  text-align: center;
  margin: 0;
  font: 18px / 1.3 Impress, sans-serif;
  position: absolute;
  inset: 20%;
}

.trailer-dialog .trailer-fallback {
  text-align: center;
  margin: 12px 0 0;
  font-size: 17px;
}

/* Bouncing DVD Logo Screensaver */
.dvd-screen {
  z-index: 100;
  cursor: pointer;
  background: #071019;
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: auto;
}

.dvd-logo {
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
  width: min(500px, 65vw, 70vh);
  height: min(500px, 65vw, 70vh);
  position: absolute;
  top: 0;
  left: 0;
  filter: drop-shadow(0 8px 5px rgba(0, 0, 0, 0.5));
}

/* Exit game button in match */
#game-exit {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 12;
  pointer-events: auto;
}

/* Epic IT HUD Badge on Score Cards */
.treasure-card {
  position: relative;
}

.treasure-card.is-it {
  box-shadow: 0 0 18px rgba(254, 0, 2, 0.75), 0 0 8px rgba(250, 248, 16, 0.85);
}

.hud-it-badge {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
  animation: hud-it-pulse 0.9s ease-in-out infinite alternate;
  z-index: 5;
}

@keyframes hud-it-pulse {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-3px) scale(1.08);
  }
}

/* ==========================================================================
   Pre-Match Playground Loading Screen (#map-loading-screen)
   ========================================================================== */
.map-loading-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at center, rgba(15, 32, 62, 0.88) 0%, rgba(7, 16, 33, 0.96) 100%);
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.22s ease;
}

.map-loading-screen[hidden] {
  display: none !important;
}

.map-loading-screen.is-fading-out {
  opacity: 0;
  pointer-events: none;
}

.map-loading-backdrop {
  position: absolute;
  inset: -24px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(18px) brightness(0.45);
  opacity: 0.65;
  z-index: 0;
  pointer-events: none;
}

.map-loading-card {
  position: relative;
  z-index: 1;
  width: min(680px, 92vw);
  padding: 20px 24px 22px;
  background: radial-gradient(at 35% 20%, rgba(255, 254, 241, 0.96) 15%, rgba(239, 243, 220, 0.95) 65%, rgba(207, 221, 186, 0.96) 100%);
  border: 5px solid #17963f;
  border-radius: 18px;
  box-shadow: inset 0 2px 4px #ffffff, 0 6px #076c2a, 0 18px 38px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.map-loading-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.map-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #175429;
  color: #ffeb29;
  border: 2px solid #f59e0b;
  border-radius: 999px;
  padding: 4px 14px;
  font-family: Impress, sans-serif;
  font-size: 13.5px;
  font-weight: bold;
  letter-spacing: 0.6px;
}

.map-loading-mode-pill {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 2px solid #93c5fd;
  border-radius: 999px;
  padding: 3px 12px;
  font-family: Impress, sans-serif;
  font-size: 12.5px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.map-loading-banner-wrap {
  position: relative;
  width: 100%;
  min-height: 164px;
  padding: 16px 22px;
  border-radius: 14px;
  overflow: hidden;
  border: 4px solid #25335b;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #172554 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
}

.map-loading-preview {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
}

.map-loading-banner-overlay {
  position: relative;
  inset: auto;
  padding: 0;
  background: none;
  text-align: left;
  flex: 1;
  min-width: 0;
}

#map-loading-title {
  margin: 0;
  font: 32px / 1.08 Minnie, sans-serif;
  color: #ffeb29;
  text-shadow: 2px 2px 0 #000, 0 3px 8px rgba(0, 0, 0, 0.85);
}

#map-loading-subtitle {
  margin: 6px 0 0;
  font-family: Impress, sans-serif;
  font-size: 16.5px;
  font-weight: bold;
  color: #93c5fd;
  text-shadow: 1px 1px 2px #000;
}

.map-loading-desc {
  margin: 0;
  font-family: Impress, sans-serif;
  font-size: 15px;
  line-height: 1.3;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid #8ba482;
  border-radius: 10px;
  padding: 8px 14px;
}

.map-loading-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.map-loading-bar-track {
  width: 100%;
  height: 22px;
  background: #0f172a;
  border: 3px solid #25335b;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65);
}

.map-loading-bar-fill {
  height: 100%;
  min-width: 8px;
  background: linear-gradient(90deg, #ff9900 0%, #ffeb3b 55%, #4ade80 100%);
  border-radius: 999px;
  transition: width 0.16s ease-out;
  box-shadow: 0 0 12px rgba(255, 235, 59, 0.75);
}

.map-loading-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: Impress, sans-serif;
  font-weight: bold;
}

.map-loading-step {
  font-size: 14.5px;
  color: #175429;
}

.map-loading-pct {
  font-size: 15px;
  color: #25335b;
}


