:root {
  --bg: #0a0e1a;
  --bg-deep: #060810;
  --bg-panel: rgba(10, 14, 26, 0.92);
  --bg-card: rgba(15, 20, 35, 0.9);
  --bg-elevated: rgba(15, 20, 35, 0.95);
  --border: rgba(255, 255, 255, 0.06);
  --gold: #d4af37;
  --gold-light: #f0d875;
  --gold-dim: #b8941f;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --blue-glow: rgba(59, 130, 246, 0.2);
  --orange-glow: rgba(251, 146, 60, 0.15);
  --text: #f0f2f5;
  --text-muted: #8b92a0;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Manrope', -apple-system, sans-serif;
  --font-display: 'Unbounded', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max-content: 480px;
  --sidebar-width: 280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; width: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  overflow-x: hidden;
}

.app-wrap {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ========== Cosmic background ========== */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-layer.stars {
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(212,175,55,0.25), transparent),
    radial-gradient(1px 1px at 90% 50%, rgba(255,255,255,0.2), transparent);
  background-size: 200% 200%, 180% 180%, 220% 220%, 190% 190%, 210% 210%;
  animation: starsMove 20s ease-in-out infinite;
}
@keyframes starsMove {
  0%, 100% { opacity: 1; background-position: 0% 0%, 10% 10%, 5% 5%, 15% 15%, 0% 10%; }
  50% { opacity: 0.85; background-position: 100% 100%, 90% 90%, 95% 95%, 85% 85%, 100% 90%; }
}
.bg-layer.streaks {
  background:
    linear-gradient(105deg, transparent 0%, var(--blue-glow) 25%, transparent 50%),
    linear-gradient(75deg, transparent 0%, var(--gold-glow) 20%, transparent 45%),
    linear-gradient(165deg, transparent 0%, var(--orange-glow) 30%, transparent 55%);
  background-size: 400% 400%, 350% 350%, 380% 380%;
  animation: streaksMove 12s ease-in-out infinite;
}
@keyframes streaksMove {
  0%, 100% { opacity: 0.6; background-position: 0% 0%, 100% 0%, 0% 100%; }
  50% { opacity: 1; background-position: 100% 100%, 0% 100%, 100% 0%; }
}
.bg-layer.gradient {
  background: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(212, 175, 55, 0.08), transparent 50%),
              radial-gradient(ellipse 80% 60% at 100% 50%, rgba(59, 130, 246, 0.06), transparent 45%),
              radial-gradient(ellipse 60% 80% at 0% 100%, rgba(212, 175, 55, 0.05), transparent 45%);
}

/* ========== Layout: responsive ========== */
.content {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  padding-bottom: 40px;
  max-width: 100%;
  margin: 0 auto;
}
.brand-col { display: none; }
.leaderboard-sidebar {
  margin-top: 0; padding: 16px;
  min-width: 0;
}
.leaderboard-sidebar .panel-title {
  margin-bottom: 12px; font-size: 0.8rem; line-height: 1.3;
  padding-bottom: 8px; border-bottom: 1px solid rgba(212,175,55,0.25);
}
.leaderboard-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
  margin-bottom: 14px; font-size: 0.8rem;
}
.leaderboard-stats-item {
  display: flex; flex-direction: column; gap: 2px;
  color: var(--text-muted);
}
.leaderboard-stats-item strong { color: var(--gold-light); font-size: 0.95rem; }
.leaderboard-sidebar .leaderboard-table { font-size: 0.78rem; width: 100%; table-layout: fixed; }
.leaderboard-sidebar .leaderboard-table th,
.leaderboard-sidebar .leaderboard-table td { padding: 6px 6px; }
.leaderboard-sidebar .leaderboard-table td:nth-child(2) {
  max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.leaderboard-prize-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.35; }
.leaderboard-mobile-wrap { display: none; margin-bottom: 16px; }
.leaderboard-mobile-wrap.has-leaderboard { display: block; }
.leaderboard-mobile-wrap .panel-title { margin-bottom: 8px; }
.leaderboard-details {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.leaderboard-details summary {
  padding: 14px 16px; font-weight: 600; color: var(--gold);
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.leaderboard-details summary::-webkit-details-marker { display: none; }
.leaderboard-details summary::before { content: '▶'; font-size: 0.75rem; transition: transform var(--transition); }
.leaderboard-details[open] summary::before { transform: rotate(90deg); }
.leaderboard-details .leaderboard-inner { padding: 0 16px 16px 16px; }

/* ========== Assistant (Помощник): bank, stats, sidebar ========== */
.assistant-bank-panel {
  margin-bottom: 10px;
  padding: 10px 12px;
}
.assistant-bank-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.assistant-bank-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.assistant-bank-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.assistant-tactic-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.assistant-tactic-btns .tab { padding: 6px 10px; font-size: 0.78rem; }
.assistant-bank-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assistant-bank-input {
  width: 88px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 20, 35, 0.8);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  transition: border-color var(--transition);
  margin-bottom: 0;
}
.assistant-bank-input:focus { outline: none; border-color: var(--gold); }
.assistant-bank-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(15, 20, 35, 0.75);
}
.assistant-bank-inline {
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
}
.assistant-bank-inline-label {
  color: var(--text-muted);
  margin-right: 2px;
}
.assistant-bank-value {
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.assistant-bank-value.empty { color: var(--text-muted); font-weight: 600; }
.assistant-bank-gear {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.assistant-bank-gear:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}
.assistant-bank-edit-wrap .assistant-bank-input-wrap { margin-top: 0; }
.assistant-bank-edit-wrap { margin-left: auto; }
.assistant-bank-group:first-child { min-width: 0; }

@media (max-width: 680px) {
  .assistant-bank-line,
  .assistant-bank-edit-wrap {
    margin-left: 0;
    width: 100%;
  }
}
.assistant-content-tabs { gap: 6px; margin-bottom: 10px; }
.assistant-content-tabs .tab { padding: 8px 12px; font-size: 0.82rem; }
@media (min-width: 900px) {
  .assistant-content-tab[data-assistant-tab="stats"] { display: none; }
}
.assistant-suggestions-msg { margin: 0 0 8px 0; font-size: 0.85rem; color: var(--text-muted); }
.assistant-stats-inner,
.assistant-history-inner {
  font-size: 0.9rem;
  line-height: 1.5;
}
.assistant-stats-inner p,
.assistant-history-inner .tx-item { margin: 0 0 8px 0; }
.assistant-stats-inner p:last-child,
.assistant-history-inner .tx-item:last-child { margin-bottom: 0; }
.assistant-stats-panel .panel-title,
.assistant-history-panel .panel-title { margin-bottom: 12px; }
.assistant-history-panel .assistant-history-inner { padding: 0; }
.assistant-history-inner .tx-item { padding: 8px 10px; border-radius: 8px; border-left: 3px solid transparent; }
.assistant-bet-won { background: rgba(34, 197, 94, 0.12); border-left-color: #22c55e; color: #86efac; }
.assistant-bet-lost { background: rgba(239, 68, 68, 0.12); border-left-color: #ef4444; color: #fca5a5; }

.assistant-welcome-body p { margin: 0 0 10px 0; font-size: 0.9rem; line-height: 1.45; }
.assistant-welcome-body p:last-of-type { margin-bottom: 16px; }
.assistant-welcome-body .btn { width: 100%; }

/* Сайдбар статистики помощника (десктоп): под логотипом */
.assistant-stats-sidebar {
  margin-top: 0;
  margin-bottom: 20px;
}
.assistant-stats-sidebar .assistant-stats-inner { font-size: 0.82rem; }
.assistant-stats-sidebar .assistant-stats-inner p { margin: 0 0 6px 0; }
@media (max-width: 899px) {
  .assistant-stats-sidebar { display: none !important; }
}
@media (min-width: 900px) {
  #assistant-tab-stats { display: none !important; }
}
@media (min-width: 900px) {
  .assistant-stats-sidebar.visible { display: block !important; }
}

@media (min-width: 900px) {
  .content { flex-direction: row; max-width: none; padding: 0 24px 24px 24px; gap: 28px; align-items: flex-start; width: 100%; }
  .content .main-col { flex: 1; min-width: 0; max-width: none; }
  .app-header .brand-mini-btn { display: none; }
  .brand-col { display: block; width: var(--sidebar-width); flex-shrink: 0; position: sticky; top: 0; overflow: visible; }
  .app-header {
    position: relative;
    top: auto;
    margin: 0 0 22px 0;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(180deg, rgba(15, 21, 38, 0.96) 0%, rgba(10, 14, 26, 0.92) 100%);
    box-shadow: 0 0 18px var(--gold-glow), inset 0 0 0 1px rgba(0,0,0,0.25);
    backdrop-filter: blur(10px);
  }
  .leaderboard-mobile-wrap.has-leaderboard { display: none; }
}
@media (max-width: 899px) {
  .leaderboard-sidebar { display: none !important; }
}

/* ========== Brand block (shield / КИТОБОЙ) ========== */
.brand-block {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px 16px;
  background: var(--bg-panel);
  border: 2px solid var(--gold);
  border-radius: 20px;
  box-shadow: 0 0 30px var(--gold-glow), inset 0 0 40px rgba(0,0,0,0.2);
  position: relative;
  cursor: pointer;
  transition: opacity var(--transition);
}
.brand-block:hover { opacity: 0.95; }
.brand-block::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold) 0%, transparent 40%, var(--gold-light) 70%, var(--gold) 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;
  pointer-events: none;
  opacity: 0.6;
}
.brand-logo-img {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  border-radius: 12px;
}
.brand-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  letter-spacing: 0.02em;
  margin: 0 0 4px 0;
}
.brand-trophy { font-size: 1.2rem; opacity: 0.9; }

/* ========== Panel (golden frame like SPORTS PREDICTION) ========== */
.panel {
  background: var(--bg-panel);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 0 24px var(--gold-glow), 0 0 0 1px rgba(0,0,0,0.3) inset;
  position: relative;
  animation: cardIn 0.45s ease-out backwards;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}
.panel-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}
.page-subtitle { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 20px 0; }

/* Auth (login/register) */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-form label { display: block; font-size: 0.85rem; font-weight: 600; margin: 10px 0 4px 0; color: var(--text-muted); }
.auth-form input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 1rem; margin-bottom: 4px; }
.auth-form .btn { margin-top: 14px; }
.auth-form .btn-outline { margin-right: 8px; margin-top: 8px; }
.auth-error { font-size: 0.85rem; color: var(--danger); margin: 8px 0 0 0; min-height: 1.2em; }

/* Balance */
.balance-block {
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 0 20px var(--gold-glow);
  animation: cardIn 0.5s ease-out;
}
.balance-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 6px; }
.balance-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-light) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: balanceShine 5s linear infinite;
}
@keyframes balanceShine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Nav */
.nav { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px 20px;
  font-family: var(--font); font-size: 1rem; font-weight: 600;
  border: none; border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 4px 20px var(--gold-glow);
}
.btn-primary:hover { box-shadow: 0 8px 28px var(--gold-glow); }
.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: rgba(212, 175, 55, 0.4); box-shadow: 0 0 18px var(--gold-glow); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  animation: cardIn 0.5s ease-out backwards;
}
.card:hover { border-color: rgba(212, 175, 55, 0.3); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.card.game-card {
  border-left: 4px solid var(--gold);
  padding-left: 18px;
}
.ai-predict-filters {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.ai-predict-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.ai-predict-leagues-wrap { flex: 1; min-width: 0; }
.ai-filter-leagues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-league-chip {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.ai-league-chip:hover { border-color: rgba(212,175,55,0.4); color: var(--text); }
.ai-league-chip.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a;
  border-color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}
.ai-predict-dates-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.ai-date-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15,20,35,0.8);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  min-width: 0;
}
.ai-date-input:focus { outline: none; border-color: var(--gold); }
.ai-date-input::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; opacity: 0.7; }
.predict-card {
  background: linear-gradient(145deg, rgba(18, 22, 35, 0.95) 0%, rgba(12, 16, 28, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 14px;
  overflow: hidden;
  animation: cardIn 0.5s ease-out backwards;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.predict-card .predict-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}
.predict-card .predict-league {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.predict-card .predict-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.predict-card .predict-teams-wrap {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.predict-card .predict-teams {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.35;
}
.predict-card .predict-outcome {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a;
  box-shadow: 0 0 12px var(--gold-glow);
}
.predict-card .predict-blocks {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.predict-card .predict-block {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.predict-card .predict-block-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.predict-card .predict-block strong { color: var(--gold-light); }
.predict-card .predict-odds {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border);
}
.card:nth-child(1){animation-delay:0.05s}.card:nth-child(2){animation-delay:0.1s}.card:nth-child(3){animation-delay:0.15s}.card:nth-child(4){animation-delay:0.2s}.card:nth-child(5){animation-delay:0.25s}.card:nth-child(n+6){animation-delay:0.3s}

.back { margin-bottom: 16px; }
.back button {
  background: none; border: none; color: var(--gold);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 0;
  transition: opacity var(--transition);
}
.back button:hover { opacity: 0.85; }

.error { color: var(--danger); margin: 12px 0; padding: 12px; background: rgba(239,68,68,0.1); border-radius: var(--radius-sm); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.choice-btn {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.choice-btn:hover:not(:disabled) { border-color: rgba(212,175,55,0.5); transform: translateY(-1px); }
.choice-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a; border-color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}
.choice-btn:disabled { cursor: not-allowed; opacity: 0.7; }

/* Tabs */
.tabs {
  display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
}
.tab {
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.tab:hover { border-color: rgba(212,175,55,0.4); color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a; border-color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}
.tabs-full { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-bottom: 12px; }
.tabs-full .tab { flex: 1 1 0; min-width: 0; font-size: 0.8rem; padding: 10px 8px; text-align: center; }
@media (min-width: 400px) { .tabs-full .tab { font-size: 0.85rem; padding: 10px 12px; } }
.tournaments-phase-tabs { margin-bottom: 10px; }
.tournaments-my-tabs { margin-bottom: 10px; }
.tournaments-price-tabs { margin-bottom: 16px; }

/* Onboarding overlay */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
}
.onboarding-overlay.show { pointer-events: auto; opacity: 1; visibility: visible; }
.onboarding-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); cursor: default;
}
.onboarding-panel {
  position: relative; width: min(96vw, 420px); max-width: 100%; max-height: 88vh;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column;
  overflow: hidden;
}
.onboarding-progress {
  display: flex; gap: 6px; padding: 14px 16px 0; flex-shrink: 0;
}
.onboarding-progress-dot {
  flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background 0.2s;
}
.onboarding-progress-dot.active { background: var(--gold); }
.onboarding-visual {
  min-height: 100px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.04) 50%, transparent 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
}
.onboarding-visual-icon {
  font-size: 3.5rem; line-height: 1; filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.35));
}
.onboarding-title {
  margin: 12px 16px 10px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--gold-light);
  line-height: 1.3;
}
.onboarding-body {
  padding: 0 16px 12px; font-size: 0.95rem; line-height: 1.55; color: var(--text);
  overflow-y: auto; flex: 1; min-height: 0;
}
.onboarding-body p { margin: 0 0 8px 0; }
.onboarding-body p:last-child { margin-bottom: 0; }
.onboarding-example {
  padding: 10px 16px 14px; font-size: 0.85rem; color: var(--text-muted); background: rgba(212, 175, 55, 0.06);
  border-radius: var(--radius-sm); margin: 0 16px 14px; border: 1px solid rgba(212, 175, 55, 0.15);
}
.onboarding-example:empty { display: none; }
.onboarding-actions {
  display: flex; gap: 10px; padding: 0 16px 20px; flex-shrink: 0;
}
.onboarding-actions .onboarding-skip { margin-right: auto; }
.onboarding-actions .onboarding-next { min-width: 120px; }

.onboarding-highlight {
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(212,175,55,0.8), 0 0 22px rgba(212,175,55,0.6);
  border-radius: inherit;
  transition: box-shadow 0.25s ease;
}

/* Cabinet settings — one row, app-style buttons */
.cabinet-settings-panel {
  padding: 18px;
}
.cabinet-settings-header {
  display: block;
  margin-bottom: 12px;
}
.cabinet-settings-header .panel-title { margin: 0 0 8px 0; }
.cabinet-settings-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.22);
}
.cabinet-settings-meta-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.cabinet-balance-badge {
  font-size: 0.83rem;
  color: var(--gold-light);
  font-weight: 700;
  white-space: nowrap;
}
.cabinet-settings-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#cabinet-settings-panel .settings-row {
  background: var(--bg-card);
  border-color: var(--border);
  min-height: 44px;
  padding: 10px 12px;
}
#cabinet-settings-panel .settings-row:hover {
  border-color: rgba(212, 175, 55, 0.38);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.14);
}
#cabinet-settings-panel .settings-inline-text {
  font-size: 0.9rem;
}
.settings-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold-light);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 9px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.settings-edit-btn:hover {
  background: rgba(212, 175, 55, 0.24);
  border-color: rgba(212, 175, 55, 0.55);
}
.settings-edit-btn:active {
  background: rgba(212, 175, 55, 0.2);
}
.cabinet-wallet-line {
  margin: 10px 2px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 6px;
  font-size: clamp(0.76rem, 1.8vw, 0.84rem);
  color: var(--text-muted);
  line-height: 1.3;
}
.cabinet-wallet-text {
  flex: 1 1 240px;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 900px) {
  .cabinet-settings-row { gap: 8px; }
}
@media (max-width: 560px) {
  #cabinet-settings-panel .settings-row {
    align-items: flex-start;
  }
  .settings-edit-btn {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 6px 8px;
  }
  .cabinet-wallet-line {
    gap: 2px 4px;
  }
  .cabinet-wallet-text {
    flex-basis: 100%;
  }
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.settings-row-inline {
  min-height: 42px;
}

.settings-inline-text {
  font-size: 0.9rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-field input {
  flex: 1;
}

.password-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
}

/* Profile modal inputs (username/email/password) */
#username-modal input,
#email-modal input,
#password-modal input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  margin-bottom: 4px;
  -webkit-appearance: none;
  appearance: none;
}
#username-modal input::placeholder,
#email-modal input::placeholder,
#password-modal input::placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}
#username-modal input:focus,
#email-modal input:focus,
#password-modal input:focus {
  outline: none;
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.14);
}

/* Cabinet modals (email/password/wallet) */
.cabinet-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cabinet-modal-note {
  margin: 0 0 2px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.cabinet-modal-body label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 2px 0 2px;
}
.cabinet-modal-body input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  -webkit-appearance: none;
  appearance: none;
}
.cabinet-modal-body input:focus {
  outline: none;
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.14);
}
.cabinet-modal-body .btn {
  margin-top: 4px;
}
#cabinet-link-send-code {
  align-self: flex-start;
}
.cabinet-modal-body .password-field {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
}
.cabinet-modal-body .password-field input {
  border: none;
  background: transparent;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.cabinet-modal-body .password-field input:focus {
  box-shadow: none;
}
.cabinet-modal-body .password-toggle {
  width: 42px;
  height: 42px;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

/* Lineups modal */
.lineups-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
}
.lineups-modal.show { pointer-events: auto; opacity: 1; visibility: visible; }
.lineups-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.7); cursor: pointer;
}
.lineups-modal-panel {
  position: relative; width: min(96vw, 1520px); max-width: 100%; max-height: 85vh; overflow: hidden;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); display: flex; flex-direction: column;
}
.lineups-modal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.lineups-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.lineups-modal-close {
  width: 36px; height: 36px; border: none; border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.lineups-modal-close:hover { color: var(--text); }
.lineups-modal-body {
  padding: 16px; overflow-y: auto; flex: 1; min-height: 0;
}
.leaderboard-lineups-wrap { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.lineups-table-wrap {
  overflow: auto;
  max-height: 62vh;
  -webkit-overflow-scrolling: touch;
}
.lineups-table {
  width: 100%; min-width: 100%; border-collapse: collapse; font-size: 0.9rem;
  --lineup-col-user-max: clamp(180px, 24vw, 340px);
}
.lineups-table th, .lineups-table td {
  padding: 6px 6px; text-align: left; border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(255,255,255,0.08);
}
.lineups-table th:nth-child(n+4),
.lineups-table td:nth-child(n+4) {
  text-align: center;
}
.lineups-table th:last-child, .lineups-table td:last-child { border-right: none; }
.lineups-table th {
  color: var(--gold); font-weight: 600; font-size: 0.75rem; white-space: nowrap;
  position: sticky; top: 0; z-index: 6;
  background: rgba(10, 14, 26, 0.98);
  backdrop-filter: blur(8px);
}
.lineups-table tbody tr.lineup-row-ai {
  position: sticky;
  top: 2rem;
  z-index: 5;
  background: rgba(10, 14, 26, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.lineups-table tbody tr.lineup-row-ai td {
  background: inherit;
}
.lineup-match-th {
  min-width: 64px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px !important;
  padding-right: 2px !important;
}
.lineup-match-head {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  line-height: 1;
  gap: 0;
  white-space: nowrap;
}
.lineup-match-head span { display: inline-block; }
.lineup-match-head span + span::before {
  content: "–";
  color: var(--text-muted);
  margin: 0 2px;
}
.lineups-table td:first-child { color: var(--text-muted); }
.lineup-username { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineups-table th:nth-child(2), .lineups-table td:nth-child(2) {
  width: var(--lineup-col-user-max);
  max-width: var(--lineup-col-user-max);
  min-width: 96px;
  position: sticky; left: 0; z-index: 7;
  background: rgba(10, 14, 26, 0.98);
  border-right: 1px solid rgba(212,175,55,0.28);
  box-shadow: 8px 0 12px -10px rgba(0, 0, 0, 0.7);
}
.lineups-table th:nth-child(3), .lineups-table td:nth-child(3) {
  border-right: 1px solid rgba(212,175,55,0.22);
}
.lineups-table tbody td:nth-child(2) { z-index: 5; }
.lineup-cell { text-align: center; vertical-align: middle; font-weight: 600; min-width: 44px; }
@media (max-width: 600px) {
  .lineups-modal { padding: 0; }
  .lineups-modal-panel {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .lineups-modal-header { padding: 12px; }
  .lineups-modal-body { padding: 8px; }
  .lineups-table-wrap { max-height: calc(100dvh - 110px); }
  .lineups-table { table-layout: auto; min-width: max-content; }
  .lineups-table th, .lineups-table td { padding: 4px 3px; }
  .lineups-table th { font-size: 0.66rem; line-height: 1.15; }
  .lineups-table th:nth-child(2), .lineups-table td:nth-child(2) {
    width: 40vw;
    max-width: 40vw;
    min-width: 128px;
    position: sticky;
    left: 0;
    overflow: hidden;
    box-shadow: 4px 0 8px -8px rgba(0, 0, 0, 0.7);
  }
  .lineup-username { font-size: 0.86rem; min-width: 0; white-space: nowrap; }
  .lineups-table th:nth-child(1), .lineups-table td:nth-child(1) { width: 24px; min-width: 24px; }
  .lineups-table th:nth-child(3), .lineups-table td:nth-child(3) { width: 36px; min-width: 36px; }
  .lineup-cell { min-width: 34px; }
  .lineup-match-th {
    min-width: 54px;
    max-width: 54px;
    text-align: center;
    white-space: normal;
  }
  .lineup-match-head {
    font-size: 0.62rem;
    flex-direction: column;
    line-height: 1.05;
    gap: 1px;
  }
  .lineup-match-head span + span::before { content: none; }
  .lineup-choice-emblem { width: 20px; min-width: 20px; height: 20px; }
  .lineup-check { font-size: 0.68rem; }
}
.lineup-cell-pending { background: rgba(148,163,184,0.16); color: #cbd5e1; }
.lineup-cell-success { background: rgba(34,197,94,0.18); color: #22c55e; }
.lineup-cell-fail { background: rgba(239,68,68,0.18); color: #ef4444; }
.lineup-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 0;
  gap: 0;
  white-space: nowrap;
  line-height: 1;
  margin: 0 auto;
}
.lineup-choice-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.lineup-choice-emblem {
  width: 20px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.35);
  background: rgba(255,255,255,0.04);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
}
.lineup-choice-emblem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lineup-choice-fallback {
  width: 100%; height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 700; color: var(--gold-light);
}
.lineup-choice-abbr { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em; }
.lineup-choice-draw { font-size: 0.85rem; font-weight: 700; min-width: 16px; line-height: 1; }
.lineup-check {
  position: absolute;
  top: -4px;
  right: -6px;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  pointer-events: none;
}
.lineups-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.withdraw-panel { display: none; margin-top: 12px; }
.withdraw-panel.show { display: block; }
.withdraw-panel-note { margin: 0 0 10px 0; font-size: 0.85rem; color: var(--text-muted); }
.withdraw-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.withdraw-error {
  margin: 0 0 10px 0; padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  font-size: 0.85rem;
  display: none;
}

/* Match card: emblems + outcomes */
.match {
  margin: 0 0 20px 0; padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: cardIn 0.4s ease-out backwards;
}
.match:last-child { margin-bottom: 0; }
.match.match-key { border-color: rgba(212,175,55,0.5); box-shadow: 0 0 16px var(--gold-glow); }
.key-match-btn {
  margin-top: 10px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.key-match-btn:hover { border-color: rgba(212,175,55,0.4); color: var(--gold-light); }
.key-match-btn.active { border-color: var(--gold); background: rgba(212,175,55,0.15); color: var(--gold); }
.leaderboard-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed;
}
.leaderboard-table th, .leaderboard-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
}
.leaderboard-table th {
  color: var(--gold); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.leaderboard-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.leaderboard-table td:first-child { width: 36px; color: var(--text-muted); font-size: 0.85rem; }
.leaderboard-table td:nth-child(2) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0;
}
.leaderboard-table td:last-child { text-align: right; color: var(--gold-light); font-weight: 600; width: 52px; }
.match-outcomes {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.outcome-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.outcome-btn:hover:not(:disabled) {
  border-color: rgba(212,175,55,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--gold-glow);
}
.outcome-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.outcome-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a; border-color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}
.outcome-btn .outcome-icon { font-size: 1.2rem; }
.outcome-btn .outcome-label { font-size: 0.75rem; opacity: 0.95; }
.outcome-btn--team {
  flex-direction: column; align-items: center; gap: 6px;
}
.outcome-btn--team .outcome-btn-top {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
}
.outcome-btn--team .outcome-emblem {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  background: linear-gradient(145deg, rgba(212,175,55,0.2) 0%, rgba(20,20,30,0.9) 100%);
  border: 2px solid rgba(212,175,55,0.4);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.outcome-btn--team .outcome-emblem img { width: 100%; height: 100%; object-fit: contain; }
.outcome-btn--team .outcome-emblem .outcome-emblem-fb {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; color: var(--gold-light);
}
.outcome-btn--team .outcome-label {
  font-size: 0.8rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.outcome-btn--guest { align-items: flex-end; }
.outcome-btn--guest .outcome-btn-top { flex-direction: row-reverse; }
.outcome-btn--guest .outcome-label { text-align: right; }
.outcome-btn--draw { flex-direction: column; gap: 6px; }
.outcome-btn--draw .outcome-btn-top {
  min-height: 40px; display: flex; align-items: center; justify-content: center;
}
.outcome-btn--draw .outcome-label { font-size: 0.95rem; }
.outcome-pts {
  font-size: 0.95rem; font-weight: 700;
  color: var(--gold-light);
  background: rgba(212,175,55,0.2);
  padding: 4px 10px; border-radius: 999px;
}
.outcome-btn.active .outcome-pts { color: #0a0e1a; background: rgba(0,0,0,0.2); }
.outcome-btn:active:not(:disabled) { transform: scale(0.96); }

/* Game-style: progress bar, level cards */
.game-progress {
  height: 8px; border-radius: 999px;
  background: var(--bg-elevated); overflow: hidden;
  margin: 10px 0 0 0;
}
.game-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-dim) 0%, var(--gold) 100%);
  transition: width 0.4s ease-out;
  box-shadow: 0 0 10px var(--gold-glow);
}
.level-card {
  position: relative;
  border-left: 4px solid var(--gold);
  padding-left: 14px;
}
.level-card .level-num {
  position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #0a0e1a; font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.game-stat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
  margin-top: 6px;
}
.game-stat strong { color: var(--gold-light); }

/* ========== App header & bottom nav (game-style) ========== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin: -16px -16px 16px -16px;
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.app-header .brand-mini {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--gold); letter-spacing: 0.02em;
}
.app-header .brand-mini-btn {
  background: none; border: none; padding: 4px 0;
  cursor: pointer; transition: color var(--transition), opacity var(--transition);
}
.app-header .brand-mini-btn:hover { color: var(--gold-light); opacity: 0.95; }
.app-header .brand-mini-btn:active { opacity: 0.85; }
.app-header .balance-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: rgba(212,175,55,0.12); border: 1px solid rgba(212,175,55,0.35);
  font-size: 0.9rem; font-weight: 600; color: var(--gold-light);
}
.app-header .btn-profile {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 1.25rem; cursor: pointer;
  transition: all var(--transition);
}
.app-header .btn-profile:hover {
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 16px var(--gold-glow);
}
.app-header .btn-fullscreen {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
  transition: all var(--transition);
}
.app-header .btn-fullscreen:hover {
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 16px var(--gold-glow);
}
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  display: flex; align-items: stretch; justify-content: space-around;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: var(--bg-panel); border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.bottom-nav.hidden { display: none; }
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 8px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.bottom-nav-item:hover { color: var(--text); }
.bottom-nav-item.active {
  color: var(--gold); background: rgba(212,175,55,0.15);
  box-shadow: 0 0 12px var(--gold-glow);
}
.bottom-nav-item .nav-icon { font-size: 1.25rem; }
@media (max-width: 380px) {
  .bottom-nav-item { font-size: 0.65rem; padding: 8px 4px; }
  .bottom-nav-item .nav-icon { font-size: 1.1rem; }
}
.main-content { padding-bottom: 76px; }
.screen { display: none; animation: screenIn 0.3s ease-out; }
.screen.active { display: block; }
@keyframes screenIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.link-text { font-size: 0.85rem; color: var(--text-muted); word-break: break-all; }
.tx-item {
  padding: 12px 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  animation: cardIn 0.4s ease-out backwards;
}
.tx-item:last-child { border-bottom: none; }
input[type="text"], input[type="number"] {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(15,20,35,0.8);
  color: var(--text); font-family: var(--font); font-size: 1rem; margin-bottom: 12px;
  transition: border-color var(--transition);
}
input:focus { outline: none; border-color: var(--gold); }
label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-muted); }

.loading { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.loading-dots::after { content: ''; animation: loadingDots 1.2s steps(4, end) infinite; }
@keyframes loadingDots {
  0%, 20% { content: ''; } 40% { content: '.'; } 60% { content: '..'; } 80%, 100% { content: '...'; }
}

.dev-banner {
  background: var(--bg-panel); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: var(--radius); margin-top: 16px;
  font-size: 0.85rem; display: none;
}
.dev-banner .panel-title { margin-bottom: 8px; }
.dev-banner input { margin-right: 8px; margin-bottom: 8px; width: 140px; display: inline-block; vertical-align: middle; }
.dev-banner .btn { width: auto; display: inline-block; padding: 10px 16px; margin: 0; vertical-align: middle; }

.toast {
  position: fixed; bottom: 88px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
  color: #fff; padding: 14px 24px; border-radius: var(--radius);
  font-weight: 600; box-shadow: 0 8px 32px rgba(34,197,94,0.3);
  z-index: 1000; opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon { margin-right: 8px; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  background: var(--gold-glow); color: var(--gold); margin-left: 8px;
}
.badge-success { background: rgba(34,197,94,0.2); color: var(--success); }

@media (max-width: 599px) {
  .brand-block { padding: 14px 12px; margin-bottom: 20px; }
  .brand-title { font-size: 1.2rem; }
  .brand-logo-img { max-width: 120px; }
  .match-outcomes { gap: 6px; }
  .outcome-btn { padding: 10px 6px; }
  .outcome-btn--team .outcome-label { font-size: 0.75rem; }
  .outcome-btn--draw .outcome-label { font-size: 0.85rem; }
  .outcome-pts { font-size: 0.85rem; padding: 3px 8px; }

  /* Фильтры турниров: компактные табы на мобильных */
  .tabs-full { gap: 6px; margin-bottom: 10px; }
  .tabs-full .tab {
    font-size: 0.75rem;
    padding: 10px 6px;
    min-height: 44px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
  }
  .tournaments-phase-tabs .tab { flex: 1 1 28%; min-width: 0; }
  .tournaments-my-tabs .tab { flex: 1 1 45%; min-width: 0; }
  .tournaments-price-tabs .tab { flex: 1 1 28%; min-width: 0; }
  .tournaments-phase-tabs { margin-bottom: 8px; }
  .tournaments-my-tabs { margin-bottom: 8px; }
  .tournaments-price-tabs { margin-bottom: 12px; }

  /* Фильтры предикта ИИ: колонка на мобильных */
  .ai-predict-filters { padding: 12px; margin-bottom: 12px; }
  .ai-predict-filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .ai-predict-leagues-wrap { min-width: 0; }
  .ai-filter-leagues { gap: 8px; }
  .ai-league-chip {
    font-size: 0.78rem;
    padding: 8px 10px;
  }
  .ai-predict-dates-wrap {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .ai-date-input {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    padding: 12px 10px;
    box-sizing: border-box;
  }
}

@media (max-width: 380px) {
  .tabs-full .tab { font-size: 0.7rem; padding: 8px 4px; }
  .tournaments-phase-tabs .tab { flex: 1 1 30%; }
}
