/* ===== CSS RESET & VARIABLES ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core backgrounds */
  --bg-primary:       #0b0f1a;
  --bg-secondary:     #111827;
  --bg-card:          #131922;
  --bg-card-hover:    #172030;
  --bg-input:         #0d1520;

  /* Glass / borders */
  --glass:            rgba(255, 255, 255, 0.03);
  --glass-border:     #1e2d40;

  /* Typography */
  --text-primary:     #e8edf5;
  --text-secondary:   #8b9ab0;
  --text-muted:       #4e5e74;
  --text-faint:       rgba(148, 163, 184, 0.7); /* nagyon halk meta/dátum/összekötő */

  /* Accents – indigo brand */
  --accent-1:         #6366f1;
  --accent-2:         #818cf8;
  --accent-3:         #a5b4fc;
  --accent-text:      #a5b4fc; /* accent szöveg indigo-tinten (aktív fül/gomb); light-ban sötétebb */

  /* Status */
  --green:            #22c55e;
  --red:              #ef4444;
  --yellow:           #f59e0b;

  /* Semantic theme tokens (dark baseline; light override jön a PR5-ben).
     surface/border = glass-overlay szintek; status-* = banner/badge bg/border/text.
     Dark = a kiváltott literálok kanonikus értéke (a szomszédos opacity-lépcsők ide snap-elnek). */
  --surface-1:             rgba(255, 255, 255, 0.03);
  --surface-2:             rgba(255, 255, 255, 0.05);
  --surface-3:             rgba(255, 255, 255, 0.08);
  --border-subtle:         rgba(255, 255, 255, 0.06);
  --border-medium:         rgba(255, 255, 255, 0.10);
  --status-success-bg:     rgba(34, 197, 94, 0.10);
  --status-success-border: rgba(34, 197, 94, 0.30);
  --status-success-text:   #4ade80;
  --status-danger-bg:      rgba(239, 68, 68, 0.10);
  --status-danger-border:  rgba(239, 68, 68, 0.25);
  --status-danger-text:    #f87171;
  --status-warning-bg:     rgba(245, 158, 11, 0.10);
  --status-warning-border: rgba(245, 158, 11, 0.25);
  --status-warning-text:   #facc15;
  --status-orange-text:    #f97316; /* "kérdéses" badge — distinct narancs (nem amber-warning) */
  --status-info-bg:        rgba(99, 102, 241, 0.15);
  --status-info-border:    rgba(99, 102, 241, 0.30);
  /* SOFT team-tintek (forma-panelek): halvány, EGYENLŐ súlyú két-szín (indigo + violet) */
  --status-info-bg-soft:   rgba(99, 102, 241, 0.06);
  --status-violet-bg-soft: rgba(139, 92, 246, 0.06);
  /* PENDING (függő tipp) — saját státusz-szín (violet), NEM info/warning */
  --status-pending-bg:     rgba(167, 139, 250, 0.12);
  --status-pending-border: rgba(167, 139, 250, 0.35);
  --status-pending-text:   #a78bfa;
  --text-strong:           #f1f5f9;

  /* Gradients */
  --gradient-main:    linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-cta:     linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-bg:      linear-gradient(160deg, #0b0f1a 0%, #0f1624 50%, #0b0f1a 100%);

  /* Shape */
  --radius-xs:        4px;
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --radius-xl:        18px;

  /* Shadow */
  --shadow:           0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg:        0 12px 48px rgba(0, 0, 0, 0.55);
  --shadow-inset:     inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* Motion */
  --transition:       all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== LIGHT THEME (opt-in: <html data-theme="light">) =====
   CSAK override-ol — a :root dark értékei BITRE érintetlenek (a dark mód nem változik).
   Default dark; a témát a header-toggle állítja, localStorage-ban perzisztálva. */
[data-theme="light"] {
  /* Core backgrounds */
  --bg-primary:       #f8fafc;
  --bg-secondary:     #ffffff;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f1f5f9;
  --bg-input:         #ffffff;

  /* Glass / borders */
  --glass:            rgba(15, 23, 42, 0.03);
  --glass-border:     rgba(15, 23, 42, 0.12);

  /* Typography */
  --text-primary:     #0f172a;
  --text-secondary:   #475569;
  --text-muted:       #64748b;
  --text-faint:       #475569; /* light: slate-600, hogy a halk meta is olvasható legyen */

  /* Accents – sötétebb indigo a fehér háttér kontrasztjához (text/link biztonság) */
  --accent-1:         #4f46e5;
  --accent-2:         #6366f1;
  --accent-3:         #818cf8;
  --accent-text:      #4338ca; /* light: indigo-700, olvasható az indigo-tintelt háttéren */

  /* --green/--red/--yellow base 500-ak változatlanok (badge-fill mindkét témán jó) */

  /* Gradients – a brand-gradient (main/cta) marad; csak a háttér vált világosra */
  --gradient-bg:      linear-gradient(160deg, #f8fafc 0%, #eef2ff 50%, #f8fafc 100%);

  /* Shadow – halvány, sötét-alfás (a fekete 0.45 túl nehéz lenne világoson) */
  --shadow:           0 4px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg:        0 12px 48px rgba(15, 23, 42, 0.14);
  --shadow-inset:     inset 0 1px 0 rgba(15, 23, 42, 0.04);

  /* Szemantikus tokenek – surface/border sötét-alfa világoson; status-text 700-as (4.5:1) */
  --surface-1:             rgba(15, 23, 42, 0.03);
  --surface-2:             rgba(15, 23, 42, 0.05);
  --surface-3:             rgba(15, 23, 42, 0.07);
  --border-subtle:         rgba(15, 23, 42, 0.10);
  --border-medium:         rgba(15, 23, 42, 0.16);
  --status-success-bg:     rgba(34, 197, 94, 0.12);
  --status-success-border: rgba(34, 197, 94, 0.40);
  --status-success-text:   #15803d;
  --status-danger-bg:      rgba(239, 68, 68, 0.10);
  --status-danger-border:  rgba(239, 68, 68, 0.35);
  --status-danger-text:    #b91c1c;
  --status-warning-bg:     rgba(245, 158, 11, 0.14);
  --status-warning-border: rgba(245, 158, 11, 0.40);
  --status-warning-text:   #854d0e;
  --status-orange-text:    #c2410c; /* light: narancs-700, hogy fehéren is olvasható legyen */
  --status-info-bg:        rgba(99, 102, 241, 0.12);
  --status-info-border:    rgba(99, 102, 241, 0.35);
  /* SOFT team-tintek light-ban (kicsit erősebb alfa, hogy fehéren is látszódjon, de egyenlő) */
  --status-info-bg-soft:   rgba(99, 102, 241, 0.08);
  --status-violet-bg-soft: rgba(139, 92, 246, 0.08);
  /* PENDING light: sötétebb violet a fehér-háttér kontraszthoz */
  --status-pending-bg:     rgba(139, 92, 246, 0.12);
  --status-pending-border: rgba(139, 92, 246, 0.35);
  --status-pending-text:   #6d28d9;
  --text-strong:           #0f172a;
}

/* Light: a dekoratív háttér-orbok tompítása (a brand-glow fehéren túl erős lenne) */
[data-theme="light"] .orb { opacity: 0.06; }

/* Header téma-toggle gomb (ikon-only) */
.btn-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-secondary);
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.btn-theme-toggle:hover { background: var(--surface-3); color: var(--text-primary); }

/* ===== BODY & BACKGROUND ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Subtle grid pattern for depth */
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, var(--status-info-bg), transparent),
    radial-gradient(ellipse 50% 35% at 85% 60%,  rgba(139,92,246,0.05), transparent),
    radial-gradient(ellipse 50% 35% at 15% 85%,  var(--status-info-bg), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Subtle static orbs – no animation, very faint */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 500px; height: 500px; background: #6366f1; top: -180px; left: -160px; }
.orb-2 { width: 400px; height: 400px; background: #7c3aed; bottom: -120px; right: -120px; }
.orb-3 { width: 260px; height: 260px; background: #0ea5e9; top: 45%; left: 48%; opacity: 0.05; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%       { transform: translate(12px,-8px) scale(1.02); }
}

/* ===== CONTAINER ===== */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 44px 24px 72px;
  position: relative;
  z-index: 1;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 52px;
  position: relative;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-3);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.header-badge .dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.header h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.header p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow), var(--shadow-inset);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--status-info-border);
}

.input-card {
  margin-bottom: 28px;
}

/* ===== FORM ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-input,
.form-select {
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

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

.form-input:focus,
.form-select:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--status-info-bg);
  background: var(--status-info-bg);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234e5e74' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== BUTTON – Analyze ===== */
.btn-analyze {
  width: 100%;
  padding: 15px 32px;
  font-size: 0.97rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: white;
  background: var(--gradient-main);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 18px var(--status-info-border);
}

.btn-analyze:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--status-info-border);
  filter: brightness(1.08);
}

.btn-analyze:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.96);
}

.btn-analyze:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--text-muted);
  box-shadow: none;
}

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

/* Spinner */
.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.active { display: inline-block; }

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

/* ===== RESULTS SECTION ===== */
.results-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.results-section.visible {
  opacity: 1;
  transform: translateY(0);
}

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

.results-header .icon {
  width: 38px; height: 38px;
  background: var(--gradient-main);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.results-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-header .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== VS SECTION ===== */
.vs-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--status-info-bg), rgba(139,92,246,0.04));
  border-radius: var(--radius-lg);
  border: 1px solid var(--status-info-bg);
}

.team-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.team-logo {
  width: 68px; height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.35));
  transition: transform 0.2s;
}
.team-logo:hover { transform: scale(1.08); }

.team-name {
  font-size: 0.97rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
}

.team-country {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-form {
  margin-top: 4px;
  padding: 5px 10px;
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  min-width: 0;
}
.team-form span {
  color: var(--accent-3);
  font-weight: 800;
  flex-shrink: 0;
}
/* Stat-sor felirat + vezető ikon (emoji helyett egységes inline SVG) */
.team-form .tf-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 1;
  color: var(--text-secondary);
  font-weight: 600;
}
.tf-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.tf-card {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,0.4));
}
/* Pörgő betöltés-ikon (⏳ helyett) */
@keyframes ico-spin { to { transform: rotate(360deg); } }
.ico.spin { animation: ico-spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ico.spin { animation: none; } }

.vs-divider {
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.vs-info-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.referee-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: var(--transition);
  animation: fadeIn 0.6s ease-out;
  white-space: nowrap;
}
.referee-pill:hover {
  background: var(--surface-2);
  border-color: var(--accent-3);
}
.referee-pill .cards-avg {
  color: var(--accent-3);
  font-weight: 800;
  background: var(--status-info-bg);
  padding: 1px 8px;
  border-radius: 5px;
}

/* ===== MATCHES TABLE ===== */
.matches-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.matches-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--surface-1);
}
.panel-header img { width: 22px; height: 22px; object-fit: contain; }
.panel-header span { font-weight: 700; font-size: 0.88rem; color: var(--text-primary); }

.match-list { padding: 6px; }

.match-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.match-item:hover { background: var(--surface-1); }
.match-item + .match-item { border-top: 1px solid var(--border-subtle); }

.match-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.match-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.match-team {
  font-size: 0.82rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}
.match-team.home { text-align: left; }
.match-team.away { text-align: right; }

.match-result {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-primary);
}
.match-result .sep { color: var(--text-muted); font-weight: 400; }

/* ===== ERROR STATE ===== */
.error-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  border-radius: var(--radius-md);
  color: var(--status-danger-text);
  font-size: 0.9rem;
}
.error-box .error-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ===== LOADING STATE ===== */
.loading-state {
  text-align: center;
  padding: 56px 20px;
}
.loading-state .spinner-large {
  width: 44px; height: 44px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}
.loading-state p { color: var(--text-secondary); font-size: 0.95rem; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.footer a { color: var(--accent-3); text-decoration: none; }
.footer a:hover { color: var(--accent-2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .container { padding: 20px 14px 48px; }
  .card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .matches-container { grid-template-columns: 1fr; }
  .vs-section { flex-direction: column; gap: 14px; }
  .vs-divider { font-size: 1.3rem; }
  .team-logo { width: 54px; height: 54px; }
}

/* ===== COOLDOWN BAR ===== */
.cooldown-bar {
  height: 3px;
  background: var(--gradient-main);
  border-radius: 3px;
  margin-top: 12px;
  transform-origin: left;
  animation: shrink 10s linear forwards;
}
@keyframes shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ===== AI SUMMARY MARKDOWN STYLING ===== */
#aiSummary {
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--text-primary);
}
#aiSummary h3 {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 1.15rem;
  color: var(--accent-3);
  display: flex;
  align-items: center;
  gap: 9px;
}
#aiSummary p { margin-bottom: 14px; }
#aiSummary strong { color: var(--accent-2); }
#aiSummary table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 18px 0;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
#aiSummary th {
  background: var(--status-info-bg);
  color: var(--accent-3);
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#aiSummary td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
#aiSummary tr:last-child td { border-bottom: none; }
#aiSummary tr:hover td { background: var(--surface-1); }
#aiSummary ul { margin-bottom: 14px; padding-left: 18px; list-style-type: none; }
#aiSummary li { position: relative; margin-bottom: 7px; }
#aiSummary li::before { content: "→"; position: absolute; left: -18px; color: var(--accent-3); font-weight: bold; }

/* AI Summary rich content */
.ai-summary-content {
  font-size: 0.93rem;
  line-height: 1.72;
  color: var(--text-primary);
}
.ai-summary-content h3 {
  font-size: 1.12rem;
  color: var(--accent-3);
  margin-top: 1.4rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.45rem;
}
.ai-summary-content h4 {
  font-size: 1rem;
  color: var(--accent-3);
  margin-top: 1.1rem;
  margin-bottom: 0.45rem;
  font-weight: 700;
}
.ai-summary-content p { margin-bottom: 0.9rem; }
.ai-summary-content strong { color: var(--accent-3); font-weight: 700; }
.ai-summary-content ul, .ai-summary-content ol { margin-bottom: 0.9rem; padding-left: 1.4rem; }
.ai-summary-content li { margin-bottom: 0.45rem; }
.ai-summary-content blockquote {
  border-left: 3px solid var(--accent-1);
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: var(--text-secondary);
}
.ai-summary-content blockquote.context-warning {
  border-left: 3px solid var(--yellow);
  background: var(--status-warning-bg);
  padding: 11px 15px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: normal;
  color: var(--text-primary);
}
.ai-summary-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.3rem 0;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}
.ai-summary-content th,
.ai-summary-content td {
  padding: 11px 15px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}
.ai-summary-content th {
  background: var(--surface-1);
  color: var(--accent-3);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-summary-content tr:last-child td { border-bottom: none; }
.ai-summary-content td { font-size: 0.88rem; color: var(--text-secondary); }

/* ===== MODERN LEAGUE SELECTOR ===== */
.league-selector-wrapper {
  margin-top: 8px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px;
}

.league-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.25);
  padding: 4px;
  border-radius: var(--radius-md);
}

.league-tab-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.league-tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-1);
}
.league-tab-btn.active {
  color: white;
  background: var(--gradient-main);
  box-shadow: 0 3px 12px var(--status-info-border);
}

.fav-count {
  background: rgba(0,0,0,0.3);
  color: var(--accent-3);
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
}
.league-tab-btn.active .fav-count {
  background: white;
  color: var(--accent-1);
}

.league-list-container {
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
  padding-right: 2px;
}
.league-list-container::-webkit-scrollbar { width: 5px; }
.league-list-container::-webkit-scrollbar-track { background: transparent; }
.league-list-container::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 10px;
}
.league-list-container::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }

.league-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.league-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--status-info-border);
}
.league-item.selected {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  box-shadow: 0 0 10px var(--status-info-bg);
}
.league-item-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.league-item-flag {
  width: 20px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.league-item-logo {
  width: 20px; height: 20px;
  object-fit: contain;
  background: white;
  padding: 2px;
  border-radius: 3px;
  flex-shrink: 0;
}
.league-item-name {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.league-item.selected .league-item-name { font-weight: 700; }

.league-item-star {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 3px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.league-item-star:hover { transform: scale(1.2); color: var(--yellow); }
.league-item-star.active { color: var(--yellow); text-shadow: 0 0 8px var(--status-warning-border); }

.no-leagues-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 16px;
  color: var(--text-secondary);
}
.no-leagues-placeholder .star-icon {
  font-size: 2rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  animation: pulse-star 2s ease-in-out infinite;
}
@keyframes pulse-star {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%       { transform: scale(1.1); opacity: 0.8; }
}

/* ===== COLLAPSED LEAGUE SELECTOR ===== */
.league-selector-collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-top: 4px;
  animation: fadeIn 0.2s ease-out;
}
.selected-league-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.selected-league-logo {
  width: 26px; height: 26px;
  object-fit: contain;
  border-radius: 3px;
  background: white;
  padding: 2px;
}
.selected-league-flag {
  width: 26px;
  height: auto;
  border-radius: 2px;
}
.selected-league-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.selected-league-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selected-league-country {
  font-size: 0.70rem;
  color: var(--text-secondary);
}
.btn-change-league {
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.70rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-change-league:hover {
  background: var(--gradient-main);
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 10px var(--status-info-border);
}

/* ===== MATCH COUNT TOGGLE ===== */
.match-count-toggle .toggle-btn.active {
  background: var(--gradient-main) !important;
  color: white !important;
  box-shadow: 0 2px 8px var(--status-info-border);
}

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

@media (max-width: 640px) {
  .league-list-container { grid-template-columns: 1fr; }
}

/* ===== HEADER ACTION BUTTONS ===== */
.header-action-buttons {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 10;
}

.btn-history-toggle {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: var(--transition);
}
.btn-history-toggle:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--text-primary);
}

.history-badge {
  background: var(--accent-1);
  color: white;
  border-radius: 50%;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-tracking-toggle {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: var(--transition);
}
.btn-tracking-toggle:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--text-primary);
}

.tracking-badge {
  background: var(--accent-1);
  color: white;
  border-radius: 50%;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .header-action-buttons {
    position: static;
    margin: 12px auto 0;
    justify-content: center;
  }
  .btn-history-toggle { position: static; }
}

/* ===== ANALYSIS HISTORY DRAWER ===== */
.history-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;  /* fallback régi böngészőknek */
  height: 100dvh; /* iOS Safari: a LÁTHATÓ viewport — különben a footer a toolbar mögé lóg */
  overflow: hidden;
  background: var(--bg-card);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 36px rgba(0,0,0,0.55);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.history-drawer.open { right: 0; }

.history-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-1);
}

.history-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.history-close-btn:hover {
  color: var(--red);
  background: var(--status-danger-bg);
}

.history-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-section-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-1);
  padding: 4px 2px 2px;
  border-bottom: 1px solid var(--status-info-border);
  margin-bottom: 2px;
}
.history-section-label--muted {
  color: var(--text-muted);
  border-bottom-color: var(--border-subtle);
  margin-top: 6px;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.history-card:hover {
  border-color: var(--status-info-border);
  background: var(--bg-card-hover);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.history-card-teams {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.history-card-details {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.history-card-actions { display: flex; gap: 7px; }

.btn-history-action {
  flex: 1;
  padding: 7px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  outline: none;
}

.btn-history-open {
  background: var(--gradient-main);
  border: none;
  color: white;
}
.btn-history-open:hover {
  box-shadow: 0 3px 10px var(--status-info-border);
  filter: brightness(1.08);
}

.btn-history-delete {
  background: var(--status-danger-bg);
  border: 1px solid rgba(239,68,68,0.18);
  color: var(--status-danger-text);
  flex-grow: 0;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-history-delete:hover {
  background: var(--red);
  border-color: transparent;
  color: white;
}

@media (max-width: 420px) {
  .history-drawer { width: 100%; right: -100%; }
}

/* ===== TRACKING DRAWER ===== */
.tracking-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  height: 100vh;  /* fallback régi böngészőknek */
  height: 100dvh; /* iOS Safari: a LÁTHATÓ viewport — különben a footer a toolbar mögé lóg */
  overflow: hidden;
  background: var(--bg-card);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 36px rgba(0,0,0,0.60);
  z-index: 1001;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.tracking-drawer.open { right: 0; }

.tracking-drawer-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-1);
}

/* ===== TRACKING STATS BAR ===== */
.tracking-stats-bar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255,255,255,0.015);
}
.tracking-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.tracking-stat-label {
  font-size: 0.63rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: center;
}
.tracking-stat-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}
.tracking-stat-hitrate {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--status-info-border);
  background: var(--status-info-bg);
}
.tracking-stat-hitrate .tracking-stat-label { font-size: 0.72rem; }
.tracking-stat-hitrate .tracking-stat-value { font-size: 1.35rem; }

/* ===== TRACKING TAB BAR ===== */
.tracking-tab-bar {
  flex-shrink: 0;
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-secondary);
}
.tracking-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  letter-spacing: 0.02em;
}
.tracking-tab:hover {
  color: var(--text-secondary);
}
.tracking-tab.active {
  color: var(--accent-1);
  border-bottom-color: var(--accent-1);
}

/* ===== TRACKING CONTENT ===== */
.tracking-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tracking-content::-webkit-scrollbar { width: 5px; }
.tracking-content::-webkit-scrollbar-track { background: transparent; }
.tracking-content::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 10px;
}
.tracking-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

/* ===== TRACKING CARD ===== */
.tracking-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 13px 15px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
  flex-shrink: 0;
}
.tracking-card:hover {
  border-color: var(--status-info-border);
  background: var(--bg-card-hover);
}
.tracking-card.status-won {
  border-color: var(--status-success-border);
  background: var(--status-success-bg);
}
.tracking-card.status-lost {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}
.tracking-card.status-void {
  border-color: var(--border-subtle);
  opacity: 0.65;
}

.tracking-card-match {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tracking-card-match-name {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tracking-card-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.tracking-card-market {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.tracking-card-selection {
  font-size: 0.93rem;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
}
.tracking-card-odd {
  font-size: 0.83rem;
  font-weight: 800;
  color: var(--accent-2);
  background: var(--status-info-bg);
  padding: 2px 9px;
  border-radius: 5px;
  border: 1px solid var(--status-info-border);
  white-space: nowrap;
}
.tracking-card-odd.no-odd {
  color: var(--text-muted);
  background: var(--surface-1);
  border-color: var(--border-subtle);
  font-weight: 500;
  font-size: 0.72rem;
}

/* Status badges */
.tracking-card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}
.status-badge-won {
  background: var(--status-success-bg);
  color: var(--green);
  border: 1px solid var(--status-success-border);
}
.status-badge-lost {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}
.status-badge-void {
  background: var(--surface-1);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.tracking-card-actions {
  display: flex;
  gap: 5px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.btn-status {
  flex: 1;
  min-width: 0;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid;
  text-align: center;
  white-space: nowrap;
}
.btn-status-won {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--green);
}
.btn-status-won:hover, .btn-status-won.active {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  box-shadow: 0 2px 8px var(--status-success-border);
}
.btn-status-lost {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger-text);
}
.btn-status-lost:hover, .btn-status-lost.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 2px 8px var(--status-danger-border);
}
.btn-status-void {
  background: var(--surface-1);
  border-color: var(--border-medium);
  color: var(--text-muted);
}
.btn-status-void:hover, .btn-status-void.active {
  background: var(--surface-3);
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.18);
}
.btn-status-delete {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-bg);
  color: rgba(252,165,165,0.55);
  flex: 0;
  min-width: 30px;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}
.btn-status-delete:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* ===== ADD TO TRACKING BUTTON ===== */
.btn-add-tracking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.70rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--accent-3);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.btn-add-tracking:hover:not(:disabled) {
  background: var(--accent-1);
  color: white;
  border-color: var(--accent-1);
  box-shadow: 0 2px 10px var(--status-info-border);
  transform: translateY(-1px);
}
.btn-add-tracking:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-1);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

@media (max-width: 420px) {
  .tracking-drawer { width: 100%; right: -100%; }
}

/* ===== BET SLIP FAB ===== */
/* A Visszajelzés gomb (#feedbackBtn) a jobb-alsó sarokban ül (bottom:24) → a
   szelvény-FAB FÖLÉ kerül, hogy ne olvadjon össze vele, amikor tipp kerül a szelvényre. */
.btn-slip-fab {
  position: fixed;
  bottom: 88px;
  right: 26px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--gradient-main);
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--status-info-border);
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-direction: column;
  gap: 2px;
}
.btn-slip-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px var(--status-info-border);
}

.slip-fab-count {
  position: absolute;
  top: -3px; right: -3px;
  background: white;
  color: var(--accent-1);
  border-radius: 50%;
  width: 19px; height: 19px;
  font-size: 0.62rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-1);
}

.slip-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  z-index: 1099;
  backdrop-filter: blur(3px);
}
.slip-overlay.show,
.slip-overlay.active { display: block; }

/* Drawer overlay (History + Tracking háttér) */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 999;
}
.drawer-overlay.show { display: block; }

/* ===== BET SLIP PANEL ===== */
.slip-panel {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  max-height: 78vh;
  max-height: 78dvh;
  background: var(--bg-card);
  border-top: 1px solid var(--status-info-border);
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  border-radius: 18px 18px 0 0;
  z-index: 1100;
  transition: bottom 0.38s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 36px rgba(0,0,0,0.55);
}
.slip-panel.open { bottom: 0; }

.slip-panel-handle {
  width: 34px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.slip-panel-header {
  padding: 13px 18px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  background: var(--surface-1);
}

.slip-items {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slip-items::-webkit-scrollbar { width: 4px; }
.slip-items::-webkit-scrollbar-track { background: transparent; }
.slip-items::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }

.slip-footer {
  padding: 12px 18px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.015);
  flex-shrink: 0;
}

.btn-slip-play {
  width: 100%;
  padding: 13px;
  background: var(--gradient-main);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.93rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 14px var(--status-info-border);
  letter-spacing: 0.2px;
}
.btn-slip-play:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px var(--status-info-border);
}

.btn-slip-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.70rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--accent-3);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.btn-slip-add:hover:not(:disabled) {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
  box-shadow: 0 2px 8px var(--status-info-border);
  transform: translateY(-1px);
}
.btn-slip-add:disabled {
  opacity: 0.50;
  cursor: not-allowed;
  background: var(--surface-1);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.slip-manual-odd {
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  width: 78px;
  text-align: center;
  transition: var(--transition);
}
.slip-manual-odd:focus {
  outline: none;
  border-color: var(--accent-1);
  background: var(--status-info-bg);
}
.slip-manual-odd::-webkit-inner-spin-button,
.slip-manual-odd::-webkit-outer-spin-button { opacity: 0; }

/* ===== PHASE 2 – HEADER NAV & HERO ===== */

/* Top nav sáv */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--glass-border);
}

/* Brand bal oldal */
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.header-brand-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.header-brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}
.header-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
/* Badge a brand-ban kisebb legyen */
.header-brand .header-badge {
  margin-bottom: 0;
  padding: 3px 10px;
  font-size: 0.65rem;
}

/* Header action buttons a nav-ban: position override */
.header-nav .header-action-buttons {
  position: static;
  flex-wrap: nowrap;
}

/* Hero szekció – h1 és p */
.header-hero {
  text-align: center;
}
.header-hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.header-hero p {
  color: var(--text-secondary);
  font-size: 0.97rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Ha nincs header-hero (örökölt .header h1 / .header p fallback) */
.header h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.header p  { font-size: 0.97rem; }

/* Érték-strip a hero alatt (onboarding): 3 tömör pont, mit kap a látogató */
.value-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.value-strip .vs-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
.value-strip .vs-item svg { color: var(--accent-text); flex-shrink: 0; }

/* "Próbáld ki egy példával" ghost-gomb az elemzés-gomb alatt */
.btn-try-example {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  background: none;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-try-example:hover {
  color: var(--accent-text);
  border-color: var(--accent-1);
  background: var(--status-info-bg-soft);
}

/* "Ma játszanak" modul (mai meccsek a népszerű ligákból, 1-kattintásos elemzéssel) */
.tm-card { margin-top: 18px; }
.tm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.tm-header svg { color: var(--accent-text); }
.tm-league { margin-top: 14px; }
.tm-league-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-medium);
}
.tm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.tm-time {
  min-width: 44px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.tm-live {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--status-danger-text);
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  border-radius: 5px;
  padding: 2px 6px;
}
.tm-teams {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-primary);
  flex-wrap: wrap;
}
.tm-teams img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.tm-vs { color: var(--text-faint); }
.tm-analyze {
  padding: 7px 14px;
  background: var(--surface-1);
  border: 1px solid var(--accent-1);
  border-radius: 8px;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.tm-analyze:hover { background: var(--accent-1); color: #fff; }
/* v2: nap-választó chipek */
.tm-day-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.tm-day-chip {
  padding: 6px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-transform: capitalize;
}
.tm-day-chip:hover { border-color: var(--accent-1); color: var(--accent-text); }
.tm-day-chip.active { background: var(--accent-1); border-color: var(--accent-1); color: #fff; }
/* v2: összecsukott "további ligák" sorok */
.tm-rest-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-medium);
}
.tm-collapsed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 4px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s, background 0.2s;
}
.tm-collapsed-row:hover { color: var(--text-primary); background: var(--surface-1); }
.tm-collapsed-row .tm-cr-caret { color: var(--text-faint); font-size: 0.7rem; transition: transform 0.2s; display: inline-block; }
.tm-collapsed-row.open .tm-cr-caret { transform: rotate(90deg); }
.tm-collapsed-row .tm-cr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-collapsed-row .tm-cr-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-faint);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 8px;
}
.tm-cr-holder { padding-left: 10px; }
@media (max-width: 480px) {
  .tm-teams { font-size: 0.8rem; }
  .tm-analyze { padding: 6px 10px; }
}

/* Egyszeri vendég regisztráció-nudge az első elemzés-eredmény tetején */
.reg-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: var(--status-info-bg-soft);
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  animation: fadeIn 0.5s ease-out;
}
.reg-nudge .rn-cta {
  color: var(--accent-text);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.reg-nudge .rn-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 0;
}
.reg-nudge .rn-close:hover { color: var(--text-primary); background: var(--surface-2); }

/* Mobil: nav sáv stack-elés */
@media (max-width: 640px) {
  .header-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 24px;
  }
  .header-nav .header-action-buttons {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ===== PHASE 2 – VS INPUT ROW ===== */

.vs-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.vs-input-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  position: relative;
}

/* FEAT-2: csapatnév-tipp dropdown */
.team-suggest {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  margin-top: 5px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border, var(--border-medium));
  border-radius: var(--radius-md, 10px);
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
}
.team-suggest-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary, var(--text-strong));
  transition: background 0.15s;
}
.team-suggest-item:hover { background: var(--status-info-bg); }
.team-suggest-item img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }

/* Csapat inputok középre igazítva, nagyobb betűk */
.vs-team-input {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 12px;
  letter-spacing: 0.1px;
}
.vs-team-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--status-info-bg);
  background: var(--status-info-bg);
}

/* VS jelvény a két input között */
.vs-center-badge {
  flex-shrink: 0;
  width: 44px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-main);
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  margin-bottom: 1px;
  box-shadow: 0 4px 14px var(--status-info-border);
  user-select: none;
}

/* Mobil: VS layout stack */
@media (max-width: 480px) {
  .vs-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .vs-center-badge {
    width: 100%;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
  }
  .vs-team-input {
    text-align: left;
  }
}

/* ===== PHASE 3 – EREDMÉNY TABS ===== */

.result-tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 20px;
  background: rgba(0,0,0,0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.result-tabs::-webkit-scrollbar { display: none; }

.result-tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.result-tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}
.result-tab-btn.active {
  background: var(--gradient-main);
  color: white;
  font-weight: 700;
  box-shadow: 0 3px 12px var(--status-info-border);
}

/* Tab panelek: csak az active látszik */
.result-tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}
.result-tab-panel.active {
  display: block;
}

@media (max-width: 480px) {
  .result-tab-btn {
    padding: 9px 12px;
    font-size: 0.78rem;
  }
}

/* ===== PHASE 4 – MOBILE OPTIMIZATION ===== */

/* --- iOS zoom prevention ---
   Safari zoom-ol ha input font-size < 16px. Fix: force 16px mobilon */
@media (max-width: 768px) {
  .form-input,
  .vs-team-input,
  .slip-manual-odd,
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* --- Touch targets: minden kattintható elem min 44×44px ---  */
@media (max-width: 768px) {
  .btn-history-toggle,
  .btn-tracking-toggle,
  .history-close-btn,
  .result-tab-btn,
  .btn-slip-add,
  .btn-analyze,
  .league-item,
  .league-tab-btn,
  .slip-item-remove {
    min-height: 44px;
  }
  /* Analyze gomb teljes széles mobilon */
  .btn-analyze {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
  }
}

/* --- Injury grid: 2-col → 1-col kis képernyőn --- */
@media (max-width: 540px) {
  .injury-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* --- Market tips grid (BTTS/Gól/Szöglet/Lapok): 2-col → 1-col mobilon --- */
@media (max-width: 540px) {
  .market-tips-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Dupla Esély grid: 3-col → 1-col nagyon kis képernyőn --- */
@media (max-width: 400px) {
  .dc-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* --- OCR szerkesztő grid: 2-col → 1-col mobilon --- */
@media (max-width: 480px) {
  .ocr-edit-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Slip Panel: teljes széles mobilon --- */
@media (max-width: 540px) {
  .slip-panel {
    width: 100% !important;
    right: 0 !important;
    left: 0 !important;
    transform: none !important; /* mobilon a desktop-központosító translateX(-50%) lelógatná balra */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    max-height: 85vh;
    max-height: 85dvh;
  }
}

/* --- History & Tracking Drawer: teljes széles mobilon --- */
@media (max-width: 480px) {
  .history-drawer,
  .tracking-drawer {
    width: 100% !important;
    right: -100% !important;
  }
  .history-drawer.open,
  .tracking-drawer.open {
    right: 0 !important;
  }
}

/* --- AI összefoglaló Markdown táblázat: vízszintes görgetés --- */
@media (max-width: 768px) {
  .ai-summary-content table,
  #tabPanelAI table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }
  /* AI szöveg font mérete */
  .ai-summary-content,
  #tabPanelAI {
    font-size: 0.9rem;
    line-height: 1.65;
  }
}

/* --- Tracking Stats Bar: 2-soros grid mobilon --- */
@media (max-width: 540px) {
  .tracking-stats-bar {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px !important;
  }
  .tracking-stat-item {
    text-align: center;
  }
  .tracking-stat-hitrate {
    grid-column: span 3;
    border-top: 1px solid var(--glass-border);
    padding-top: 8px;
  }
}

/* --- FAB (Bet Slip) pozíció mobilon --- */
@media (max-width: 480px) {
  .btn-slip-fab {
    bottom: 80px !important;
    right: 16px !important;
    width: 52px !important;
    height: 52px !important;
    font-size: 1.3rem !important;
  }
}

/* --- Input card padding mobilon --- */
@media (max-width: 480px) {
  .input-card {
    padding: 16px !important;
  }
  .card {
    padding: 16px;
  }
}

/* --- Eredmény kártya VS fejléc mobilon --- */
@media (max-width: 480px) {
  .result-vs-section {
    padding: 16px !important;
  }
  .team-name {
    font-size: 0.9rem !important;
  }
  .team-score {
    font-size: 1.8rem !important;
  }
  .vs-divider {
    font-size: 0.8rem !important;
  }
}

/* --- Prediction piac csempék mobilon --- */
@media (max-width: 480px) {
  .prediction-section {
    padding: 12px 14px !important;
  }
  .market-tile {
    padding: 10px 8px !important;
  }
}

/* --- Stat boxok mobilon --- */
@media (max-width: 480px) {
  .stat-box {
    padding: 10px 8px !important;
  }
  .stat-box-value {
    font-size: 1.1rem !important;
  }
}

/* --- Header action buttons: 480px alatt a 3 funkció-gomb FELIRATTAL (egyértelmű),
       a téma + auth ikon marad (univerzális). A korábbi "csak ikon" kétértelmű volt
       (vendégként a Tippjeim + Auto-Szelvény egyforma lakat). --- */
@media (max-width: 480px) {
  .btn-auth-toggle .btn-label { display: none; } /* user-ikon univerzális → felirat nélkül */
  .btn-history-toggle .btn-label,
  .btn-tracking-toggle .btn-label,
  .btn-autoslip-toggle .btn-label {
    display: inline;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0;
  }
  /* magasabb specifikusság, hogy felülírja a .header-nav .header-action-buttons nowrap-et */
  .header-nav .header-action-buttons {
    flex-wrap: wrap;      /* ha nem fér ki egy sorba (pl. 360px), tördeljen (ne lógjon le/vágódjon) */
    row-gap: 6px;
    justify-content: flex-end;
  }
  .btn-history-toggle,
  .btn-tracking-toggle,
  .btn-autoslip-toggle,
  .btn-auth-toggle {
    padding: 6px 8px !important;
    gap: 3px !important;
  }
  /* Sync pill: csak az ikon marad mobilon */
  .sync-status span:last-child {
    display: none;
  }
  .sync-status {
    padding: 4px 7px !important;
    font-size: 0.72rem !important;
  }
}

/* --- Header action buttons mobilon kisebb méret --- */
@media (max-width: 380px) {
  .btn-history-toggle,
  .btn-tracking-toggle {
    font-size: 0.75rem !important;
    padding: 7px 8px !important;
  }
  .header-brand-name {
    font-size: 0.9rem !important;
  }
}

/* --- Container padding mobilon --- */
@media (max-width: 480px) {
  .container {
    padding: 12px 12px 40px !important;
  }
}

/* --- Footer mobilon --- */
@media (max-width: 480px) {
  .footer {
    font-size: 0.75rem;
    padding: 20px 0 12px;
  }
}

/* --- OCR Modal mobilon --- */
@media (max-width: 480px) {
  #ocrModal {
    width: 98vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
  }
}

/* --- League selector mobilon --- */
@media (max-width: 480px) {
  .league-item {
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
  }
  .league-tabs {
    gap: 4px !important;
  }
  .league-tab-btn {
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }
}

/* --- Görgetés simítása minden görgethető területen --- */
@media (max-width: 768px) {
  .history-content,
  .tracking-content,
  .slip-items,
  #ocrModalBody,
  .league-list-container {
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== AUTO-SLIP PANEL ===== */

.btn-autoslip-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.btn-autoslip-toggle:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--text-primary);
}

.autoslip-badge {
  background: var(--accent-1);
  color: white;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
}

/* Panel (alulról csúszik fel, mint a slip panel) */
.autoslip-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 460px;
  max-height: 85vh;
  max-height: 85dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--status-info-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: -8px -4px 40px rgba(0,0,0,0.55);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.autoslip-panel.open {
  transform: translateY(0);
}

.autoslip-panel-handle {
  width: 36px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.autoslip-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.autoslip-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.autoslip-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

/* Konfigurátor sor */
.autoslip-config {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.autoslip-config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.autoslip-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 90px;
  flex-shrink: 0;
}

/* Slider */
.autoslip-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.autoslip-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(to right, var(--accent-1) var(--pct, 75%), var(--surface-3) var(--pct, 75%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.autoslip-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-1);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--status-info-border);
}
.autoslip-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-1);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px var(--status-info-border);
}
.autoslip-slider-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-2);
  min-width: 38px;
  text-align: right;
}

/* Odds slider — kissé más árnyalat a megkülönböztetéshez */
.autoslip-slider-odds::-webkit-slider-thumb {
  background: var(--accent-2);
  box-shadow: 0 2px 8px rgba(129,140,248,0.45);
}
.autoslip-slider-odds::-moz-range-thumb {
  background: var(--accent-2);
  box-shadow: 0 2px 8px rgba(129,140,248,0.45);
}
#asMinOddsVal {
  color: var(--accent-3);
}

/* Count selector */
.autoslip-count-btns {
  display: flex;
  gap: 6px;
}
.autoslip-count-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.autoslip-count-btn.active,
.autoslip-count-btn:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-3);
}

/* Dátum gombok */
.autoslip-date-btns {
  display: flex;
  gap: 6px;
}
.autoslip-date-btn {
  padding: 7px 14px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.autoslip-date-btn.active,
.autoslip-date-btn:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-3);
}

/* Liga multi-select */
.autoslip-league-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Preset gyorsgombok */
.as-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.as-preset-btn {
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}
.as-preset-btn:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-3);
}
.as-preset-clear {
  color: var(--text-muted);
}
.as-preset-clear:hover {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger-text);
}

/* Kiválasztva számláló */
.as-league-counter {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 2px 0;
}

/* Figyelmeztetés sok liga esetén */
.as-league-warning {
  font-size: 0.72rem;
  color: var(--status-warning-text);
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1.45;
}

/* Liga csoportok */
.as-league-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.as-league-group-label {
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.as-league-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.autoslip-league-chip {
  padding: 5px 12px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  user-select: none;
}
.autoslip-league-chip.selected {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-3);
}

/* Generálás gomb */
.btn-autoslip-generate {
  width: 100%;
  padding: 14px;
  background: var(--gradient-main);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
  box-shadow: 0 3px 14px var(--status-info-border);
}
.btn-autoslip-generate:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--status-info-border);
}
.btn-autoslip-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Pick kártyák */
.autoslip-pick-card {
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: var(--transition);
}
.autoslip-pick-card:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
}
.autoslip-pick-teams {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.autoslip-pick-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.autoslip-pick-market {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.autoslip-pick-selection {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent-2);
}
.autoslip-pick-prob {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--status-info-bg);
  color: var(--accent-3);
  border: 1px solid var(--status-info-border);
}
.autoslip-pick-odd {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-2);
}
.autoslip-pick-league {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Összesítő sor */
.autoslip-summary-bar {
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-around;
  gap: 8px;
  flex-wrap: wrap;
}
.autoslip-summary-item {
  text-align: center;
}
.autoslip-summary-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.autoslip-summary-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-2);
}

/* Warning szalag */
.autoslip-warning {
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--status-warning-text);
  margin-bottom: 10px;
}

/* Empty state */
.autoslip-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.autoslip-empty-icon { font-size: 2.2rem; margin-bottom: 10px; }

/* Hozzáadás gomb a footer-ben */
.btn-autoslip-add-all {
  width: 100%;
  padding: 13px;
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-md);
  color: var(--accent-3);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.btn-autoslip-add-all:hover {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--status-info-border);
}

/* Mobil */
@media (max-width: 540px) {
  .autoslip-panel {
    width: 100% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 88vh;
    max-height: 88dvh;
  }
  .autoslip-config-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .autoslip-label {
    min-width: unset;
  }
}

/* ===== CUSTOM PICK WIZARD ===== */

.cp-market-btn,
.cp-line-btn,
.cp-dir-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--surface-1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.cp-market-btn:hover,
.cp-line-btn:hover,
.cp-dir-btn:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-1);
}

.cp-market-btn.active,
.cp-line-btn.active,
.cp-dir-btn.active {
  background: var(--status-info-border);
  border-color: var(--status-info-border);
  color: var(--accent-text);
  font-weight: 800;
}

/* ===== AUTH GOMB (HEADER) ===== */

.btn-auth-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--surface-1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-auth-toggle:hover {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-text);
}
.btn-auth-toggle.auth-logged-in {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--accent-text);
}

/* ===== SYNC STÁTUSZ JELZŐ ===== */

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
}

/* Kis színes pötty az állapot színével (emoji helyett) */
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Egységes háttér — az állapotot csak a pötty + a szövegszín jelzi */
.sync-status.pending { color: var(--status-warning-text); }
.sync-status.syncing { color: var(--accent-text); }
.sync-status.success { color: var(--status-success-text); }
.sync-status.offline { color: var(--status-danger-text); }
.sync-status.error   { color: var(--status-danger-text); }
.sync-status.guest   { color: var(--text-secondary); }

.sync-status.syncing .sync-dot { animation: syncPulse 1s ease-in-out infinite; }
@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ===== AUTH MODAL ===== */

.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.auth-modal-overlay.open {
  display: flex;
}
.auth-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 40px);
  margin: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  animation: fadeIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.auth-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.auth-tab.active {
  background: var(--status-info-border);
  color: var(--accent-text);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 4px;
}
.auth-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.auth-field input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--surface-2);
  color: var(--text-strong);
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.auth-field input:focus {
  border-color: var(--status-info-border);
  background: var(--status-info-bg);
}

.auth-submit-btn {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--status-info-border), rgba(139,92,246,0.9));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--status-info-border);
}

.auth-error {
  padding: 8px 12px;
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  border-radius: 7px;
  color: var(--status-danger-text);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.auth-action-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-medium);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  text-align: left;
}
.auth-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* ── Feedback gomb ─────────────────────────────────────────────────────────── */
#feedbackBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--status-info-border);
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.3px;
}
#feedbackBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--status-info-border);
}

/* ── Feedback modal ────────────────────────────────────────────────────────── */
.feedback-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1100;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 80px 24px 24px 24px;
}
.feedback-modal-overlay.open {
  display: flex;
}
.feedback-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: slideUpFade 0.2s ease-out;
}
.feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── UX-1: prefers-reduced-motion (a11y) ──────────────────────────────────────
   Aki rendszerszinten kevesebb mozgást kér, annak lecsökkentjük/leállítjuk az
   animációkat (háttér-orbök, fadeIn, spinner, transitionök). Vesztibuláris
   zavar elkerülése + akku/CPU kímélése. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .orb { animation: none !important; }
}

/* ── UX-2: látható billentyűzet-fókusz (a11y) ─────────────────────────────────
   Minden interaktív elem kap egy jól látható fókuszgyűrűt billentyűs
   navigációnál. Egérkattintásnál nem villan (csak :focus-visible). */
:focus-visible {
  outline: 2px solid var(--accent-1, #6366f1);
  outline-offset: 2px;
  border-radius: var(--radius-sm, 6px);
}
:focus:not(:focus-visible) { outline: none; }

/* ── UX-3: tap-terület ≥44px a kis gomboknál (touch-target, a11y/mobil) ───────
   A vizuális méret változatlan marad (a × ugyanakkora), csak a kattintható
   terület nő a középre igazítással. */
.history-close-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tracking-tab,
.league-tab-btn { min-height: 44px; }

/* ── UX-5: Lucide ikonok igazítása a gombok szövegéhez ───────────────────────── */
.lucide, [data-lucide] {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  display: inline-block;
  flex-shrink: 0;
  stroke-width: 2;
}

/* Felállás-korrekció gombok (hazai/vendég/semleges) */
.venue-fix-btn {
  padding: 5px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-1);
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.venue-fix-btn:hover { background: var(--status-info-border); }
