/* ================== GLOBAL LAYOUT FIX ================== */
* {
  min-width: 0;
}

/* ================== CSS VARIABLES ================== */
:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #111820;
  --bg-tertiary: #1a2330;
  --bg-elevated: #232d3d;
  --border-color: #2a3548;
  --border-light: #3a4a63;
  
  --text-primary: #f0f4f8;
  --text-secondary: #8b9aae;
  --text-muted: #5a6a7d;
  
  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  
  --online: #22c55e;
  --offline: #ef4444;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  
  /* ================== Z-INDEX HIERARCHY ================== */
  --z-base: 1;
  --z-dropdown: 50;
  --z-pagination: 80;
  --z-header: 100;
  --z-sidebar-overlay: 150;
  --z-sidebar: 200;
  --z-bottom-bar: 200;
  --z-modal: 500;
  --z-toast: 600;
  --z-modal-high: 11000; /* Higher than everything else */
  
  /* ================== LAYOUT DIMENSIONS ================== */
  --header-height: 56px;
  --bottom-bar-height: 72px;
  --pagination-height: 64px;
  --stats-bar-height: 80px;
}

/* ================== RESET & BASE ================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ================== ICONS ================== */
.icon-xs { width: 14px; height: 14px; stroke-width: 2; }
.icon-sm { width: 18px; height: 18px; stroke-width: 2; }
.icon-md { width: 22px; height: 22px; stroke-width: 2; }
.icon-lg { width: 28px; height: 28px; stroke-width: 2; }

/* ================== AUTH SCREEN ================== */
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-container {
  width: 100%;
  max-width: 360px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo-icon {
  width: 56px;
  height: 56px;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.auth-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.auth-form h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-group input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

.input-group input[type="password"] {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-primary, .btn-secondary {
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:active {
  transform: scale(0.98);
  background: #2563eb;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:active {
  background: var(--bg-elevated);
}

.btn-danger {
  background: var(--accent-danger);
  color: white;
}

.btn-danger:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-danger:not(:disabled):active {
  transform: scale(0.98);
  background: #dc2626;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-error, .form-error {
  color: var(--accent-danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
}

/* ================== APP LAYOUT ================== */
/* ================== APP LAYOUT GRID ================== */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--header-height) + var(--safe-top));
  /* Bottom padding accounts for selection bar when visible */
  padding-bottom: var(--safe-bottom);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-height) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(10, 14, 20, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 12px;
  padding-right: 12px;
  z-index: var(--z-header);
}

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

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  margin-left: 8px;
}

.selection-mode-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--accent-primary);
  border-radius: 20px;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.selection-mode-indicator.hidden {
  display: none;
}

.header-selection-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0 6px;
  background: var(--accent-primary);
  border-radius: 12px;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  animation: pulse-badge 2s ease-in-out infinite;
}

.header-selection-badge.hidden {
  display: none;
}

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

.search-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  flex: 1;
  max-width: 300px;
  animation: slideIn 0.2s ease;
}

.search-input-container input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.search-input-container input::placeholder {
  color: var(--text-muted);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}

.icon-btn:active {
  background: var(--bg-tertiary);
}

.connection-status {
  display: flex;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--offline);
}

.status-dot.online {
  background: var(--online);
  box-shadow: 0 0 8px var(--online);
}

.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================== SIDEBAR ================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: var(--z-sidebar);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  height: calc(56px + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon-sm {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
}

.nav-list {
  list-style: none;
  padding: 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
  margin-bottom: 4px;
}

.nav-item:active,
.nav-item.active {
  background: var(--accent-primary);
  color: white;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
}

.sidebar-footer .btn-secondary {
  width: 100%;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: var(--z-sidebar-overlay);
  opacity: 0;
  visibility: hidden;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ================== MAIN CONTENT ================== */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  padding: 16px;
}

/* ================== PAGE LAYOUT ================== */
.page {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: fadeIn 0.2s ease;
}

.page.active {
  display: flex;
}

/* Accounts page has special layout with sticky sections */
#page-accounts {
  position: relative;
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  /* ⭐ 1. Soft Page Background Atmosphere */
  background: radial-gradient(circle at top, var(--bg-secondary), var(--bg-primary));
}

#page-accounts.active {
  display: flex;
}

/* Scrollable content area within page */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  min-height: 0;
  display: flex;
  flex-direction: column;
  scroll-behavior: auto;
  padding: 0 16px;
}

@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  .modal-content-body {
    scroll-behavior: smooth;
  }
}

/* ⭐ 6. Subtle fade at bottom of scroll */
.page-content::after {
  content: '';
  position: sticky;
  bottom: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--bg-primary));
  display: block;
  pointer-events: none;
  margin-top: -40px;
  z-index: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.back-btn {
  margin-left: -8px;
}

/* ================== STATS BAR ================== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  /* Sticky positioning */
  position: sticky;
  top: 0;
  z-index: var(--z-base);
  background: var(--bg-primary);
  padding: 4px 0;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  /* ⭐ 2. Live Instrument Feel */
  box-shadow:
    0 6px 12px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform, box-shadow; */
}

.stat-card.clickable {
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.stat-card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.1);
}

.stat-card.clickable:active {
  transform: scale(0.96);
}

.stat-card.clickable * {
  pointer-events: none; /* Ensure clicks go to the card, not children */
}

/* Low balance threshold modal */
.lb-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.lb-pop-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.lb-chip {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.lb-chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(59,130,246,0.08);
}

.lb-pop-row {
  display: flex;
}

.lb-pop-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.lb-pop-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

.lb-pop-input::-webkit-outer-spin-button,
.lb-pop-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lb-pop-input[type=number] { -moz-appearance: textfield; }

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  transition: transform 0.16s ease;
}

/* ⭐ 2. Animate value change */
.stat-value.updating {
  transform: scale(1.15);
  color: var(--accent-primary);
}

.stat-value.win { color: var(--accent-success); }
.stat-value.loss { color: var(--accent-danger); }
.stat-value.danger { color: var(--accent-danger); font-weight: 700; }

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================== SEARCH ================== */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-bar input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ================== VISIBILITY FILTER BAR ================== */
.visibility-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  width: 100%;
  min-width: 100%;
  overflow-x: auto;
  scroll-padding-left: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  scroll-snap-type: x mandatory;
  position: relative;
  z-index: 5;
}

.visibility-filter-bar::-webkit-scrollbar {
  display: none;
}

.visibility-filter-bar::before,
.visibility-filter-bar::after {
  content: "";
  flex: 0 0 6px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
  opacity: 0.8;
  scroll-snap-align: start;
}

.filter-btn:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.filter-btn.active {
  opacity: 1;
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

.filter-btn i {
  stroke-width: 2.5;
}

/* Mobile: icon-only pills */
@media (max-width: 480px) {
  .visibility-filter-bar {
    gap: 6px;
    padding: 6px 8px;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .filter-btn {
    padding: 8px;
  }

  .filter-btn span {
    display: none;
  }
}

/* ================== ACCOUNT LIST ================== */
/* ================== ACCOUNT LIST (Responsive Grid) ================== */
.account-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  flex: 1;
  align-content: start;
  padding: 0;
}

/* Mobile: Single column */
@media (max-width: 639px) {
  .account-list {
    grid-template-columns: 1fr;
  }

  /* Account card mobile layout */
  .account-card {
    padding: 10px 12px;
    gap: 10px;
    min-height: 64px;
  }

  /* Give account-info more room */
  .account-right {
    max-width: 90px;
    gap: 8px;
  }

  /* Tighten profile chip on mobile — keep name visible */
  .account-profile {
    max-width: 90px;
    padding: 4px 6px;
  }

  .profile-name {
    max-width: 55px;
    font-size: 11px;
  }

  /* Let meta row scroll rather than clip into each other */
  .account-meta {
    overflow: hidden;
    gap: 6px;
  }

  .balance {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
  }

  /* Smaller status pill on mobile */
  .status-pill {
    padding: 2px 6px;
    font-size: 10px;
  }

  .account-id {
    font-size: 13px;
  }
}

/* Tablet: Two columns */
@media (min-width: 640px) and (max-width: 1023px) {
  .account-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: Auto-fill based on container */
@media (min-width: 1024px) {
  .account-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.account-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 14px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: auto;
  min-height: 72px;
  cursor: pointer;
  background: linear-gradient(to bottom, rgba(255,255,255,0.02), rgba(0,0,0,0.2));
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform, box-shadow, border-color; */
  min-width: 0;
  position: relative;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  z-index: 1;
  animation: cardEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(var(--card-index, 0) * 30ms);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.account-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  border-color: var(--border-light);
}

.account-card:active {
  transform: scale(0.96);
}

/* Selection mode styles */
body.selection-mode .account-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* ⭐ Selected State - Powerful */
.account-card.selected {
  border: 2px solid var(--accent-primary);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(99,102,241,0.1));
  box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
  /* Tap feedback animation - feels native like Telegram multi-select */
  transform: scale(0.98);
  transition: transform 120ms ease, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.account-card:not(.selected) {
  transform: scale(1);
  transition: transform 120ms ease, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

/* ⭐ SELECTION CHECKBOX - Clean UX */
.selection-checkbox {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: auto;
}

.selection-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
}

.selection-checkbox .checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selection-checkbox:hover .checkmark {
  border-color: var(--accent-primary);
}

.selection-checkbox input:checked + .checkmark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.selection-checkbox input:checked + .checkmark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Selected card enhanced styling with checkbox */
.account-card.selected .selection-checkbox .checkmark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.account-card.selected .selection-checkbox .checkmark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Selection mode styles */
body.selection-mode .account-card {
  cursor: pointer;
  user-select: none;
}

body.selection-mode.is-dragging .account-card {
  cursor: grabbing;
}

/* HIDE CSS-generated checkbox - using HTML checkbox instead */
body.selection-mode .account-card::before {
  display: none; /* HTML .selection-checkbox handles this */
}

body.selection-mode .account-card.selected::before {
  display: none;
}

body.selection-mode .account-card {
  /* No padding-left needed - checkbox is in HTML */
}

.account-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.account-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  min-width: 0;
}

.account-id {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 80px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.status-pill.online {
  background: rgba(34, 197, 94, 0.15);
  color: var(--online);
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--offline);
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
}

.balance {
  font-weight: 500;
  color: var(--text-primary);
  flex: 0 1 auto;
  overflow: visible;
  white-space: nowrap;
}

.account-meta span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
  opacity: 0.8;
}

.balance.low {
  color: var(--accent-danger);
}

.config-badges {
  display: flex;
  gap: 6px;
}

.config-badge {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}


.config-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent-success);
}

.corner-badges {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  pointer-events: none;
}

.corner-badge {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.corner-badge svg {
  width: 8px !important;
  height: 8px !important;
  stroke-width: 2.2;
}

.corner-badge.terminal {
  background: rgba(99, 102, 241, 0.22);
  color: #818cf8;
}

.corner-badge.freebet {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.corner-badge.autospin {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

.needs-refresh-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.chevron-right {
  color: var(--text-muted);
}

/* ================== ACCOUNT PROFILE ================== */
.account-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 160px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.account-right-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  max-width: 110px;
  overflow: hidden;
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.profile-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-light);
}

.profile-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.8;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================== EMPTY STATE ================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ================== ACCOUNT DETAIL ================== */
.account-detail-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--online);
  box-shadow: 0 0 10px var(--online);
}

.status-indicator.offline {
  background: var(--offline);
}

.detail-balance, .detail-freebets {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-freebets {
  border-bottom: none;
}

.balance-label, .freebets-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.balance-value {
  font-size: 24px;
  font-weight: 700;
}

.freebets-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-warning);
}

/* ================== ACTION GRID ================== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.action-card {
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
  color: var(--text-primary);
  font-size: 12px;
  box-shadow:
    0 6px 14px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.action-card:active {
  transform: scale(0.94);
  box-shadow:
    inset 0 4px 10px rgba(0,0,0,0.12);
}

.action-card.danger {
  color: var(--accent-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.action-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

.action-card.danger .action-icon {
  color: var(--accent-danger);
}

.detail-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Live Cashout Section */
.live-cashout-section {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent-success);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0;
  animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--accent-success); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { border-color: #4ade80; box-shadow: 0 0 20px 5px rgba(34, 197, 94, 0.2); }
}

.cashout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cashout-multiplier {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-success);
}

.cashout-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
}

.cashout-progress {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-success), #4ade80);
  border-radius: 3px;
  transition: width 0.1s linear;
  width: 0%;
}

.btn-cashout {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-success), #16a34a);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
  animation: pulse-btn 0.5s ease-in-out infinite;
}

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

.btn-cashout:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  filter: brightness(1.08);
}

.btn-cashout:active {
  animation-play-state: paused;
  transform: scale(0.94);
  filter: brightness(0.85);
  transition: transform 0.08s, filter 0.08s;
}

/* Floating Cashout Widget - Footer Style */
.floating-cashout {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  transition: transform 200ms ease;
}

.floating-cashout.hidden {
  display: none;
}

.cashout-footer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  max-width: 600px;
  margin: 0 auto;
}

.cashout-footer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cashout-footer-row .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-danger);
  box-shadow: 0 0 6px var(--accent-danger);
  animation: live-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.4; }
}

.cashout-footer-account {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cashout-footer-divider {
  color: var(--text-muted);
  font-size: 13px;
}

.cashout-footer-multiplier {
  color: var(--accent-success);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cashout-footer-amount {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 80px;
}

.btn-cashout-footer {
  background: var(--accent-warning);
  color: #1a1000;
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, transform 100ms ease;
  flex-shrink: 0;
}

.btn-cashout-footer:hover {
  background: #f5b340;
}

.btn-cashout-footer:active {
  transform: scale(0.96);
}

.btn-cashout-footer:disabled {
  background: var(--text-muted);
  color: rgba(255,255,255,0.6);
  cursor: not-allowed;
}

/* Mobile adjustments */
@media (max-width: 400px) {
  .cashout-footer-row {
    padding: 10px 12px;
    gap: 10px;
  }
  
  .cashout-footer-multiplier,
  .cashout-footer-amount {
    font-size: 16px;
  }
  
  .btn-cashout-footer {
    padding: 10px 16px;
    font-size: 12px;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-label {
  display: block;
  margin-bottom: 4px;
}

.stat-item .stat-value {
  font-size: 16px;
  color: var(--text-primary);
}

.settings-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.setting-row-simple:last-child {
  border-bottom: none;
}

.setting-row-simple span:first-child {
  color: var(--text-secondary);
}

.setting-row-simple span:last-child {
  font-weight: 500;
  color: var(--accent-success);
}

.setting-row-simple span:last-child.inactive {
  color: var(--text-muted);
}

/* ================== FREEBETS PAGE ================== */
#page-freebets {
  position: relative;
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #0b0d10;
  min-height: 100vh;
}

#page-freebets.active {
  display: flex;
  animation: pageSlideIn 0.3s ease;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Checking State */
.freebets-checking {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
  background: #0b0d10;
}

.checking-spinner .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #1f2228;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.checking-text {
  font-size: 16px;
  color: #9aa0a6;
  font-weight: 500;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State — Ready for Illustration */
.freebets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  background: #0b0d10;
  flex: 1;
}

/* ⭐ 8. Illustration Space */
.freebets-empty .empty-illustration {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  position: relative;
}

.freebets-empty .empty-icon {
  width: 64px;
  height: 64px;
  color: #1f2228;
  margin-bottom: 16px;
  /* Ready for animation */
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.3s ease;
}

/* Ticket icon bounce animation (ready to use) */
.freebets-empty .empty-icon.animated {
  animation: ticketBounce 2s ease-in-out infinite;
}

@keyframes ticketBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.freebets-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.freebets-empty p {
  font-size: 14px;
  color: #6b7280;
  max-width: 280px;
  margin-bottom: 24px;
}

/* Confetti container (for future win celebration) */
.freebets-empty .confetti-container,
.freebets-summary .confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 100;
}

.empty-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.empty-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.empty-actions .btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
}

.empty-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.empty-actions .btn-secondary {
  background: #1f2228;
  color: #ffffff;
  border: 1px solid #2a2d35;
}

.empty-actions .btn-secondary:hover {
  background: #2a2d35;
}

/* Freebets Summary — Dark Style */
.freebets-summary {
  padding: 0;
  overflow-y: auto;
  background: #0b0d10;
  flex: 1;
}

/* ⭐ 7. Page Header Power Feel */
.freebets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid #1f2228;
}

.freebets-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.freebets-total {
  font-size: 13px;
  color: #9aa0a6;
  font-weight: 500;
}

.freebets-account-info {
  padding: 12px 20px 16px;
  border-bottom: 1px solid #1f2228;
  margin-bottom: 8px;
}

.freebets-account-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.freebets-tickets-count {
  font-size: 13px;
  color: #9aa0a6;
}

.freebets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

/* Freebet Row (Grouped by Amount) — Dark Premium Style */
.freebet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: #0f1115;
  border: 1px solid #1f2228;
  border-radius: 12px;
  /* ⭐ 1. Subtle Card Depth */
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.25s ease;
  animation: rowEnter 0.3s ease backwards;
}

.freebet-row:nth-child(1) { animation-delay: 0ms; }
.freebet-row:nth-child(2) { animation-delay: 50ms; }
.freebet-row:nth-child(3) { animation-delay: 100ms; }
.freebet-row:nth-child(4) { animation-delay: 150ms; }
.freebet-row:nth-child(5) { animation-delay: 200ms; }

@keyframes rowEnter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ⭐ 2. Improved Hover Focus (Trading Feel) */
.freebet-row:hover {
  border-color: #ffffff22;
  background: #13161c;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.45);
}

.freebet-row.spinning {
  border-color: #00ffae;
  box-shadow: 0 0 0 1px #00ffae44 inset,
              0 0 20px #00ffae33,
              0 0 40px #00ffae11;
  pointer-events: none;
  animation: rowGlow 1.5s ease-in-out infinite;
}

.freebet-row.highlighted {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px #3b82f6 inset,
              0 0 20px #3b82f644,
              0 8px 24px rgba(0,0,0,0.4);
  background: #131825;
  transform: translateY(-2px) scale(1.02);
  z-index: 10;
}

@keyframes rowGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px #00ffae44 inset,
                0 0 20px #00ffae33,
                0 0 40px #00ffae11;
  }
  50% {
    box-shadow: 0 0 0 2px #00ffae66 inset,
                0 0 30px #00ffae55,
                0 0 60px #00ffae22;
  }
}

/* ⭐ 6. Smooth Count Change Animation */
.freebet-row.updating {
  opacity: 0.6;
}

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

.freebet-amount {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
  min-width: 100px;
}

.freebet-amount::after {
  content: " freebet";
  font-size: 12px;
  color: #6b7280;
  margin-left: 6px;
}

.freebet-quantity {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  /* ⭐ 3. Stronger Quantity Badge Hierarchy */
  color: #cfd3da;
  background: #181b21;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

.freebet-quantity svg,
.freebet-quantity i {
  width: 14px;
  height: 14px;
  stroke: #6b7280;
  color: #6b7280;
}

.btn-spin {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
  /* ⭐ 4. Spin Button Premium Motion - Soft Shadow */
  box-shadow: 0 3px 8px rgba(255,255,255,0.12);
}

.btn-spin:hover {
  background: #e6e6e6;
  transform: scale(1.03);
  /* ⭐ 4. Stronger Shadow on Hover */
  box-shadow: 0 6px 16px rgba(255,255,255,0.22);
}

.btn-spin:active {
  transform: scale(0.97);
}

.btn-spin:disabled {
  background: #1f2228;
  color: #6b7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ⭐ 5. Loading State (Critical UX) */
.btn-spin.loading {
  background: #2a2f36;
  color: #777;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spin.spinning {
  background: #00ffae;
  color: #000;
  animation: pulseSpin 1.5s ease-in-out infinite;
}

@keyframes pulseSpin {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.icon-sm {
  width: 16px;
  height: 16px;
}

/* ================== PREMIUM LIVE CASHOUT PANEL ================== */

#live-cashout-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 280px;
  background: #0b0d10;
  border: 1px solid #1f2228;
  border-radius: 14px;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 50px rgba(0,0,0,0.8),
    0 0 100px rgba(0,0,0,0.4);
  overflow: hidden;
}

#live-cashout-panel.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#live-cashout-panel.exiting {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.3s ease;
}

/* Ambient glow layer */
.cashout-panel-glow {
  position: absolute;
  inset: -1px;
  background: radial-gradient(
    ellipse at center top,
    rgba(255,255,255,0.03) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#live-cashout-panel.has-value .cashout-panel-glow {
  opacity: 1;
}

/* Breathing animation for active state */
#live-cashout-panel.breathing {
  animation: panelBreathe 4s ease-in-out infinite;
}

@keyframes panelBreathe {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.03),
      0 20px 50px rgba(0,0,0,0.8),
      0 0 0 0 rgba(34,197,94,0);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.05),
      0 25px 60px rgba(0,0,0,0.85),
      0 0 30px rgba(34,197,94,0.1);
  }
}

#live-cashout-panel.has-value.breathing {
  animation: panelBreatheActive 3s ease-in-out infinite;
  border-color: rgba(34,197,94,0.3);
}

@keyframes panelBreatheActive {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(34,197,94,0.2),
      0 20px 50px rgba(0,0,0,0.8),
      0 0 0 0 rgba(34,197,94,0);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(34,197,94,0.4),
      0 25px 60px rgba(0,0,0,0.85),
      0 0 40px rgba(34,197,94,0.15);
  }
}

/* Close button */
.cashout-close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  z-index: 10;
}

.cashout-close-x:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  transform: rotate(90deg);
}

/* Content wrapper */
.cashout-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
}

/* Label */
.cashout-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Amount display */
.cashout-amount-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.cashout-currency {
  font-size: 20px;
  font-weight: 600;
  color: #9ca3af;
}

.cashout-value {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

/* Pop animation for value updates */
.cashout-value.pop {
  animation: valuePop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes valuePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Growing state - color flash */
.cashout-value.growing {
  color: #4ade80;
  text-shadow: 0 0 20px rgba(74,222,128,0.3);
}

/* Multiplier */
.cashout-multi {
  font-size: 14px;
  font-weight: 500;
  color: #8b8f97;
  font-family: 'SF Mono', Monaco, monospace;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease;
}

/* Premium CASH OUT Button */
.btn-cashout-premium {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 50px;
  margin-top: 16px;
  padding: 0 16px;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-cashout-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fff 0%, #f3f4f6 100%);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.btn-cashout-premium:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255,255,255,0.2);
}

.btn-cashout-premium:active:not(:disabled) {
  transform: translateY(1px) scale(0.93);
  filter: brightness(0.82);
  transition: transform 0.07s ease, filter 0.07s ease;
}

.btn-cashout-premium:disabled,
.btn-cashout-premium.disabled {
  background: #1f2228;
  color: #4b5563;
  cursor: not-allowed;
}

.btn-cashout-premium:disabled::before,
.btn-cashout-premium.disabled::before {
  opacity: 0;
}

.btn-cashout-premium.active {
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255,255,255,0);
  }
  50% {
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
  }
}

/* Button content elements */
.cashout-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.cashout-btn-text {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.cashout-btn-amount {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  opacity: 0.7;
  position: relative;
  z-index: 1;
  min-width: 50px;
  text-align: right;
}

.btn-cashout-premium:disabled .cashout-btn-amount,
.btn-cashout-premium.disabled .cashout-btn-amount {
  opacity: 0.3;
}

/* ================== MOBILE RESPONSIVE ================== */

@media (max-width: 640px) {
  #live-cashout-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px 20px calc(20px + var(--safe-bottom));
    transform: translateY(100%);
  }
  
  #live-cashout-panel.active {
    transform: translateY(0);
  }
  
  #live-cashout-panel.exiting {
    transform: translateY(20px);
  }
  
  .cashout-value {
    font-size: 42px;
  }
  
  .btn-cashout-premium {
    height: 56px;
    font-size: 14px;
  }
}

/* ================== WIN TOAST ================== */
.win-toast {
  background: #0b0b0b;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 220px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 10px 30px rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  animation: toastFadeIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.win-toast.won {
  border-color: #00ffae33;
}

.win-toast.lost {
  border-color: #ff444433;
}

.win-toast .multiplier {
  text-align: center;
  min-width: 60px;
}

.win-toast .multiplier .label {
  color: #8b8b8b;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.win-toast .multiplier .value {
  color: #ffffff;
  font-size: 26px;
  font-weight: 700;
}

.win-toast .win {
  flex: 1;
}

.win-toast .win .label {
  color: #6f6f6f;
  font-size: 12px;
}

.win-toast .win .value {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
}

.win-toast-close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow .2s ease;
  color: #8b8b8b;
}

.win-toast-close:hover {
  border-color: #ffffff;
  transform: rotate(90deg);
  color: #ffffff;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Adjustments */
@media (max-width: 639px) {
  .freebets-list {
    padding: 16px;
  }
  
  .freebet-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }
  
  .freebet-info {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .freebet-amount {
    font-size: 16px;
    min-width: auto;
  }
  
  .freebet-amount::after {
    display: none;
  }
  
  .btn-spin {
    width: 100%;
    justify-content: center;
  }
  
  /* Mobile cashout panel - Premium bottom sheet */
  #live-cashout-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px 20px calc(24px + var(--safe-bottom));
    transform: translateY(100%);
  }
  
  #live-cashout-panel.active {
    transform: translateY(0);
  }
  
  #live-cashout-panel.exiting {
    transform: translateY(20px);
  }
  
  .cashout-value {
    font-size: 42px;
  }
  
  .btn-cashout-premium {
    height: 56px;
    font-size: 14px;
  }
}

/* ================== ODDS PAGE ================== */
/* Ensure odds page fills available space properly */
#page-odds {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#page-odds.active {
  display: flex;
}

/* Mobile: Allow odds page to scroll for analytics */
@media (max-width: 768px) {
  #page-odds {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
}

.odds-visual {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.odds-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.odd-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.odd-ball.low { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.odd-ball.medium { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.odd-ball.high { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.odd-ball.jackpot { 
  background: linear-gradient(135deg, #f59e0b, #d97706); 
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.odds-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row b {
  font-weight: 600;
}

.summary-row .highlight {
  color: var(--accent-warning);
}

.prediction-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.prediction-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
}

.prediction-text {
  display: flex;
  flex-direction: column;
}

.prediction-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.prediction-value {
  font-weight: 600;
  color: var(--accent-success);
}

.prediction-value.caution {
  color: var(--accent-warning);
}

.prediction-value.danger {
  color: var(--accent-danger);
}

/* ================== SETTINGS ================== */
.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.setting-item:last-of-type {
  border-bottom: none;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-name {
  font-weight: 500;
  font-size: 15px;
}

.setting-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
  position: relative;
  width: 52px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
}

.slider::before {
  content: '';
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--accent-primary);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.setting-inputs {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.input-row:last-child {
  margin-bottom: 0;
}

.input-row label {
  font-size: 14px;
  color: var(--text-secondary);
}

.input-row input {
  width: 100px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  text-align: right;
}

.setting-input-inline {
  width: 100px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  text-align: right;
}

.list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item span {
  flex: 1;
  text-align: left;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row span:last-child {
  color: var(--text-secondary);
}

/* ================== SETTINGS ACTIONS ================== */
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ================== BOTTOM BAR ================== */
/* ================== BOTTOM ACTION BAR (Selection) ================== */
.bottom-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(30, 30, 35, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  z-index: var(--z-bottom-bar);
  /* ⭐ 5. Floating Bottom Bar */
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  animation: bottomBarEnter 0.3s ease;
}

@keyframes bottomBarEnter {
  from {
    transform: translateY(120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.bottom-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.selection-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-exit-selection {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
  flex-shrink: 0;
}

.btn-exit-selection:hover {
  background: var(--accent-danger);
  color: white;
  transform: scale(1.1);
}

.selected-text {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.selected-text b {
  color: var(--text-primary);
  font-size: 16px;
}

.btn-select-all {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-select-all:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.bottom-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}

.bottom-actions .icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* ⭐ 5. Tactile Buttons - Gradient */
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-tertiary));
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.bottom-actions .icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.bottom-actions .icon-btn:active {
  transform: scale(0.92);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}

.bottom-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.bottom-amount label {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.bottom-amount input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
}

/* Mobile: Stack layout */
@media (max-width: 639px) {
  .bottom-bar-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .selection-info {
    justify-content: space-between;
  }
  
  .bottom-actions {
    justify-content: center;
    order: -1; /* Move actions above count on mobile */
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Desktop with sidebar */
@media (min-width: 1024px) {
  .bottom-bar {
    left: 260px;
    padding: 16px 24px calc(16px + var(--safe-bottom));
  }
}

/* ================== TOASTS ================== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px + var(--safe-top));
  left: 16px;
  right: 16px;
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--accent-success); }
.toast.error { border-left: 3px solid var(--accent-danger); }
.toast.warning { border-left: 3px solid var(--accent-warning); }
.toast.info { border-left: 3px solid var(--accent-primary); }

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateY(-20px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

/* ================== MODALS ================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: calc(var(--z-modal) - 10);
  opacity: 0;
  visibility: hidden;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal.active {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
  flex: 1;
}

.amount-input-lg {
  width: 100%;
  height: 60px;
  padding: 0 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.quick-amounts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  height: 40px;
  padding: 0 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
}

.chip:active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.activity-action {
  font-weight: 500;
  margin-bottom: 4px;
}

.activity-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ================== UTILITIES ================== */
.hidden {
  display: none !important;
}

.win { color: var(--accent-success); }
.loss { color: var(--accent-danger); }
.warning { color: var(--accent-warning); }

/* ================== DESKTOP ADAPTATIONS ================== */
@media (min-width: 768px) {
  .app {
    padding-left: 260px;
    padding-top: calc(64px + var(--safe-top));
  }
  
  .app-header {
    left: 260px;
    height: calc(64px + var(--safe-top));
    padding-left: 24px;
    padding-right: 24px;
  }
  
  .header-left .icon-btn:first-child {
    display: none;
  }
  
  .sidebar {
    transform: translateX(0);
    width: 260px;
  }
  
  .main-content {
    padding: 24px;
    max-width: 1200px;
  }
  
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .action-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .modal {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 400px;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  
  .modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  .modal-large {
    width: 600px;
    max-height: 80vh;
  }
  
  .bottom-bar {
    left: 260px;
    padding: 16px 24px calc(16px + var(--safe-bottom));
  }
}

@media (min-width: 1024px) {
  .account-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bottom-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
  }
}

/* ================== ACCOUNT LIST MODAL ================== */
.account-list-modal {
  max-height: 400px;
  overflow-y: auto;
}

.account-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
}

.account-list-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-light);
}

.account-list-item .account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.account-list-item .account-info {
  flex: 1;
}

.account-list-item .account-name {
  font-weight: 600;
  color: var(--text-primary);
}

.account-list-item .account-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ================== FREEBET AMOUNT GRID ================== */
.freebet-amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.freebet-amount-btn {
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
}

.freebet-amount-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
}

.freebet-amount-btn:active {
  transform: scale(0.98);
}

/* ================== NOTIFICATIONS ================== */
.notifications-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 320px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notifications-container .notification {
  pointer-events: auto;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification.success {
  border-left: 4px solid var(--accent-success);
}

.notification.error {
  border-left: 4px solid var(--accent-danger);
}

.notification.warning {
  border-left: 4px solid var(--accent-warning);
}

.notification.info {
  border-left: 4px solid var(--accent-primary);
}

.notification-icon {
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 14px;
  color: var(--text-secondary);
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.notification.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

.notifications-container {
  z-index: var(--z-toast);
}

/* ================== LOADING SKELETON ================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--border-light) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 80px;
  margin-bottom: 12px;
}

/* ================== PAGINATION ================== */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-top: auto;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-size-select {
  /* Remove native browser styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  
  /* Layout */
  padding: 8px 36px 8px 12px;
  min-width: 70px;
  height: 36px;
  
  /* Visual */
  background: var(--bg-elevated);
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7280' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.5 7l4.5 5 4.5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  
  /* Typography */
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  
  /* Interaction */
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.18s ease;
}

.page-size-select:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.page-size-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform, box-shadow; */
}

.pagination-btn:hover:not(:disabled) {
  background: var(--border-light);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

.pagination-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pagination-btn:disabled,
.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pagination-ellipsis {
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

/* Mobile pagination adjustments */
@media (max-width: 640px) {
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0;
  }
  
  .pagination-left {
    justify-content: center;
    order: 2; /* Move below page numbers */
  }
  
  .pagination-controls {
    justify-content: center;
    order: 1;
  }
  
  .pagination-btn {
    min-width: 44px;
    height: 44px;
    font-size: 14px;
  }
  
  .pagination-ellipsis {
    display: none; /* Hide ellipsis on small screens */
  }
}

/* ================== QUICK SELECT PANEL ================== */
.quick-select-panel {
  transition: opacity 0.2s, transform 0.2s;
}

.quick-select-btn {
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s;
  font-weight: 500;
}

.quick-select-btn:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quick-select-btn:active {
  transform: translateX(1px);
}


/* ================== FREEBET UI COMPONENTS ================== */

/* Stat card loading state */
.stat-card.checking {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Freebet filter banner */
.freebet-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-success);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.freebet-filter-banner span {
  color: var(--text-secondary);
}

.freebet-filter-banner span strong {
  color: var(--accent-success);
  font-weight: 600;
}

.freebet-filter-banner .btn-text {
  color: var(--accent-success);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s;
}

.freebet-filter-banner .btn-text:hover {
  background: rgba(34, 197, 94, 0.1);
}

/* Freebet action modal */
.freebet-action-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.freebet-modal-content {
  position: relative;
  width: 90%;
  max-width: 360px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.freebet-summary {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.freebet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.freebet-actions button {
  justify-content: center;
  gap: 8px;
}

/* Freebet quick menu */
.freebet-quick-menu {
  position: fixed;
  z-index: var(--z-modal);
}

.freebet-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.freebet-menu-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-width: 280px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.freebet-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.freebet-menu-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-success);
}

.freebet-menu-body {
  padding: 16px;
}

.freebet-total {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.freebet-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freebet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.freebet-amount {
  font-weight: 600;
  color: var(--text-primary);
}

.freebet-count {
  font-size: 13px;
  color: var(--accent-success);
  font-weight: 500;
}

.freebet-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
}

.freebet-menu-actions button {
  justify-content: center;
  gap: 8px;
}

/* Account card freebet indicator */
.account-card.has-freebet {
  border-left: 3px solid var(--accent-success);
}


/* ================== OFFLINE DISABLED STATE ================== */
.account-card.offline-disabled {
  opacity: 1; /* Full opacity - not transparent */
  filter: grayscale(30%); /* Slight desaturation to indicate offline */
  background: var(--bg-tertiary); /* Solid background color */
}

/* Disable click navigation on account info but keep card interactive for swipe */
.account-card.offline-disabled .account-info {
  pointer-events: none;
}

/* Ensure swipeable offline cards can still receive touch events */
.account-card.offline-disabled.swipeable {
  pointer-events: auto;
  cursor: grab;
}

.account-card.offline-disabled.swipeable:active {
  cursor: grabbing;
}

/* Remove hover effects for offline cards */
.account-card.offline-disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-color);
}

/* Selection mode cursor feedback - show selection cursor */
body.selection-mode .account-card {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body.selection-mode .account-card:not(.offline-disabled):hover {
  cursor: pointer;
}

/* In selection mode, still show disabled state but allow swipe */
body.selection-mode .account-card.offline-disabled {
  border-color: var(--border-color);
  box-shadow: none;
}

body.selection-mode .account-card.offline-disabled.swipeable {
  cursor: grab;
}

body.selection-mode .account-card.offline-disabled:hover {
  border-color: var(--border-color);
  box-shadow: none;
}

/* Selection checkbox is hidden for offline cards in selection mode */
body.selection-mode .account-card.offline-disabled::before {
  display: none;
}

/* Remove left padding for offline cards in selection mode (no checkbox) */
body.selection-mode .account-card.offline-disabled {
  padding-left: 16px;
}

/* Freebet indicator on account card */
.freebet-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.freebet-indicator.has-freebets {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-success);
}

/* Mobile adjustments */
@media (max-width: 639px) {
  .freebet-menu-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: none;
    animation: slideUp 0.3s ease;
  }
  
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  
  .freebet-quick-menu {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
  }
}

/* ================== OFFLINE DELETE MODAL ================== */
#offline-delete-modal .delete-account-info {
  margin-bottom: 20px;
}

#offline-delete-modal .delete-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

#offline-delete-modal .delete-account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

#offline-delete-modal .delete-account-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
}

#offline-delete-modal .delete-account-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#offline-delete-modal .delete-account-name {
  font-weight: 600;
  color: var(--text-primary);
}

#offline-delete-modal .delete-account-id {
  font-size: 12px;
  color: var(--text-secondary);
}

#offline-delete-modal .offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-danger);
  border-radius: 4px;
  color: var(--accent-danger);
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}

#offline-delete-modal .delete-warning {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

#offline-delete-modal .delete-warning-highlight {
  color: var(--accent-danger);
  font-weight: 600;
  font-size: 14px;
}

#offline-delete-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

#offline-delete-modal .btn-danger {
  background: var(--accent-danger);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s;
}

#offline-delete-modal .btn-danger:hover {
  background: #dc2626;
}

/* Account card deleting state */
.account-card.deleting {
  position: relative;
}

.account-card.deleting::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-card.deleting::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

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

/* ================== ACCOUNT DETAIL PREMIUM ENHANCEMENTS ================== */

/* 1. Soft Page Entrance Animation */
#page-account-detail.active {
  animation: panelEnter 0.32s ease;
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 3. Micro Ripple Feedback */
.action-card .ripple {
  position: absolute;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.5s ease;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* 4. Balance Section - Main Instrument Panel */
.detail-balance-section {
  text-align: center;
  padding: 20px 0;
}

.balance-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.balance-value.updating {
  transform: scale(1.12);
}

.balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* 5. Status Indicator Glow */
.status-indicator.online {
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  animation: statusPulse 2s ease-in-out infinite;
}

.status-indicator.offline {
  box-shadow: none;
  opacity: 0.6;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.8); }
}

/* 6. Live Cashout Panel - Dramatic Event Panel */
.live-cashout-section {
  transform: translateY(30px);
  opacity: 0;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.35s ease;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.1), transparent);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
}

.live-cashout-section.active {
  transform: translateY(0);
  opacity: 1;
}

.live-cashout-section .section-title {
  color: var(--accent-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-cashout-section .section-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: liveDot 1s ease-in-out infinite;
}

@keyframes liveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* 7. Soft Section Separation */
.detail-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* 8. Back Button Responsive */
.back-btn {
  transition: transform 0.15s ease;
}

.back-btn:active {
  transform: scale(0.9);
}

/* 9. Ambient Background Mood */
#page-account-detail {
  background: radial-gradient(circle at top, var(--bg-secondary), var(--bg-primary));
  min-height: 100%;
  overflow-y: auto;
}

/* Detail Header Enhancement */
.detail-header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-account-name {
  font-size: 22px;
  font-weight: 700;
  margin-top: 12px;
}

.detail-account-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 13px;
}

/* Action Grid Enhancement */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px;
}

/* Action Card Label */
.action-card span {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Ensure clicks on icon/text go through to the card */
.action-card * {
  pointer-events: none;
}

/* Detail Settings Panel */
.detail-settings {
  padding: 0 20px 20px;
}

/* Float animation for live elements */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.live-indicator {
  animation: float 2s ease-in-out infinite;
}


/* ================== MODAL OVERLAY SYSTEM ================== */

/* Modal Root Container */
#modal-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-modal);
}

#modal-root:has(.modal-overlay) {
  pointer-events: auto;
}

/* Modal Overlay Backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 11000; /* Higher than tournament modals (10000) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Card */
.modal-card {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-footer .btn {
  flex: 1;
}

/* Modal Stacking Support */
.modal-overlay[data-stack="0"] { z-index: var(--z-modal-high); }
.modal-overlay[data-stack="1"] { z-index: calc(var(--z-modal-high) + 10); }
.modal-overlay[data-stack="2"] { z-index: calc(var(--z-modal-high) + 20); }
.modal-overlay[data-stack="3"] { z-index: calc(var(--z-modal-high) + 30); }

/* Ensure ModalSystem modals appear above everything */
#modal-root .modal-overlay {
  z-index: var(--z-modal-high);
}

/* ================== AVATAR MODAL SPECIFIC ================== */

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 4px;
}

.avatar-item {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.avatar-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.avatar-item.selected {
  border-color: var(--accent-success);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

.avatar-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.avatar-item:hover img {
  transform: scale(1.1);
}

/* Avatar Loading Skeleton */
.avatar-skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-color) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Avatar Loading State */
.avatar-grid.loading .avatar-item {
  pointer-events: none;
}

/* ================== PROFILE MODAL ================== */

.profile-options {
  display: flex;
  gap: 16px;
  padding: 8px;
}

.profile-option-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.profile-option-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.profile-option-btn i {
  width: 48px;
  height: 48px;
  color: var(--accent-primary);
}

.profile-option-btn span {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================== FREEBET MODAL ================== */

.freebet-amount-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.freebet-amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.freebet-amount-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
}

.freebet-amount-btn .amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-success);
}

.freebet-amount-btn .count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ================== MOBILE MODAL ADJUSTMENTS ================== */

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  
  .modal-card {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    animation: modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  @keyframes modal-slide-up {
    to { transform: translateY(0); }
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 16px 20px;
  }
  
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  
  .profile-options {
    flex-direction: column;
    gap: 12px;
  }
  
  .profile-option-btn {
    padding: 24px;
    flex-direction: row;
    justify-content: center;
  }
}

/* ================== MODAL ANIMATIONS ================== */

.modal-closing .modal-card {
  transform: scale(0.95) translateY(20px);
  opacity: 0;
}

.modal-closing {
  opacity: 0;
  visibility: hidden;
}

/* Ensure smooth exit animation */
.modal-overlay {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}


/* ================== REDESIGNED SETTINGS PAGE ================== */

/* Settings Page Layout */
/* Context Bar - Account Selector */
.settings-context-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.context-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.context-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.context-dropdown {
  flex: 1 1 0px;
  min-width: 280px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  appearance: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px 44px 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.context-dropdown:hover {
  border-color: var(--border-hover);
}

.context-dropdown:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.context-dropdown option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

.override-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 20px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.default-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
}

.bulk-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 13px;
}

.bulk-banner i {
  color: var(--accent-primary);
}

.bulk-banner strong {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

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

/* Settings Card */
.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.settings-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.settings-card.highlighted {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
  border-bottom: 1px solid var(--border-default);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-lg);
  color: white;
  flex-shrink: 0;
}

.card-icon i {
  width: 20px;
  height: 20px;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.global-badge {
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.card-body {
  padding: 16px 20px;
}

/* Setting Row */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-default);
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-row:first-child {
  padding-top: 0;
}

.setting-row.compact {
  padding: 12px 0;
}

.setting-row.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.setting-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.setting-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.setting-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Input Fields */
.input-field {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:hover {
  border-color: var(--border-hover);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-field.narrow {
  width: 100px;
  text-align: right;
}

.input-field.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* Input Pair */
.input-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
}

.input-group .input-field {
  width: 100%;
}

/* Modern Switch */
.switch.modern {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch.modern input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch.modern .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  transition: .3s;
  border-radius: 28px;
}

.switch.modern .slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch.modern input:checked + .slider {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: transparent;
}

.switch.modern input:checked + .slider:before {
  transform: translateX(24px);
}

.switch.modern input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Sticky Action Bar */
.settings-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-default);
  padding: 16px 20px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.sidebar-visible ~ #main-content .settings-action-bar {
  left: var(--sidebar-width);
}

@media (max-width: 768px) {
  .settings-action-bar {
    left: 0 !important;
  }
}

.action-bar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.action-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-dot.dirty {
  background: var(--warning);
  animation: none;
}

.status-dot.saved {
  background: var(--success);
  animation: none;
}

.status-dot.error {
  background: var(--danger);
  animation: none;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-bulk {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
}

.btn-bulk:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-sm i {
  width: 14px;
  height: 14px;
}

/* Icon Sizes */
.icon-xs {
  width: 14px;
  height: 14px;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

/* Hidden state */
.hidden {
  display: none !important;
}

/* Hide Global-Only Cards When Editing Account */
.editing-account .global-only {
  opacity: 0.5;
  pointer-events: none;
}

.editing-account .global-only .card-header::after {
  content: 'Global';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
}

/* Compact mode for many cards */
.settings-grid.compact .settings-card {
  border-radius: var(--radius-lg);
}

.settings-grid.compact .card-header {
  padding: 14px 16px;
}

.settings-grid.compact .card-body {
  padding: 12px 16px;
}

.settings-grid.compact .setting-row {
  padding: 10px 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .settings-context-bar {
    padding: 14px 16px;
    border-radius: var(--radius-lg);
  }
  
  .context-dropdown-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .context-dropdown {
    width: 100%;
  }
  
  .action-bar-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-buttons {
    justify-content: stretch;
  }
  
  .action-buttons .btn {
    flex: 1;
    justify-content: center;
  }
  
  .input-pair {
    grid-template-columns: 1fr;
  }
  
  /* Increase bottom padding on mobile since action bar stacks vertically and is taller */
  #page-settings {
    padding-bottom: 280px !important;
  }
}

/* Card Focus Animation */
@keyframes card-highlight {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.settings-card.flash {
  animation: card-highlight 0.6s ease-out;
}

/* Dirty State Indicator */
.setting-row.dirty .setting-name::after {
  content: ' •';
  color: var(--warning);
}

/* Save Animation */
@keyframes save-success {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.settings-card.saving {
  animation: save-success 0.3s ease-out;
}


/* ================== SETTINGS LIST ITEM BUTTONS ================== */

.settings-card .list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.settings-card .list-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

.settings-card .list-item:active {
  transform: scale(0.98);
}

.settings-card .list-item i:first-child {
  color: var(--text-secondary);
}

.settings-card .list-item i:last-child {
  margin-left: auto;
  color: var(--text-muted);
}

.settings-card .list-item span {
  flex: 1;
}

/* ================== SETTINGS PAGE SCROLLING ================== */

#page-settings {
  padding-bottom: 80px;
  overflow-y: auto;
}

/* Ensure the settings grid takes full width */
.settings-grid {
  width: 100%;
}

/* ================== SETTINGS VALUE DISPLAY ================== */

.setting-value {
  font-variant-numeric: tabular-nums;
}

/* ================== DIRTY STATE INDICATORS ================== */

.setting-row.dirty .input-field,
.setting-row.dirty .context-dropdown {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.05);
}

.setting-row.dirty .setting-name {
  color: var(--warning);
}

/* ================== FOCUS STATES FOR CARDS ================== */

.settings-card:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ================== RESPONSIVE SETTINGS GRID ================== */

@media (min-width: 1200px) {
  .settings-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1600px) {
  .settings-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ================== CARD TRANSITIONS ================== */

.settings-card {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

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

/* ================== GLOBAL-ONLY OVERLAY ================== */

.editing-account .global-only {
  position: relative;
}

.editing-account .global-only::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.7);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.editing-account .global-only:hover::after {
  opacity: 1;
}

/* Remove the old ::after content style and use a tooltip instead */
.editing-account .global-only .global-badge::before {
  content: 'Global only';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.editing-account .global-only:hover .global-badge::before {
  opacity: 1;
}


/* ================== ALIVE UI INTERACTION SYSTEM ================== */
/* Design Principle: Every action produces visual feedback within 50-120ms */

/* ------------------------------------------------------------------ */
/* 1. PRESS FEEDBACK (Micro-compression)                              */
/* ------------------------------------------------------------------ */

/* Base interactive elements */
.btn,
.icon-btn,
.account-card,
.settings-card,
.list-item,
.chip,
.quick-select-btn,
.nav-item,
.toggle-switch,
.switch .slider,
.context-dropdown,
.input-field,
.radio-label,
.fab {
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 200ms ease,
              border-color 150ms ease,
              background-color 150ms ease;
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform; */
}

/* Press state - physical button feel */
.btn:active,
.icon-btn:active,
.account-card:active,
.settings-card:active,
.list-item:active,
.chip:active,
.quick-select-btn:active,
.nav-item:active,
.radio-label:active,
.fab:active {
  transform: scale(0.96);
}

/* Smaller compression for switches and toggles */
.switch:active .slider,
.toggle-switch:active .toggle-slider {
  transform: scale(0.95);
}

/* Input fields - subtle press */
.input-field:active,
.context-dropdown:active {
  transform: scale(0.98);
}

/* ------------------------------------------------------------------ */
/* 2. HOVER INTELLIGENCE (Desktop)                                    */
/* ------------------------------------------------------------------ */

@media (hover: hover) and (pointer: fine) {
  /* Buttons - elevation + glow */
  .btn:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25),
                0 0 0 1px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
  }
  
  .btn-secondary:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15),
                0 0 0 1px var(--border-hover);
  }
  
  /* Icon buttons - glow effect */
  .icon-btn:hover {
    background: var(--bg-tertiary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
  }
  
  .icon-btn.danger:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
  }
  
  /* Account cards - lift + border glow */
  .account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
  }
  
  /* Settings cards - subtle lift */
  .settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(99, 102, 241, 0.15);
  }
  
  /* List items - background shift + border */
  .list-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.1);
  }
  
  /* Chips - pop effect */
  .chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  }
  
  /* Navigation items - underline slide */
  .nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
  }
  
  .nav-item:hover .nav-label {
    color: var(--accent-primary);
  }
  
  /* Input fields - focus glow on hover */
  .input-field:hover,
  .context-dropdown:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
  }
}

/* ------------------------------------------------------------------ */
/* 3. ACTION STATE TRANSITIONS                                        */
/* ------------------------------------------------------------------ */

/* Loading state base */
.is-loading {
  position: relative;
  pointer-events: none;
  overflow: hidden;
}

.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Button loading state */
.btn.is-loading {
  color: transparent;
}

.btn.is-loading::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  left: 50%;
  top: 50%;
  margin-left: -9px;
  margin-top: -9px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success state */
.is-success {
  animation: success-pulse 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes success-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Error state */
.is-error {
  animation: error-shake 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Processing ring for async operations */
.is-processing {
  position: relative;
}

.is-processing::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotate-gradient 1.5s linear infinite;
}

@keyframes rotate-gradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ------------------------------------------------------------------ */
/* 4. LIVE PULSE FEEDBACK (Real-time elements)                        */
/* ------------------------------------------------------------------ */

/* Breathing pulse - slow and premium */
.live-pulse {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { 
    opacity: 0.9;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.03);
  }
}

/* Status dots with breathing */
.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  animation: dot-breathe 2s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% { 
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

/* Processing spinner ring */
.status-dot.processing {
  background: transparent;
  border: 2px solid var(--warning);
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Cashout active pulse */
.cashout-active {
  animation: cashout-pulse 1.5s ease-in-out infinite;
}

@keyframes cashout-pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% { 
    box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.2);
  }
}

/* Freebet available glow */
.freebet-glow {
  animation: freebet-pulse 2s ease-in-out infinite;
}

@keyframes freebet-pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }
  50% { 
    box-shadow: 0 0 16px 2px rgba(139, 92, 246, 0.3);
  }
}

/* ------------------------------------------------------------------ */
/* 5. LIST ITEM REACTIONS                                             */
/* ------------------------------------------------------------------ */

/* Account card click feedback */
.account-card {
  transition: transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 200ms ease,
              border-color 150ms ease,
              background-color 150ms ease;
}

.account-card.is-entering {
  animation: card-enter 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes card-enter {
  0% { 
    transform: scale(0.98);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.01);
  }
  100% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* Chevron rotation on expand */
.chevron {
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-expanded .chevron {
  transform: rotate(180deg);
}

/* Selection feedback */
.account-card.selected {
  animation: selection-pop 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes selection-pop {
  0% { transform: scale(0.98); }
  50% { transform: scale(0.99); }
  100% { transform: scale(0.98); }
}

/* ------------------------------------------------------------------ */
/* 6. SAVE FEEDBACK                                                   */
/* ------------------------------------------------------------------ */

/* Field highlight on save */
.field-saved {
  animation: field-flash 600ms ease-out;
}

@keyframes field-flash {
  0% { 
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
  }
  100% { 
    background: transparent;
    border-color: var(--border-default);
  }
}

/* Override badge fade in */
.override-badge {
  animation: badge-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes badge-in {
  0% { 
    opacity: 0;
    transform: scale(0.8) translateY(-4px);
  }
  100% { 
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Settings card save feedback */
.settings-card.saving {
  position: relative;
}

.settings-card.saving::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  background-size: 200% 100%;
  animation: save-shimmer 1s ease-out;
  pointer-events: none;
  border-radius: inherit;
}

@keyframes save-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ------------------------------------------------------------------ */
/* 7. NAVIGATION MOTION LANGUAGE                                      */
/* ------------------------------------------------------------------ */

/* Page slide transitions */
.page {
  transition: opacity 200ms ease,
              transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 200ms ease;
}

.page-entering {
  animation: page-slide-in 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.page-leaving {
  animation: page-slide-out 200ms cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

@keyframes page-slide-in {
  0% { 
    opacity: 0;
    transform: translateX(20px);
    filter: blur(4px);
  }
  100% { 
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

@keyframes page-slide-out {
  0% { 
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
  100% { 
    opacity: 0;
    transform: translateX(-20px);
    filter: blur(4px);
  }
}

/* Back navigation - reverse direction */
.page-entering-back {
  animation: page-slide-in-back 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes page-slide-in-back {
  0% { 
    opacity: 0;
    transform: translateX(-20px);
    filter: blur(4px);
  }
  100% { 
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

/* Modal transitions */
.modal-overlay {
  transition: opacity 200ms ease, visibility 200ms ease;
}

.modal-card {
  transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 200ms ease;
}

/* ------------------------------------------------------------------ */
/* 8. STATUS LIVE INDICATORS                                          */
/* ------------------------------------------------------------------ */

/* Online - soft green breathing */
.status-online {
  position: relative;
}

.status-online::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: status-breathe 2s ease-in-out infinite;
}

@keyframes status-breathe {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    transform: scale(1.1);
  }
}

/* Processing - rotating gradient ring */
.status-processing {
  position: relative;
}

.status-processing::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-primary), var(--accent-secondary), var(--accent-primary));
  animation: rotate 1s linear infinite;
  mask: radial-gradient(circle at center, transparent 40%, black 45%);
  -webkit-mask: radial-gradient(circle at center, transparent 40%, black 45%);
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

/* Error - subtle shake once */
.status-error {
  animation: error-shake-once 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes error-shake-once {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Offline - static with fade */
.status-offline {
  opacity: 0.5;
  transition: opacity 300ms ease;
}

/* ------------------------------------------------------------------ */
/* 9. TOAST NOTIFICATIONS                                             */
/* ------------------------------------------------------------------ */

.toast {
  animation: toast-slide-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes toast-slide-in {
  0% { 
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  100% { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.hiding {
  animation: toast-slide-out 200ms ease forwards;
}

@keyframes toast-slide-out {
  0% { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% { 
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* Toast type colors with glow */
.toast.success {
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
}

.toast.error {
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.toast.warning {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

/* ------------------------------------------------------------------ */
/* PERFORMANCE OPTIMIZATIONS                                          */
/* ------------------------------------------------------------------ */

/* GPU acceleration for animated elements */
.live-pulse,
.status-dot,
.is-loading::after,
.chevron,
.page,
.toast,
.account-card,
.settings-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* QUICK ACTION BAR ANIMATIONS                                        */
/* ------------------------------------------------------------------ */

.bottom-bar {
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bottom-bar.hidden {
  transform: translateY(100%);
}

/* Action bar button press */
.bottom-actions .icon-btn:active {
  transform: scale(0.9);
}

/* ------------------------------------------------------------------ */
/* SWITCH MODERN - ENHANCED                                           */
/* ------------------------------------------------------------------ */

.switch.modern .slider::before {
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.switch.modern input:checked + .slider {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ------------------------------------------------------------------ */
/* INPUT FIELD FOCUS GLOW                                             */
/* ------------------------------------------------------------------ */

.input-field:focus,
.context-dropdown:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15),
              0 0 20px rgba(99, 102, 241, 0.1);
}

/* ------------------------------------------------------------------ */
/* SELECTION MODE FEEDBACK                                            */
/* ------------------------------------------------------------------ */

body.selection-mode .account-card::before {
  transition: transform, opacity, background-color, background, border-color, box-shadow 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.selection-mode .account-card.selected::before {
  animation: checkbox-pop 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes checkbox-pop {
  0% { transform: translateY(-50%) scale(0.8); }
  50% { transform: translateY(-50%) scale(1.1); }
  100% { transform: translateY(-50%) scale(1); }
}

/* ------------------------------------------------------------------ */
/* SELECTION MODE SCROLL CLEARANCE                                     */
/* Push scrollable content above the fixed bottom bar when it's shown  */
/* ------------------------------------------------------------------ */

/* Desktop/tablet: bar is single row (~100px tall) + 12px bottom gap */
body.selection-mode .page-content {
  padding-bottom: 160px;
}

body.selection-mode .pagination-container {
  display: none !important;
}

/* Mobile ≤639px: bar stacks into 3 rows (~200px tall) + 12px gap + safe area */
@media (max-width: 639px) {
  body.selection-mode .page-content {
    padding-bottom: calc(240px + var(--safe-bottom));
  }
}


/* ================== ALIVE UI CARD ENTRY ANIMATIONS ================== */

/* Staggered card entry animation */
.account-card {
  animation: card-fade-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--card-index, 0) * 40ms);
}

@keyframes card-fade-in {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Settings cards entry */
.settings-card {
  animation: card-fade-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--card-index, 0) * 50ms);
}

/* ================== ALIVE UI RIPPLE EFFECT ================== */

.btn,
.icon-btn,
.list-item,
.chip,
.account-card {
  position: relative;
  overflow: hidden;
}

/* ================== ALIVE UI FOCUS STATES ================== */

/* Enhanced focus states for keyboard navigation */
.btn:focus-visible,
.icon-btn:focus-visible,
.input-field:focus-visible,
.context-dropdown:focus-visible,
.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ================== ALIVE UI SELECTION TRANSITIONS ================== */

/* Smooth checkbox appearance */
.account-card::before {
  transition: transform, opacity, background-color, background, border-color, box-shadow 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ================== ALIVE UI SCROLLBAR ================== */

/* Custom scrollbar for premium feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
  transition: background 150ms ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ================== ALIVE UI LOADING SKELETON ================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ================== ALIVE UI PULSE DOTS ================== */

/* Different pulse speeds for different urgency */
.pulse-slow {
  animation: breathe 3s ease-in-out infinite;
}

.pulse-medium {
  animation: breathe 2s ease-in-out infinite;
}

.pulse-fast {
  animation: breathe 1s ease-in-out infinite;
}

/* ================== ALIVE UI HOVER LIFT ================== */

/* Enhanced lift effect */
.hover-lift {
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 200ms ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ================== ALIVE UI MICRO-INTERACTIONS ================== */

/* Subtle scale on hover for interactive elements */
.interactive-micro:hover {
  transform: scale(1.02);
}

.interactive-micro:active {
  transform: scale(0.98);
}

/* ================== ALIVE UI TEXT REVEAL ================== */

/* Text fade in for dynamic content */
.text-reveal {
  animation: text-fade-in 200ms ease-out;
}

@keyframes text-fade-in {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ================== ALIVE UI BADGE ANIMATIONS ================== */

/* Badge pop in */
.badge-pop {
  animation: badge-pop-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes badge-pop-in {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ================== ALIVE UI NUMBER COUNTERS ================== */

/* Smooth number transitions */
.number-counter {
  transition: color 200ms ease;
}

.number-counter.changed {
  animation: number-flash 400ms ease;
}

@keyframes number-flash {
  0% { color: var(--accent-primary); transform: scale(1.1); }
  100% { color: inherit; transform: scale(1); }
}


/* ================== ACCOUNT DETAIL SETTINGS STYLING ================== */

.settings-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.setting-row-simple:last-child {
  border-bottom: none;
}

.setting-row-simple span:first-child {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Status badges (ON/OFF) */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 200ms ease;
}

.status-badge:not(.active) {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

.status-badge.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
  animation: status-badge-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes status-badge-in {
  0% { transform: scale(0.9); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* Config values (amounts) */
.config-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Auto-spin config row animation */
#detail-autospin-config {
  transition: transform, opacity, background-color, background, border-color, box-shadow 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#detail-autospin-config.show {
  display: flex !important;
  animation: slide-down-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slide-down-in {
  0% { 
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  100% { 
    opacity: 1;
    transform: translateY(0);
    max-height: 50px;
  }
}

/* Settings update animation */
.setting-row-simple.updated {
  animation: row-update-flash 600ms ease;
}

@keyframes row-update-flash {
  0% { background: rgba(99, 102, 241, 0.1); }
  100% { background: transparent; }
}

/* Live sync indicator */
.settings-summary.syncing::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  pointer-events: none;
}

.settings-summary {
  position: relative;
}


/* ================== BULK FREEBET SPIN PAGE ================== */

/* Bulk Summary Card */
.bulk-summary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.bulk-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .bulk-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bulk-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

.bulk-summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.bulk-summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Progress Bar */
.bulk-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.bulk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 300ms ease;
}

.bulk-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

/* Bulk Accounts Section */
.bulk-accounts-section {
  margin-bottom: 20px;
}

.bulk-accounts-section .section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-left: 4px;
}

.bulk-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bulk Account Row */
.bulk-account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: transform, opacity, background-color, background, border-color, box-shadow 200ms ease;
}

.bulk-account-row:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.bulk-account-row.spinning {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(99, 102, 241, 0.05));
}

.bulk-account-row.completed {
  border-color: var(--success);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(34, 197, 94, 0.05));
}

.bulk-account-row.crashed {
  border-color: var(--danger);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(239, 68, 68, 0.05));
}

.bulk-account-row.failed {
  border-color: var(--warning);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(245, 158, 11, 0.05));
  opacity: 0.7;
}

.bulk-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.bulk-account-info {
  flex: 1;
  min-width: 0;
}

.bulk-account-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-account-name .profile-name {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 13px;
}

.bulk-account-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.bulk-account-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.bulk-account-status.online {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.bulk-account-status.offline {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.bulk-account-status.spinning {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.bulk-account-freebets {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 60px;
  justify-content: flex-end;
}

.bulk-account-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  min-width: 80px;
  justify-content: flex-end;
}

.bulk-account-result.won {
  color: var(--success);
}

.bulk-account-result.crashed {
  color: var(--danger);
}

.bulk-account-result.failed {
  color: var(--warning);
}

/* Bulk Cashout Button */
.bulk-account-cashout {
  display: flex;
  align-items: center;
  min-width: 100px;
  justify-content: flex-end;
}

.btn-bulk-cashout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  animation: cashout-pulse 1.5s infinite;
}

.btn-bulk-cashout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.btn-bulk-cashout:active {
  transform: translateY(0);
}

.btn-bulk-cashout:disabled,
.btn-bulk-cashout.processing {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  animation: none;
  cursor: not-allowed;
}

.btn-bulk-cashout.medium-multiplier {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-bulk-cashout.high-multiplier {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.cashout-multi {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.cashout-amount {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.2;
}

@keyframes cashout-pulse {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.5);
    transform: scale(1.02);
  }
}

/* Bulk Action Bar */
.bulk-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-default);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
}

.sidebar-visible ~ #main-content .bulk-action-bar {
  left: var(--sidebar-width);
}

@media (max-width: 768px) {
  .sidebar-visible ~ #main-content .bulk-action-bar {
    left: 0;
  }
}

.bulk-action-bar .btn {
  min-width: 120px;
}

.bulk-action-bar .btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* Status Indicator */
.bulk-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.bulk-status-indicator .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.bulk-status-indicator.active .status-dot {
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

.bulk-status-indicator.spinning .status-dot {
  background: var(--accent-primary);
  animation: pulse-dot 1s infinite;
}

/* Results Card */
.bulk-results-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-top: 20px;
  animation: slide-up 300ms ease;
}

@keyframes slide-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.bulk-results-card.hidden {
  display: none;
}

.bulk-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.bulk-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-lg);
  text-align: center;
}

.bulk-result-item.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.bulk-result-item.danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.bulk-result-item.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.bulk-result-item.info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.bulk-result-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.bulk-result-item.success .bulk-result-value {
  color: var(--success);
}

.bulk-result-item.danger .bulk-result-value {
  color: var(--danger);
}

.bulk-result-item.warning .bulk-result-value {
  color: var(--warning);
}

.bulk-result-item.info .bulk-result-value {
  color: var(--accent-primary);
}

.bulk-result-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* ================== BULK FREEBET AMOUNT MODAL ================== */

.bulk-freebet-amounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.bulk-freebet-amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 200ms ease;
}

.bulk-freebet-amount-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.bulk-freebet-amount-btn:active {
  transform: scale(0.98);
}

.bulk-freebet-amount-btn .amount-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.bulk-freebet-amount-btn .account-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.bulk-freebet-summary {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ================== PAGE BULK FREEBET SPECIFIC ================== */

#page-bulk-freebet {
  padding-bottom: 100px; /* Space for sticky action bar */
}

#page-bulk-freebet .page-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Navigation Guard Warning */
.bulk-nav-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: transform, opacity, background-color, background, border-color, box-shadow 200ms ease;
}

.bulk-nav-warning.active {
  opacity: 1;
  visibility: visible;
}

.bulk-nav-warning-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.bulk-nav-warning-card h3 {
  margin-bottom: 12px;
  color: var(--warning);
}

.bulk-nav-warning-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.bulk-nav-warning-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}


/* ================== SWIPE TO DELETE FOR OFFLINE ACCOUNTS ================== */

/* Swipe Container */
.account-card-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
  /* Ensure proper stacking context */
  isolation: isolate;
}

/* The actual account card that swipes - MUST cover delete panel */
.account-card.swipeable {
  position: relative;
  z-index: 2;
  background: var(--bg-secondary); /* Solid background to cover delete panel */
  width: 100%;
  margin-bottom: 0; /* Wrapper handles spacing */
  transition: transform 0.25s ease;
  touch-action: pan-y; /* Allow vertical scroll, handle horizontal in JS */
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform; */
  /* Ensure card fully covers panel */
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

/* When card is swiped open (revealed), show the delete button */
.account-card.swipeable.revealed .swipe-delete-btn {
  opacity: 1 !important;
}

/* Offline swipeable cards need solid background too */
.account-card.offline-disabled.swipeable {
  background: var(--bg-tertiary); /* Use offline color but keep it solid */
}

.account-card.swipeable.swiping {
  transition: none; /* No transition during active swipe */
}

.account-card.swipeable.locked {
  animation: shake-locked 400ms ease;
}

@keyframes shake-locked {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Delete Action Panel (revealed underneath) */
.delete-action-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 120px;
  background: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  cursor: pointer;
  pointer-events: auto;
}

.delete-action-panel:hover {
  background: #b91c1c; /* Darker red on hover */
}

.delete-action-panel:active {
  background: #991b1b; /* Even darker on click */
}

.delete-action-panel .delete-icon {
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  /* Ensure clean background */
  background: transparent;
  pointer-events: none; /* Let clicks pass through to panel */
  user-select: none;
}

/* Delete confirmation modal checkbox */
.delete-confirm-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 150ms ease;
}

.delete-confirm-checkbox:hover {
  background: var(--bg-secondary);
}

.delete-confirm-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.delete-confirm-checkbox span {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Undo toast styling */
.toast.undo-toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
}

.toast.undo-toast .undo-btn {
  margin-left: auto;
  padding: 6px 12px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease;
}

.toast.undo-toast .undo-btn:hover {
  background: var(--accent-secondary);
}

/* Card collapse animation */
.account-card-wrapper.collapsing {
  animation: card-collapse 400ms ease forwards;
}

@keyframes card-collapse {
  0% {
    opacity: 1;
    max-height: 200px;
    margin-bottom: 12px;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
  }
}

/* Swipe hint indicator */
.swipe-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 200ms ease;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.account-card.offline-disabled:hover .swipe-hint {
  opacity: 0.6;
}

/* Delete settings option */
.delete-settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-default);
}

.delete-settings-option:last-child {
  border-bottom: none;
}

.delete-settings-option .option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.delete-settings-option .option-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.delete-settings-option .option-desc {
  font-size: 12px;
  color: var(--text-secondary);
}


/* ================== BULK SESSION ENHANCEMENTS ================== */

/* Session Timer Display */
.bulk-session-timer {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
}

@media (max-width: 768px) {
  .bulk-session-timer {
    position: static;
    transform: none;
    text-align: left;
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
  }
}

.bulk-session-timer .session-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.bulk-session-timer .session-status.running {
  color: var(--accent-primary);
  animation: pulse-text 2s infinite;
}

.bulk-session-timer .session-status.completed {
  color: var(--success);
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.bulk-session-timer .session-times {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.bulk-session-timer .session-times span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-session-timer .session-times span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-default);
}

.bulk-session-timer .session-status.running + .session-times span:first-child::before {
  background: var(--accent-primary);
}

/* Account Row Status - Dispatching */
.bulk-account-row.dispatching {
  border-color: var(--warning);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(245, 158, 11, 0.05));
}

.bulk-account-row.dispatching .bulk-account-status {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* Account Row - Spinning with Live Multiplier */
.bulk-account-row.spinning {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(99, 102, 241, 0.08));
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.bulk-account-row.spinning .bulk-account-result.spinning {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  animation: multiplier-pulse 1s ease-in-out infinite;
}

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

/* Highlight Animation for New Spins */
.bulk-account-row.highlight-new {
  animation: highlight-row 2s ease;
}

@keyframes highlight-row {
  0% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.5);
    transform: scale(1.01);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}

/* Recovery Modal Styles */
#modal-bulk-recovery .modal-body {
  padding: 20px;
}

#modal-bulk-recovery .status-dot.spinning {
  background: var(--accent-primary);
  animation: pulse-dot 1s infinite;
}

/* Enhanced Progress Bar */
.bulk-progress-fill {
  position: relative;
  overflow: hidden;
}

.bulk-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Status Badge Enhancements */
.bulk-account-status {
  transition: transform, opacity, background-color, background, border-color, box-shadow 200ms ease;
}

.bulk-account-status .status-dot.processing {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: processing-pulse 1s infinite;
}

@keyframes processing-pulse {
  0%, 100% { 
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% { 
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0);
  }
}

/* Results Card Enhancements */
.bulk-results-card {
  animation: slide-up-fade 400ms ease;
}

@keyframes slide-up-fade {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Summary Card with Session Info */
.bulk-summary-card .bulk-summary-item:first-child {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  border-color: rgba(99, 102, 241, 0.3);
}

.bulk-summary-card .bulk-summary-item:first-child .bulk-summary-value {
  color: var(--accent-primary);
}


/* ================== LOW BALANCE URGENT ALERT ================== */

/* Danger state for low balance */
.stat-value.danger {
  color: #ef4444;
}

/* Urgent pulse animation - fast and highly visible */
.stat-value.pulse-urgent {
  animation: urgentPulse 0.55s infinite, urgentShake 0.25s infinite;
}

@keyframes urgentPulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  25% {
    transform: scale(1.25);
    text-shadow: 0 0 18px rgba(239, 68, 68, 0.9);
  }
  50% {
    transform: scale(0.95);
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
  }
  75% {
    transform: scale(1.2);
    text-shadow: 0 0 20px rgba(239, 68, 68, 1);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes urgentShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  50% { transform: translateX(1px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

/* Ensure the stat card remains clickable */
#stat-lowbalance-card {
  cursor: pointer;
}

#stat-lowbalance-card:active {
  transform: scale(0.98);
}


/* ================== LOW BALANCE URGENT ALERT ON ACCOUNT CARDS ================== */

/* Low balance state with urgent pulse animation */
.balance.low {
  color: #ef4444;
  animation: urgentBalancePulse 0.55s infinite, urgentBalanceShake 0.25s infinite;
  font-weight: 700;
}

@keyframes urgentBalancePulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  25% {
    transform: scale(1.22);
    text-shadow: 0 0 14px rgba(239, 68, 68, 0.9);
  }
  50% {
    transform: scale(0.96);
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
  }
  75% {
    transform: scale(1.18);
    text-shadow: 0 0 16px rgba(239, 68, 68, 1);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes urgentBalanceShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  50% { transform: translateX(1px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

/* Ensure balance element doesn't cause layout shift */
.balance {
  display: inline-block;
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform, text-shadow; */
}


/* ================== SCROLLABLE STATS ROW ================== */

.stats-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  padding: 12px 16px 18px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  /* Hide scrollbar but keep functionality */
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

.stats-row::-webkit-scrollbar {
  height: 6px;
}

.stats-row::-webkit-scrollbar-track {
  background: transparent;
}

.stats-row::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

.stats-row::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Stat card in scrollable row */
.stats-row .stat-card {
  flex-shrink: 0;
  min-width: 110px;
  padding: 14px 18px;
}

/* Highlight animation for stat card clicks */
.stat-card.highlight-scroll {
  animation: stat-highlight 600ms ease;
}

@keyframes stat-highlight {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Account row highlight for stat navigation */
.account-card.highlight-stat-nav {
  animation: row-highlight-nav 1.5s ease;
}

@keyframes row-highlight-nav {
  0% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.6);
    transform: scale(1.01);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}


/* ================== SMART ODDS HISTORY SYSTEM ================== */

/* Odds History Panel */
.odds-history-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
  display: block;
}

.odds-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
}

.odds-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.odds-leader-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.odds-leader-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-success);
  animation: pulse-dot 2s infinite;
}

.odds-leader-badge.offline .status-dot {
  background: var(--danger);
  animation: none;
}

/* Odds items container - flex wrap layout */
.odds-items-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
  align-content: flex-start;
}

/* Individual odd item styling */
.odd-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  flex-shrink: 0;
  animation: odd-pop-in 0.3s ease;
}

@keyframes odd-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Odd color classification — dark, semantic: red=crash, neutral=mid, green=high */
.odd-low {
  background: rgba(220, 38, 38, 0.12);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.odd-mid {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.odd-high {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Odds stats summary */
.odds-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
}

.odds-stat {
  text-align: center;
}

.odds-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.odds-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Empty state */
.odds-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
}

.odds-empty i {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Scrollbar for odds container */
.odds-items-container::-webkit-scrollbar {
  width: 4px;
}

.odds-items-container::-webkit-scrollbar-track {
  background: transparent;
}

.odds-items-container::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 2px;
}

/* Odds Balls (Legacy Visualization) */
.odds-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  justify-content: center;
  min-height: 60px;
}

.odd-ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: ball-pop 0.3s ease;
}

@keyframes ball-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.odd-ball.odd-low {
  background: rgba(220, 38, 38, 0.15);
  border: 2px solid rgba(220, 38, 38, 0.35);
  color: #f87171;
}

.odd-ball.odd-mid {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.odd-ball.odd-high {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

/* Refresh button spinning animation */
.icon-btn.spinning i {
  animation: spin-refresh 1s linear infinite;
}

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

/* Pulse dot animation for leader status */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.8);
  }
}

/* ================== DROPDOWN SIZING FIXES ================== */

/* Ensure all select elements stretch properly */
select {
  width: 100%;
  min-width: 220px;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Ensure dropdown wrappers in flex/grid contexts expand */
.context-dropdown-wrapper,
.dataset-selector {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

/* Ensure dropdown inputs in flex contexts don't shrink */
.context-dropdown,
.dataset-selector select {
  flex-shrink: 0;
}

/* Consistent height for better UX */
.dataset-selector select {
  height: 40px;
  padding: 0 12px;
}

/* Total Balance Threshold Selector */
.threshold-option {
  padding: 10px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.threshold-option:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.threshold-option.active {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: white;
}

/* ================== DESKTOP RESPONSIVE IMPROVEMENTS ================== */

/* Desktop: Stats row becomes a grid instead of horizontal scroll */
@media (min-width: 1200px) {
  .stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    overflow-x: visible;
    padding: 16px 24px 20px 24px;
  }
  
  .stats-row .stat-card {
    min-width: auto;
    flex-shrink: 1;
    padding: 18px 20px;
  }
  
  .stat-value {
    font-size: 22px;
  }
}

/* Large desktop: More spacious layout */
@media (min-width: 1400px) {
  .stats-row {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px 28px 24px 28px;
  }
  
  .stats-row .stat-card {
    padding: 20px 24px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 12px;
  }
}

/* Desktop: Better account list grid */
@media (min-width: 1024px) {
  .account-list {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
  }

  .account-card {
    padding: 18px;
  }

  .account-avatar {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 1400px) {
  .account-list {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
  }
}

/* Desktop: Sidebar is overlay-only (no persistent layout shift) */

/* Desktop: Better header spacing */
@media (min-width: 1024px) {
  .main-header {
    padding: 16px 24px;
  }
  
  .header-title h1 {
    font-size: 22px;
  }
}

/* Desktop: Better container padding */
@media (min-width: 1024px) {
  .page {
    padding-bottom: 32px;
  }
}

/* Desktop: Better modal sizing */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
  }
  
  .modal {
    max-width: 560px;
    max-height: 85vh;
    border-radius: var(--radius-xl);
  }
  
  .modal-header {
    padding: 24px 24px 0 24px;
  }
  
  .modal-body {
    padding: 20px 24px;
  }
  
  .modal-footer {
    padding: 0 24px 24px 24px;
  }
}

/* Desktop: Better form layouts */
@media (min-width: 768px) {
  .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
}

/* Desktop: Better toast positioning */
@media (min-width: 768px) {
  .toast-container {
    top: 24px;
    right: 24px;
    left: auto;
    transform: none;
    max-width: 400px;
  }
  
  .toast {
    animation: slideInRight 0.3s ease;
  }
  
  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
}

/* Desktop: Better bottom bar on larger screens */
@media (min-width: 768px) {
  .bottom-bar {
    left: 220px;
    max-width: 600px;
    margin: 0 auto 20px;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  }
  
  .bottom-bar-actions {
    padding: 16px 24px;
  }
}

/* Desktop: Better page header */
@media (min-width: 768px) {
  .page-header {
    padding: 24px 24px 16px 24px;
  }
  
  .page-header h2 {
    font-size: 20px;
  }
}

/* Desktop: Empty state improvements */
@media (min-width: 768px) {
  .empty-state {
    padding: 48px 32px;
  }
  
  .empty-state i {
    width: 64px;
    height: 64px;
  }
  
  .empty-state h3 {
    font-size: 18px;
  }
}

/* ================== TOURNAMENT MODE STYLES ================== */

/* Tournament Page Layout */
#page-tournament .page-content {
  padding: 16px;
}

/* Tournament Disabled State (Entry Screen) */
.tournament-disabled-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  text-align: center;
}

.tournament-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.tournament-hero-icon {
  width: 64px;
  height: 64px;
  color: var(--accent-warning);
  stroke-width: 1.5;
}

.tournament-hero h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.tournament-hero p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
}

.tournament-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.tournament-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 12px;
  color: var(--text-secondary);
}

.tournament-feature i {
  color: var(--accent-primary);
}

/* Tournament Enabled State */
.tournament-enabled-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tournament Info Card */
.tournament-info-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tournament-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.tournament-title-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tournament-title-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.tournament-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-success);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
}

.tournament-status-badge.ended {
  background: var(--text-muted);
}

.tournament-status-badge.upcoming {
  background: var(--accent-warning);
}

.tournament-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-warning);
  font-variant-numeric: tabular-nums;
}

.tournament-countdown i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.tournament-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.tournament-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tournament-info-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tournament-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.tournament-prize-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.tournament-prize-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-warning);
}

/* Tournament Section */
.tournament-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.tournament-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.tournament-section-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.tournament-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
}

.tournament-leaderboard-controls {
  display: flex;
  gap: 4px;
}

.tournament-leaderboard-controls .btn {
  padding: 4px 10px;
  font-size: 11px;
}

.tournament-leaderboard-controls .btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Tournament Accounts List */
.tournament-accounts-list {
  display: flex;
  flex-direction: column;
}

.tournament-accounts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  color: var(--text-muted);
}

.tournament-accounts-empty i {
  color: var(--text-secondary);
}

.tournament-accounts-empty p {
  font-size: 14px;
}

/* Tournament Account Card */
.tournament-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}

.tournament-account-card:last-child {
  border-bottom: none;
}

.tournament-account-card:hover {
  background: var(--bg-tertiary);
}

.tournament-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
  position: relative;
}

.tournament-account-avatar.master::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--accent-warning);
  border: 2px solid var(--bg-secondary);
  border-radius: 50%;
}

.tournament-account-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tournament-account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tournament-account-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tournament-account-badges {
  display: flex;
  gap: 4px;
}

.tournament-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 4px;
}

.tournament-badge.mode-manual {
  background: rgba(52, 180, 255, 0.15);
  color: #34b4ff;
}

.tournament-badge.mode-auto {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.tournament-badge.risk-safe {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.tournament-badge.risk-risky {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.tournament-badge.risk-riskiest {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.tournament-badge.joined {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.tournament-badge.not-joined {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.tournament-account-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12px;
}

.tournament-account-position {
  font-weight: 700;
  color: var(--accent-warning);
}

.tournament-account-points {
  color: var(--text-secondary);
}

/* Leaderboard */
.tournament-leaderboard {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow-y: auto;
}

.tournament-leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.tournament-leaderboard-entry:last-child {
  border-bottom: none;
}

.tournament-leaderboard-entry.own-entry {
  background: rgba(99, 102, 241, 0.1);
}

.tournament-leaderboard-entry.top-3 {
  background: rgba(234, 179, 8, 0.05);
}

.tournament-leaderboard-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tournament-leaderboard-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #000;
}

.tournament-leaderboard-rank.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #000;
}

.tournament-leaderboard-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #fff;
}

.tournament-leaderboard-rank.other {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tournament-leaderboard-name {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
}

.tournament-leaderboard-score {
  font-weight: 700;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

/* Exit Section */
.tournament-exit-section {
  display: flex;
  justify-content: center;
  padding: 16px;
}

/* Tournament Modal Styles */
.tournament-modal-account-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.tournament-modal-account-id {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.tournament-modal-balance {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-success);
}

.tournament-modal-status {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-indicator.joined {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-indicator.not-joined {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.tournament-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.tournament-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.tournament-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tournament-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.tournament-modal-section {
  margin-bottom: 20px;
}

.tournament-modal-section .form-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Mode Toggle */
.tournament-mode-toggle,
.tournament-risk-toggle {
  display: flex;
  gap: 8px;
}

.tournament-mode-btn,
.tournament-risk-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.tournament-mode-btn:hover,
.tournament-risk-btn:hover {
  border-color: var(--border-light);
}

.tournament-mode-btn.active,
.tournament-risk-btn.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.tournament-mode-btn i,
.tournament-risk-btn i {
  color: var(--text-secondary);
}

.tournament-mode-btn.active i,
.tournament-risk-btn.active i {
  color: var(--accent-primary);
}

.tournament-mode-btn span,
.tournament-risk-btn span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.tournament-mode-btn.active span,
.tournament-risk-btn.active span {
  color: var(--text-primary);
}

.tournament-risk-btn.safe.active {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.tournament-risk-btn.safe.active i {
  color: #22c55e;
}

.tournament-risk-btn.risky.active {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.1);
}

.tournament-risk-btn.risky.active i {
  color: #eab308;
}

.tournament-risk-btn.riskiest.active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.tournament-risk-btn.riskiest.active i {
  color: #ef4444;
}

/* Manual Controls */
.tournament-bet-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tournament-bet-input-row .form-input {
  flex: 1;
}

.tournament-live-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.tournament-live-multiplier {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary);
}

.tournament-live-cashout {
  font-size: 14px;
  color: var(--accent-success);
  font-weight: 600;
}

.btn-full {
  width: 100%;
}

/* Auto Controls */
.tournament-auto-status {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 12px;
}

.tournament-auto-state {
  font-size: 13px;
  color: var(--text-secondary);
}

.tournament-strategy-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.strategy-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.strategy-row span:first-child {
  color: var(--text-muted);
}

.strategy-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* Available Accounts List (Add Modal) */
.tournament-available-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.tournament-available-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-available-account-item:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.tournament-available-account-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tournament-available-account-item .account-avatar {
  width: 36px;
  height: 36px;
}

.tournament-available-account-item .account-info {
  flex: 1;
}

.tournament-available-account-item .account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.tournament-available-account-item .account-balance {
  font-size: 12px;
  color: var(--text-secondary);
}

.tournament-available-account-item .btn-add {
  padding: 6px 12px;
  font-size: 12px;
}

/* Help Modal */
.tournament-help-section {
  margin-bottom: 20px;
}

.tournament-help-section:last-child {
  margin-bottom: 0;
}

.tournament-help-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tournament-help-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tournament-help-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tournament-help-section li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tournament-help-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: 700;
}

/* Tournament Badge in Nav */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--text-muted);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 9px;
  margin-left: auto;
}

.nav-badge.active {
  background: var(--accent-success);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Modal sizes */
.modal-sm {
  max-width: 400px;
}

.modal-lg {
  max-width: 600px;
}

/* Desktop responsive for tournament */
@media (min-width: 768px) {
  .tournament-features {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .tournament-info-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .tournament-accounts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    padding: 16px;
  }
  
  .tournament-account-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
  }
}

/* ================== KILL SWITCH + SHIELD SYSTEM ================== */

/* Kill Switch Section */
.tournament-killswitch-section {
  border: 2px solid var(--border-color);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.killswitch-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--accent-success);
  color: white;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 10px;
  margin-left: 8px;
}

.killswitch-status-indicator.warning {
  background: var(--accent-warning);
}

.killswitch-status-indicator.danger {
  background: var(--accent-danger);
}

/* Kill Switch Grid */
.killswitch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
}

@media (min-width: 768px) {
  .killswitch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Kill Switch Cards */
.killswitch-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.killswitch-card.emergency {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, transparent 100%);
}

.killswitch-card.leader {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, transparent 100%);
}

.killswitch-card.shield {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
}

.killswitch-card.status {
  border-color: rgba(52, 180, 255, 0.3);
  background: linear-gradient(135deg, rgba(52, 180, 255, 0.05) 0%, transparent 100%);
}

.killswitch-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.killswitch-card-header i {
  color: var(--text-secondary);
}

.killswitch-card.emergency .killswitch-card-header i {
  color: var(--accent-danger);
}

.killswitch-card.leader .killswitch-card-header i {
  color: var(--accent-warning);
}

.killswitch-card.shield .killswitch-card-header i {
  color: var(--accent-primary);
}

.killswitch-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.killswitch-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.killswitch-btn {
  width: 100%;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.killswitch-account-select {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.killswitch-no-account {
  color: var(--text-muted);
  font-style: italic;
}

.killswitch-account-name {
  font-weight: 600;
}

/* Status Grid */
.killswitch-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.killswitch-status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.killswitch-status-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.killswitch-status-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.killswitch-status-value.active {
  color: var(--accent-success);
}

.killswitch-status-value.warning {
  color: var(--accent-warning);
}

.killswitch-status-value.danger {
  color: var(--accent-danger);
}

/* Tournament Account Card Updates for Kill Switch */
.tournament-account-card.paused {
  opacity: 0.7;
  border-left: 4px solid var(--accent-warning);
}

.tournament-account-card.profit-locked {
  border-left: 4px solid #22c55e;
}

.tournament-account-card.shielded {
  border-left: 4px solid var(--accent-primary);
}

.tournament-account-card.paused.profit-locked {
  border-left: 4px solid;
  border-image: linear-gradient(to bottom, var(--accent-warning), #22c55e) 1;
}

.tournament-account-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tournament-account-pause-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.tournament-account-pause-btn:hover {
  background: var(--border-hover);
  color: var(--text-primary);
}

.tournament-account-pause-btn.paused {
  background: var(--accent-warning);
  color: white;
}

.tournament-account-pause-btn.paused:hover {
  background: var(--accent-success);
}

/* Badges */
.tournament-pause-badge,
.tournament-lock-badge,
.tournament-shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 4px;
  margin-left: 6px;
}

.tournament-pause-badge {
  background: var(--accent-warning);
  color: white;
}

.tournament-lock-badge {
  background: #22c55e;
  color: white;
}

.tournament-shield-badge {
  background: var(--accent-primary);
  color: white;
}

/* Avatar Icons */
.avatar-lock-icon,
.avatar-shield-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-lock-icon {
  background: #22c55e;
  color: white;
}

.avatar-shield-icon {
  background: var(--accent-primary);
  color: white;
}

.tournament-account-avatar {
  position: relative;
}

/* Auto Mode - Respect Kill Switch */
.tournament-auto-state.paused {
  color: var(--accent-warning);
}

.tournament-auto-state.locked {
  color: #22c55e;
}

.tournament-auto-state.shielded {
  color: var(--accent-primary);
}

.tournament-auto-state.stopped {
  color: var(--accent-danger);
}

/* ================== MICRO PROTECTION ICONS ================== */

.tournament-micro-icon {
  position: absolute;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tournament-micro-icon i {
  color: white;
  stroke-width: 3;
}

/* Ensure card has relative positioning for absolute icons */
.tournament-account-card {
  position: relative;
}

/* ================== TOURNAMENT PREMIUM UI ENHANCEMENTS ================== */

/* Base spacing improvements for tournament page */
#page-tournament .page-content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Tournament Enabled State - Better breathing room */
.tournament-enabled-state {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ================== HERO TOURNAMENT INFO CARD ================== */
.tournament-info-card {
  position: relative;
  background: linear-gradient(145deg, 
    rgba(30, 30, 40, 0.95) 0%, 
    rgba(20, 20, 30, 0.98) 50%,
    rgba(15, 15, 25, 1) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tournament-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(99, 102, 241, 0.5) 20%, 
    rgba(168, 85, 247, 0.5) 50%, 
    rgba(99, 102, 241, 0.5) 80%, 
    transparent 100%
  );
}

.tournament-info-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

/* Tournament Title Section */
.tournament-title-section h3 {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

/* Status Badge Enhancement */
.tournament-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 2px 16px rgba(34, 197, 94, 0.5); }
}

.tournament-status-badge.ended {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
  animation: none;
}

.tournament-status-badge.upcoming {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  animation: pulse-glow-warning 2s ease-in-out infinite;
}

@keyframes pulse-glow-warning {
  0%, 100% { box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 2px 16px rgba(245, 158, 11, 0.5); }
}

/* Countdown Enhancement */
.tournament-countdown {
  background: linear-gradient(145deg, 
    rgba(30, 30, 40, 0.9) 0%, 
    rgba(25, 25, 35, 0.95) 100%
  );
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#tournament-countdown-time {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

/* Info Grid Enhancement */
.tournament-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.tournament-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tournament-info-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tournament-info-value {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

/* Prize Section Enhancement */
.tournament-prize-section {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tournament-prize-value {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.2);
}

/* ================== TOURNAMENT SECTIONS ================== */
.tournament-section {
  background: linear-gradient(145deg, 
    rgba(25, 25, 35, 0.8) 0%, 
    rgba(20, 20, 30, 0.9) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.3s ease;
}

.tournament-section:hover {
  border-color: rgba(99, 102, 241, 0.1);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.3);
}

.tournament-section-header {
  padding: 18px 24px;
  background: linear-gradient(90deg, 
    rgba(99, 102, 241, 0.1) 0%, 
    transparent 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tournament-section-header h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #e2e8f0;
}

.tournament-count {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ================== TOURNAMENT ACCOUNTS GRID ================== */
.tournament-accounts-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 20px;
}

@media (min-width: 768px) {
  .tournament-accounts-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .tournament-accounts-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tournament-account-card {
  position: relative;
  background: linear-gradient(145deg, 
    rgba(35, 35, 45, 0.9) 0%, 
    rgba(28, 28, 38, 0.95) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tournament-account-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(99, 102, 241, 0.1);
}

.tournament-account-card:active {
  transform: translateY(-1px) scale(0.995);
}

/* Card States with Glow Effects */
.tournament-account-card.paused {
  border-left: 3px solid #eab308;
  background: linear-gradient(145deg, 
    rgba(45, 40, 25, 0.9) 0%, 
    rgba(35, 32, 22, 0.95) 100%
  );
}

.tournament-account-card.profit-locked {
  border-left: 3px solid #22c55e;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(34, 197, 94, 0.1);
}

.tournament-account-card.shielded {
  border-left: 3px solid #6366f1;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(99, 102, 241, 0.1);
}

/* Avatar Enhancement */
.tournament-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.tournament-account-card:hover .tournament-account-avatar {
  transform: scale(1.08);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Account Name Enhancement */
.tournament-account-name {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

/* Badges Enhancement */
.tournament-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tournament-badge.mode-manual {
  background: linear-gradient(135deg, rgba(52, 180, 255, 0.2) 0%, rgba(52, 180, 255, 0.1) 100%);
  border: 1px solid rgba(52, 180, 255, 0.3);
}

.tournament-badge.mode-auto {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.tournament-badge.risk-safe {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tournament-badge.risk-risky {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(234, 179, 8, 0.1) 100%);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.tournament-badge.risk-riskiest {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Position and Points Emphasis */
.tournament-account-position {
  font-size: 18px;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

.tournament-account-points {
  font-size: 12px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
}

/* Pause Button Enhancement */
.tournament-account-pause-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, 
    rgba(50, 50, 60, 0.8) 0%, 
    rgba(40, 40, 50, 0.9) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-account-pause-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(145deg, 
    rgba(60, 60, 70, 0.9) 0%, 
    rgba(50, 50, 60, 1) 100%
  );
}

.tournament-account-pause-btn:active {
  transform: scale(0.95);
}

.tournament-account-pause-btn.paused {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

/* ================== LEADERBOARD PREMIUM ================== */
.tournament-leaderboard {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.tournament-leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  margin: 0 12px;
  border-radius: 10px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.tournament-leaderboard-entry:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.15);
  transform: translateX(4px);
}

/* Rank Badges Enhancement */
.tournament-leaderboard-rank {
  width: 34px;
  height: 34px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tournament-leaderboard-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  box-shadow: 
    0 4px 12px rgba(255, 215, 0, 0.4),
    0 0 0 2px rgba(255, 215, 0, 0.2);
  animation: gold-glow 2s ease-in-out infinite;
}

@keyframes gold-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4), 0 0 0 2px rgba(255, 215, 0, 0.2); }
  50% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6), 0 0 0 2px rgba(255, 215, 0, 0.3); }
}

.tournament-leaderboard-rank.rank-2 {
  background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 100%);
  box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.tournament-leaderboard-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
  box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

.tournament-leaderboard-rank.other {
  background: rgba(30, 30, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Leaderboard Name and Score */
.tournament-leaderboard-name {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
}

.tournament-leaderboard-score {
  font-size: 15px;
  font-weight: 700;
  color: #a5b4fc;
  font-variant-numeric: tabular-nums;
}

/* Own Entry Highlight */
.tournament-leaderboard-entry.own-entry {
  background: linear-gradient(90deg, 
    rgba(99, 102, 241, 0.15) 0%, 
    rgba(99, 102, 241, 0.05) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.tournament-leaderboard-entry.own-entry:hover {
  background: linear-gradient(90deg, 
    rgba(99, 102, 241, 0.25) 0%, 
    rgba(99, 102, 241, 0.1) 100%
  );
}

/* Top 3 Glow Effect */
.tournament-leaderboard-entry.top-3 {
  background: linear-gradient(90deg, 
    rgba(251, 191, 36, 0.08) 0%, 
    transparent 100%
  );
}

/* ================== KILL SWITCH PREMIUM CARDS ================== */
.tournament-killswitch-section {
  border: 1px solid rgba(239, 68, 68, 0.1);
  background: linear-gradient(180deg, 
    rgba(30, 25, 25, 0.95) 0%, 
    rgba(25, 22, 22, 0.98) 100%
  );
}

/* Emergency Card - Dangerous Feel */
.killswitch-card.emergency {
  background: linear-gradient(145deg, 
    rgba(50, 25, 25, 0.9) 0%, 
    rgba(40, 20, 20, 0.95) 100%
  );
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: 
    0 4px 16px rgba(239, 68, 68, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.killswitch-card.emergency::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(239, 68, 68, 0.8) 50%, 
    transparent 100%
  );
  animation: danger-pulse 1.5s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.killswitch-card.emergency .killswitch-card-header i {
  color: #ef4444;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4));
}

/* Leader Card - Strategic Gold */
.killswitch-card.leader {
  background: linear-gradient(145deg, 
    rgba(45, 40, 25, 0.9) 0%, 
    rgba(35, 32, 20, 0.95) 100%
  );
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 
    0 4px 16px rgba(245, 158, 11, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.killswitch-card.leader .killswitch-card-header i {
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3));
}

/* Shield Card - Calm Protective Blue */
.killswitch-card.shield {
  background: linear-gradient(145deg, 
    rgba(30, 35, 55, 0.9) 0%, 
    rgba(25, 30, 45, 0.95) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 
    0 4px 16px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.killswitch-card.shield .killswitch-card-header i {
  color: #818cf8;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

/* Status Card - Technical Grey */
.killswitch-card.status {
  background: linear-gradient(145deg, 
    rgba(30, 35, 40, 0.9) 0%, 
    rgba(25, 30, 35, 0.95) 100%
  );
  border: 1px solid rgba(52, 180, 255, 0.15);
}

.killswitch-card.status .killswitch-card-header i {
  color: #34b4ff;
}

/* Kill Switch Buttons Enhancement */
.killswitch-btn {
  position: relative;
  overflow: hidden;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.killswitch-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.killswitch-btn:active::after {
  width: 200px;
  height: 200px;
}

.killswitch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.killswitch-btn:active {
  transform: translateY(0);
}

/* Emergency Button Special */
#btn-emergency-stop-all {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
  font-weight: 800;
  letter-spacing: 0.5px;
}

#btn-emergency-stop-all:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 28px rgba(220, 38, 38, 0.4);
}

/* ================== BUTTON INTERACTIONS ================== */
.btn {
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-secondary:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.btn-success:hover {
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
}

/* Large buttons feel powerful */
.btn-lg {
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Icon + Text spacing improvement */
.btn i {
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.btn:hover i {
  transform: scale(1.1);
}

/* ================== MODAL PREMIUM LAYERING ================== */
.modal-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 0.25s ease;
}

.modal {
  background: linear-gradient(145deg, 
    rgba(30, 30, 40, 0.98) 0%, 
    rgba(22, 22, 32, 0.99) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(99, 102, 241, 0.1);
  animation: modal-enter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 0 24px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* ================== DISABLED STATE HERO ================== */
.tournament-disabled-state {
  padding: 48px 24px;
}

.tournament-hero {
  background: linear-gradient(145deg, 
    rgba(30, 30, 40, 0.6) 0%, 
    rgba(25, 25, 35, 0.8) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 48px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tournament-hero-icon {
  width: 80px;
  height: 80px;
  color: #fbbf24;
  filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.3));
  animation: trophy-float 3s ease-in-out infinite;
}

@keyframes trophy-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.tournament-hero h3 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tournament-hero p {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(148, 163, 184, 0.9);
  max-width: 400px;
}

/* Feature cards enhancement */
.tournament-features {
  margin-top: 8px;
}

.tournament-feature {
  background: linear-gradient(145deg, 
    rgba(35, 35, 45, 0.6) 0%, 
    rgba(28, 28, 38, 0.8) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px 16px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.tournament-feature:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.tournament-feature i {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

/* ================== MICRO ICONS ENHANCEMENT ================== */
.tournament-micro-icon {
  width: 16px;
  height: 16px;
  right: 10px;
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: micro-icon-pulse 2s ease-in-out infinite;
}

@keyframes micro-icon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ================== FORM INPUTS PREMIUM ================== */
.form-input {
  background: linear-gradient(145deg, 
    rgba(30, 30, 40, 0.8) 0%, 
    rgba(25, 25, 35, 0.9) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

/* ================== EMPTY STATE ENHANCEMENT ================== */
.tournament-accounts-empty {
  padding: 48px 24px;
  color: rgba(148, 163, 184, 0.7);
}

.tournament-accounts-empty i {
  width: 48px;
  height: 48px;
  opacity: 0.5;
  margin-bottom: 16px;
}

/* ================== SCROLLBAR STYLING ================== */
.tournament-leaderboard::-webkit-scrollbar {
  width: 6px;
}

.tournament-leaderboard::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.tournament-leaderboard::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}

.tournament-leaderboard::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ================== SECTION HEADER CONTROLS ================== */
.tournament-leaderboard-controls .btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-leaderboard-controls .btn:hover {
  transform: translateY(-1px);
}

.tournament-leaderboard-controls .btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ================== TOURNAMENT PAGE FIXES ================== */

/* Tournament Page Base */
#page-tournament {
  min-height: 100vh;
  background: var(--bg-primary);
}

#page-tournament .page-content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tournament Disabled State - Clean Centered Entry */
.tournament-disabled-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 20px;
  text-align: center;
}

.tournament-hero {
  background: linear-gradient(180deg, 
    rgba(99, 102, 241, 0.1) 0%, 
    transparent 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
}

.tournament-hero-icon {
  width: 72px;
  height: 72px;
  color: #fbbf24;
  margin-bottom: 24px;
}

.tournament-hero h3 {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
}

.tournament-hero p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 32px;
}

.tournament-hero .btn-lg {
  width: 100%;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
}

/* Features Grid */
.tournament-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
  max-width: 480px;
  width: 100%;
}

.tournament-feature {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.tournament-feature:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.tournament-feature i {
  color: #6366f1;
}

/* Tournament Enabled State */
.tournament-enabled-state {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Info Card - Clean and Professional */
.tournament-info-card {
  background: linear-gradient(145deg, 
    rgba(30, 30, 40, 0.9) 0%, 
    rgba(22, 22, 32, 0.95) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.tournament-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.tournament-title-section h3 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.tournament-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #22c55e;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 20px;
}

.tournament-status-badge.ended {
  background: #64748b;
  color: #fff;
}

.tournament-status-badge.upcoming {
  background: #f59e0b;
  color: #000;
}

.tournament-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
}

.tournament-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.tournament-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tournament-info-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tournament-info-value {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.tournament-prize-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tournament-prize-value {
  font-size: 20px;
  font-weight: 700;
  color: #fbbf24;
}

/* Tournament Sections */
.tournament-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
}

.tournament-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tournament-section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.tournament-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  margin-left: 8px;
}

/* Accounts List - Clean Grid */
.tournament-accounts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.tournament-accounts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 20px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.tournament-accounts-empty i {
  color: rgba(255, 255, 255, 0.2);
}

/* Account Card - Clean Design */
.tournament-account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  position: relative;
}

.tournament-account-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.tournament-account-card.paused {
  border-left: 3px solid #eab308;
}

.tournament-account-card.profit-locked {
  border-left: 3px solid #22c55e;
}

.tournament-account-card.shielded {
  border-left: 3px solid #6366f1;
}

.tournament-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.tournament-account-avatar.master::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #fbbf24;
  border: 2px solid var(--bg-secondary);
  border-radius: 50%;
}

.tournament-account-info {
  flex: 1;
  min-width: 0;
}

.tournament-account-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tournament-account-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.tournament-account-badges {
  display: flex;
  gap: 6px;
}

.tournament-badge {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
}

.tournament-badge.mode-manual {
  background: rgba(52, 180, 255, 0.15);
  color: #34b4ff;
}

.tournament-badge.mode-auto {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.tournament-badge.risk-safe {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.tournament-badge.risk-risky {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.tournament-badge.risk-riskiest {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.tournament-badge.joined {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.tournament-badge.not-joined {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.tournament-pause-badge,
.tournament-lock-badge,
.tournament-shield-badge {
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  border-radius: 4px;
  margin-left: 4px;
}

.tournament-pause-badge {
  background: #eab308;
  color: #000;
}

.tournament-lock-badge {
  background: #22c55e;
  color: #fff;
}

.tournament-shield-badge {
  background: #6366f1;
  color: #fff;
}

.tournament-account-controls {
  display: flex;
  gap: 8px;
}

.tournament-account-pause-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-account-pause-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tournament-account-pause-btn.paused {
  background: #eab308;
  color: #000;
  border-color: #eab308;
}

.tournament-account-stats {
  text-align: right;
  min-width: 60px;
}

.tournament-account-position {
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
  display: block;
}

.tournament-account-points {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* Micro Icons */
.tournament-micro-icon {
  position: absolute;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* Leaderboard */
.tournament-leaderboard {
  max-height: 350px;
  overflow-y: auto;
  padding: 8px;
}

.tournament-leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-leaderboard-entry:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tournament-leaderboard-entry.own-entry {
  background: rgba(99, 102, 241, 0.1);
}

.tournament-leaderboard-rank {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tournament-leaderboard-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #000;
}

.tournament-leaderboard-rank.rank-2 {
  background: linear-gradient(135deg, #e0e0e0, #a0a0a0);
  color: #000;
}

.tournament-leaderboard-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #fff;
}

.tournament-leaderboard-rank.other {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
}

.tournament-leaderboard-name {
  flex: 1;
  font-size: 14px;
  color: #fff;
}

.tournament-leaderboard-score {
  font-size: 14px;
  font-weight: 600;
  color: #6366f1;
}

/* Leaderboard Controls */
.tournament-leaderboard-controls {
  display: flex;
  gap: 4px;
}

.tournament-leaderboard-controls .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.tournament-leaderboard-controls .btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* Kill Switch Section */
.tournament-killswitch-section {
  background: rgba(239, 68, 68, 0.02);
  border-color: rgba(239, 68, 68, 0.1);
}

.killswitch-status-indicator {
  padding: 4px 10px;
  background: #22c55e;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 12px;
  margin-left: 12px;
}

.killswitch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px;
}

.killswitch-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.killswitch-card.emergency {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.08), transparent);
  border-color: rgba(239, 68, 68, 0.2);
}

.killswitch-card.leader {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), transparent);
  border-color: rgba(245, 158, 11, 0.2);
}

.killswitch-card.shield {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), transparent);
  border-color: rgba(99, 102, 241, 0.2);
}

.killswitch-card.status {
  background: rgba(255, 255, 255, 0.02);
}

.killswitch-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.killswitch-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.killswitch-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
  margin-bottom: 16px;
}

.killswitch-btn {
  width: 100%;
  justify-content: center;
}

.killswitch-account-select {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.killswitch-no-account {
  color: rgba(255, 255, 255, 0.3);
}

.killswitch-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.killswitch-status-item {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.killswitch-status-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.killswitch-status-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.killswitch-status-value.active {
  color: #22c55e;
}

.killswitch-status-value.warning {
  color: #eab308;
}

.killswitch-status-value.danger {
  color: #ef4444;
}

/* Exit Section */
.tournament-exit-section {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* Available Accounts Modal */
.tournament-available-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.tournament-available-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-available-account-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

.tournament-available-account-item .account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.tournament-available-account-item .account-info {
  flex: 1;
}

.tournament-available-account-item .account-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.tournament-available-account-item .account-balance {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Tournament Modal Specifics */
.tournament-modal-account-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 16px;
}

.tournament-modal-account-id {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.tournament-modal-balance {
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
}

.tournament-modal-status {
  text-align: center;
  margin-bottom: 16px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-indicator.joined {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-indicator.not-joined {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.tournament-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.tournament-stat-item {
  text-align: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.tournament-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.tournament-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.tournament-modal-section {
  margin-bottom: 20px;
}

.tournament-modal-section .form-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
  display: block;
}

.tournament-mode-toggle,
.tournament-risk-toggle {
  display: flex;
  gap: 8px;
}

.tournament-mode-btn,
.tournament-risk-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-mode-btn:hover,
.tournament-risk-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.tournament-mode-btn.active,
.tournament-risk-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  color: #fff;
}

.tournament-mode-btn.active i,
.tournament-risk-btn.active i {
  color: #6366f1;
}

.tournament-risk-btn.safe.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
}

.tournament-risk-btn.safe.active i {
  color: #22c55e;
}

.tournament-risk-btn.risky.active {
  background: rgba(234, 179, 8, 0.15);
  border-color: #eab308;
}

.tournament-risk-btn.risky.active i {
  color: #eab308;
}

.tournament-risk-btn.riskiest.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.tournament-risk-btn.riskiest.active i {
  color: #ef4444;
}

.tournament-bet-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tournament-bet-input-row .form-input {
  flex: 1;
}

.tournament-live-info {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}

.tournament-live-multiplier {
  font-size: 20px;
  font-weight: 700;
  color: #6366f1;
}

.tournament-live-cashout {
  font-size: 14px;
  color: #22c55e;
  font-weight: 600;
}

.tournament-auto-status {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.tournament-strategy-info {
  margin-top: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.strategy-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.strategy-row:last-child {
  margin-bottom: 0;
}

.strategy-row span:first-child {
  color: rgba(255, 255, 255, 0.4);
}

.strategy-value {
  font-weight: 600;
  color: #fff;
}

/* Tournament Help Modal */
.tournament-help-section {
  margin-bottom: 24px;
}

.tournament-help-section:last-child {
  margin-bottom: 0;
}

.tournament-help-section h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.tournament-help-section p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.tournament-help-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tournament-help-section li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.tournament-help-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #6366f1;
}

/* ================== TOURNAMENT MODAL FIXES ================== */

/* Ensure tournament modals show correctly */
#tournament-add-account-modal,
#tournament-account-modal,
#tournament-help-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#tournament-add-account-modal:not(.hidden),
#tournament-account-modal:not(.hidden),
#tournament-help-modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

#tournament-add-account-modal.active,
#tournament-account-modal.active,
#tournament-help-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Modal content sizing */
#tournament-add-account-modal .modal {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

#tournament-account-modal .modal {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

#tournament-help-modal .modal {
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Ensure modals are above other content */
#tournament-add-account-modal .modal,
#tournament-account-modal .modal,
#tournament-help-modal .modal {
  position: relative;
  z-index: 1001;
}

/* ================== TOURNAMENT MOBILE-FIRST RESPONSIVE ================== */

/* ========================================
   1. MOBILE BASE (< 768px)
   ======================================== */

/* Page Layout - Single Column */
#page-tournament .page-content {
  padding: 16px;
  padding-bottom: 100px; /* Space for sticky bottom bar */
  max-width: 100%;
  overflow-x: hidden;
}

.tournament-enabled-state {
  gap: 16px;
}

/* ========================================
   2. TOURNAMENT HEADER - STACKED
   ======================================== */
.tournament-info-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tournament-title-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tournament-title-section h3 {
  font-size: 20px;
  line-height: 1.2;
}

/* Countdown below title on mobile */
.tournament-countdown {
  align-self: flex-start;
  order: 2;
}

/* Info Grid - 2 columns on mobile */
.tournament-info-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  margin: 16px 0;
}

.tournament-info-value {
  font-size: 14px;
}

/* Action Buttons Row - Horizontal Scroll */
.tournament-leaderboard-controls {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;

  scrollbar-width: none;
}

.tournament-leaderboard-controls::-webkit-scrollbar {
  display: none;
}

.tournament-leaderboard-controls .btn {
  min-height: 48px;
  padding: 12px 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Section Header Buttons */
.tournament-section-header {
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
}

.tournament-section-header .btn {
  width: 100%;
  min-height: 48px;
}

/* ========================================
   3. ACCOUNT CARDS - MOBILE GRID LAYOUT
   ======================================== */
.tournament-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

/* Account Card - 3 Row Grid Layout */
.tournament-account-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "name status"
    "badges badges"
    "actions actions";
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

/* State borders */
.tournament-account-card.paused {
  border-left: 4px solid #eab308;
}

.tournament-account-card.profit-locked {
  border-left: 4px solid #22c55e;
}

.tournament-account-card.shielded {
  border-left: 4px solid #6366f1;
}

/* Row 1: Name + Status Icon */
.tournament-account-avatar {
  display: none; /* Hide avatar on mobile, show name instead */
}

.tournament-account-info {
  grid-area: name;
  min-width: 0;
}

.tournament-account-name {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tournament-account-stats {
  grid-area: status;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.tournament-account-position {
  font-size: 20px;
  font-weight: 700;
  color: #fbbf24;
}

/* Row 2: Balance + Badges */
.tournament-account-meta {
  grid-area: badges;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.tournament-balance {
  font-weight: 600;
  color: #fff;
  font-size: 15px;
}

.tournament-account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tournament-badge {
  padding: 4px 10px;
  font-size: 11px;
}

/* Row 3: Action Buttons */
.tournament-account-controls {
  grid-area: actions;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tournament-account-pause-btn,
.tournament-account-open-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

.tournament-account-pause-btn:hover,
.tournament-account-open-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.tournament-account-pause-btn.paused {
  background: rgba(234, 179, 8, 0.2);
  border-color: rgba(234, 179, 8, 0.4);
  color: #eab308;
}

.tournament-account-open-btn {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.tournament-account-open-btn:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* Micro icons positioning */
.tournament-micro-icon {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* ========================================
   4. KILL SWITCH - MOBILE GRID
   ======================================== */
.killswitch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.killswitch-card {
  padding: 16px;
  border-radius: 12px;
}

/* Full width cards (span 2 columns) */
.killswitch-card.emergency,
.killswitch-card.status {
  grid-column: 1 / -1;
}

/* Half width cards */
.killswitch-card.leader,
.killswitch-card.shield {
  grid-column: span 1;
}

/* Emergency card emphasis */
.killswitch-card.emergency {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.killswitch-card.emergency .killswitch-btn {
  min-height: 56px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Card headers */
.killswitch-card-header {
  margin-bottom: 12px;
}

.killswitch-card-title {
  font-size: 12px;
}

.killswitch-card-desc {
  font-size: 12px;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Half-width card adjustments */
.killswitch-card.leader .killswitch-card-desc,
.killswitch-card.shield .killswitch-card-desc {
  -webkit-line-clamp: 3;
  font-size: 11px;
}

.killswitch-account-select {
  padding: 10px;
  font-size: 12px;
  margin-bottom: 10px;
}

.killswitch-btn {
  min-height: 44px;
  font-size: 12px;
  padding: 10px;
}

/* Status grid - 2 columns */
.killswitch-status-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.killswitch-status-item {
  padding: 10px;
}

.killswitch-status-label {
  font-size: 10px;
}

.killswitch-status-value {
  font-size: 13px;
}

/* ========================================
   5. LEADERBOARD - MOBILE CARDS
   ======================================== */
.tournament-leaderboard {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;

}

/* Leaderboard entry as card */
.tournament-leaderboard-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "rank name score"
    "rank user multiplier";
  gap: 4px 12px;
  padding: 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  align-items: center;
}

.tournament-leaderboard-entry:last-child {
  margin-bottom: 0;
}

.tournament-leaderboard-rank {
  grid-area: rank;
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.tournament-leaderboard-name {
  grid-area: name;
  font-size: 15px;
  font-weight: 600;
}

.tournament-leaderboard-score {
  grid-area: score;
  font-size: 16px;
  font-weight: 700;
}

/* Add multiplier display */
.tournament-leaderboard-entry::after {
  content: attr(data-multiplier);
  grid-area: multiplier;
  justify-self: end;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Top 3 emphasis */
.tournament-leaderboard-entry.top-3 {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

/* Own entry emphasis */
.tournament-leaderboard-entry.own-entry {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ========================================
   6. MODALS - BOTTOM SHEET STYLE
   ======================================== */
#tournament-add-account-modal:not(.hidden),
#tournament-account-modal:not(.hidden),
#tournament-help-modal:not(.hidden) {
  align-items: flex-end;
  padding: 0;
}

#tournament-add-account-modal .modal,
#tournament-account-modal .modal,
#tournament-help-modal .modal {
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  margin: 0;
  animation: modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal internal scroll */
#tournament-add-account-modal .modal-body,
#tournament-account-modal .modal-body,
#tournament-help-modal .modal-body {
  max-height: calc(85vh - 140px);
  overflow-y: auto;

}

/* Available accounts in modal */
.tournament-available-accounts {
  max-height: 50vh;
}

.tournament-available-account-item {
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 12px;
}

.tournament-available-account-item .btn-add {
  min-height: 40px;
  padding: 8px 16px;
}

/* Modal buttons full width */
.modal-footer .btn {
  min-height: 48px;
  flex: 1;
}

/* ========================================
   7. STICKY BOTTOM ACTION BAR
   ======================================== */
.tournament-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, 
    rgba(20, 20, 30, 0.95) 0%, 
    rgba(15, 15, 25, 1) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  gap: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tournament-bottom-bar .btn {
  min-height: 48px;
  flex: 1;
  font-weight: 600;
}

/* ========================================
   8. EXIT SECTION
   ======================================== */
.tournament-exit-section {
  padding: 16px;
}

.tournament-exit-section .btn {
  width: 100%;
  min-height: 48px;
}

/* ========================================
   9. DISABLED STATE - MOBILE
   ======================================== */
.tournament-disabled-state {
  padding: 24px 16px;
}

.tournament-hero {
  padding: 32px 24px;
}

.tournament-hero h3 {
  font-size: 24px;
}

.tournament-hero p {
  font-size: 14px;
}

.tournament-features {
  grid-template-columns: 1fr;
  gap: 12px;
}

.tournament-feature {
  flex-direction: row;
  text-align: left;
  padding: 16px;
}

.tournament-feature i {
  flex-shrink: 0;
}

/* ========================================
   TABLET ADJUSTMENTS (768px - 1023px)
   ======================================== */
@media (min-width: 768px) {
  .tournament-accounts-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tournament-account-card {
    display: flex;
    flex-direction: column;
  }
  
  .tournament-account-avatar {
    display: flex;
  }
  
  .killswitch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tournament-info-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   DESKTOP PRESERVATION (>= 1024px)
   ======================================== */
@media (min-width: 1024px) {
  #page-tournament .page-content {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  /* Header - horizontal layout */
  .tournament-info-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  
  .tournament-countdown {
    order: 0;
  }
  
  /* Accounts - 3 column grid */
  .tournament-accounts-list {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .tournament-account-card {
    flex-direction: row;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .tournament-account-info {
    flex: 1;
  }
  
  .tournament-account-meta {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  
  .tournament-account-controls {
    display: flex;
    width: auto;
    gap: 8px;
  }
  
  .tournament-account-pause-btn {
    width: 40px;
    min-height: 40px;
  }
  
  /* Hide open button on desktop - card is clickable */
  .tournament-account-open-btn {
    display: none;
  }
  
  /* Kill Switch - 2x2 grid */
  .killswitch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Modals - centered */
  #tournament-add-account-modal:not(.hidden),
  #tournament-account-modal:not(.hidden),
  #tournament-help-modal:not(.hidden) {
    align-items: center;
    padding: 20px;
  }
  
  #tournament-add-account-modal .modal,
  #tournament-account-modal .modal,
  #tournament-help-modal .modal {
    max-width: 520px;
    border-radius: 16px;
    animation: modal-enter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes modal-enter {
    from {
      transform: scale(0.95);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  /* Hide bottom bar on desktop */
  .tournament-bottom-bar {
    display: none;
  }
}

/* ========================================
   LARGE DESKTOP (>= 1400px)
   ======================================== */
@media (min-width: 1400px) {
  .tournament-accounts-list {
    grid-template-columns: repeat(4, 1fr);
  }
  
  #page-tournament .page-content {
    max-width: 1400px;
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */
.tournament-account-card,
.tournament-leaderboard-entry,
.killswitch-card {
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform; */
  transform: translateZ(0);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .tournament-account-card,
  .tournament-leaderboard-entry,
  #tournament-add-account-modal .modal,
  #tournament-account-modal .modal,
  #tournament-help-modal .modal {
    animation: none;
    transition: none;
  }
}

/* ================== TOURNAMENT UI STABILITY FIXES ================== */

/* Modal Portal Root - Direct child of body, highest z-index */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
}

#modal-root.active {
  pointer-events: auto;
}

/* Tournament Modals - Proper Portal Rendering */
#modal-root .tournament-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10000;
}

#modal-root .tournament-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Bottom Sheet Modal Content */
#modal-root .tournament-modal-content {
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  background: linear-gradient(180deg, 
    rgba(30, 30, 40, 0.98) 0%, 
    rgba(22, 22, 32, 1) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  /* mobile-opt: will-change removed to save GPU memory */
  /* will-change: transform; */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#modal-root .tournament-modal-overlay.active .tournament-modal-content {
  transform: translateY(0);
}

/* Modal Header */
#modal-root .tournament-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

#modal-root .tournament-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

#modal-root .tournament-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.15s ease;
}

#modal-root .tournament-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: rotate(90deg);
}

/* Modal Body - Scrollable */
#modal-root .tournament-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;

}

/* Modal Footer */
#modal-root .tournament-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

#modal-root .tournament-modal-footer .btn {
  flex: 1;
  min-height: 48px;
}

/* Desktop Modal - Centered */
@media (min-width: 768px) {
  #modal-root .tournament-modal-overlay {
    align-items: center;
    padding: 20px;
  }
  
  #modal-root .tournament-modal-content {
    max-width: 520px;
    border-radius: 16px;
    max-height: 80vh;
    transform: scale(0.95);
    opacity: 0;
  }
  
  #modal-root .tournament-modal-overlay.active .tournament-modal-content {
    transform: scale(1);
    opacity: 1;
  }
}

/* Body scroll lock */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Bottom Bar z-index fix - below modal */
.tournament-bottom-bar {
  z-index: 120 !important;
}

/* Ensure original modals are hidden when using portal */
#tournament-add-account-modal.hidden,
#tournament-account-modal.hidden,
#tournament-help-modal.hidden {
  display: none !important;
}

/* Prevent layout shift containers */
#page-tournament .page-content,
.tournament-enabled-state,
.tournament-section {
  transform: none;
  will-change: auto;
}

/* Improve tap accuracy - buttons must stop propagation */
.tournament-account-pause-btn,
.tournament-account-open-btn,
.tournament-account-controls button {
  position: relative;
  z-index: 2;
}

/* Account card click exclusion zones */
.tournament-account-card {
  position: relative;
}

.tournament-account-card > * {
  pointer-events: auto;
}

.tournament-account-controls {
  pointer-events: auto;
}

/* Smooth scroll behavior for modal content */
#modal-root .tournament-modal-body {
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  #modal-root .tournament-modal-body {
    scroll-behavior: smooth;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #modal-root .tournament-modal-overlay,
  #modal-root .tournament-modal-content {
    transition: none;
  }
  
  #modal-root .tournament-modal-overlay.active .tournament-modal-content {
    transform: none;
    opacity: 1;
  }
}

/* ================== TOURNAMENT EMPTY STATE CLICK FIX ================== */

/* Ensure empty state is clickable and on top */
.tournament-accounts-empty {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Ensure buttons in empty state are clickable */
.tournament-accounts-empty .btn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

/* Fix any potential overlay issues */
.tournament-section {
  position: relative;
}

/* Ensure modal root doesn't block when not active */
#modal-root:not(.active) {
  pointer-events: none !important;
  z-index: -1 !important;
}

/* When modal is active, it should be on top */
#modal-root.active {
  pointer-events: auto !important;
  z-index: 9999 !important;
}

/* Debug - make sure empty state is visible and clickable */
#tournament-accounts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 20px;
}

#tournament-accounts-empty.hidden {
  display: none !important;
}

/* Ensure the accounts list doesn't overlay empty state */
#tournament-accounts-list {
  position: relative;
}

#tournament-accounts-list.hidden {
  display: none !important;
}


/* ================== PROFILE MODAL ================== */

.profile-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.profile-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.profile-option-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.profile-option-btn i {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

/* ================== AVATAR MODAL ================== */

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 12px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.avatar-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

.avatar-item {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.avatar-item.selected {
  border-color: var(--accent-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.avatar-item img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  pointer-events: none;
}

.avatar-skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile responsive */
@media (max-width: 640px) {
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
  }
  
  .profile-option-btn {
    padding: 16px 20px;
    font-size: 15px;
  }
}
