/* ═══════════════════════════════════════════════════
   MoneySpread – Modern Lobby Redesign v2
   Aesthetic: Clean Dark Fintech / Premium Minimal
   ═══════════════════════════════════════════════════ */

:root {
  --lobby-bg: #080710;
  --lobby-surface: rgba(255, 255, 255, 0.03);
  --lobby-surface-hover: rgba(255, 255, 255, 0.06);
  --lobby-border: rgba(166, 186, 237, 0.2);
  --lobby-border-hover: rgba(166, 186, 237, 0.3);

  /* Gold Accent Palette */
  --accent: #e8b94e;
  --accent-dim: rgba(232, 185, 78, 0.15);
  --accent-glow: rgba(232, 185, 78, 0.3);
  --accent-gradient: linear-gradient(135deg, #e8b94e, #f0d78c);

  /* Semantic Colors */
  --color-win: #34d399;
  --color-win-dim: rgba(52, 211, 153, 0.12);
  --color-lose: #f87171;
  --color-lose-dim: rgba(248, 113, 113, 0.12);
  --color-online: #34d399;

  /* Text */
  --text-primary: #f5f5f7;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-tertiary: rgba(255, 255, 255, 0.3);

  /* Typography */
  --font: 'Outfit', system-ui, -apple-system, sans-serif;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 100px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ════════════════ BASE ════════════════ */
.lobby-page {
  background: var(--lobby-bg);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  position: relative;
}

/* Subtle background mesh - Simplified to match game */
.lobby-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 185, 78, 0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ════════════════ HEADER (full-width) ════════════════ */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 9, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--lobby-border);
  /* Break out of max-width container */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  box-sizing: border-box;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: #0a0a0f;
  letter-spacing: 0.02em;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.status {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-online);
  opacity: 0.8;
}

/* Brand */
.brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-money {
  color: var(--text-primary);
}

.brand-spread {
  color: var(--accent);
}

/* Balance */
.balance-container {
  position: relative;
  background: var(--lobby-surface);
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-pill);
  padding: 6px 8px 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}

.balance-container:hover {
  border-color: var(--lobby-border-hover);
}

.balance-glow {
  display: none;
  /* Clean design — no glow needed */
}

.balance-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.balance-label {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.balance-amount,
.lobby-page .balance-amount,
.lobby-page #lobby-balance-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent) !important;
  letter-spacing: -0.01em;
}

#lobby-deposit-btn {
  background: var(--accent);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: #0a0a0f;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s var(--spring), opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#lobby-deposit-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

/* ════════════════ HERO SECTION ════════════════ */
#hero-section {
  width: 100%;
  margin-top: 8px;
}

.hero-glass-card {
  background: var(--lobby-surface);
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-2xl);
  padding: 40px 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  backdrop-filter: none;
  box-shadow: none;
  transition: border-color 0.4s var(--ease);
}

.hero-glass-card:hover {
  border-color: var(--lobby-border-hover);
}

/* Remove heavy glow effect */
.hero-glass-card::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(232, 185, 78, 0.03), transparent 70%);
  pointer-events: none;
}

.hero-content {
  flex: 1;
  min-width: 280px;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.hero-title .highlight {
  background: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.6;
  font-weight: 400;
}

/* ════════════════ PLAY CONTROLS ════════════════ */
.play-controls {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-xl);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stake-config {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.config-header .label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

#min-stake-hint {
  font-size: 0.6rem;
  color: var(--accent);
  font-weight: 600;
  opacity: 0.7;
}

/* Stake Input */
.stake-input-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.stake-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ccy-symbol {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

#lobby-stake-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 700;
  width: 100%;
  outline: none;
  font-family: var(--font);
  letter-spacing: -0.02em;
}

#lobby-stake-input::-webkit-inner-spin-button,
#lobby-stake-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Quick Stake Chips */
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
  display: none;
}

.stake-chip {
  background: transparent;
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  min-width: 52px;
  text-align: center;
  font-family: var(--font);
  white-space: nowrap;
}

.stake-chip:hover {
  background: var(--lobby-surface-hover);
  color: var(--text-primary);
  border-color: var(--lobby-border-hover);
}

.stake-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
}

/* ════════════════ SPREAD NOW BUTTON ════════════════ */
.main-action-btn {
  position: relative;
  background: var(--accent);
  border: none;
  padding: 18px;
  border-radius: var(--r-md);
  color: #0a0a0f;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--spring), box-shadow 0.3s var(--ease), filter 0.2s;
  box-shadow: 0 4px 20px var(--accent-dim);
}

.main-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  filter: brightness(1.05);
}

.main-action-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  animation: shine 5s ease infinite;
}

@keyframes shine {
  0% {
    left: -100%;
  }

  20% {
    left: 200%;
  }

  100% {
    left: 200%;
  }
}

.btn-label {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-family: var(--font);
}

.btn-subtext {
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* ════════════════ DASHBOARD GRID ════════════════ */
#dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ════════════════ DASH CARD (shared) ════════════════ */
.dash-card {
  background: var(--lobby-surface);
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: none;
  box-shadow: none;
  transition: border-color 0.3s var(--ease);
}

.dash-card:hover {
  border-color: var(--lobby-border-hover);
}

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

.card-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  display: flex;
  text-transform: uppercase;
  align-items: center;
  gap: 8px;
}

/* Live indicator */
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--color-lose);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(1.4);
  }
}

.feed-count {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* ════════════════ ACTIVITY FEED ════════════════ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-card {
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s var(--ease);
}

.activity-card:hover {
  background: var(--lobby-surface-hover);
}

.act-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-avatar {
  width: 28px;
  height: 28px;
  background: var(--lobby-surface-hover);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-tertiary);
}

.act-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.act-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-outcome {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.act-outcome.win {
  color: var(--color-win);
}

.act-outcome.lose {
  color: var(--color-lose);
  opacity: 0.6;
}

.act-mult {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 3px 8px;
  background: var(--lobby-surface);
  border-radius: var(--r-xs);
}

/* ════════════════ SIDE NAV / DASHBOARD ════════════════ */
#side-nav {
  order: -1;
  /* Move dashboard above activity feed */
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.nav-tile {
  background: transparent;
  border: 1px solid var(--lobby-border);
  border-radius: var(--r-md);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  color: var(--text-secondary);
}

.nav-tile:hover {
  background: var(--lobby-surface-hover);
  border-color: var(--accent-dim);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.tile-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.tile-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: inherit;
  text-transform: uppercase;
}

/* ════════════════ ENTRANCE ANIMATIONS ════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#hero-section {
  animation: fadeInUp 0.6s var(--ease) both 0.1s;
}

#dashboard-grid {
  animation: fadeInUp 0.6s var(--ease) both 0.25s;
}

#side-nav {
  animation: fadeInUp 0.6s var(--ease) both 0.3s;
}

#activity-feed {
  animation: fadeInUp 0.6s var(--ease) both 0.4s;
}

/* ════════════════ MOBILE ════════════════ */
@media (max-width: 768px) {
  .nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  #app-wrapper {
    padding: 0 16px 24px;
    gap: 16px;
  }

  #app-header {
    padding: 10px 0;
  }

  .brand {
    font-size: 1.1rem;
  }

  .username {
    display: none;
  }

  .hero-glass-card {
    padding: 28px 20px;
    gap: 24px;
    border-radius: var(--r-xl);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .play-controls {
    padding: 18px;
    max-width: 100%;
  }

  #lobby-stake-input {
    font-size: 1.5rem;
  }

  .nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-tile {
    padding: 14px 6px;
  }

  .tile-icon {
    font-size: 1.1rem;
  }

  .dash-card {
    padding: 16px 18px;
    border-radius: var(--r-lg);
  }
}

@media (max-width: 400px) {
  .nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .balance-container {
    padding: 4px 6px 4px 12px;
  }

  .balance-amount {
    font-size: 0.9rem;
  }
}

/* ════════════════ LOADING SCREEN ════════════════ */
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* ════════════════ SCROLLBAR ════════════════ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--lobby-border);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--lobby-border-hover);
}