: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; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 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; } }

/* Шкала джекпота: 12 побед над ИИ подряд в обычных турнирах → приз 500 USDT */
.jackpot-scale-panel {
  margin-bottom: 18px;
  padding: 16px 18px;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.14) 0%, rgba(212, 175, 55, 0.05) 50%, rgba(212, 175, 55, 0.08) 100%);
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden; /* защита от горизонтального вылета контента */
}
.jackpot-scale-panel * { box-sizing: border-box; max-width: 100%; }
.jackpot-scale-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
  text-align: left;
  text-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}
.jackpot-scale-segments {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
.jackpot-scale-segment {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: var(--border);
  overflow: hidden;
}
.jackpot-scale-segment-fill {
  height: 100%;
  min-width: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  transition: width 0.25s ease;
}
.jackpot-scale-segment-last-full .jackpot-scale-segment-fill {
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}
.jackpot-scale-superprize {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-bottom: 2px;
}
.jackpot-scale-actions {
  margin: 10px 0 0 0;
}
.jackpot-scale-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.jackpot-scale-actions-row .btn {
  flex: 1 1 120px;
  min-width: 0;
}

.jackpot-rules-modal-panel {
  max-width: 600px;
  width: calc(100% - 24px);
}
.jackpot-rules-body {
  max-height: min(78vh, 640px);
  overflow-y: auto;
}
.jackpot-rules-prose {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  text-align: left;
}
.jackpot-rules-prose p {
  margin: 0 0 10px 0;
}
.jackpot-rules-prose p:last-child {
  margin-bottom: 0;
}
.jackpot-rules-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.jackpot-rules-subtitle {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
}
.jackpot-rules-label {
  margin: 0 0 4px 0;
  font-size: 0.88rem;
}
.jackpot-rules-list {
  margin: 0 0 10px 0;
  padding-left: 1.2rem;
}
.jackpot-rules-list li {
  margin-bottom: 2px;
}
.jackpot-rules-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0 !important;
}
.jackpot-rules-superprize-line {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
}
.jackpot-rules-muted {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.jackpot-leaderboard-me {
  background: rgba(212, 175, 55, 0.12);
}
.jackpot-leaderboard-me td { color: var(--gold-light); }

/* Карточка группы турниров: друг под другом, выравнивание по левой стороне */
.tournaments-group-card.card {
  padding: 16px 18px;
  margin-bottom: 14px;
  text-align: left;
}
.tournaments-group-header {
  margin-bottom: 10px;
}
.tournaments-group-title {
  margin: 0 0 4px 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-light);
  line-height: 1.3;
  text-align: left;
}
.tournaments-group-title .badge {
  font-family: var(--font);
  font-size: 0.65rem;
  padding: 2px 6px;
  vertical-align: middle;
}
.tournaments-group-time {
  margin: 0;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
  letter-spacing: 0.02em;
  text-align: left;
}
.tournaments-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 8px;
  justify-content: flex-start;
}
.tournament-variant-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 0;
  min-width: min(100%, 110px);
}
.tournament-variant-stats {
  margin: 0 0 6px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: left;
}
.tournament-variant-cell .tournament-variant-btn {
  width: 100%;
}
.tournament-variant-btn {
  padding: 10px 14px;
  font-size: clamp(0.68rem, 1.9vw, 0.9rem); /* при нехватке места уменьшается у всех кнопок */
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.06) 100%);
  color: var(--gold-light);
  line-height: 1.15;
  white-space: nowrap;     /* "20 USDT" не переносится */
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tournament-variant-btn:hover {
  border-color: var(--gold-light);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.12) 100%);
  transform: translateY(-1px);
}
.tournament-variant-btn.is-paid {
  border-color: rgba(34, 197, 94, 0.6);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.08) 100%);
  color: #86efac;
}
.tournament-variant-btn.is-paid:hover {
  border-color: #22c55e;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.28) 0%, rgba(34, 197, 94, 0.14) 100%);
  transform: translateY(-1px);
}
@media (max-width: 420px) {
  .tournaments-group-title { font-size: 1.1rem; }
  .tournament-variant-cell { min-width: calc(33.333% - 6px); }
  .tournament-variant-btn { padding: 8px 6px; font-size: clamp(0.64rem, 2.8vw, 0.82rem); }
}

/* 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;
}
.lineups-table tbody tr.lineup-row-ai td.lineup-cell-success,
.lineups-table tbody tr.lineup-row-ai td.lineup-cell-fail {
  background: unset;
}
.lineups-table tbody tr.lineup-row-ai td.lineup-cell-success {
  background: rgba(34,197,94,0.18);
  color: #22c55e;
}
.lineups-table tbody tr.lineup-row-ai td.lineup-cell-fail {
  background: rgba(239,68,68,0.18);
  color: #ef4444;
}
.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; }
.fantasy-header { margin-bottom: 10px; }
.fantasy-header-title { margin: 0; font-weight: 800; font-size: 1.05rem; }
.fantasy-header-sub { margin: 6px 0 0 0; color: var(--text-muted); font-size: 0.86rem; }
.fantasy-tournaments-list { display: grid; gap: 10px; }
.fantasy-tournament-card { border: 1px solid rgba(255,255,255,0.08); }
.fantasy-tournament-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fantasy-tournament-title { margin: 0; font-size: 1rem; font-weight: 700; }
.fantasy-tournament-meta { margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.85rem; }
.fantasy-tournament-actions { margin-top: 10px; }
.fantasy-status-unpaid { color: #fca5a5; border: 1px solid rgba(252,165,165,0.35); }
.fantasy-lineup { margin-top: 10px; padding: 12px; }
.fantasy-lineup-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fantasy-lineup-progress { font-size: 0.78rem; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 3px 8px; color: var(--gold-light); }
.fantasy-pitch {
  position: relative;
  min-height: 300px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08) 0 1px, transparent 1px) 0 0/12px 12px,
    linear-gradient(180deg, rgba(26,119,66,0.35), rgba(16,78,44,0.35));
  margin-bottom: 12px;
}
.fantasy-pitch-slot {
  position: absolute;
  width: 46%;
  max-width: 190px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.82);
  color: var(--text);
  padding: 9px;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease;
}
.fantasy-pitch-slot:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 194, 88, 0.55);
}
.fantasy-slot-pos {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 4px;
}
.fantasy-slot-name {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fantasy-slot-gk { left: 4%; top: 44%; }
.fantasy-slot-def { left: 26%; top: 74%; }
.fantasy-slot-mid { left: 52%; top: 56%; }
.fantasy-slot-fwd { left: 26%; top: 24%; }
.fantasy-slot-flex { left: 52%; top: 9%; }
.fantasy-slots-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fantasy-slot-item {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.03);
}
.fantasy-slot-item-label { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 3px; }
.fantasy-slot-item-value { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fantasy-toolbar { margin-top: 10px; }
.fantasy-extra { margin-top: 10px; }
.fantasy-picker-head { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fantasy-search {
  min-width: 200px;
  flex: 1;
  max-width: 320px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.7);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 10px;
}
.fantasy-players-list { display: grid; gap: 7px; max-height: 360px; overflow: auto; }
.fantasy-player-row {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: 8px 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
.fantasy-player-row:hover { border-color: rgba(245, 194, 88, 0.5); }
.fantasy-player-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fantasy-player-name { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fantasy-player-club { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fantasy-player-pos { font-size: 0.72rem; color: var(--gold-light); border: 1px solid rgba(245,194,88,0.4); border-radius: 999px; padding: 2px 8px; }
@media (max-width: 640px) {
  .fantasy-pitch { min-height: 260px; }
  .fantasy-pitch-slot { width: 46%; max-width: none; padding: 7px; }
  .fantasy-slot-name { font-size: 0.76rem; }
  .fantasy-slots-grid { grid-template-columns: 1fr; }
  .fantasy-search { min-width: 0; max-width: none; width: 100%; }
}
.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-choice-double .lineup-choice-draw { font-size: 0.8rem; font-weight: 700; color: var(--gold-light); }
.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 tbody tr.leaderboard-row-ai { background: rgba(120, 160, 255, 0.06); }
.leaderboard-table tbody tr.leaderboard-row-ai td:first-child { color: var(--text-muted); }
.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: center; }
.outcome-btn--guest .outcome-btn-top { flex-direction: row-reverse; justify-content: center; }
.outcome-btn--guest .outcome-label { text-align: center; }
.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); }

/* Двойной шанс (1X / X2) — отдельный ряд под основными исходами */
.match-outcomes-double {
  grid-template-columns: 1fr 1fr;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.outcome-btn--double {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  background: rgba(212,175,55,0.08);
  border-color: rgba(212,175,55,0.25);
}
.outcome-btn--double .outcome-double-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.outcome-btn--double {
  min-width: 0;
}
.outcome-btn--double .outcome-pts {
  font-size: 0.85rem;
  padding: 3px 8px;
  flex-shrink: 0;
}
.outcome-btn--double:hover:not(:disabled) {
  border-color: rgba(212,175,55,0.5);
  background: rgba(212,175,55,0.12);
}
.outcome-btn--double.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  border-color: var(--gold);
}
.outcome-btn--double.active .outcome-double-label { color: #0a0e1a; }

/* 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); }
.jackpot-warning {
  font-size: 0.75rem; color: var(--text-muted);
  margin: 0 0 10px 0; padding: 8px 10px;
  background: rgba(212, 175, 55, 0.08); border-radius: var(--radius-sm);
  border-left: 3px solid rgba(212, 175, 55, 0.4);
}

/* ========== 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; }
  .match-outcomes-double {
    margin-top: 4px;
    padding-top: 6px;
    gap: 6px;
    grid-template-columns: 1fr;
  }
  .outcome-btn { padding: 10px 6px; }
  .outcome-btn--double {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
  .outcome-btn--double .outcome-double-label {
    font-size: 0.75rem;
    white-space: normal;
    text-overflow: unset;
    line-height: 1.25;
  }
  .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%; }
}

/* --- Турниры: панель фильтров (отдельные блоки + перенос текста во вкладках) --- */
.tournaments-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.tournaments-filter-block {
  padding: 8px 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.tournaments-filter-block-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  line-height: 1.2;
}
#screen-tournaments .tournaments-filters .tabs-full {
  gap: 5px;
  margin-bottom: 0;
  align-items: stretch;
}
#screen-tournaments .tournaments-filters .tab {
  padding: 7px 5px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 7px;
  box-shadow: none;
  min-height: 2.5em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Режим и этапы: одна строка, без переноса через дефис */
#screen-tournaments .tournaments-type-tabs .tab {
  white-space: nowrap;
  -webkit-hyphens: none;
  hyphens: none;
}
/* Этапы: короткие подписи, равные колонки */
#screen-tournaments .tournaments-phase-tabs .tab {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
  flex: 1 1 0;
  min-width: 0;
}
#screen-tournaments .tournaments-filter-block-header .tournaments-my-tabs .tab {
  flex: 0 1 auto;
  min-width: 2.75rem;
  white-space: nowrap;
  hyphens: none;
}
#screen-tournaments .tournaments-filters .tab.active {
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}
@media (min-width: 380px) {
  #screen-tournaments .tournaments-filters .tab {
    padding: 7px 7px;
    font-size: 0.78rem;
  }
}
@media (min-width: 420px) {
  #screen-tournaments .tournaments-filters .tab {
    font-size: 0.82rem;
    padding: 8px 8px;
  }
}

/* --- Турниры: первая строка — только вкладки «Турниры / Против ИИ» (заголовок h2 — sr-only) --- */
.tournaments-head-row {
  width: 100%;
  margin-bottom: 0;
}
.tournaments-head-row .tournaments-type-tabs {
  width: 100%;
  margin-bottom: 0;
  flex-wrap: nowrap;
}
/* --- Турниры: этап (полная ширина) и ниже — все/мои --- */
.tournaments-filter-block-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
}
.tournaments-filter-block-header .tournaments-filter-block-label {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: 0;
}
.tournaments-filter-block-header .tournaments-my-tabs {
  flex: 0 0 auto;
}
.tournaments-phase-strip {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}
.tournaments-phase-strip .tournaments-phase-tabs {
  width: 100%;
}
.tabs-inline {
  display: inline-flex;
  flex-wrap: nowrap;
  width: auto;
  flex: 0 0 auto;
  gap: 5px;
  margin-bottom: 0;
}
.tabs-inline .tab {
  flex: 0 1 auto;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
}
/* --- Турниры: подтип (обычные / против ИИ) --- */
.tournaments-type-tabs .tab {
  flex: 1 1 50%;
  min-width: 0;
  font-weight: 600;
}

/* --- Задания и колесо --- */
.quests-week-hint {
  margin: 0 0 12px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.quests-tickets-hint {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.quests-spins-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.quests-spins-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 140px;
}
.quests-spins-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quests-spins-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quests-spins-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
}
.quest-item {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.quest-item-title {
  font-weight: 700;
  margin: 0 0 6px 0;
  font-size: 0.95rem;
}
.quest-item-desc {
  margin: 0 0 10px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.quest-progress-track {
  height: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.quest-progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-light));
  transition: width 0.35s ease;
}
.quest-progress-meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.quest-done-badge {
  color: var(--success);
  font-weight: 600;
  font-size: 0.78rem;
}
.quests-admin-panel {
  margin-top: 20px;
}
.quests-admin-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 12px 0;
}
.quests-admin-note code {
  font-size: 0.72rem;
  color: var(--gold-light);
}
.quests-admin-list {
  font-size: 0.8rem;
  margin-bottom: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.quests-admin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.quests-admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quests-admin-form label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.quests-admin-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 0.9rem;
}
.quests-admin-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.quests-admin-row-inline .quests-admin-input {
  flex: 1 1 160px;
  min-width: 0;
}

.quest-group-card {
  margin-bottom: 20px;
  padding: 16px 16px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: linear-gradient(165deg, rgba(15, 20, 35, 0.95) 0%, rgba(10, 14, 26, 0.88) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.quest-group-title {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.quest-group-progress {
  margin: 0 0 12px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.quest-group-bonus {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}
.quest-group-list .quest-item {
  margin-bottom: 10px;
}
.quest-group-list .quest-item:last-child {
  margin-bottom: 0;
}

.fortune-wheel-modal-panel {
  max-width: 520px;
  background: linear-gradient(180deg, rgba(18, 22, 38, 0.98) 0%, rgba(8, 10, 18, 0.99) 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 175, 55, 0.12);
}
.fortune-wheel-modal-body {
  text-align: center;
}
.fortune-wheel-stage {
  position: relative;
  width: min(460px, 92vw);
  height: 156px;
  margin: 0 auto 20px;
}
.fortune-wheel-stage--kitoboy {
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}
.fortune-wheel-outer-glow {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: fortuneWheelGlowPulse 3.5s ease-in-out infinite;
}
@keyframes fortuneWheelGlowPulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}
.fortune-case-window {
  position: absolute;
  inset: 16px 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background:
    linear-gradient(180deg, rgba(17, 24, 40, 0.94) 0%, rgba(8, 12, 22, 0.95) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -16px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 2;
}
.fortune-case-track-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.fortune-case-track {
  position: absolute;
  top: 8px;
  left: 0;
  height: calc(100% - 16px);
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 0 0;
  transition: transform 4.4s cubic-bezier(0.12, 0.88, 0.16, 1);
  will-change: transform;
}
.fortune-case-item {
  width: 132px;
  min-width: 132px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(165deg, rgba(28, 38, 62, 0.95) 0%, rgba(17, 24, 38, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 6px 16px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 8px;
}
.fortune-case-item.is-usdt {
  border-color: rgba(34, 197, 94, 0.45);
}
.fortune-case-item.is-premium_days {
  border-color: rgba(147, 51, 234, 0.48);
}
.fortune-case-item.is-none {
  border-color: rgba(248, 113, 113, 0.36);
}
.fortune-case-label {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  color: #f8f6ef;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  margin: 0 0 6px 0;
}
.fortune-case-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.2;
}
.fortune-wheel-pointer {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
}
.fortune-wheel-pointer--kitoboy {
  top: 0;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(212, 175, 55, 0.45));
}
.fortune-case-pointer::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 18px;
  width: 2px;
  height: 100px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.75) 0%, rgba(212, 175, 55, 0.02) 100%);
}
.fortune-wheel-status {
  min-height: 2.5em;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.fortune-case-reveal {
  margin: 0 0 12px 0;
}
.fortune-case-reveal-card {
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: linear-gradient(165deg, rgba(30, 40, 62, 0.95) 0%, rgba(15, 20, 34, 0.95) 100%);
  padding: 10px 12px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.fortune-case-reveal-title {
  margin: 0 0 4px 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fortune-case-reveal-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-light);
}
.fortune-case-reveal-meta {
  margin: 4px 0 10px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.fortune-wheel-spin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}
.fortune-wheel-spin-actions .btn:disabled {
  opacity: 0.45;
}

/* Fantasy: отдельное мини-приложение /fantasy/ + блок в кабинете */
.fantasy-standalone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.fantasy-standalone-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  flex: 1;
  text-align: center;
  margin: 0;
}
.fantasy-standalone-main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.cabinet-fantasy-entry {
  margin-bottom: 14px;
}
.cabinet-fantasy-hint {
  font-size: 0.85rem;
  margin: 0 0 10px 0;
  line-height: 1.35;
}
.fantasy-empty-title { margin: 0 0 8px 0; font-weight: 700; }
.fantasy-empty-help { margin: 0; color: var(--text-muted); font-size: 0.86rem; line-height: 1.4; }
.fantasy-empty-help code { font-size: 0.78rem; }
.text-muted { color: var(--text-muted); }
