/* VM-TIPSET 2026 — lekfull, fotbollsfärgad design.
   Färger inspirerade av värdländernas flaggor: Kanada-röd, USA-blå, Mexiko-grön. */
:root {
  --green:     #1a8f3b;
  --green-dk:  #0f5e25;
  --red:       #d6202b;
  --blue:      #1c3b8a;
  --gold:      #ffc933;
  --bg:        #0d1b2a;
  --card:      #ffffff;
  --ink:       #0a1421;
  --muted:     #6b7a8a;
  --grass-lo:  #2fa84a;
  --grass-hi:  #1a8f3b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); }
body {
  background:
    radial-gradient(ellipse at top, #16324f 0%, var(--bg) 60%) fixed,
    repeating-linear-gradient(180deg, transparent 0 80px, rgba(255,255,255,0.02) 80px 81px);
  min-height: 100vh;
}

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(90deg, var(--red), var(--blue) 50%, var(--green));
  color: white;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  flex-wrap: wrap; gap: 12px;
}
.topbar .logo {
  display: flex; align-items: center; gap: 10px;
  color: white; text-decoration: none; font-size: 20px;
  flex: 1; min-width: 0;
}
.topbar .logo .ball { font-size: 28px; animation: spin 8s linear infinite; display: inline-block; }
.topbar .logo .trophy {
  display: inline-block;
  animation: spin-y 4s linear infinite;
  transform-style: preserve-3d;
  perspective: 600px;
  font-size: 28px;
  line-height: 1;
}
.topbar .logo .trophy img {
  height: 36px; width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.topbar .logo .trophy-3d {
  width: 60px; height: 60px;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  vertical-align: middle;
  pointer-events: none;
}
@media (max-width: 720px) {
  .topbar .logo .trophy-3d { width: 44px; height: 44px; }
}
.topbar .logo .title { font-weight: 600; letter-spacing: 1px; }
.topbar .logo .title strong { color: var(--gold); }
.topbar .logo .flags { font-size: 22px; letter-spacing: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-y { to { transform: rotateY(360deg); } }

/* Hamburger-meny — samma stil som user-menu-dropdown */
.topbar nav {
  display: none;
  position: absolute;
  top: calc(100% + 10px); right: 12px;
  flex-direction: column;
  gap: 0;
  background: white;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 8px;
  min-width: 260px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: 99;
  animation: user-menu-pop 0.16s ease-out;
  transform-origin: top right;
}
/* Pil uppåt mot hamburger-knappen */
.topbar nav::before {
  content: ""; position: absolute;
  top: -5px; right: 18px;
  width: 10px; height: 10px;
  background: white;
  transform: rotate(45deg);
  box-shadow: -1px -1px 0 rgba(0,0,0,0.04);
}
.topbar.nav-open nav { display: flex; }
.topbar nav a, .topbar nav button {
  color: var(--ink);
  background: none;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background 0.12s, transform 0.12s;
  white-space: normal;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  text-align: left;
  width: 100%;
  font-family: inherit;
  border: none;
  cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  transform: translateX(2px);
}
.topbar nav a.cta {
  background: var(--gold); color: var(--ink); font-weight: 700;
  margin: 4px 0; border-radius: 10px; justify-content: center;
}
.topbar nav a.cta:hover { background: #ffd95c; transform: none; }
.topbar nav a.admin-link {
  background: rgba(0,0,0,0.06);
  font-weight: 600;
}
.topbar nav a.admin-link:hover { background: rgba(0,0,0,0.1); }
.topbar nav .muted { color: var(--muted); font-size: 14px; }

/* ---------- PWA INSTALL-BANNER ---------- */
.pwa-install-banner {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  z-index: 250; max-width: 540px; margin: 0 auto;
  background: white; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; line-height: 1.35;
  border-left: 4px solid var(--green);
}
.pwa-install-banner[hidden] { display: none !important; }
.pwa-install-icon { font-size: 24px; flex-shrink: 0; }
.pwa-install-text { flex: 1; color: var(--ink); }
.pwa-install-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: #777;
  padding: 4px 8px;
}
.pwa-install-close:hover { color: var(--red); }
@media (max-width: 480px) {
  .pwa-install-banner { flex-wrap: wrap; }
  .pwa-install-text { flex-basis: 100%; }
}

/* ---------- LIGA-EDITOR-BAR (Tippar för: dropdown) ---------- */
.league-editor-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0 16px; padding: 10px 14px;
  background: linear-gradient(135deg, #fff8e0 0%, #fff2c2 100%);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
}
.league-editor-bar label { font-weight: 700; flex-shrink: 0; }
.league-editor-bar select {
  padding: 7px 12px; border-radius: 8px; border: 1px solid #cbd5e1;
  font-size: 14px; font-family: inherit; cursor: pointer;
  background: white;
  flex: 1; min-width: 0;
  max-width: 100%;
}
@media (max-width: 520px) {
  .league-editor-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .league-editor-bar select {
    width: 100%;
    /* text-overflow funkar inte i alla browsers på select, men padding-right ger luft */
    padding-right: 28px;
  }
}

/* ---------- IMPACT-BANNER (förändringspåverkan-varning) ---------- */
.impact-banner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; margin: 14px 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8e1 0%, #ffeaa7 100%);
  border-left: 6px solid #f0b400;
  box-shadow: 0 4px 14px rgba(240, 180, 0, 0.18);
}
.impact-banner .impact-icon { font-size: 28px; line-height: 1; }
.impact-banner .impact-body { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; color: #5b3d00; }
.impact-banner .impact-body strong { color: #3a2700; }

/* Impact-panel — visuellt rik med gradient-header och chip-listor */
.impact-panel {
  background: white;
  border-radius: 16px; margin: 16px 0 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(240, 180, 0, 0.18), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #fde68a;
}
.impact-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white; padding: 18px 22px;
  display: flex; align-items: center; gap: 14px;
}
.impact-header-icon {
  font-size: 32px; line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  animation: impact-pulse 2.4s ease-in-out infinite;
}
@keyframes impact-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.impact-header h3 {
  margin: 0 !important; color: white;
  font-size: 18px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
  display: flex; align-items: center;
}
.impact-header-sub {
  display: block; font-size: 13px; font-weight: 400;
  opacity: 0.92; margin-top: 2px;
}

.impact-block { padding: 18px 22px; border-bottom: 1px solid #f1f5f9; }
.impact-block:last-child { border-bottom: none; }
.impact-block-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--ink);
  margin-bottom: 12px;
}
.impact-block-title .emoji { font-size: 22px; }

.impact-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 14px; }
@media (max-width: 720px) { .impact-cols { grid-template-columns: 1fr; } }
.impact-col {
  padding: 12px 14px; border-radius: 12px;
  background: #f8fafc;
}
.impact-col.removed {
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
}
.impact-col.added {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
}
.impact-col-title {
  font-size: 12px; font-weight: 800;
  margin-bottom: 10px; text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}
.impact-col.removed .impact-col-title { color: #991b1b; }
.impact-col.added .impact-col-title { color: #065f46; }
.impact-col-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 999px;
  font-size: 12px; padding: 0 6px;
}
.impact-col.removed .impact-col-count { background: #b91c1c; color: white; }
.impact-col.added .impact-col-count { background: #047857; color: white; }

.impact-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.impact-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: white;
  padding: 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.impact-chip .fi { width: 16px; height: 12px; border-radius: 2px; }
.impact-col.removed .impact-chip { color: #7f1d1d; }
.impact-col.added .impact-chip { color: #064e3b; }

.impact-goals {
  display: flex; align-items: center; gap: 16px;
  margin: 8px 0 14px; flex-wrap: wrap;
}
.impact-goals-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 18px; border-radius: 12px;
  background: #f1f5f9; min-width: 90px;
}
.impact-goals-box.current { background: #fef2f2; }
.impact-goals-box.predicted { background: #ecfdf5; }
.impact-goals-num { font-size: 30px; font-weight: 800; line-height: 1; }
.impact-goals-box.current .impact-goals-num { color: #991b1b; }
.impact-goals-box.predicted .impact-goals-num { color: #065f46; }
.impact-goals-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #475569; margin-top: 4px; }
.impact-arrow { font-size: 24px; color: #94a3b8; }

.impact-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0 0; border-top: 1px dashed #e2e8f0; margin-top: 10px;
}
.impact-footer {
  padding: 12px 22px 16px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  text-align: center;
}
.impact-dismiss {
  background: none; border: none; cursor: pointer;
  color: #92400e; font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 6px 10px; border-radius: 6px;
}
.impact-dismiss:hover { background: rgba(146, 64, 14, 0.08); }

/* ---------- GOALS-LISTA (på match-vy) ---------- */
.goals-list { margin: 14px 0 20px; padding: 14px 18px; background: #f4f7fb; border-radius: 12px; }
.goals-list h3 { margin-top: 0; color: var(--green-dk); }
.goals { list-style: none; margin: 0; padding: 0; }
.goal-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 14px; }
.goal-row:last-child { border-bottom: none; }
.goal-min { font-weight: 700; color: var(--blue); min-width: 38px; }
.goal-scorer { font-weight: 600; }
.goal-team { color: #777; font-size: 13px; }
.goal-tag { background: var(--blue); color: white; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.goal-tag.own { background: var(--red); }

/* ---------- TIP-HELPERS (Joker + Dagens utmaning på Mitt tips) ---------- */
.tip-helpers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 14px 0 20px;
}
@media (max-width: 720px) {
  .tip-helpers { grid-template-columns: 1fr; }
}
.tip-helper {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px;
  background: white;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-left: 6px solid;
  position: relative; overflow: hidden;
}
.tip-helper-joker { border-left-color: var(--gold);
  background: linear-gradient(135deg, #fffbe6 0%, #fff7d6 100%); }
.tip-helper-fire { border-left-color: #f0533a;
  background: linear-gradient(135deg, #fff1ec 0%, #ffe2d6 100%); }
.tip-helper-icon {
  font-size: 32px; line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.tip-helper-body { flex: 1; min-width: 0; }
.tip-helper-title {
  font-weight: 700; font-size: 15px;
  color: var(--ink); margin-bottom: 4px;
  line-height: 1.25;
}
.tip-helper-text {
  font-size: 13px; line-height: 1.45; color: #475569;
}

/* På mobil: bara ikonen visas; tap för att expandera */
@media (max-width: 720px) {
  .tip-helpers {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: stretch;
  }
  .tip-helper {
    flex: 0 0 auto;
    cursor: pointer;
    padding: 10px 12px;
    transition: flex-basis 0.2s ease;
    user-select: none;
    position: relative;
  }
  .tip-helper::after {
    content: ""; position: absolute; bottom: 4px; right: 6px;
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(0,0,0,0.25);
  }
  .tip-helper.expanded::after { display: none; }
  .tip-helper:not(.expanded) {
    width: 56px; height: 56px;
    padding: 0;
    justify-content: center; align-items: center; gap: 0;
    border-left-width: 4px;
  }
  .tip-helper:not(.expanded) .tip-helper-body { display: none; }
  .tip-helper:not(.expanded) .tip-helper-icon { font-size: 30px; margin: 0; }
  .tip-helper.expanded {
    flex: 1 1 100%; width: auto;
  }
}

/* ---------- GRUPP-BLOCK (tipsformulär gruppspel) ---------- */
.group-controls {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 16px; flex-wrap: wrap;
}
.group-toggle {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.group-toggle button {
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.group-toggle button:hover { color: var(--ink); }
.group-toggle button.active {
  background: white;
  color: var(--blue);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.group-toggle .icon { font-size: 11px; }
.group-block {
  border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 10px;
  background: white; overflow: hidden;
}
.group-block > summary {
  cursor: pointer; padding: 10px 14px; background: #f4f7fb;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  list-style: none; user-select: none;
  border-left: 4px solid var(--blue);
}
.group-block > summary::-webkit-details-marker { display: none; }
.group-block > summary::before {
  content: "▶"; font-size: 11px; color: var(--blue); transition: transform 0.15s;
  display: inline-block;
}
.group-block[open] > summary::before { transform: rotate(90deg); }
.group-block > summary > strong { font-size: 16px; }
.group-block.is-complete > summary { border-left-color: var(--green); background: #ecf9ee; }
.group-progress {
  margin-left: auto; padding: 2px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.08); font-size: 12px; font-weight: 600;
}
.group-progress.done { background: var(--green); color: white; }
.group-block .match-row { padding-left: 14px; padding-right: 14px; }

.nav-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.18);
  border: none;
  color: white;
  font-size: 22px;
  width: 42px; height: 42px;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(255,255,255,0.28); }

/* Användarprofil utanför hamburger-menyn — alltid synlig */
.topbar-user-menu {
  flex-shrink: 0;
}
.topbar-user-menu .me {
  color: white;
  background: rgba(255,255,255,0.18);
  width: 42px; height: 42px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.topbar-user-menu .me:hover { background: rgba(255,255,255,0.28); }
.topbar-user-menu .me svg { width: 22px; height: 22px; }

/* Header inom user-dropdown — visa vem som är inloggad */
.user-menu-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 6px;
}
.user-menu-avatar { font-size: 26px; line-height: 1; }
.user-menu-name {
  font-weight: 700; font-size: 14px;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- USER MENU (dropdown) ---------- */
.user-menu { position: relative; display: inline-block; }
.user-menu-toggle {
  background: rgba(255,255,255,0.15); color: white;
  border: none; cursor: pointer; padding: 4px 12px;
  border-radius: 999px; font-size: inherit; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.user-menu-toggle:hover { background: rgba(255,255,255,0.25); }
.user-menu-toggle .caret { font-size: 11px; opacity: 0.8; }
.user-menu-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 260px; background: white; color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 8px; z-index: 105;
  display: flex; flex-direction: column;
  animation: user-menu-pop 0.16s ease-out;
  transform-origin: top right;
}
@keyframes user-menu-pop {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
/* Liten pil som pekar uppåt mot toggle-knappen */
.user-menu-panel::before {
  content: ""; position: absolute;
  top: -5px; right: 18px;
  width: 10px; height: 10px;
  background: white;
  transform: rotate(45deg);
  box-shadow: -1px -1px 0 rgba(0,0,0,0.04);
}
.user-menu-panel[hidden] { display: none !important; }
.user-menu-panel a,
.user-menu-panel .user-menu-item-btn,
.topbar nav .user-menu-panel a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; color: var(--ink);
  text-decoration: none; font-size: 14px; text-align: left;
  background: none; border: none; cursor: pointer; font-family: inherit;
  width: 100%;
  border-radius: 8px;
  transition: background 0.12s, transform 0.12s;
}
.user-menu-panel a:hover,
.user-menu-panel .user-menu-item-btn:hover,
.topbar nav .user-menu-panel a:hover {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  transform: translateX(2px);
}
.user-menu-panel a.muted,
.topbar nav .user-menu-panel a.muted {
  color: var(--red); opacity: 1; font-size: 14px;
}
.user-menu-panel a.muted:hover {
  background: #fee2e2;
}
.user-menu-panel hr {
  border: none; border-top: 1px solid rgba(0,0,0,0.08);
  margin: 6px 4px;
}
.user-menu-panel .lang-switcher {
  padding: 6px 14px 6px;
}

/* ---------- LAYOUT ---------- */
main { max-width: 1100px; margin: 24px auto 60px; padding: 0 16px; }
.card {
  background: var(--card); border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  margin-bottom: 20px;
}
.card h1, .card h2 { margin-top: 0; }
.card h2 { color: var(--blue); display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }

footer {
  max-width: 1100px; margin: 30px auto; padding: 0 16px 30px;
  color: rgba(255,255,255,0.75); font-size: 14px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* ---------- FLASHES ---------- */
.flashes { max-width: 1100px; margin: 14px auto 0; padding: 0 16px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-weight: 500; }
.flash-success { background: #d3f4dc; color: var(--green-dk); border-left: 5px solid var(--green); }
.flash-error   { background: #ffd9dc; color: #7a0d14;       border-left: 5px solid var(--red); }
.flash-info    { background: #e0eaff; color: #0d2257;       border-left: 5px solid var(--blue); }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-dk) 0%, var(--grass-hi) 50%, var(--green) 100%);
  color: white; border-radius: 20px; padding: 36px 32px;
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  position: relative; overflow: hidden;
  margin-bottom: 24px;
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -80px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 30%, transparent 70%);
  border-radius: 50%;
}
.hero h1 { font-size: 38px; margin: 0 0 8px; letter-spacing: 1px; }
.hero h1 strong { color: var(--gold); }
.hero p { margin: 6px 0; font-size: 17px; max-width: 580px; }
.hero-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--gold); color: var(--ink); text-decoration: none; font-weight: 700;
  border: none; cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
  font-size: 15px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.25); }
.btn-ghost {
  background: rgba(0,0,0,0.06); color: var(--ink);
  border: 1px solid rgba(0,0,0,0.12);
}
.btn-ghost:hover { background: rgba(0,0,0,0.12); }
.btn-red    { background: var(--red);  color: white; }
.btn-blue   { background: var(--blue); color: white; }
.btn-green  { background: var(--green); color: white; }

.pot-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--ink); border-radius: 999px;
  padding: 6px 14px; font-weight: 800; font-size: 16px;
}

/* ---------- TOPPLISTA ---------- */
.board { width: 100%; border-collapse: collapse; }
.board th, .board td { padding: 10px 12px; text-align: left; }
.board thead th { background: var(--blue); color: white; font-weight: 600; }
.board tbody tr:nth-child(even) { background: #f4f7fb; }
.board tbody tr:hover { background: #fff7d6; }
.board .rank { font-weight: 800; width: 50px; }
.board .rank.gold   { color: #b8860b; }
.board .rank.silver { color: #888; }
.board .rank.bronze { color: #b06234; }
.board .total { font-weight: 800; color: var(--green-dk); font-size: 18px; }

.medal { font-size: 22px; }

/* ---------- TIPSFORMULÄR ---------- */
.match-list {
  display: grid; grid-template-columns: 1fr; gap: 6px;
}
/* Bas — gemensam för tipsformulär och tipslapp */
.match-row {
  display: grid;
  align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; background: #f4f7fb;
  transition: background 0.15s;
}
/* Tipsformulär: #nr | datum | hemma → | input | – | input | ← borta  (7 celler) */
.match-row.row-7 { grid-template-columns: 44px 56px 1fr 56px 16px 56px 1fr; }
/* Tipsformulär med joker: + joker-stjärna kolumn */
.match-row.row-7-joker { grid-template-columns: 50px 56px 1fr 56px 16px 56px 1fr 40px; }
/* Tipslapp: #nr | datum | hemma → | mitt tips | ← borta | poäng  (6 celler) */
.match-row.row-6 { grid-template-columns: 44px 56px 1fr 100px 1fr 90px; }

/* Joker */
.joker-toggle { cursor: pointer; user-select: none; text-align: center; }
.joker-toggle input { display: none; }
.joker-star { font-size: 22px; filter: grayscale(1) opacity(0.35); transition: filter 0.15s, transform 0.15s; display: inline-block; }
.joker-toggle:hover .joker-star { filter: grayscale(0.5) opacity(0.7); transform: scale(1.1); }
.joker-toggle input:checked + .joker-star { filter: none; transform: scale(1.2); animation: jokerPulse 1.4s infinite; }
.match-row.is-joker { background: linear-gradient(90deg, #fff3a8, #ffe070); }
.match-row.is-challenge { border-left: 4px solid #ff6b35; }
.match-row.is-joker.is-challenge { background: linear-gradient(90deg, #fff3a8, #ffd49a); }
@keyframes jokerPulse { 0%,100% { transform: scale(1.2); } 50% { transform: scale(1.35) rotate(6deg); } }

.joker-counter {
  display: inline-block; background: var(--gold); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px;
  margin-bottom: 8px;
}
.joker-counter.full { background: var(--red); color: white; }

.quick-fill-bar {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; background: #f4f7fb; border-radius: 10px;
  margin-bottom: 8px; position: sticky; top: 60px; z-index: 5;
}
.quick-fill {
  background: white; border: 2px solid var(--blue); color: var(--blue);
  padding: 4px 10px; border-radius: 6px; font-weight: 700; cursor: pointer;
  font-size: 13px; transition: all 0.1s;
}
.quick-fill:hover { background: var(--blue); color: white; }
.quick-fill.flash-active { background: var(--green); color: white; border-color: var(--green); }

/* Reactions */
.reactions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 20px 0; padding: 12px; background: #f4f7fb; border-radius: 12px;
}
.reaction-btn {
  background: white; border: 2px solid #cbd5e1; border-radius: 999px;
  padding: 4px 10px; cursor: pointer; font-size: 18px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: transform 0.1s, border-color 0.1s, background 0.1s;
}
.reaction-btn:hover { transform: translateY(-2px); border-color: var(--blue); }
.reaction-btn.mine { background: var(--gold); border-color: var(--gold); }
.reaction-btn .count { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 12px; }
.reaction-btn.mine .count { color: var(--ink); }
.reaction-btn .count:empty::before { content: ""; }
.reaction-tag { background: white; border-radius: 999px; padding: 4px 10px; font-size: 14px; font-weight: 600; border: 1px solid #cbd5e1; }
.reaction-pop { animation: reactionPop 0.4s; }
.comment { background: #f4f7fb; border-radius: 10px; padding: 8px 12px; margin: 6px 0; }
.comment-text { margin-top: 4px; word-wrap: break-word; }
.comment-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 6px; }
.comment-del:hover { color: var(--red); }

/* Cheer */
.cheer-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 0; padding: 10px 12px; background: #fff4e0; border-radius: 12px;
  border-left: 4px solid var(--gold);
}
.cheer-btn { padding: 4px 10px; font-size: 20px; }
.cheer-status { margin-left: auto; }
.cheer-badge {
  background: var(--red); color: white; border-radius: 999px; padding: 1px 6px;
  font-size: 11px; font-weight: 800; position: absolute; transform: translate(8px, -10px);
}
#cheer-bell { position: relative; }
.cheer-popover {
  position: absolute; top: 56px; right: 80px; background: white; color: var(--ink);
  padding: 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  min-width: 260px; max-width: 360px; z-index: 200;
}
.cheer-popover h4 { margin: 0 0 8px; color: var(--blue); }
.cheer-item { padding: 6px 0; border-bottom: 1px solid #eef2f7; }
.cheer-item:last-child { border-bottom: none; }

/* Gruppvy */
.groups-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); margin-top: 12px; }
@media (max-width: 720px) { .groups-grid { grid-template-columns: 1fr; } }
.group-card {
  background: white; border-radius: 12px; padding: 14px;
  border: 1px solid #cfd9e6; box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.group-title {
  margin: 0 0 10px;
  border-radius: 6px; overflow: hidden;
  font-size: 14px;
  height: 32px;
  display: flex; align-items: stretch;
  background: white;
  border: 1px solid #cfd9e6;
}
.group-title-flag {
  width: 16%;          /* alla lika breda */
  max-width: 16%;
  height: 100%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.group-title-text {
  margin-left: auto;   /* puttar text alltid längst till höger */
  width: 25%;          /* 1/4 */
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: white; color: black;
  font-weight: 700; font-size: 14px;
}
.group-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.group-table th { background: #f4f7fb; padding: 4px 6px; text-align: left; }
.group-table td { padding: 5px 6px; border-bottom: 1px solid #eef2f7; }
.group-table tr.top-2 { background: #e8f4ec; }
.group-table tr.top-2 .team-cell { font-weight: 700; }
.group-table tr.third { background: #fff8e0; }
.group-table .pts { font-weight: 800; color: var(--green-dk); text-align: right; }
.group-table .rank-mini { color: var(--muted); }

.group-matches { margin-top: 10px; }
.group-matches summary { cursor: pointer; font-weight: 600; padding: 4px 0; font-size: 13px; }
.group-match {
  display: grid; grid-template-columns: 44px 28px 1fr 50px 1fr; gap: 6px;
  align-items: center; padding: 4px 6px; font-size: 13px;
}
.group-match .g-home { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-match .g-score { text-align: center; font-weight: 600; }
.group-match .g-away { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-match .g-venue { text-align: center; }
/* Symmetrisk spacing kring flaggorna: home = text + (gap) + flagga, away = flagga + (gap) + text */
.group-match .g-home .fi { margin-right: 0; margin-left: 6px; }
.group-match .g-away .fi { margin-right: 6px; margin-left: 0; }
.venue-btn {
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px;
  transition: transform 0.1s;
  opacity: 0.75;
}
.venue-btn:hover { transform: scale(1.25); opacity: 1; }

/* Stadium-modal */
.venue-modal {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.venue-modal[hidden] { display: none !important; }
.venue-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); cursor: pointer; }
.venue-modal-panel {
  position: relative; background: white; border-radius: 14px;
  width: 100%; max-width: 480px; max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  overflow: hidden;
}
.venue-modal-image {
  width: 100%; max-height: 240px; object-fit: cover;
  display: block; background: #f4f7fb;
}
.venue-modal-body { padding: 16px 22px 20px; }
.venue-modal-body h3 { margin: 0 0 6px; color: var(--ink); }
.venue-modal-meta { color: #475569; font-weight: 600; font-size: 13px; margin: 0 0 12px; }
.venue-modal-info { font-size: 14px; line-height: 1.5; color: var(--ink); }
.venue-modal-close {
  position: absolute; top: 8px; right: 12px; z-index: 2;
  background: rgba(255,255,255,0.92); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 22px; cursor: pointer; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.venue-modal-close:hover { background: white; color: var(--red); }

/* Matchday */
.day-pill {
  background: white; color: var(--ink); border: 2px solid #cbd5e1;
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 13px;
}
.day-pill.active { background: var(--blue); color: white; border-color: var(--blue); }
.day-pill.today { border-color: var(--red); }
.day-pill.today.active { background: var(--red); border-color: var(--red); }

.matchday-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.matchday-card {
  background: linear-gradient(180deg, #f0f9f0, white);
  border: 1px solid #d1e3d1; border-radius: 12px; padding: 14px;
}
.matchday-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.matchday-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.matchday-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px; align-items: center; font-size: 18px;
  width: 100%;
  margin-bottom: 10px;
}
.matchday-score .team { font-weight: 700; white-space: nowrap; }
.matchday-score .team.home { text-align: right; }
.matchday-score .team.away { text-align: left; }
.matchday-score .team.home .fi { margin-right: 0; margin-left: 6px; }
.matchday-score .team.away .fi { margin-right: 6px; margin-left: 0; }
.matchday-score .score { font-size: 24px; font-weight: 800; color: var(--green-dk); min-width: 80px; text-align: center; }
.matchday-score .score.muted { color: var(--muted); }
.matchday-tips { display: flex; flex-wrap: wrap; gap: 6px; }
.tip-chip {
  background: white; border: 1px solid #cbd5e1; border-radius: 999px;
  padding: 4px 10px; font-size: 13px;
  display: inline-flex; gap: 6px; align-items: center;
}
.tip-chip .tip-user { font-weight: 600; }
.tip-chip .tip-score { background: #e8eef5; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.tip-chip .tip-pts { color: var(--green-dk); font-weight: 700; }
.tip-chip.correct { background: #e8f4ec; border-color: var(--green); }
.tip-chip.perfect { background: linear-gradient(90deg, #fff3a8, #ffe070); border-color: var(--gold); font-weight: 700; }

@media (max-width: 720px) {
  .matchday-score { font-size: 14px; gap: 8px; }
  .matchday-score .score { font-size: 18px; min-width: 60px; }
}
@keyframes reactionPop { 0% { transform: scale(1); } 50% { transform: scale(1.4) rotate(8deg); } 100% { transform: scale(1); } }

/* Bracket-träd (riktigt format med matchningar) */
.bracket-tree-wrap { overflow-x: auto; padding: 8px 4px; }
.bracket-tree-real {
  display: flex; gap: 18px; align-items: stretch;
  min-height: 700px; min-width: 980px;
}
.bt-col {
  display: flex; flex-direction: column;
  flex: 1; min-width: 150px;
}
.bt-col h3 { margin: 0 0 8px; text-align: center; color: var(--blue); font-size: 14px; }
.bt-col h3 .muted { font-weight: 400; }
.bt-col-body { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 4px; }

.bt-matchup {
  display: flex; flex-direction: column;
  border: 2px solid #cbd5e1; border-radius: 8px; overflow: hidden;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  position: relative;
}
.bt-matchup::after {
  /* Linje som visar koppling till nästa stage */
  content: ""; position: absolute; right: -18px; top: 50%;
  width: 18px; height: 2px; background: #cbd5e1;
}
.bt-col:last-child .bt-matchup::after,
.stage-final .bt-matchup::after { display: none; }

.bt-slot {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; font-size: 13px;
}
.bt-slot:first-child { border-bottom: 1px dashed #e1e8f0; }
.bt-slot .bt-team { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-slot.hit { background: linear-gradient(90deg, #d3f4dc, #b5e7c2); font-weight: 700; }
.bt-slot.hit .check { color: var(--green-dk); font-weight: 800; margin-left: auto; }
.bt-slot.empty { color: var(--muted); justify-content: center; font-style: italic; }

/* Senare stages = större matchups (de tar mer plats i kolumnen) */
.stage-r32 .bt-slot { font-size: 11px; padding: 3px 6px; }
.stage-r16 .bt-slot { font-size: 12px; padding: 4px 7px; }
.stage-qf .bt-slot { font-size: 14px; padding: 6px 9px; }
.stage-sf .bt-slot, .stage-final .bt-slot { font-size: 15px; padding: 8px 10px; }

/* Vinnare-kolumn */
.stage-winner .bt-col-body { justify-content: center; }
.bt-winner {
  background: linear-gradient(135deg, var(--gold), #ffd95c);
  border: 3px solid #b8860b; border-radius: 14px;
  padding: 20px 16px; text-align: center; font-weight: 800; font-size: 18px;
  box-shadow: 0 8px 24px rgba(255,201,51,0.55);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.bt-winner.hit { animation: champPulse 2s infinite; }
.bt-winner .trophy { font-size: 40px; }
.bt-winner .champion-label {
  background: var(--ink); color: var(--gold); padding: 2px 12px; border-radius: 999px;
  font-size: 11px; letter-spacing: 2px;
}
@keyframes champPulse {
  0%,100% { box-shadow: 0 8px 24px rgba(255,201,51,0.55); }
  50%     { box-shadow: 0 8px 36px rgba(255,201,51,0.95), 0 0 0 4px rgba(255,201,51,0.3); }
}

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.badge-pill {
  display: inline-block; background: linear-gradient(135deg, var(--gold), #ffd95c);
  color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 700;
  font-size: 13px; border: 1px solid rgba(0,0,0,0.08); cursor: help;
}
.badge-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 10px; }
.badge-card {
  background: linear-gradient(135deg, #fff7d6, #fff);
  border: 2px solid var(--gold); border-radius: 12px; padding: 14px; text-align: center;
  transition: transform 0.15s;
}
.badge-card:hover { transform: translateY(-3px) scale(1.02); }
.badge-emoji { font-size: 36px; }
.badge-name { font-weight: 800; font-size: 15px; margin-top: 4px; }
.badge-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Hall of Fame */
.hof-hero {
  background: linear-gradient(135deg, #4a3700, #b8860b 60%, #ffc933 100%);
  color: white; text-align: center;
}
.hof-hero h1 { font-size: 42px; margin: 0 0 10px; letter-spacing: 2px; }
.awards-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 16px; }
.award-card {
  background: white; border-radius: 14px; padding: 16px; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  border-top: 4px solid var(--gold);
}
.award-card.award-champion { border-top-color: var(--gold); transform: scale(1.04); }
.award-card.award-silver { border-top-color: #c0c0c0; }
.award-card.award-bronze { border-top-color: #cd7f32; }
.award-title { font-size: 14px; font-weight: 700; color: var(--muted); }
.award-user { font-size: 22px; margin: 6px 0; font-weight: 800; }
.award-value { color: var(--green-dk); font-weight: 700; font-size: 18px; }

/* Statistik-boxar */
.stat-box {
  background: linear-gradient(135deg, var(--blue), #2a4ca8);
  color: white; border-radius: 12px; padding: 18px 24px;
  text-align: center; min-width: 130px;
}
.stat-num { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; opacity: 0.85; }

/* Admin status-checklist */
.status-list { list-style: none; padding: 0; }
.status-list li {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 6px;
  display: flex; align-items: flex-start; gap: 10px;
}
.status-list .status-icon { font-weight: 800; font-size: 18px; min-width: 24px; }
.status-list .status-ok { background: #e8f4ec; color: var(--green-dk); }
.status-list .status-ok .status-icon { color: var(--green); }
.status-list .status-fail { background: #ffe5e5; color: #7a0d14; }
.status-list .status-fail .status-icon { color: var(--red); }

/* SFX-knapp */
.sfx-toggle {
  background: rgba(255,255,255,0.15); color: white; border: none;
  border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 16px;
}
.sfx-toggle:hover { background: rgba(255,255,255,0.28); }

/* Confetti */
.confetti-burst { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -10px; width: 10px; height: 16px;
  animation: confettiFall linear forwards;
  border-radius: 2px;
}
@keyframes confettiFall {
  to { top: 110vh; transform: rotate(720deg); }
}

/* Bar för "hur sticker du ut" */
.bar-row { position: relative; height: 22px; background: #e8eef5; border-radius: 6px; overflow: hidden; min-width: 200px; }
.bar-row .bar { position: absolute; top: 0; left: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); }
.bar-row span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* Badges på tipslapp */
.badge-joker { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 1px 6px; font-size: 11px; font-weight: 800; margin-right: 4px; }
.badge-chal  { background: #ff6b35; color: white; border-radius: 999px; padding: 1px 6px; font-size: 11px; font-weight: 800; margin-right: 4px; }

@media (max-width: 720px) {
  .match-row.row-7-joker { grid-template-columns: 1fr 50px 14px 50px 1fr 36px; gap: 6px; }
}

/* Flagga (SVG via flag-icons) — gör dem lika höga och ge mellanrum */
.fi {
  display: inline-block;
  width: 1.4em; height: 1.05em;
  vertical-align: 0.05em;
  margin-right: 6px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.match-row .home .fi { margin-right: 0; margin-left: 6px; }
.bracket-stage .slot .fi { margin-right: 6px; }

/* Tom Select — anpassa till sidans stil */
.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
  border: 2px solid #cbd5e1; border-radius: 8px;
  padding: 4px 8px; min-height: 36px; font-size: 14px;
  background: white;
}
.ts-wrapper.single.focus .ts-control { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,59,138,0.15); }
.ts-dropdown { border: 2px solid var(--blue); border-radius: 8px; }
.ts-dropdown .option { padding: 6px 10px; }
.ts-dropdown .option.active { background: var(--blue); color: white; }
.ts-dropdown .option .fi, .ts-wrapper .item .fi { margin-right: 8px; }
.match-row:hover { background: #e9f0fa; }
.match-row.locked { background: #ede9e0; }
.match-row .nr { color: var(--muted); font-size: 13px; }
.match-row .date { color: var(--muted); font-size: 13px; }
.match-row .home, .match-row .away { font-weight: 600; }
.match-row .home { text-align: right; }
.match-row .vs { color: var(--muted); }
.match-row input[type="number"] {
  width: 52px; padding: 6px 8px; text-align: center; font-size: 16px;
  border: 2px solid #cbd5e1; border-radius: 8px;
}
.match-row input[type="number"]:focus { border-color: var(--blue); outline: none; }
.match-row.correct { background: #d3f4dc; }
.match-row.perfect { background: linear-gradient(90deg, #fff3a8, #ffe070); animation: pulse 2s infinite; }
.match-row .pts { font-weight: 700; color: var(--green-dk); min-width: 38px; text-align: right; }
.match-row .facit { color: var(--muted); font-size: 13px; }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,201,51,0.6); } 50% { box-shadow: 0 0 0 8px rgba(255,201,51,0); } }

.bracket-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.bracket-stage {
  background: #f4f7fb; border-radius: 12px; padding: 16px;
}
.bracket-stage h3 {
  margin: 0 0 10px; color: var(--blue); display: flex; justify-content: space-between;
  border-bottom: 2px solid var(--blue); padding-bottom: 6px;
}
.bracket-stage .pts-badge {
  background: var(--blue); color: white; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 700;
}
.bracket-stage .slot {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 8px;
  align-items: center; margin-bottom: 4px;
}
.bracket-stage .slot .n { color: var(--muted); font-size: 13px; }
.bracket-stage select {
  width: 100%; padding: 6px 8px; border: 2px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; background: white;
}
.bracket-stage select:focus { border-color: var(--blue); outline: none; }
.bracket-stage .hit { color: var(--green-dk); font-weight: 800; }
.bracket-stage .miss { color: var(--muted); }

/* Matchup-form */
.bracket-matchup {
  display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center;
  margin-bottom: 10px;
  padding: 8px; background: white; border-radius: 8px;
  border-left: 3px solid var(--blue);
}
.bracket-matchup .bm-label {
  font-weight: 800; color: var(--blue); font-size: 12px;
  background: #e0eaff; padding: 4px 6px; border-radius: 6px; text-align: center;
}
.bracket-matchup .bm-slots { display: flex; flex-direction: column; gap: 4px; position: relative; }
.bracket-matchup .bm-vs {
  text-align: center; font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 1px;
}
.bracket-matchup .bm-team { width: 100%; }

.bracket-winner-pick {
  background: linear-gradient(135deg, var(--gold), #ffd95c);
  padding: 14px; border-radius: 10px; border: 2px solid #b8860b;
  text-align: center;
}
.bracket-trophy { font-weight: 800; }
.bracket-trophy select { margin-top: 8px; }
.stage-winner h3 { color: #b8860b; }

/* ---------- TABS / SECTIONS ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  background: white; border: 2px solid #cbd5e1; padding: 8px 14px;
  border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.tabs button.active { background: var(--blue); color: white; border-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- AUTH ---------- */
.auth-card {
  max-width: 440px; margin: 30px auto;
}
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card label {
  font-weight: 600; font-size: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.auth-card input, .auth-card select {
  padding: 10px 12px; font-size: 16px; border: 2px solid #cbd5e1; border-radius: 10px;
  width: 100%; box-sizing: border-box;
}
.auth-card input:focus, .auth-card select:focus { border-color: var(--blue); outline: none; }
.auth-card .btn { width: 100%; box-sizing: border-box; }
/* Emoji-picker INUTI auth-card ska behålla horisontellt och radio-inputs ska INTE bli full bredd */
.auth-card .emoji-picker { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.auth-card .emoji-picker label { display: inline-block; flex-direction: row; }
.auth-card .emoji-picker input[type="radio"] { width: auto; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-picker label {
  cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: 22px;
  border: 2px solid transparent;
}
.emoji-picker input { display: none; }
.emoji-picker input:checked + span { background: var(--gold); border-radius: 8px; }
.emoji-picker label:hover { background: #f4f7fb; }

/* ---------- DELA / QR ---------- */
.share-box { text-align: center; padding: 30px; }
.share-box img { max-width: 240px; border: 8px solid white; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.share-url {
  display: inline-block; background: #f4f7fb; padding: 10px 16px; border-radius: 10px;
  font-family: ui-monospace, monospace; margin: 14px 0; word-break: break-all;
}

/* ---------- DEADLINE BANNER ---------- */
.deadline {
  background: linear-gradient(90deg, var(--red), #ff6b6b);
  color: white; padding: 10px 16px; border-radius: 10px;
  font-weight: 700; display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.deadline.ok { background: linear-gradient(90deg, var(--green-dk), var(--green)); }
.deadline .countdown { background: rgba(0,0,0,0.25); padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }

/* ---------- ADMIN ---------- */
.admin-section { margin-bottom: 24px; }
.admin-section h2 { color: var(--red); }

/* ---------- HELPERS ---------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.small { font-size: 13px; color: var(--muted); }
.tag { display: inline-block; background: var(--blue); color: white; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.tag.paid { background: var(--green); }
.tag.unpaid { background: var(--red); }

@media (max-width: 720px) {
  .match-row.row-7 { grid-template-columns: 1fr 50px 14px 50px 1fr; gap: 6px; }
  .match-row.row-7-joker { grid-template-columns: 1fr 50px 12px 50px 1fr 36px; gap: 6px; }
  .match-row.row-6 { grid-template-columns: 1fr 80px 1fr 64px; gap: 6px; }
  .match-row .nr, .match-row .date { display: none; }
  .hero h1 { font-size: 28px; }
}

/* ===== MOBIL-OPTIMERING ===== */
@media (max-width: 720px) {
  /* Layout */
  main { padding: 0 10px; margin-top: 14px; }
  .card { padding: 14px 12px; border-radius: 12px; }

  /* Topbar mobil-anpassning */
  .topbar { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
  .topbar .logo { font-size: 16px; gap: 6px; flex: 1; min-width: 0; }
  .topbar .logo .ball { font-size: 22px; }
  .topbar .logo .title { letter-spacing: 0; }
  .topbar .logo .flags { display: none; }
  .nav-toggle { flex-shrink: 0; }

  /* Mobil: hamburger-drawer + user-dropdown anpassade till smalare skärm */
  .topbar nav {
    left: 8px; right: 8px;
    min-width: 0;
    max-height: calc(100vh - 60px);
  }
  /* User-menu-panel på mobil: full bredd minus margin, position right */
  .topbar-user-menu .user-menu-panel {
    right: 0;
    min-width: 240px;
    max-width: calc(100vw - 16px);
  }
  .cheer-popover { position: static; box-shadow: none; background: #f1f5f9; color: var(--ink); border-radius: 8px; }

  /* Hero */
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .pot-pill { font-size: 14px; }

  /* Tabeller blir scroll-bara horisontellt */
  .board { font-size: 13px; min-width: 100%; display: block; overflow-x: auto; white-space: nowrap; }
  .board th, .board td { padding: 6px 8px; }
  .board .total { font-size: 15px; }

  /* Tipsrutor + bracket-form */
  .match-row input[type=number] { width: 40px; padding: 4px 4px; font-size: 14px; }
  .home, .away { font-size: 13px; }
  .fi { width: 1.2em; height: 0.9em; margin-right: 4px; }
  .match-row .home .fi { margin-left: 4px; margin-right: 0; }

  /* Joker-stjärnan */
  .joker-star { font-size: 18px; }

  /* Quick-fill-knappar */
  .quick-fill-bar { padding: 6px 8px; gap: 4px; top: 50px; }
  .quick-fill { padding: 3px 8px; font-size: 12px; }
  .quick-fill-bar .small { display: none; }

  /* Tabs */
  .tabs { gap: 4px; }
  .tabs button { padding: 6px 10px; font-size: 12px; }

  /* Bracket-tree — låt horisontell scroll vara, men skala ner */
  .bracket-tree-real { gap: 10px; min-width: 880px; min-height: 600px; }
  .bt-col { min-width: 120px; }
  .bt-slot { padding: 3px 5px; }
  .bt-winner { padding: 14px 10px; font-size: 16px; }
  .bt-winner .trophy { font-size: 32px; }

  /* Bracket-form (tipsformulär) */
  .bracket-grid { grid-template-columns: 1fr; gap: 10px; }
  .bracket-stage { padding: 12px 10px; }
  .bracket-matchup { padding: 6px 8px; grid-template-columns: 28px 1fr; gap: 6px; }
  .bracket-matchup .bm-label { font-size: 11px; padding: 3px 5px; }
  .bracket-matchup .bm-vs { font-size: 9px; }

  /* Grupper */
  .groups-grid { grid-template-columns: 1fr; gap: 10px; }
  .group-card { padding: 10px; }
  .group-table { font-size: 11px; }
  .group-table th, .group-table td { padding: 3px 4px; }
  .group-table .team-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }

  /* Matchday */
  .matchday-card { padding: 10px; }
  .matchday-head { gap: 6px; }
  .matchday-score { font-size: 13px; gap: 6px; grid-template-columns: 1fr auto 1fr; }
  .matchday-score .team { font-size: 13px; }
  .matchday-score .score { font-size: 18px; min-width: 56px; }
  .tip-chip { font-size: 11px; padding: 3px 7px; gap: 4px; }
  .tip-chip .tip-user { font-size: 11px; }

  /* Reactions */
  .reactions { gap: 4px; padding: 8px; }
  .reaction-btn { padding: 3px 8px; font-size: 16px; }

  /* Cheer-bar */
  .cheer-bar { gap: 4px; padding: 8px 10px; }
  .cheer-btn { padding: 3px 6px; font-size: 18px; }
  .cheer-popover { right: 12px; max-width: calc(100vw - 24px); }

  /* Bonus och formulär */
  .auth-card { max-width: 100%; margin: 12px auto; }
  .emoji-picker label { padding: 4px 8px; font-size: 18px; }
  .stat-box { padding: 12px 16px; min-width: 100px; }
  .stat-num { font-size: 24px; }

  /* Badges */
  .badge-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .badge-card { padding: 10px; }
  .badge-emoji { font-size: 28px; }
  .badge-name { font-size: 13px; }
  .badge-desc { font-size: 11px; }

  /* Tom Select dropdowns */
  .ts-wrapper.single .ts-control { font-size: 13px; min-height: 32px; padding: 3px 6px; }

  /* Footer */
  footer { flex-direction: column; gap: 4px; font-size: 12px; text-align: center; }

  /* Knappar */
  .btn { padding: 9px 16px; font-size: 14px; }

  /* Awards-grid */
  .awards-grid { grid-template-columns: 1fr; gap: 10px; }
  .award-card { padding: 12px; }
  .award-user { font-size: 18px; }
}

/* Lösenord öga-toggle — visa/dölj klartext */
.pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.pw-wrap input {
  width: 100%;
  padding-right: 44px;
  box-sizing: border-box;
}
.pw-toggle {
  position: absolute;
  top: 50%; right: 8px;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  padding: 6px;
  color: #64748b;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.pw-toggle:hover { color: var(--blue); background: rgba(0,0,0,0.05); }
.pw-toggle:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* Mindre mobil (400px och under) */
@media (max-width: 400px) {
  .topbar nav a { padding: 10px 14px; font-size: 14px; }
  .topbar { gap: 4px; }
  .topbar .logo .title { font-size: 14px; letter-spacing: 0; }
  .topbar .logo .trophy-3d { width: 38px; height: 38px; }
  .nav-toggle, .topbar-user-menu .me { width: 38px; height: 38px; font-size: 20px; }
  .topbar-user-menu .me svg { width: 20px; height: 20px; }
  .badge-grid { grid-template-columns: 1fr; }
  .stat-box { min-width: 80px; padding: 10px 12px; }
  .stat-num { font-size: 20px; }
  .quick-fill-bar { flex-wrap: wrap; }
  .match-row input[type=number] { width: 36px; }
}

/* Språk-switcher (dropdown) */
.lang-switcher {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
}
.lang-switcher .lang-label { flex: 0 0 auto; }
.lang-select {
  flex: 1;
  padding: 6px 28px 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #1f2937;
  background: white;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%2364748b'><path d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 7px;
}
.lang-select:hover { border-color: var(--blue); }
.lang-select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.lang-select-inline {
  margin-left: 8px;
  font-size: 12px;
  padding: 4px 24px 4px 8px;
}
