@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --page-bg: #F8FAFD;
  --surface: #FFFFFF;
  --surface-soft: #F3F6FA;
  --text-primary: #182033;
  --text-secondary: #727B8C;
  --text-muted: #A8B0C0;
  --border: #E2E7EF;
  --blue: #389DD9;
  --blue-hover: #2E91CD;
  --green: #2ECC71;
  --green-hover: #27BE67;
  --green-active: #22AE5D;
  --red: #F14E43;
  --red-hover: #E7463C;
  --orange: #EC811B;
  --orange-hover: #DC7412;
  --yellow: #F9C80C;
  --yellow-text: #604D00;
  --purple: #7C4DE0;
  --purple-hover: #6D3FD1;
  --purple-soft: #EBDDFF;
  --purple-text: #4B3279;
  --coin-bg: #FFF5D4;
  --coin-yellow: #FFD21A;
  --coin-orange: #F6AE00;
  --disabled: #C7CED8;

  --cell-pink: #F66AA8;
  --cell-blue: #24A7E0;
  --cell-cyan: #14B8D4;
  --cell-green: #32C983;
  --cell-yellow: #FFD400;
  --cell-red: #ED5B47;
  --cell-purple: #7655D8;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  --duration-fast: 120ms;
  --duration-normal: 180ms;
  --duration-slow: 240ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--page-bg);
  font-family: Inter, Arial, sans-serif;
  color: var(--text-primary);
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  filter: blur(0px);
  transition: filter 0.6s ease;
}

#game-canvas.death-blur {
  filter: blur(3px);
}

#game-canvas.zoom-transition-blur {
  filter: blur(3px);
  transition: filter 0.2s ease;
}

.hidden {
  display: none !important;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #8B8F96;
  border-radius: 8px;
}

/* ---------- in-game HUD: light chips over the white game world ---------- */

#hud {
  position: fixed;
  top: 10px;
  left: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  padding: 8px 14px;
  border-radius: 10px;
  pointer-events: none;
}

#mass-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hud-mass-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hud-mass-value {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(160deg, var(--green), #1a9e52);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

@keyframes hud-mass-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.hud-mass-pop .hud-mass-value {
  animation: hud-mass-pop 0.35s ease;
  display: inline-block;
}

#exit-to-menu-button {
  position: fixed;
  top: 10px;
  right: 200px;
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

#in-game-invite-button {
  position: fixed;
  top: 10px;
  right: 330px;
  width: auto;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

#exit-to-menu-button:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}

#top-right-hud {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

#leaderboard {
  width: 150px;
  max-height: 38vh;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.3;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-weight: 600;
}

.lb-row-top3 {
  background: var(--surface-soft);
}

.lb-row-you {
  background: var(--purple-soft);
  color: var(--purple-text);
  box-shadow: inset 0 0 0 1px rgba(124,77,224,0.35);
}

.lb-rank {
  flex-shrink: 0;
  width: 18px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}

.lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-mass {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--green);
}

.lb-row-you .lb-mass {
  color: var(--purple-text);
}

.lb-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  padding: 1px 0;
  letter-spacing: 0.1em;
}

.lb-divider-red { color: var(--red); font-weight: 800; font-size: 12px; }
.lb-divider-blue { color: var(--blue); font-weight: 800; font-size: 12px; margin-top: 4px; }
.lb-divider-total { color: var(--text-primary); font-weight: 800; font-size: 12px; margin-top: 2px; }

#reconnect-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orange);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

#reconnect-banner.hidden {
  display: none;
}

#join-error-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--red);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 90vw;
}

#team-scores {
  width: 180px;
  padding: 8px 10px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

#team-scores .team-red { color: var(--red); }
#team-scores .team-blue { color: var(--blue); }

#match-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
}

#hourly-event-banner {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #ff9f1c, #ffd93d);
  color: #3a2600;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 14px rgba(255, 159, 28, 0.4);
  animation: hourly-event-pulse 1.6s ease-in-out infinite;
}

@keyframes hourly-event-pulse {
  50% { transform: translateX(-50%) scale(1.035); }
}

/* A full-screen, unmissable "pick your side" gate — was a small pill in the
   corner before, which players did not notice in time. */
#team-pick-buttons {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

#team-pick-modal {
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

#team-pick-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

#team-pick-timer {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary, #666);
  margin-bottom: 4px;
}

#team-pick-counts {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin-bottom: 22px;
}

#team-pick-btn-row {
  display: flex;
  gap: 20px;
}

.team-pick-btn {
  padding: 18px 46px;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  transition: transform var(--duration-fast) ease;
}

.team-pick-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.team-pick-btn.selected {
  box-shadow: 0 0 0 4px #ffd93d, 0 4px 14px rgba(0,0,0,0.3);
  transform: scale(1.06);
}

.team-pick-btn.selected::after {
  content: ' ✓';
}

.team-pick-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.team-pick-btn:disabled:hover {
  transform: none;
}

.team-pick-red { background: var(--red); }
.team-pick-blue { background: var(--blue); }

/* A blocking modal, not a floating text banner — gameplay kept running
   silently underneath a plain text banner before, so the round would
   auto-cycle into the next one while the player was still reading it,
   with no clear way to say "yes I'm done, take me to X". */
#team-win-banner {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#team-win-banner.team-win-banner-show {
  opacity: 1;
  pointer-events: auto;
}

#match-end-modal {
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transform: scale(0.85);
  transition: transform 0.3s ease;
}

#team-win-banner.team-win-banner-show #match-end-modal {
  transform: scale(1);
}

#match-end-title {
  font-size: 30px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}

#team-win-banner.team-win-banner-red #match-end-title { color: var(--red); }
#team-win-banner.team-win-banner-blue #match-end-title { color: var(--blue); }
#team-win-banner.team-win-banner-draw #match-end-title { color: #e0a800; }

/* Big pre-round countdown for the timed modes (Ranked/BR) — a "sочное"
   moment before every round instead of the round just quietly starting.
   pointer-events: none so it never blocks clicking/steering underneath. */
#countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#countdown-mode-label {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 4px;
  opacity: 0.9;
}

#countdown-number {
  font-size: 160px;
  font-weight: 900;
  color: var(--yellow, #ffd93d);
  text-shadow: 0 0 40px rgba(255, 217, 61, 0.65), 0 6px 20px rgba(0,0,0,0.5);
  line-height: 1;
}

/* .countdown-pop is reused on #team-pick-timer too (Teams' own DRAFT
   countdown lives inside its existing full-screen pick modal instead of a
   second overlay), so this isn't scoped to #countdown-number alone. */
.countdown-pop {
  animation: countdown-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}

#countdown-number.countdown-go {
  color: #4ade80;
  text-shadow: 0 0 50px rgba(74, 222, 128, 0.8), 0 6px 20px rgba(0,0,0,0.5);
  font-size: 130px;
  animation: countdown-go 0.7s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes countdown-pop {
  0% { transform: scale(0.4); opacity: 0; }
  55% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes countdown-go {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#ranked-timer {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple-text);
  color: var(--yellow);
  padding: 8px 22px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

/* ---------- language switcher ---------- */

#lang-switcher {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(25,38,58,0.14);
}

#lang-switcher button {
  height: 28px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

#lang-switcher button:hover {
  color: var(--text-primary);
}

#lang-switcher button.active {
  background: var(--blue);
  color: #fff;
}

/* ---------- background: faint grid + decorative floating/chasing cells ---------- */

.overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay.hidden,
.modal-overlay.hidden {
  display: none;
}

#nickname-screen.overlay {
  background-color: var(--page-bg);
  background-image:
    linear-gradient(rgba(153, 166, 185, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(153, 166, 185, 0.08) 1px, transparent 1px);
  background-size: 8px 8px;
  overflow: hidden;
}

.bg-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0.85;
  animation: float 14s ease-in-out infinite;
}

.d1  { width: 22px; height: 22px; left: 8%;  top: 15%; background: var(--cell-pink); animation-delay: 0s; }
.d2  { width: 16px; height: 16px; left: 80%; top: 20%; background: var(--cell-green); animation-delay: -3s; }
.d3  { width: 26px; height: 26px; left: 75%; top: 65%; background: var(--cell-yellow); animation-delay: -6s; }
.d4  { width: 18px; height: 18px; left: 15%; top: 70%; background: var(--cell-cyan); animation-delay: -9s; }
.d5  { width: 12px; height: 12px; left: 45%; top: 10%; background: var(--orange); animation-delay: -2s; }
.d6  { width: 20px; height: 20px; left: 50%; top: 80%; background: var(--cell-green); animation-delay: -11s; }
.d7  { width: 14px; height: 14px; left: 30%; top: 45%; background: var(--cell-purple); animation-delay: -5s; }
.d8  { width: 10px; height: 10px; left: 65%; top: 35%; background: var(--cell-pink); animation-delay: -8s; }
.d9  { width: 16px; height: 16px; left: 90%; top: 45%; background: var(--cell-blue); animation-delay: -4s; }
.d10 { width: 12px; height: 12px; left: 5%;  top: 45%; background: var(--cell-red); animation-delay: -7s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.08); }
}

.bg-chase {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.chase-sprite {
  position: absolute;
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.12));
  animation-name: chase-sweep;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.chase-lane-1 { top: 14%; width: 50px; height: 50px; animation-duration: 16s; }
.chase-lane-2 { top: 60%; width: 62px; height: 62px; animation-duration: 20s; }
.chase-lane-3 { top: 84%; width: 46px; height: 46px; animation-duration: 24s; }

.chase-fleeing { animation-delay: 0s; }
.chase-chasing { animation-delay: 0.9s; }
.chase-lane-2.chase-fleeing { animation-delay: -6s; }
.chase-lane-2.chase-chasing { animation-delay: -5.1s; }
.chase-lane-3.chase-chasing { animation-delay: -14s; }

@keyframes chase-sweep {
  from { transform: translateX(-90px); }
  to { transform: translateX(calc(100vw + 90px)); }
}

.bg-corner-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.corner-blob {
  position: absolute;
  width: 220px;
  height: 220px;
  object-fit: contain;
  animation: float 16s ease-in-out infinite;
}

.corner-blob-tl { left: -60px; top: -50px; animation-delay: -3s; }
.corner-blob-tr { right: -70px; top: -60px; width: 180px; height: 180px; animation-delay: -9s; }
.corner-blob-br { right: -80px; bottom: -70px; width: 260px; height: 260px; animation-delay: -6s; }

@media (max-width: 767px) {
  .corner-blob {
    width: 120px;
    height: 120px;
  }
  .corner-blob-br {
    width: 150px;
    height: 150px;
  }
}

/* ---------- main panel + cards ---------- */

.main-panel {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100vw - 48px));
  max-height: calc(100vh - 20px);
  margin: 10px auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(25, 38, 58, 0.04);
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(24, 35, 55, 0.03), 0 10px 30px rgba(24, 35, 55, 0.07);
  padding: var(--space-6);
}

/* ---------- brand row: logo + mascots, standalone above the top bar ---------- */

.brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.brand-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  /* Bigger without pushing the header taller or the row wider — the extra
     height "bleeds" outside the row's own box instead of growing it. */
  margin: -18px -6px -18px 0;
  animation: brand-logo-bob 3.2s ease-in-out infinite;
}

@keyframes brand-logo-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-2deg); }
}

.logo {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-size: 22px;
}

.logo-main { color: var(--text-primary); }
.logo-domain { color: var(--blue); }

.tagline {
  display: none;
}

/* ---------- top bar: brand + guest auth OR minimal account bar ---------- */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
}

.hero-auth {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.text-field-inline {
  margin-bottom: 0;
  height: 40px;
  max-width: 220px;
}

.hero-auth .btn {
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  white-space: nowrap;
}

.auth-hint {
  display: none;
}

/* ---------- account bar (logged in, inside .top-bar) ---------- */

.account-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.account-bar .pill {
  height: 30px;
  padding: 0 8px 0 11px;
  font-size: 12px;
}

.account-status-nickname {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
}

#topbar-play-button::before {
  content: "▶ ";
}

.pill-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border: none;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.pill-plus:hover {
  filter: brightness(1.08);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.btn-icon:hover {
  background: #E4E9F0;
}

.topbar-icon-btn {
  position: relative;
  flex-shrink: 0;
}

.referral-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.referral-badge .referral-info-icon {
  opacity: 0.85;
}

.btn-sm {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  width: auto;
}

#admin-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wallet-details-inline {
  margin-bottom: 0;
  font-size: 13px;
}

.wallet-details-inline summary {
  margin-bottom: 0;
}

/* Accordion pops out as a small floating card instead of pushing the bar
   taller — keeps the header a fixed height so the page doesn't reflow. */
.wallet-details-inline[open] {
  position: relative;
}

.wallet-details-inline[open] > *:not(summary) {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  width: 260px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(24,35,55,0.15);
  padding: var(--space-3);
  z-index: 6;
}

/* ---------- footer ---------- */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) 0;
  font-size: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ---------- form fields ---------- */

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-align: left;
}

.text-field {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid #DDE3EC;
  background: #F7F9FC;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}

.text-field::placeholder {
  color: #A2AABA;
}

.text-field:focus {
  outline: none;
  border-color: #39A4E3;
  box-shadow: 0 0 0 3px rgba(57, 164, 227, 0.14);
  background: var(--surface);
}

/* ---------- buttons ---------- */

.btn {
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(56, 157, 217, 0.18);
}

.btn:disabled {
  background: var(--disabled) !important;
  color: #fff !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 18px rgba(46,204,113,0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  background: var(--green-active);
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: #E4E9F0;
}

.btn-tertiary {
  width: 100%;
  background: var(--surface-soft);
  color: #252D3D;
}

.btn-tertiary:hover:not(:disabled) {
  background: #E4E9F0;
}

.btn-large {
  min-height: 50px;
  width: 100%;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
}

.error {
  color: var(--red);
  font-size: 13px;
  margin: 10px 0 0;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--space-5) 0;
}

/* ---------- main grid: profile + modes ---------- */

.main-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-3);
  /* stretch (not "start") so the shorter right column grows to match the
     left one's height instead of leaving dead space below it — the featured
     Speedario tile (see .featured-mode-section) fills exactly that gap. */
  align-items: stretch;
}

.modes-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
}

.profile-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 2px solid #E7EBF2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-ring {
  width: 68px;
  height: 68px;
  border: 3px solid var(--blue);
  overflow: visible;
}

#avatar-button {
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--duration-fast) ease;
}

#avatar-button:hover {
  transform: scale(1.05);
}

.avatar-ring .avatar-img {
  border-radius: 50%;
  overflow: hidden;
}

.avatar-online-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--surface);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.profile-identity-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-nickname {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  word-break: break-word;
}

.profile-stats-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: var(--space-2);
  margin-bottom: var(--space-3);
  background: var(--surface-soft);
  border-radius: 12px;
}

/* Reset the <button> back to looking like the plain box it replaces —
   the whole rating/rank strip opens the leaderboard now. */
.profile-stats-box-button {
  width: 100%;
  border: none;
  font: inherit;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.profile-stats-box-button:hover {
  background: var(--surface-soft-hover, var(--surface-soft));
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  padding: 4px;
  border-radius: 10px;
}

.profile-stat:nth-child(2) {
  background: linear-gradient(160deg, var(--purple-soft), #fff);
}

.profile-stat:nth-child(2) strong {
  color: var(--purple-text);
}

.profile-stat-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 2px;
}

.profile-stat-globe {
  font-size: 24px;
  margin-bottom: 2px;
}

.profile-stat strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.profile-stat span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.profile-stat span.profile-stat-globe {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: normal;
  color: initial;
}

.deposit-open-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-bottom: var(--space-2);
  border: none;
  border-radius: 12px;
  background: #EAF7EE;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.deposit-open-button:hover {
  background: #DCF2E3;
}

.invite-link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  margin-top: var(--space-2);
  border: none;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.invite-link-button:hover {
  background: #E4E9F0;
}

.referral-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 10px;
  cursor: help;
}

#random-skin-toggle.active {
  background: var(--purple);
  color: #fff;
}

/* ---------- deposit modal ---------- */

.deposit-modal-card {
  width: 480px;
  max-width: 94vw;
}

.deposit-rate-note {
  margin: -8px 0 var(--space-4);
  font-size: 12px;
  color: var(--text-muted);
}

.deposit-address-block {
  text-align: left;
  margin-bottom: var(--space-4);
}

.deposit-address-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 8px 0;
}

.deposit-address-row code {
  flex: 1;
  min-width: 0;
  background: var(--surface-soft);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 14px;
  cursor: pointer;
}

.copy-btn:hover {
  background: #E4E9F0;
}

.deposit-live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-3) 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.deposit-live-status-credited {
  background: #DBF6E5;
  color: #1F9C4E;
}

.deposit-live-spinner {
  animation: deposit-spin 1.6s linear infinite;
  display: inline-block;
}

@keyframes deposit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.deposit-hash-optional-note {
  margin: 0 0 var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
}

.deposit-hash-form {
  text-align: left;
  padding-top: var(--space-3);
  border-top: 1px solid var(--surface-soft);
}

.deposit-hash-row {
  display: flex;
  gap: var(--space-2);
}

.deposit-hash-row .text-field {
  margin-bottom: 0;
}

.deposit-hash-status {
  margin: var(--space-2) 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.deposit-hash-status-pending {
  background: #FBE1E1;
  color: #C23B3B;
}

.deposit-hash-status-credited {
  background: #DBF6E5;
  color: #1F9C4E;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
  color: #242C3C;
}

.pill-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.pill-balance { background: var(--coin-bg); color: var(--yellow-text); }
.pill-rating { background: var(--purple-soft); color: var(--purple-text); }

.pill-arsenal {
  background: var(--purple-soft, #ece6ff);
  color: var(--purple-text, #5b3fd6);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease;
}
.pill-arsenal:hover { filter: brightness(1.06); }
.pill-arsenal span { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- mode tiles ---------- */

.section-kicker {
  display: block;
  color: #9BA5B5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.modes-card-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.modes-card-hint {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.mode-button {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 372px;
  width: 100%;
  padding: var(--space-4) var(--space-3) var(--space-3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  border: none;
  border-radius: 16px;
  line-height: 1.3;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, filter var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.mode-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.mode-button.selected {
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.95), 0 8px 18px rgba(25,38,58,0.16);
  transform: scale(1.015);
}

.mode-button-check {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.mode-button.selected .mode-button-check {
  opacity: 1;
}

.mode-icon {
  width: 187px;
  height: 187px;
  object-fit: contain;
  flex-shrink: 0;
  margin-bottom: 4px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
}

.mode-button-title {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.mode-button-desc {
  min-height: 50px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.92;
  white-space: normal;
}

.mode-button[data-mode="ffa"] { background: linear-gradient(160deg, color-mix(in srgb, var(--red) 100%, white 20%), color-mix(in srgb, var(--red) 100%, black 25%)); }
.mode-button[data-mode="teams"] { background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 100%, white 20%), color-mix(in srgb, var(--blue) 100%, black 25%)); }
.mode-button[data-mode="battle-royale"] { background: linear-gradient(160deg, color-mix(in srgb, var(--orange) 100%, white 20%), color-mix(in srgb, var(--orange) 100%, black 25%)); }
.mode-button[data-mode="ranked"] { background: linear-gradient(160deg, color-mix(in srgb, var(--purple) 100%, white 20%), color-mix(in srgb, var(--purple) 100%, black 25%)); }

.mode-button-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  font-size: 12px;
  font-weight: 700;
}

.mode-button::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  pointer-events: none;
}

.mode-button-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ---------- featured mode: a bright horizontal banner below the grid,
   instead of squeezing a 5th tile in and shrinking everything ---------- */

/* .modes-card is a flex column (see .main-grid's align-items:stretch above)
   whose height now matches the left column's — this slot is the LAST child
   and grows to eat whatever's left, instead of leaving dead space below the
   mode grid when the left column (profile + daily reward) runs taller. */
.featured-mode-slot {
  margin-top: var(--space-3);
  flex: 1;
  display: flex;
}

.featured-mode-button {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(100deg, color-mix(in srgb, var(--yellow) 100%, white 15%), color-mix(in srgb, var(--yellow) 100%, black 15%));
  border: none;
  border-radius: 20px;
  color: var(--yellow-text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, filter var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.featured-mode-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.featured-mode-button.selected {
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.95), 0 8px 18px rgba(25,38,58,0.16);
}

.featured-mode-icon {
  width: 140px;
  height: 140px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}

.featured-mode-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.featured-mode-title {
  font-size: 26px;
  font-weight: 800;
  text-transform: uppercase;
}

.featured-mode-desc {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.85;
}

.featured-mode-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.profile-card .text-field {
  margin-bottom: var(--space-2);
}

/* ---------- profile tile row: shop / boosts (daily reward is its own strip below) ---------- */

.profile-tile-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Compact bright squares instead of the old elongated banner cards — same
   juicy gradients, much less vertical space, icon-forward. */
.promo-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2);
  border: none;
  cursor: default;
  text-align: center;
  font-family: inherit;
  min-height: 138px;
}

.promo-tile-shop {
  cursor: pointer;
  background:
    radial-gradient(circle at 15% 20%, rgba(124,77,224,0.55), transparent 55%),
    radial-gradient(circle at 90% 85%, rgba(46,204,113,0.35), transparent 50%),
    linear-gradient(135deg, #3a1f7a, #150f30);
}

.promo-tile-boosts {
  cursor: pointer;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.30), transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(255,107,107,0.4), transparent 55%),
    linear-gradient(135deg, #E8590C, #862E0C);
}

.promo-tile::before {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.promo-tile-icon {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.25));
}

.promo-tile-icon-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  line-height: 1;
}

.promo-tile-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  min-width: 0;
}

/* ---------- daily reward: a horizontal strip, not a square (the stacked
   header + day-row + button never fit legibly in a small square). ---------- */

.daily-reward-strip {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  border: none;
  font-family: inherit;
  /* Was a flat, washed-out sky blue — swapped for the same rich-dark-plus-
     radial-glow construction as .promo-tile-shop/.promo-tile-boosts so this
     strip actually matches the rest of the site's "vivid tile" language
     instead of looking like a leftover placeholder. Gold glow ties it to the
     reward/coin theme; white text now sits on near-black instead of pale blue. */
  background:
    radial-gradient(circle at 12% 15%, rgba(255,229,143,0.35), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(249,200,12,0.4), transparent 55%),
    linear-gradient(135deg, #3a2a1f, #14100a);
}

.reward-strip-tabs {
  display: flex;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.reward-strip-tab {
  flex: 1;
  padding: 5px 8px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.reward-strip-tab.active {
  background: rgba(255,255,255,0.32);
  color: #fff;
  box-shadow: 0 0 0 2px var(--yellow);
}

.daily-reward-strip-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.daily-reward-strip-top .promo-tile-title {
  flex-shrink: 0;
}

.daily-reward-strip-top .daily-reward-days {
  flex: 1;
  min-width: 0;
}

/* #daily-tab-panel has no layout rules of its own — its two children
   (the day-card row and the claim button) were stacking with zero gap
   between them, reading as "climbing on top of each other" even though
   nothing technically overlapped. The parent .daily-reward-strip's own
   `gap` only applies between ITS direct children (the tabs / this panel /
   the quests panel), not down into this panel's own contents. */
#daily-tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Full-width second row — was squeezed next to the day cards before,
   wrapping "Next in Xh Ym" into an unreadable overlap. */
.daily-reward-strip .daily-reward-claim-button {
  width: 100%;
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.quest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
}

.quest-row-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-row-progress {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}

.quest-row-claim {
  flex-shrink: 0;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.quest-row-claim:disabled {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  cursor: default;
}

.daily-reward-claim-button.just-claimed {
  animation: daily-claim-pulse 0.5s ease;
}

@keyframes daily-claim-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.daily-reward-float {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 900;
  color: var(--yellow, #ffd93d);
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
  pointer-events: none;
  z-index: 2;
  animation: daily-claim-float 1.1s ease-out forwards;
}

@keyframes daily-claim-float {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}

.daily-reward-days {
  display: flex;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}

.daily-reward-day-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
}

.daily-reward-day-card-current {
  background: rgba(255,255,255,0.32);
  box-shadow: 0 0 0 2px var(--yellow);
}

.daily-reward-day-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
}

.daily-reward-day-amount {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.daily-reward-claim-button {
  position: relative;
  z-index: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--yellow-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.daily-reward-claim-button:hover:not(:disabled) {
  filter: brightness(1.05);
}

.daily-reward-claim-button:disabled {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.75);
  cursor: default;
}

/* ---------- paid boosts (modal) ---------- */

.boost-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-2);
}

.boost-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px var(--space-2);
  border-radius: 14px;
  background: var(--boost-accent-soft, var(--surface-soft));
  text-align: center;
  transition: transform 0.15s;
}

.boost-card:hover {
  transform: translateY(-2px);
}

.boost-card::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
}

.boost-card-mass_x3 { --boost-accent-soft: #FFF3D6; }
.boost-card-mass_x5 { --boost-accent-soft: #FFE3D0; }
.boost-card-zoom { --boost-accent-soft: #DCEEFC; }
.boost-card-speed { --boost-accent-soft: #EBDDFF; }

.boost-card-icon {
  font-size: 30px;
  position: relative;
  z-index: 1;
}

.boost-card-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

.boost-card-charges {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.boost-card-buy {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(46, 204, 113, 0.4);
  transition: transform 0.1s, box-shadow 0.1s;
}

.boost-card-buy:hover:not(:disabled) {
  background: var(--green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.5);
}

.boost-card-buy:disabled {
  background: var(--disabled);
  cursor: default;
  box-shadow: none;
}

/* ---------- in-game boost HUD ---------- */

#boost-hud {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 10px;
}

.boost-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.boost-pill .boost-count {
  font-size: 13px;
}

.boost-pill-active {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(249,200,12,0.35), 0 2px 10px rgba(0,0,0,0.12);
}

.coin-icon-inline,
.mode-icon-inline {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -2px;
}

.wallet-details {
  text-align: left;
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.wallet-details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 6px;
  list-style: none;
}

.wallet-details summary::-webkit-details-marker {
  display: none;
}

.topup-arrow {
  display: inline-block;
  transition: transform var(--duration-normal) ease;
}

.wallet-details[open] .topup-arrow {
  transform: rotate(90deg);
}

.wallet-details[open] > *:not(summary) {
  animation: accordion-in var(--duration-normal) ease;
}

@keyframes accordion-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.wallet-address-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 3px 0;
  color: var(--text-primary);
}

.wallet-network-badge {
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
}

.wallet-network-badge.wallet-network-bsc {
  background: var(--coin-yellow);
  color: #3a2e00;
}

.wallet-address-row code {
  background: var(--surface-soft);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  word-break: break-all;
}

/* ---------- modals ---------- */

.modal-overlay {
  background: rgba(17, 24, 39, 0.36);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.modal-card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.24);
  padding: var(--space-6) var(--space-6);
  text-align: center;
  animation: modal-in var(--duration-normal) ease;
}

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

.modal-card h2 {
  margin: 0 0 var(--space-5);
  font-size: 22px;
  color: var(--text-primary);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #F1F4F8;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.modal-close:hover {
  background: #E4E9F0;
}

#auth-form {
  text-align: left;
}

.auth-buttons {
  display: flex;
  gap: var(--space-2);
}

.auth-buttons .btn {
  flex: 1;
}

.google-button {
  display: block;
  margin-top: var(--space-3);
  height: 47px;
  line-height: 47px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #DCE2EA;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.google-button:hover {
  background: var(--surface-soft);
}

.death-card {
  text-align: center;
  width: 380px;
  max-width: 90vw;
}

.death-illustration {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: var(--space-2);
}

.death-context-message {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin-top: -8px;
  margin-bottom: 4px;
}

.death-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.death-actions .btn {
  flex: 1;
}

/* ---------- shop modal ---------- */

.shop-modal-card {
  width: 640px;
  max-width: 94vw;
}

.boosts-modal-card {
  width: 480px;
  max-width: 94vw;
}

.boosts-modal-card .boost-shop-grid {
  margin-top: var(--space-3);
}

/* Every button selector below is scoped as ".shop-modal-card .foo" (two
   classes) — a base ".btn" rule elsewhere only targets elements with the
   .btn class, but these shop buttons intentionally DON'T use .btn (custom
   sizing), so scoping here is just for organization, not a specificity fix
   like it used to be. Keep it anyway: cheap insurance against a future
   generic "button inside .card" rule reintroducing that exact bug. */

.shop-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.shop-modal-header h2 {
  margin: 0;
}

.shop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--surface-soft);
  padding-bottom: var(--space-3);
}

.shop-modal-card .shop-tab,
.leaderboard-modal-card .shop-tab {
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  background: #F7F8FA;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.shop-modal-card .shop-tab:hover:not(.active),
.leaderboard-modal-card .shop-tab:hover:not(.active) {
  background: var(--surface-soft);
}

.shop-modal-card .shop-tab.active,
.leaderboard-modal-card .shop-tab.active {
  background: var(--blue);
  color: #fff;
}

.shop-pager {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.shop-modal-card .shop-pager-arrow {
  flex-shrink: 0;
  flex-grow: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.shop-modal-card .shop-pager-arrow:hover:not(:disabled) {
  background: #E4E9F0;
}

.shop-modal-card .shop-pager-arrow:disabled {
  background: #F7F8FA;
  color: #CFD4DD;
  cursor: default;
}

.shop-items-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  min-height: 220px;
}

.shop-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 14px;
  overflow: hidden;
  background: #F7F8FA;
  border: 2px solid transparent;
}

.shop-card-item.equipped {
  border-color: var(--green);
}

.shop-card-item-label {
  width: 100%;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  background: var(--surface-soft);
}

.shop-card-item-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
}

.shop-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #ffffff;
  border: 3px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.shop-modal-card .shop-card-item-btn {
  width: 100%;
  border: none;
  border-radius: 0;
  padding: 10px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: background var(--duration-fast) ease;
}

.shop-modal-card .shop-card-item-btn-action {
  background: var(--green);
}

.shop-modal-card .shop-card-item-btn-action:hover:not(:disabled) {
  background: var(--green-hover);
}

.shop-modal-card .shop-card-item-btn:disabled {
  background: var(--disabled);
  color: #fff;
  cursor: default;
}

.shop-page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: var(--space-4);
}

.shop-modal-card .shop-page-number {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #F7F8FA;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.shop-modal-card .shop-page-number:hover:not(.active) {
  background: var(--surface-soft);
}

.shop-modal-card .shop-page-number.active {
  background: var(--blue);
  color: #fff;
}

/* ---------- leaderboard modal ---------- */

.leaderboard-modal-card {
  width: 480px;
  max-width: 94vw;
  max-height: 80vh;
  overflow-y: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leaderboard-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 2px solid var(--surface-soft);
}

.leaderboard-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--surface-soft);
}

.leaderboard-table tr.leaderboard-row-you {
  background: var(--purple-soft);
  font-weight: 800;
}

.leaderboard-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: var(--space-4) 0;
}

/* ---------- responsive ---------- */

@media (max-height: 800px) {
  .main-panel {
    margin-top: 16px;
    margin-bottom: 16px;
  }
}

@media (max-width: 1200px) {
  .main-panel {
    width: calc(100vw - 32px);
  }

  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 849px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .profile-tile-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .main-panel {
    width: calc(100vw - 20px);
    margin: 54px auto 10px;
  }

  .brand-row {
    flex-wrap: wrap;
  }

  .logo {
    font-size: 28px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-button {
    min-height: 180px;
  }

  .hero-auth {
    flex-direction: column;
    align-items: stretch;
  }

  .text-field-inline {
    max-width: none;
  }

  .btn {
    min-height: 50px;
  }
}

@media (max-width: 380px) {
  .main-panel {
    padding-left: 0;
    padding-right: 0;
  }

  .card {
    padding: var(--space-4);
  }

  .logo {
    font-size: 29px;
  }

  .mode-button-title {
    font-size: 14px;
  }

  .mode-button-desc {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot,
  .chase-sprite,
  .corner-blob,
  .modal-card,
  .wallet-details[open] > *:not(summary) {
    animation: none !important;
    transition: none !important;
  }
}
