/* =====================================================================
 * wm-tippspiel.css — WM 2026 Tippspiel
 * Uses the app's design tokens (light/dark) — NO custom theme.
 * Everything is scoped under #wm-game-container / .wm-* so it never
 * leaks into the rest of the app.
 * ===================================================================== */

/* ---- Fullscreen shell --------------------------------------------- *
 * .game-fullscreen (from styles.css) uses transform:translateX(-50%)
 * for centering, which would trap position:fixed children inside the
 * container. We neutralise the transform here so the bottom navigation
 * and save bar can pin to the real viewport.                          */
body.wm-mode #wm-game-container.game-fullscreen {
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: auto !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  background: var(--bg-body) !important;
  /* Full-viewport shell anchored top:0 + bottom:0 (height auto). The shell no
     longer needs to be pixel-perfect: the bottom nav is now `position:fixed`
     and pins itself directly to the viewport bottom (see .wm-bottomnav), so its
     placement does NOT depend on this shell's measured height. That is what
     finally fixes the iOS standalone PWA case, where any flex/height-based nav
     floated up because dvh/innerHeight are mis-computed there. */
  top: 0 !important;
  bottom: 0 !important;
  height: auto !important;
  padding-top: env(safe-area-inset-top, 0);
  overflow-x: hidden !important;
  /* The shell itself must NOT scroll: #wm-root scrolls inside it, while the
     bottom nav sits below as a static flex child pinned to the viewport bottom. */
  overflow-y: hidden !important;
}
/* Hard stop against any horizontal page scroll (which would carry the sticky
   back-arrow off-screen) while the Tippspiel is open. The Tippspiel "takes
   over" the app: the page behind must NOT scroll. We pin the body in place
   (scroll position is saved/restored by app.js) so only the Tippspiel's own
   container scrolls. */
body.wm-mode {
  overflow: hidden !important;
  position: fixed !important;
  top: var(--wm-scroll-top, 0px) !important;
  left: 0 !important; right: 0 !important; width: 100% !important;
  overscroll-behavior: none;
}
html.wm-lock { overflow: hidden !important; }
#wm-game-container {
  color: var(--text); overflow-x: hidden; max-width: 100%;
  overscroll-behavior: contain;
}
#wm-game-container .wm-tabbody { min-width: 0; }
/* Hide the generic game fullscreen buttons — the WM header has its own back. */
#wm-game-container .game-fs-btn,
#wm-game-container .game-fs-close { display: none !important; }

#wm-root {
  /* #wm-root is a FLEX ITEM of .game-fullscreen (display:flex;flex-direction:column).
     Without width:100% + min-width:0 the item stretches to its content's natural
     nowrap width (the chip strip), blowing past the viewport on phones and pushing
     everything off-screen to the right. These three lines pin it to the container. */
  width: 100%; max-width: 100%; min-width: 0;
  margin: 0 auto;
  /* #wm-root is the SCROLLER (the fixed shell above does not scroll). Being a
     flex:1 child lets the static bottom nav below it pin to the viewport edge. */
  flex: 1 1 auto; min-height: 0;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px calc(86px + env(safe-area-inset-bottom, 0px));
}
.wm-loading, .wm-empty {
  text-align: center; padding: 48px 16px; color: var(--text-secondary);
  font-size: 15px; line-height: 1.5;
}

/* ---- Top bar (header with back arrow) ----------------------------- */
.wm-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; margin: 0 -14px 12px; padding-left: 10px; padding-right: 10px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
}
.wm-back, .wm-gear {
  flex: 0 0 auto; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-sm);
}
.wm-gear { width: 36px; }
.wm-back { gap: 3px; padding: 0 10px 0 6px; font-family: inherit; font-weight: 700; font-size: 12.5px; }
.wm-back-label { white-space: nowrap; }
.wm-back:active, .wm-gear:active { transform: scale(.94); }
.wm-back svg { width: 18px; height: 18px; }
.wm-gear svg { width: 22px; height: 22px; }
/* Title is absolutely centred so it stays in the true middle regardless of the
   (variable-width) back button / gear on either side. */
.wm-topbar-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  pointer-events: none;
}
.wm-topbar-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.wm-topbar-badge { font-weight: 800; font-size: 14px; color: var(--text); letter-spacing: .2px; white-space: nowrap; }
.wm-topbar-sub { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.wm-topbar-spacer { flex: 0 0 36px; }

/* ---- Bottom navigation (mirrors the app .tab-nav EXACTLY) --------- */
.wm-bottomnav {
  /* Pinned to the REAL visible viewport bottom. `bottom:0` is only a pre-JS
     fallback: in an iOS standalone PWA `position:fixed; bottom:0` does NOT reach
     the true screen bottom (it leaves a fat white band below the nav), so
     app.js _wmPlaceNav sets an explicit `top` from visualViewport
     (offsetTop + height - navHeight) and flips `bottom` to auto. visualViewport
     is the only viewport metric iOS reports correctly in standalone — it is the
     same signal the save bar uses to dodge the keyboard. */
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 600px; margin-left: auto; margin-right: auto;
  z-index: 900;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  padding: 6px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-body);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.wm-bottomnav:empty { display: none; }
.wm-navbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 0; border: none; background: transparent; color: var(--text);
  font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  min-height: 52px; width: 100%; position: relative;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
  transition: color .2s ease, transform .15s ease;
}
.wm-navbtn:active { transform: scale(.92); }
.wm-navicon {
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; padding: 5px 16px; transition: background .25s ease;
}
.wm-navicon svg { width: 24px; height: 24px; }
.wm-navlabel { line-height: 1; }
.wm-navbtn.active { color: var(--primary); font-weight: 700; }
.wm-navbtn.active .wm-navicon { background: var(--primary-glow); }
.wm-navbtn.active .wm-navicon svg { transform: scale(1.08); transition: transform .2s ease; }
.wm-navbtn.active::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary);
}

/* ---- Spiele navigation: top filter + context chip row ------------- */
.wm-spielnav {
  position: sticky; top: 57px; z-index: 20;
  background: var(--bg-body);
  /* box-shadow upward closes the slit between topbar and this nav without a
     ::before pseudo-element (which would otherwise clip the card above it). */
  box-shadow: 0 -10px 0 0 var(--bg-body);
  margin: 0 -14px 12px; padding: 8px 0 2px;
}
.wm-topfilter { display: flex; gap: 8px; padding: 0 14px 8px; }
.wm-tf {
  flex: 1 1 0; min-width: 0; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text); font-weight: 700; font-size: 13.5px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.wm-tf.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.wm-tf-ico { display: flex; align-items: center; }
.wm-tf-ico svg { width: 17px; height: 17px; }
.wm-tf-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(0,0,0,.12); color: inherit; font-size: 11px; font-weight: 800;
}
.wm-tf.active .wm-tf-badge { background: rgba(255,255,255,.3); }

/* ---- Sub-nav chips (group / date) --------------------------------- */
.wm-subnav {
  display: flex; gap: 8px; overflow-x: auto; white-space: nowrap;
  padding: 2px 14px; margin: 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.wm-subnav::-webkit-scrollbar { display: none; }
.wm-chip {
  flex: 0 0 auto; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text); font-weight: 700; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: all .15s;
}
.wm-chip.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* ---- Push reminder opt-in card ------------------------------------ */
.wm-pushcard {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 12px 15px; margin: 4px 0 16px;
  box-shadow: var(--shadow-sm);
}
.wm-pushcard-ico {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--primary-glow); color: var(--primary);
}
.wm-pushcard-ico svg { width: 19px; height: 19px; }
.wm-pushcard-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wm-pushcard-txt strong { font-size: 13px; color: var(--text); }
.wm-pushcard-txt span { font-size: 11.5px; color: var(--text-secondary); line-height: 1.3; }
.wm-pushcard-btn {
  flex: 0 0 auto; border: none; background: var(--primary); color: #fff;
  font-weight: 800; font-size: 12.5px; padding: 9px 14px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px var(--primary-glow);
}
.wm-pushcard-btn:active { transform: scale(.97); }
.wm-pushcard-on .wm-pushcard-ico {
  background: rgba(34, 197, 94, .15); color: #16a34a;
}
.wm-pushcard-btn-off {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); box-shadow: none; font-weight: 700;
}

/* ---- Admin: result mode toggle ------------------------------------ */
.wm-resmode {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; box-shadow: var(--shadow-sm);
}

/* ---- Info banner -------------------------------------------------- */
.wm-info {
  font-size: 13px; color: var(--text-secondary); background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; margin: 0 0 14px; line-height: 1.45;
}

/* ---- Points key (Rangliste explainer) ----------------------------- */
.wm-points-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 16px; margin: 0 0 14px;
  font-family: inherit; font-weight: 700; font-size: 13px; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow-sm);
}
.wm-points-btn:active { transform: scale(.97); }
.wm-points-btn-ico { font-size: 15px; line-height: 1; }

/* Modal (Punkte-Erklärung) */
.wm-modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5); }
.wm-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1001;
  width: calc(100% - 36px); max-width: 420px; max-height: 80vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.wm-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.wm-modal-title { font-weight: 800; font-size: 16px; color: var(--text); }
.wm-modal-x {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  border: none; background: var(--bg-elevated); color: var(--text);
  font-size: 16px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.wm-modal-x:active { transform: scale(.94); }
.wm-modal-body { padding: 16px 18px 20px; }
.wm-pk-sub {
  font-size: 12px; font-weight: 800; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .4px; margin: 16px 0 10px;
}
.wm-pk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wm-pk-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text); line-height: 1.3;
}
.wm-pk-list li strong { font-weight: 800; }
.wm-pk-badge {
  flex: 0 0 auto; min-width: 30px; height: 24px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 800; font-size: 12.5px;
}
.wm-pk-pos { background: rgba(52,199,89,.16); color: var(--success); }
.wm-pk-zero { background: var(--bg-elevated); color: var(--text-secondary); }
.wm-pk-neg { background: rgba(255,59,48,.14); color: var(--danger); }
.wm-pk-risky { background: rgba(255,149,0,.16); }
.wm-pk-boost { background: var(--primary-glow); }

/* ---- Group + standings -------------------------------------------- */
.wm-group { margin-bottom: 24px; }
.wm-group-head {
  font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: .2px;
  padding: 4px 2px 10px;
}
.wm-table {
  width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.wm-table th {
  text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-tertiary); padding: 9px 2px; background: var(--bg-elevated);
}
.wm-th-team { text-align: left !important; padding-left: 12px !important; }
.wm-th-pos, .wm-td-pos { width: 26px; }
/* fixed widths for the numeric columns; the team column takes the rest */
.wm-table th:nth-child(3), .wm-table td:nth-child(3) { width: 30px; }
.wm-table th:nth-child(4), .wm-table td:nth-child(4) { width: 46px; }
.wm-table th:nth-child(5), .wm-table td:nth-child(5) { width: 40px; }
.wm-th-pts, .wm-td-pts { width: 34px; }
.wm-table td {
  text-align: center; padding: 9px 2px; color: var(--text);
  border-top: 1px solid var(--border);
}
.wm-td-pos { color: var(--text-tertiary); font-weight: 700; }
.wm-td-team { text-align: left; padding-left: 12px; }
/* flag + name on one baseline, flags line up in a clean column, name truncates */
.wm-td-team-inner { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wm-td-team-inner .wm-flag { width: 24px; height: 16px; border-radius: 2px; flex: 0 0 auto; }
.wm-td-team-inner .wm-flag-ph { width: 24px; min-width: 24px; height: 16px; }
.wm-td-team-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wm-td-pts { font-weight: 800; color: var(--primary); }
.wm-tr-qual td { background: var(--primary-glow); }
.wm-tr-qual .wm-td-pos { color: var(--primary); }
.wm-group-matches { display: flex; flex-direction: column; }

/* ---- Match card --------------------------------------------------- */
.wm-match {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.wm-match-ph { opacity: .7; }
.wm-match-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; margin-bottom: 10px; gap: 8px;
}
.wm-match-stage { color: var(--text-tertiary); font-weight: 600; }
.wm-match-status {
  font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 9px; border-radius: 999px;
}
.wm-st-eval { background: rgba(52,199,89,.14); color: var(--success); }
.wm-st-locked { background: var(--bg-elevated); color: var(--text-tertiary); }
.wm-st-saved { background: var(--primary-glow); color: var(--primary); }
.wm-st-ph, .wm-st-none { background: var(--bg-elevated); color: var(--text-tertiary); }

.wm-match-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px;
}
.wm-match-side { display: flex; align-items: center; min-width: 0; }
.wm-side-home { justify-content: flex-end; text-align: right; }
.wm-side-away { justify-content: flex-start; text-align: left; }
.wm-team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.wm-side-away .wm-team { flex-direction: row-reverse; }
/* Uniform flags — object-fit + hairline border so white flags (e.g. Japan) keep the same box and stay flush. */
#wm-game-container .wm-flag {
  object-fit: cover; border: 1px solid var(--border); background: var(--bg-elevated);
  display: inline-block; flex: 0 0 auto;
}
.wm-team .wm-flag { width: 30px; height: 20px; border-radius: 3px; }
.wm-team .wm-flag-ph {
  width: auto; min-width: 28px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--bg-elevated); color: var(--text-secondary); border-radius: 3px; padding: 0 4px; flex: 0 0 auto;
}
.wm-team-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.wm-match-center { display: flex; align-items: center; justify-content: center; min-width: 92px; }
.wm-score { font-size: 22px; font-weight: 800; }
.wm-score-final { color: var(--text); }
.wm-score-tip { color: var(--primary); }
.wm-score-empty { color: var(--text-tertiary); font-weight: 700; }

.wm-score-input { display: flex; align-items: center; gap: 6px; }
.wm-colon { font-weight: 800; font-size: 18px; color: var(--text-tertiary); }

/* Score inputs — override the global full-width input style. */
#wm-game-container input.wm-sc {
  width: 44px !important; height: 44px !important; padding: 0 !important;
  text-align: center; font-size: 18px !important; font-weight: 800;
  border: 1.5px solid var(--border-light) !important; border-radius: 12px !important;
  background: var(--bg-input) !important; color: var(--text) !important;
  -moz-appearance: textfield; appearance: textfield; box-shadow: var(--shadow-sm);
}
#wm-game-container input.wm-sc::-webkit-outer-spin-button,
#wm-game-container input.wm-sc::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#wm-game-container input.wm-sc:focus {
  outline: none; border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* points line */
.wm-pts {
  margin-top: 10px; text-align: center; font-weight: 700; font-size: 13px;
  padding: 6px; border-radius: 10px;
}
.wm-pts-pos { background: rgba(52,199,89,.14); color: var(--success); }
.wm-pts-zero { background: var(--bg-elevated); color: var(--text-secondary); }
.wm-pts-neg { background: rgba(255,59,48,.12); color: var(--danger); }

/* risky checkbox — force a real checkbox (global input rule kills it) */
.wm-risky {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; flex-wrap: wrap;
}
#wm-game-container input.wm-risky-cb {
  -webkit-appearance: auto !important; appearance: auto !important;
  width: 20px !important; height: 20px !important; min-width: 20px; padding: 0 !important;
  margin: 0 !important; accent-color: var(--primary); cursor: pointer; box-shadow: none !important;
  border: 0 !important; background: none !important;
}
.wm-risky-hint { font-size: 11px; color: var(--text-tertiary); font-weight: 500; flex-basis: 100%; }

/* Marker shown on a saved (not-yet-evaluated) tip so it's clear it counts double. */
.wm-risky-tag {
  margin-top: 10px; text-align: center; font-weight: 700; font-size: 12px;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(255,149,0,.14); color: var(--warning);
}

.wm-match-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 11.5px; color: var(--text-tertiary);
}
.wm-cd { font-weight: 700; color: var(--warning); }
.wm-cd-locked { color: var(--text-tertiary); }

.wm-btn-change {
  width: 100%; margin-top: 10px; padding: 10px; border-radius: 12px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border);
}
.wm-btn-change:active { transform: scale(.98); }

/* result save (admin) */
.wm-btn-res {
  border: none; background: var(--success); color: #fff;
  width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.wm-btn-res svg { width: 22px; height: 22px; }

/* ---- Group tips expander ------------------------------------------ */
.wm-grouptips { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.wm-grouptips summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); list-style: none;
}
.wm-grouptips summary::-webkit-details-marker { display: none; }
.wm-grouptips-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.wm-gt-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 6px 10px; border-radius: 10px; background: var(--bg-elevated);
}
.wm-gt-me { background: var(--primary-glow); }
.wm-gt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.wm-gt-tip { font-weight: 800; color: var(--text); }
.wm-gt-pts { font-weight: 800; min-width: 30px; text-align: right; border-radius: 6px; padding: 1px 6px; }

/* ---- Sticky save bar ---------------------------------------------- */
.wm-savebar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 800;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--primary); border: 2px solid #fff;
  border-radius: 999px; padding: 6px 6px 6px 16px;
  box-shadow: 0 6px 22px var(--primary-glow), 0 0 0 4px var(--primary-glow);
  width: calc(100% - 24px); max-width: 460px;
  animation: wm-savebar-pulse 1.8s ease-in-out infinite;
}
@keyframes wm-savebar-pulse {
  0%, 100% { box-shadow: 0 6px 22px var(--primary-glow), 0 0 0 0 var(--primary-glow); }
  50%      { box-shadow: 0 6px 22px var(--primary-glow), 0 0 0 8px rgba(200,16,46,0); }
}
.wm-savebar-msg {
  font-weight: 800; font-size: 13px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 7px;
}
.wm-savebar-msg #wm-savebar-txt { overflow: hidden; text-overflow: ellipsis; }
.wm-savebar-ico { flex: 0 0 auto; font-size: 14px; line-height: 1; }
.wm-btn-saveall {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: #fff; color: var(--primary);
  font-weight: 800; padding: 10px 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.wm-btn-saveall:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .wm-savebar { animation: none; } }

/* ---- Boost tab ---------------------------------------------------- */
.wm-boost-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.wm-boost-correct { border-color: var(--success); background: rgba(52,199,89,.06); }
.wm-boost-wrong { border-color: rgba(255,59,48,.4); }
.wm-boost-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wm-boost-label { flex: 1; font-weight: 700; font-size: 15px; color: var(--text); }
.wm-boost-pts {
  font-weight: 800; font-size: 12.5px; color: var(--primary);
  background: var(--primary-glow); padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}
.wm-boost-pick { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.wm-boost-pick .wm-flag { width: 24px; height: 16px; border-radius: 2px; }
.wm-boost-answer { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* Boost picker trigger button (opens the country / player popup) */
.wm-boost-trigger {
  width: 100%; min-height: 48px; padding: 10px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--border-light); border-radius: 12px;
  background: var(--bg-input); color: var(--text); font-size: 15px; font-weight: 600; text-align: left;
}
.wm-boost-trigger:active { transform: scale(.99); }
.wm-boost-trigger .wm-flag { width: 28px; height: 19px; border-radius: 3px; }
.wm-boost-trigger-empty { color: var(--text-tertiary); font-weight: 500; }
.wm-boost-trigger-arrow { margin-left: auto; color: var(--text-tertiary); display: inline-flex; }
.wm-boost-trigger-arrow svg { width: 18px; height: 18px; }

/* ---- Picker popup (country / player selection) -------------------- */
.wm-picker-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5); }
.wm-picker-sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 1001;
  width: 100%; max-width: 600px; height: 82vh; display: flex; flex-direction: column;
  background: var(--bg-card); border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
.wm-picker-head {
  display: flex; align-items: center; gap: 10px; padding: 16px;
  border-bottom: 1px solid var(--border);
}
.wm-picker-back, .wm-picker-x {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: none; background: var(--bg-elevated); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.wm-picker-back svg, .wm-picker-x svg { width: 18px; height: 18px; }
.wm-picker-title { flex: 1; font-weight: 800; font-size: 16px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-picker-searchwrap { padding: 12px 16px 6px; }
#wm-game-container input.wm-picker-search {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--border-light); background: var(--bg-input); color: var(--text); font-size: 15px;
}
#wm-game-container input.wm-picker-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.wm-picker-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 12px calc(16px + env(safe-area-inset-bottom,0px));
}
.wm-picker-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px;
  border: none; background: transparent; cursor: pointer; border-radius: 12px;
  color: var(--text); font-size: 15px; font-weight: 600; text-align: left;
}
.wm-picker-item:hover { background: var(--bg-elevated); }
.wm-picker-item.active { background: var(--primary-glow); color: var(--primary); }
.wm-picker-item .wm-flag { width: 30px; height: 20px; border-radius: 3px; }
.wm-picker-empty { text-align: center; color: var(--text-tertiary); padding: 28px 16px; font-size: 14px; }
.wm-picker-confirm { padding: 12px 16px calc(16px + env(safe-area-inset-bottom,0px)); border-top: 1px solid var(--border); }
.wm-picker-confirm button {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 15px;
}
.wm-picker-confirm button:disabled { opacity: .5; cursor: default; }

/* While a score field is focused (keyboard open) the bottom nav would float
   up weirdly on iOS — hide it. The save bar stays visible and is pinned just
   above the keyboard via JS (visualViewport), so the user always sees it. */
#wm-game-container.wm-typing .wm-bottomnav { display: none !important; }

/* Admin boost-answer inputs (native select / text) */
#wm-game-container select.wm-boost-select,
#wm-game-container input.wm-boost-text {
  width: 100%; height: 46px; border-radius: 12px; padding: 0 14px;
  border: 1.5px solid var(--border-light); background-color: var(--bg-input); color: var(--text);
  font-size: 15px; font-weight: 500;
}
#wm-game-container select.wm-boost-select { padding-right: 40px; }
#wm-game-container select.wm-boost-select:focus,
#wm-game-container input.wm-boost-text:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); background-color: #fff;
}


/* ---- Stats tab ---------------------------------------------------- */
.wm-stats-section { margin-bottom: 24px; }
.wm-stats-section h4 { font-size: 16px; color: var(--text); margin: 4px 2px 12px; font-weight: 800; }
.wm-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wm-statcard {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow-sm);
}
.wm-statcard-val { font-size: 22px; font-weight: 800; color: var(--primary); }
.wm-statcard-label { font-size: 11px; color: var(--text-tertiary); line-height: 1.2; }
.wm-stat-line {
  margin-top: 10px; font-size: 13.5px; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px;
}

/* ---- Leaderboard -------------------------------------------------- */
.wm-lb { display: flex; flex-direction: column; gap: 8px; }
.wm-lb-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 12px; box-shadow: var(--shadow-sm);
}
.wm-lb-me { border-color: var(--primary); background: var(--primary-glow); }
.wm-lb-rank {
  font-size: 15px; font-weight: 800; min-width: 30px; height: 30px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: var(--bg-elevated); color: var(--text-secondary);
}
.wm-lb-rank-1 { background: #FFD24A; color: #5a4500; }
.wm-lb-rank-2 { background: #C7CDD6; color: #2c333d; }
.wm-lb-rank-3 { background: #E0A878; color: #4a2c10; }
.wm-lb-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wm-lb-top { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.wm-lb-uname { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.wm-lb-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px;
  padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-secondary);
  white-space: nowrap;
}
.wm-lb-badge-e { font-size: 12px; }
.wm-lb-badge-king { background: #FFD24A; color: #5a4500; }
.wm-lb-badge-sniper { background: rgba(0,122,255,.16); color: #0a6cff; }
.wm-lb-badge-risk { background: rgba(0,0,0,.10); color: var(--text); }
.wm-lb-badge-hot { background: rgba(255,89,0,.16); color: #ff5900; }
.wm-lb-badge-comeback { background: rgba(52,199,89,.18); color: #1b9e4b; }
.wm-lb-badge-var { background: rgba(255,59,48,.14); color: var(--danger); }
.wm-lb-badge-cold { background: rgba(0,160,255,.14); color: #00a0ff; }
.wm-lb-stats { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.wm-lb-right { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; gap: 2px; }
.wm-lb-pts { font-size: 20px; font-weight: 800; color: var(--primary); line-height: 1; }
.wm-lb-pts small { font-size: 10px; font-weight: 600; opacity: .7; margin-left: 2px; }
.wm-lb-last { font-size: 11px; font-weight: 700; }
.wm-lb-last-pos { color: var(--success); }
.wm-lb-last-neg { color: var(--danger); }
.wm-lb-last-zero { color: var(--text-tertiary); }
/* round initials avatar in the list + podium */
.wm-lb-av {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(135deg, #2e7d32, #1b9e4b); color: #fff;
}
.wm-lb-you {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 999px;
  flex: 0 0 auto;
}

/* ---- Podium (top 3) ----------------------------------------------- */
.wm-podium {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-items: end;
  margin: 2px 0 14px;
}
.wm-pod {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 4px 0; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.wm-pod-me { border-color: var(--primary); }
.wm-pod-1 { background: linear-gradient(180deg, rgba(255,210,74,.18), var(--bg-card)); border-color: #FFD24A; }
.wm-pod-2 { background: linear-gradient(180deg, rgba(199,205,214,.18), var(--bg-card)); }
.wm-pod-3 { background: linear-gradient(180deg, rgba(224,168,120,.18), var(--bg-card)); }
.wm-pod-medal { font-size: 18px; line-height: 1; }
.wm-pod-av {
  width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2e7d32, #1b9e4b);
}
.wm-pod-1 .wm-pod-av { width: 42px; height: 42px; font-size: 15px; box-shadow: 0 0 0 3px rgba(255,210,74,.5); }
.wm-pod-name {
  font-size: 11px; font-weight: 700; color: var(--text); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wm-pod-pts { font-size: 15px; font-weight: 800; color: var(--primary); }
.wm-pod-pts small { font-size: 9px; font-weight: 600; opacity: .7; margin-left: 1px; }
.wm-pod-base {
  margin-top: 4px; width: 100%; padding: 5px 2px; font-weight: 800; font-size: 9.5px;
  text-align: center; letter-spacing: .2px; line-height: 1.1; text-transform: uppercase;
  background: var(--bg-elevated); color: var(--text-secondary);
}
.wm-pod-1 .wm-pod-base { background: #FFD24A; color: #5a4500; padding: 8px 2px; }
.wm-pod-2 .wm-pod-base { background: #C7CDD6; color: #2c333d; padding: 6px 2px; }
.wm-pod-3 .wm-pod-base { background: #E0A878; color: #4a2c10; }

/* ---- Join screen -------------------------------------------------- */
.wm-join {
  text-align: center; padding: 18px 18px calc(40px + env(safe-area-inset-bottom, 0px));
  max-width: 460px; margin: 0 auto;
}
.wm-join-emoji {
  font-size: 56px; line-height: 1; margin: 8px 0 4px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.18));
}
.wm-join-title { font-size: 24px; font-weight: 900; color: var(--text); margin: 6px 0 10px; letter-spacing: .2px; }
.wm-join-text { font-size: 15px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 16px; }
.wm-join-points {
  list-style: none; padding: 0; margin: 0 0 20px; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
}
.wm-join-points li {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--text); box-shadow: var(--shadow-sm);
}
.wm-join-count { font-size: 13px; font-weight: 700; color: #1b9e4b; margin: 0 0 16px; }
.wm-join-btn {
  width: 100%; border: none; border-radius: var(--radius); padding: 16px;
  font-size: 16px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #2e7d32, #1b9e4b);
  box-shadow: 0 8px 22px rgba(27,158,75,.35);
}
.wm-join-btn:active { transform: scale(.98); }
.wm-join-btn:disabled { opacity: .7; cursor: default; }
.wm-join-skip {
  margin-top: 12px; background: transparent; border: none; cursor: pointer;
  color: var(--text-tertiary); font-size: 14px; font-weight: 600; font-family: inherit;
}

/* ---- Admin slide-up sheet ----------------------------------------- */
.wm-admin-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5); }
.wm-admin-sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 1001;
  width: 100%; max-width: 600px; max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-card); border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wm-admin-sheet-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 16px; font-weight: 800; font-size: 17px; color: var(--text);
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.wm-admin-x {
  border: none; background: var(--bg-elevated); color: var(--text);
  width: 34px; height: 34px; border-radius: 10px; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.wm-admin-x svg { width: 18px; height: 18px; }
.wm-admin-sheet-body { padding: 16px; }
.wm-admin-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.wm-admin-card h4 { margin: 0 0 12px; font-size: 15px; color: var(--text); font-weight: 800; }
.wm-admin-note { font-size: 12px; color: var(--text-secondary); margin: 0 0 10px; line-height: 1.45; }
.wm-admin-toggle {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; color: var(--text); cursor: pointer;
}
#wm-game-container input.wm-admin-cb {
  -webkit-appearance: auto !important; appearance: auto !important;
  width: 20px !important; height: 20px !important; min-width: 20px; padding: 0 !important;
  margin: 0 !important; accent-color: var(--primary); box-shadow: none !important; border: 0 !important; background: none !important;
}
.wm-btn-seed {
  width: 100%; padding: 12px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; font-size: 14px;
}
.wm-seed-status { font-size: 12px; margin-top: 8px; color: var(--text-secondary); min-height: 16px; }
.wm-admin-boost { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.wm-admin-boost-label { font-size: 13px; font-weight: 600; color: var(--text); }
.wm-btn-bans-save {
  width: 100%; margin-top: 12px; padding: 12px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; font-size: 14px;
}

@media (max-width: 480px) {
  /* Tighter gutters so the match cards use the full phone width. */
  #wm-root { padding-left: 10px; padding-right: 10px; }
  .wm-topbar { margin-left: -10px; margin-right: -10px; }
  .wm-spielnav { margin-left: -10px; margin-right: -10px; }
  .wm-topfilter { padding-left: 10px; padding-right: 10px; }
  .wm-subnav { padding-left: 10px; padding-right: 10px; }
  .wm-match { padding: 12px 10px; }
  .wm-match-row { gap: 6px; }
  .wm-team { gap: 6px; }
  .wm-team .wm-flag { width: 26px; height: 18px; }
  .wm-match-center { min-width: 0; }
  .wm-score { font-size: 20px; }
  .wm-score-input { gap: 4px; }
  #wm-game-container input.wm-sc { width: 40px !important; height: 40px !important; font-size: 17px !important; }
}

@media (max-width: 380px) {
  .wm-team-name { font-size: 13px; }
  .wm-team .wm-flag { width: 24px; height: 16px; }
  .wm-chip { padding: 0 13px; height: 38px; font-size: 13px; }
  #wm-game-container input.wm-sc { width: 38px !important; height: 38px !important; font-size: 16px !important; }
  .wm-podium { gap: 5px; }
  .wm-pod-name { font-size: 11px; }
}

/* ---- Community entry tile (green WM look) ------------------------- *
 * Overrides the default red .community-games-cta styling for the WM
 * tippspiel tile so it stands out with a football/World-Cup vibe.      */
.community-games-cta.wm-cta {
  position: relative; overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #1b7a3a 0%, #1b9e4b 55%, #14b85a 100%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 8px 22px rgba(27,158,75,.32);
}
/* subtle football-pitch stripe + glow */
.community-games-cta.wm-cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120px 120px at 90% -20%, rgba(255,255,255,.22), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 22px, transparent 22px 44px);
}
.community-games-cta.wm-cta:hover {
  background: linear-gradient(135deg, #1d8540 0%, #1faa51 55%, #16c862 100%);
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 10px 26px rgba(27,158,75,.42);
  transform: translateY(-1px);
}
.community-games-cta.wm-cta .community-games-cta-icon { font-size: 30px; position: relative; }
.community-games-cta.wm-cta .community-games-cta-text strong { color: #fff; }
.community-games-cta.wm-cta .community-games-cta-text small { color: rgba(255,255,255,.85); }
.community-games-cta.wm-cta .community-games-cta-arrow { color: #fff; opacity: .9; position: relative; }
