:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: rgba(24, 24, 27, .92);
  --panel-2: rgba(39, 39, 42, .82);
  --line: rgba(255,255,255,.09);
  --text: #f8fafc;
  --muted: #a1a1aa;
  --red: #ef4444;
  --orange: #f97316;
  --green: #22c55e;
  --blue: #38bdf8;
  --yellow: #facc15;
  --violet: #a78bfa;
  --shadow: 0 20px 80px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(239, 68, 68, .18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(250, 204, 21, .12), transparent 25%),
    radial-gradient(circle at 50% 100%, rgba(59, 130, 246, .16), transparent 30%),
    var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); background: rgba(9,9,11,.78); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1360px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -.02em; }
.brand.big { font-size: 22px; }
.brand-mark { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #ef4444, #f59e0b); color: white; box-shadow: 0 12px 30px rgba(239,68,68,.35); }
.nav, .actions, .tabs, .match-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav a, .tabs a { padding: 9px 12px; border-radius: 999px; color: var(--muted); }
.nav a:hover, .nav a.active, .tabs a:hover, .tabs a.active { background: rgba(255,255,255,.08); color: white; }
.layout { max-width: 1360px; margin: 0 auto; padding: 24px 20px 50px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: 22px; box-shadow: var(--shadow); }
.card.soft { background: var(--panel-2); box-shadow: none; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero { display: grid; grid-template-columns: 1fr 240px; align-items: center; overflow: hidden; position: relative; margin-bottom: 16px; background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(24,24,27,.92) 45%, rgba(250,204,21,.12)); }
.hero h1 { margin: 14px 0 10px; font-size: clamp(32px, 6vw, 64px); line-height: .95; letter-spacing: -.06em; }
.hero p { max-width: 720px; color: #d4d4d8; font-size: 18px; }
.hero-cup { font-size: 96px; text-align: center; filter: drop-shadow(0 20px 40px rgba(250,204,21,.22)); }
.hero-cup span { display: block; font-size: 22px; font-weight: 900; }
.section-head, .match-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h1, h2 { margin: 0 0 10px; letter-spacing: -.03em; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.07); }
.badge.red { color: #fecaca; background: rgba(239,68,68,.14); }
.badge.green { color: #bbf7d0; background: rgba(34,197,94,.14); }
.badge.blue { color: #bae6fd; background: rgba(56,189,248,.14); }
.badge.yellow { color: #fef3c7; background: rgba(250,204,21,.14); }
.badge.violet { color: #ddd6fe; background: rgba(167,139,250,.14); }
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.07); color: white; border-radius: 14px; padding: 11px 15px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); }
.btn.primary { background: linear-gradient(135deg, #ef4444, #f97316); border-color: transparent; box-shadow: 0 12px 30px rgba(239,68,68,.25); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 7px; }
.field label { color: #d4d4d8; font-size: 13px; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: rgba(0,0,0,.24); color: white; border-radius: 14px; padding: 12px 13px; outline: none; }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(239,68,68,.72); box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: min(480px, 100%); }
.notice { margin-bottom: 16px; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.08); }
.notice.success { border-color: rgba(34,197,94,.28); background: rgba(34,197,94,.11); }
.notice.error { border-color: rgba(239,68,68,.28); background: rgba(239,68,68,.11); }
.stat-grid { margin: 16px 0; }
.stat span { display: block; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.stat strong { font-size: 38px; letter-spacing: -.05em; }
.match-card { display: grid; gap: 14px; }
.match-line { display: grid; grid-template-columns: 1fr 92px 1fr; gap: 12px; align-items: center; margin: 10px 0; }
.team { font-size: 20px; font-weight: 900; }
.team.right { text-align: right; }
.flag { margin-right: 8px; }
.score-box { min-height: 70px; display: grid; place-items: center; border-radius: 22px; background: radial-gradient(circle at top, rgba(255,255,255,.14), rgba(0,0,0,.18)); border: 1px solid var(--line); font-size: 28px; font-weight: 950; }
.prediction-form { display: grid; gap: 12px; }
.score-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.mini input { font-size: 24px; font-weight: 900; text-align: center; }
.power-toggle { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(239,68,68,.09); border: 1px solid rgba(239,68,68,.16); font-weight: 900; }
.power-toggle input { width: auto; }
.power-toggle span { color: var(--muted); font-size: 12px; font-weight: 700; }

.bet-slip-preview { border: 1px solid rgba(251,191,36,.28); background: linear-gradient(135deg, rgba(251,191,36,.10), rgba(239,68,68,.08)); border-radius: 18px; padding: 13px; display: grid; gap: 10px; }
.bet-slip-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.bet-slip-head strong { font-size: 14px; }
.bet-slip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bet-slip-grid div { border: 1px solid var(--line); background: rgba(0,0,0,.18); border-radius: 14px; padding: 10px; min-height: 62px; }
.bet-slip-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.bet-slip-grid strong { font-size: 17px; }
.bet-points-box { border-radius: 14px; padding: 11px 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); color: #fed7aa; font-size: 13px; line-height: 1.45; }
.bet-points-box strong { color: #fbbf24; }
@media (max-width: 720px) { .bet-slip-grid { grid-template-columns: 1fr 1fr; } }

.prediction-result { background: rgba(0,0,0,.18); border: 1px solid var(--line); padding: 14px; border-radius: 18px; display: grid; gap: 8px; }
.points { color: #fbbf24; }
.breakdown { display: flex; flex-wrap: wrap; gap: 6px; }
.breakdown span { font-size: 12px; color: #fed7aa; border-radius: 999px; padding: 4px 8px; background: rgba(249,115,22,.12); }
.mini-match, .rank-row, .team-row, .crowd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-match:last-child, .rank-row:last-child, .team-row:last-child, .crowd-row:last-child { border-bottom: 0; }
.avatar { --c: #ef4444; width: 38px; height: 38px; border-radius: 15px; display: inline-grid; place-items: center; background: var(--c); color: white; font-weight: 950; flex: 0 0 auto; }
.avatar.small { width: 30px; height: 30px; border-radius: 11px; font-size: 13px; }
.place { font-weight: 950; color: #fbbf24; }
.person { display: flex; align-items: center; gap: 10px; }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #d4d4d8; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.04); }
tr:last-child td { border-bottom: 0; }
.fun-card { background: linear-gradient(135deg, rgba(239,68,68,.16), rgba(167,139,250,.12)); }
.idea-box { min-height: 72px; display: grid; place-items: center; text-align: center; border: 1px dashed rgba(255,255,255,.18); border-radius: 18px; padding: 14px; margin: 14px 0; color: #fef3c7; font-weight: 900; }
.result-card { padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.05); display: grid; gap: 7px; }
.actions.compact { align-items: center; }
.actions.compact input, .actions.compact select { width: 86px; padding: 9px; }
.footer { text-align: center; color: var(--muted); padding: 28px 0 0; }
@media (max-width: 900px) {
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .hero { grid-template-columns: 1fr; }
  .hero-cup { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .match-line { grid-template-columns: 1fr; }
  .team.right { text-align: left; }
  .score-box { min-height: 56px; }
  .section-head { flex-direction: column; }
}

/* v6 polish: filters, today's matches, localized team labels */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.filter-bar label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.filter-bar select {
  width: min(260px, 100%);
}
.today-card {
  margin: 16px 0;
  background: linear-gradient(135deg, rgba(56,189,248,.12), rgba(249,115,22,.12), rgba(24,24,27,.92));
}
.team .flag, .flag {
  font-size: 1.1em;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.25));
}
.table-wrap td .muted {
  font-size: 12px;
  margin-top: 3px;
}

/* v8 odds scoring */
.odds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(250, 204, 21, .28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(250, 204, 21, .10), rgba(249, 115, 22, .08));
  color: var(--text);
}
.odds-strip span {
  color: var(--muted);
  font-weight: 700;
  margin-right: 2px;
}
.odds-strip strong {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
}
.small-note { font-size: 13px; line-height: 1.45; }
.odds-admin input { width: 72px; }

/* v14 admin cleanup */
.btn.danger {
  background: rgba(239, 68, 68, .16);
  border-color: rgba(239, 68, 68, .35);
  color: #fecaca;
}
.btn.danger:hover {
  background: rgba(239, 68, 68, .24);
}

/* v17 review tables: long questions/answers no longer push action buttons away */
.review-table {
  table-layout: fixed;
  min-width: 980px;
}
.review-table .col-user { width: 120px; }
.review-table .col-title { width: 44%; }
.review-table .col-answer { width: 120px; }
.review-table .col-status { width: 96px; }
.review-table .col-actions { width: 270px; }
.review-table th,
.review-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}
.review-table td:last-child {
  overflow-wrap: normal;
}
.review-table .actions.compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 250px;
}
.review-table .actions.compact input[type="number"] {
  width: 64px;
  flex: 0 0 64px;
}
.review-table .actions.compact .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-left: 12px;
  padding-right: 12px;
}
@media (max-width: 900px) {
  .review-table { min-width: 920px; }
  .review-table .col-title { width: 38%; }
  .review-table .col-actions { width: 260px; }
}


/* v18 spacing/layout polish: give sections and cards breathing room */
.layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.layout > .notice {
  margin-bottom: 0;
}
.layout > .footer {
  padding-top: 4px;
}
.grid {
  gap: 24px;
}
.card {
  padding: 24px;
}
.card.soft {
  padding: 22px;
}
.hero {
  margin-bottom: 0;
}
.stat-grid {
  margin: 0;
}
.today-card {
  margin: 0;
}
.match-card {
  gap: 16px;
  align-self: start;
}
.match-card.card.soft {
  padding: 22px;
}
.section-head {
  margin-bottom: 18px;
}
.filter-bar {
  margin-top: 20px;
  padding-top: 20px;
}
.groups-stack,
.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.table-wrap {
  margin-top: 12px;
}
.card > .table-wrap:first-child {
  margin-top: 0;
}
.card > h2 + .table-wrap,
.card > h1 + .table-wrap {
  margin-top: 14px;
}
.card > .grid,
.card > form.card,
.card > .card.soft {
  margin-top: 14px;
}
.card > h2[style*="margin-top"],
.card > div[style*="margin-top"] {
  margin-top: 24px !important;
}
.result-card {
  min-height: 74px;
}
@media (max-width: 900px) {
  .layout { gap: 20px; padding-left: 14px; padding-right: 14px; }
  .grid { gap: 18px; }
  .card { border-radius: 22px; padding: 18px; }
  .card.soft { padding: 18px; }
}

/* v22 table/playoff bracket */
.bracket-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.bracket-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 26px;
  min-width: 880px;
  align-items: stretch;
}
.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.bracket-round h2 {
  text-align: center;
  color: #fef3c7;
  font-size: 18px;
  margin-bottom: 2px;
}
.bracket-matches {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: space-around;
  height: 100%;
}
.bracket-match {
  position: relative;
  border: 1px solid rgba(255,255,255,.11);
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(0,0,0,.18));
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}
.bracket-match::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -27px;
  width: 26px;
  border-top: 1px solid rgba(250,204,21,.26);
}
.bracket-round:last-child .bracket-match::after {
  display: none;
}
.bracket-match.finished {
  border-color: rgba(34,197,94,.25);
}
.bracket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.bracket-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(56,189,248,.12);
  color: #bae6fd;
  font-weight: 800;
}
.bracket-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
  font-weight: 850;
}
.bracket-team + .bracket-team {
  margin-top: 7px;
}
.bracket-team strong {
  min-width: 24px;
  text-align: right;
  color: #fbbf24;
}
.empty-bracket {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 22px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(56,189,248,.08), rgba(249,115,22,.08));
}
.empty-bracket p {
  max-width: 620px;
}
@media (max-width: 900px) {
  .bracket-grid {
    min-width: 760px;
    grid-auto-columns: 240px;
    gap: 20px;
  }
  .bracket-match::after {
    right: -21px;
    width: 20px;
  }
}

/* v23 table tabs + planned playoff bracket */
.table-hero {
  display: grid;
  gap: 14px;
}
.table-hero .muted {
  max-width: 820px;
}
.table-tabs {
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
  width: fit-content;
  max-width: 100%;
  justify-self: center;
}
.table-tabs a {
  min-width: 128px;
  text-align: center;
  justify-content: center;
  font-weight: 900;
}
.table-tabs a.active {
  background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(249,115,22,.18));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.playoff-card {
  overflow: hidden;
}
.playoff-note {
  margin-bottom: 18px;
  text-align: center;
}
.playoff-note h2 {
  margin-bottom: 6px;
}
.playoff-note p {
  max-width: 720px;
  margin: 0 auto;
}
.bracket-grid {
  align-items: center;
}
.bracket-round-final .bracket-matches {
  justify-content: center;
}
.bracket-match.placeholder {
  border-style: dashed;
  background: linear-gradient(135deg, rgba(255,255,255,.045), rgba(0,0,0,.14));
  opacity: .92;
}
.bracket-team-placeholder {
  color: rgba(248,250,252,.68);
  font-weight: 750;
}
.worldcup-trophy {
  display: grid;
  place-items: center;
  gap: 2px;
  margin: -2px auto 10px;
  width: 112px;
  min-height: 92px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 20%, rgba(250,204,21,.24), rgba(249,115,22,.10) 52%, rgba(0,0,0,.16));
  border: 1px solid rgba(250,204,21,.26);
  box-shadow: 0 18px 50px rgba(250,204,21,.13);
  font-size: 46px;
  line-height: 1;
}
.worldcup-trophy span {
  font-size: 11px;
  font-weight: 950;
  color: #fef3c7;
  text-transform: uppercase;
  letter-spacing: .03em;
}
@media (max-width: 720px) {
  .table-tabs {
    width: 100%;
    border-radius: 20px;
  }
  .table-tabs a {
    min-width: 0;
    flex: 1 1 0;
  }
}

/* v24 brand logo */
.brand-logo-link {
  flex: 0 0 auto;
  min-width: 280px;
  max-width: 360px;
  gap: 0;
}
.brand-logo-img {
  display: block;
  width: 100%;
  height: 54px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .45));
}
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.login-logo-img {
  display: block;
  width: min(100%, 520px);
  height: auto;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .55));
}
@media (max-width: 900px) {
  .brand-logo-link {
    min-width: 0;
    max-width: min(100%, 420px);
  }
  .brand-logo-img {
    height: 48px;
  }
}
@media (max-width: 560px) {
  .brand-logo-img {
    height: 42px;
  }
}

/* v25: compact table page header */
.table-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0 26px;
}
.table-switcher .table-tabs {
  margin-top: 0;
}

/* v26: compact playoff web bracket */
.playoff-web-card {
  overflow: hidden;
}
.playoff-web {
  display: grid;
  gap: 12px;
  align-items: stretch;
  min-height: var(--playoff-board-height, 480px);
}
.playoff-stage-col,
.playoff-final-col {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.playoff-stage-col.left:not(.is-final-side)::after,
.playoff-stage-col.right:not(.is-final-side)::after {
  content: '';
  position: absolute;
  top: 42px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, rgba(56, 189, 248, .06), rgba(56, 189, 248, .45), rgba(56, 189, 248, .06));
}
.playoff-stage-col.left:not(.is-final-side)::after {
  right: -6px;
}
.playoff-stage-col.right:not(.is-final-side)::after {
  left: -6px;
}
.playoff-stage-label {
  text-align: center;
  color: #fef3c7;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.playoff-stage-label-final {
  margin-bottom: 8px;
}
.playoff-stage-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
  flex: 1;
}
.playoff-node {
  position: relative;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(0,0,0,.18));
  border-radius: 18px;
  padding: 10px;
  min-width: 0;
  box-shadow: 0 14px 34px rgba(0,0,0,.20);
}
.playoff-node.placeholder {
  border-style: dashed;
  background: linear-gradient(135deg, rgba(255,255,255,.045), rgba(0,0,0,.12));
}
.playoff-stage-col.left .playoff-node::after,
.playoff-stage-col.right .playoff-node::after,
.playoff-stage-col.final .playoff-node::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  border-top: 1px solid rgba(56, 189, 248, .55);
}
.playoff-stage-col.left .playoff-node::after {
  right: -16px;
}
.playoff-stage-col.right .playoff-node::after {
  left: -16px;
}
.playoff-stage-col.final .playoff-node::after {
  display: none;
}
.playoff-stage-col.is-final-side .playoff-node::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 18px;
  border-top: 1px solid rgba(56, 189, 248, .65);
}
.playoff-stage-col.left.is-final-side .playoff-node::before {
  right: -18px;
}
.playoff-stage-col.right.is-final-side .playoff-node::before {
  left: -18px;
}
.playoff-node.finished {
  border-color: rgba(34,197,94,.24);
}
.playoff-node.compact {
  margin-top: 10px;
}
.playoff-node-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}
.playoff-node-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(56,189,248,.12);
  color: #bae6fd;
  font-weight: 800;
}
.playoff-node .bracket-team {
  padding: 8px 9px;
  font-size: 13px;
}
.playoff-node .bracket-team + .bracket-team {
  margin-top: 6px;
}
.playoff-node .bracket-team strong {
  min-width: 16px;
}
.playoff-final-col {
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.worldcup-trophy {
  width: 100%;
  max-width: 150px;
  padding: 10px 10px 8px;
  border-radius: 24px;
  border: 1px solid rgba(250,204,21,.26);
  background: radial-gradient(circle at 50% 18%, rgba(250,204,21,.22), rgba(249,115,22,.08) 56%, rgba(0,0,0,.14));
  box-shadow: 0 18px 48px rgba(250,204,21,.14);
  display: grid;
  place-items: center;
  gap: 4px;
}
.worldcup-trophy img {
  display: block;
  width: 88px;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.28));
}
.worldcup-trophy span {
  font-size: 10px;
  font-weight: 950;
  color: #fef3c7;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.playoff-final-col .playoff-stage-col {
  width: 100%;
}
.playoff-third-place {
  width: 100%;
  margin-top: 8px;
}
.playoff-web-note {
  margin-top: 16px;
  text-align: center;
}
@media (max-width: 1360px) {
  .playoff-node {
    padding: 8px;
    border-radius: 16px;
  }
  .playoff-node .bracket-team {
    font-size: 12px;
    padding: 7px 8px;
  }
  .playoff-stage-label {
    font-size: 12px;
  }
  .worldcup-trophy {
    max-width: 132px;
  }
  .worldcup-trophy img {
    width: 76px;
  }
}
@media (max-width: 1100px) {
  .playoff-web-card {
    overflow-x: auto;
  }
  .playoff-web {
    min-width: 980px;
  }
}

/* v27: groups page uniform cards in 2 columns */
.groups-grid {
  align-items: start;
  gap: 24px;
}
.group-table-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
}
.group-table-card h2 {
  margin: 0 0 14px;
}
.group-table-card .table-wrap {
  margin-top: 0;
  flex: 1;
}
.group-table-card table {
  margin: 0;
}
@media (max-width: 980px) {
  .groups-grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

/* v30: compact group tables without horizontal scrollbar */
.group-table-card {
  overflow: hidden;
}
.group-table-card .table-wrap {
  overflow-x: hidden;
}
.group-table-card table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.group-table-card th,
.group-table-card td {
  padding: 10px 6px;
  font-size: 12px;
}
.group-table-card th {
  font-size: 11px;
  letter-spacing: .04em;
}
.group-table-card th:nth-child(1),
.group-table-card td:nth-child(1) {
  width: 28px;
}
.group-table-card th:nth-child(2),
.group-table-card td:nth-child(2) {
  width: 40%;
}
.group-table-card td:nth-child(n+3),
.group-table-card th:nth-child(n+3) {
  text-align: center;
  white-space: nowrap;
}
.group-table-card td:nth-child(2) strong {
  display: block;
  line-height: 1.2;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.group-table-card td:nth-child(2) .muted {
  font-size: 10px;
  line-height: 1.2;
}
@media (min-width: 981px) and (max-width: 1240px) {
  .group-table-card {
    padding: 18px;
  }
  .group-table-card th,
  .group-table-card td {
    padding: 8px 4px;
    font-size: 11px;
  }
  .group-table-card th {
    font-size: 10px;
  }
  .group-table-card td:nth-child(2) strong {
    font-size: 10.5px;
  }
  .group-table-card td:nth-child(2) .muted {
    display: none;
  }
}
@media (max-width: 980px) {
  .group-table-card .table-wrap {
    overflow-x: auto;
  }
  .group-table-card table {
    min-width: 700px;
    table-layout: auto;
  }
  .group-table-card td:nth-child(2) .muted {
    display: block;
  }
}

/* v31: larger, wider group cards */
.groups-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.group-table-card {
  padding: 26px;
  border-radius: 28px;
}
.group-table-card h2 {
  margin: 0 0 18px;
  font-size: 20px;
}
.group-table-card .table-wrap {
  border-radius: 20px;
}
.group-table-card table {
  width: 100%;
}
.group-table-card th,
.group-table-card td {
  padding: 12px 8px;
  font-size: 13px;
}
.group-table-card th {
  font-size: 11px;
}
.group-table-card th:nth-child(1),
.group-table-card td:nth-child(1) {
  width: 32px;
}
.group-table-card th:nth-child(2),
.group-table-card td:nth-child(2) {
  width: 45%;
}
.group-table-card td:nth-child(2) strong {
  font-size: 13px;
  line-height: 1.25;
}
.group-table-card td:nth-child(2) .muted {
  display: none;
}
.group-table-card td:nth-child(n+3),
.group-table-card th:nth-child(n+3) {
  min-width: 22px;
}
@media (min-width: 981px) and (max-width: 1240px) {
  .groups-grid {
    gap: 22px;
  }
  .group-table-card {
    padding: 22px;
  }
  .group-table-card th,
  .group-table-card td {
    padding: 10px 6px;
    font-size: 12px;
  }
  .group-table-card td:nth-child(2) strong {
    font-size: 12px;
  }
}
@media (max-width: 980px) {
  .groups-grid {
    grid-template-columns: 1fr;
  }
  .group-table-card td:nth-child(2) .muted {
    display: block;
  }
}

/* v32: tighten inner spacing for group tables so all columns fit */
.group-table-card {
  padding: 22px;
}
.group-table-card .table-wrap {
  border-radius: 16px;
}
.group-table-card table {
  font-variant-numeric: tabular-nums;
}
.group-table-card th,
.group-table-card td {
  padding: 9px 5px;
  font-size: 12px;
}
.group-table-card th {
  font-size: 10px;
}
.group-table-card th:nth-child(1),
.group-table-card td:nth-child(1) {
  width: 26px;
}
.group-table-card th:nth-child(2),
.group-table-card td:nth-child(2) {
  width: 43%;
}
.group-table-card td:nth-child(2) strong {
  font-size: 12px;
}
.group-table-card td:nth-child(n+3),
.group-table-card th:nth-child(n+3) {
  min-width: 18px;
  width: 5.7%;
}
@media (min-width: 981px) {
  .group-table-card th:last-child,
  .group-table-card td:last-child {
    padding-right: 8px;
  }
}
@media (min-width: 981px) and (max-width: 1240px) {
  .group-table-card {
    padding: 20px;
  }
  .group-table-card th,
  .group-table-card td {
    padding: 8px 4px;
    font-size: 11px;
  }
  .group-table-card td:nth-child(2) strong {
    font-size: 11px;
  }
}

/* v33: reduce team-name column so stats start earlier */
.group-table-card th:nth-child(2),
.group-table-card td:nth-child(2) {
  width: 34%;
}
.group-table-card td:nth-child(2) strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.group-table-card td:nth-child(n+3),
.group-table-card th:nth-child(n+3) {
  width: auto;
  min-width: 16px;
}
@media (min-width: 981px) {
  .group-table-card th,
  .group-table-card td {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* v35: larger group blocks and bigger text */
.groups-grid {
  gap: 30px;
}
.group-table-card {
  padding: 26px;
  border-radius: 28px;
}
.group-table-card h2 {
  margin: 0 0 18px;
  font-size: 18px;
}
.group-table-card .table-wrap {
  border-radius: 18px;
}
.group-table-card th,
.group-table-card td {
  padding: 10px 5px;
  font-size: 13px;
}
.group-table-card th {
  font-size: 10.5px;
}
.group-table-card th:nth-child(2),
.group-table-card td:nth-child(2) {
  width: 32%;
}
.group-table-card td:nth-child(2) strong {
  font-size: 13px;
  font-weight: 800;
}
.group-table-card td:nth-child(n+3),
.group-table-card th:nth-child(n+3) {
  min-width: 16px;
}
@media (min-width: 981px) and (max-width: 1240px) {
  .group-table-card {
    padding: 22px;
  }
  .group-table-card th,
  .group-table-card td {
    font-size: 12px;
    padding: 9px 4px;
  }
  .group-table-card td:nth-child(2) strong {
    font-size: 12px;
  }
}

/* v36: final readable group tables */
.layout {
  max-width: 1480px;
}
.topbar-inner {
  max-width: 1480px;
}
.groups-grid {
  grid-template-columns: repeat(2, minmax(560px, 1fr));
  gap: 32px;
}
.group-table-card {
  padding: 28px;
  min-width: 0;
}
.group-table-card h2 {
  font-size: 22px;
  margin-bottom: 20px;
}
.group-table-card table {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
}
.group-table-card .table-wrap {
  overflow: hidden;
}
.group-table-card th,
.group-table-card td {
  padding: 12px 8px;
  font-size: 14px;
}
.group-table-card th {
  font-size: 11px;
}
.group-table-card th:nth-child(1),
.group-table-card td:nth-child(1) {
  width: 34px;
}
.group-table-card th:nth-child(2),
.group-table-card td:nth-child(2) {
  width: 38%;
}
.group-table-card td:nth-child(2) strong {
  font-size: 14px;
  line-height: 1.25;
}
.group-table-card td:nth-child(n+3),
.group-table-card th:nth-child(n+3) {
  width: auto;
  min-width: 22px;
  text-align: center;
}
@media (max-width: 1280px) {
  .groups-grid {
    grid-template-columns: 1fr;
  }
  .group-table-card table {
    table-layout: auto;
  }
  .group-table-card .table-wrap {
    overflow-x: auto;
  }
}

/* v37: larger top navigation sections */
.nav {
  gap: 14px;
}
.nav a {
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
}
@media (max-width: 1100px) {
  .nav {
    gap: 10px;
  }
  .nav a {
    padding: 10px 13px;
    font-size: 15px;
  }
}

/* v41: rules page and first-login modal */
.rules-page-card {
  padding: 0;
  overflow: hidden;
}
.rules-content {
  display: grid;
  gap: 22px;
}
.rules-hero {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 20px;
  align-items: center;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(239,68,68,.20), rgba(24,24,27,.92) 45%, rgba(250,204,21,.12));
  border: 1px solid rgba(255,255,255,.08);
}
.rules-hero h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  margin: 12px 0 10px;
}
.rules-hero p {
  max-width: 880px;
  color: #d4d4d8;
  font-size: 17px;
  line-height: 1.55;
}
.rules-hero-cup {
  font-size: 80px;
  text-align: center;
  filter: drop-shadow(0 20px 36px rgba(250,204,21,.25));
}
.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.rule-card {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(0,0,0,.16));
}
.rule-card h2 {
  font-size: 20px;
  margin-bottom: 10px;
}
.rule-card p {
  color: #d4d4d8;
  line-height: 1.55;
  margin: 0 0 10px;
}
.rule-card p:last-child {
  margin-bottom: 0;
}
.rules-summary {
  padding: 22px;
}
.rules-short-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rules-short-list span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(249,115,22,.12);
  border: 1px solid rgba(249,115,22,.18);
  color: #fed7aa;
  font-weight: 800;
}
.modal-backdrop.rules-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(16px);
}
.rules-modal {
  width: min(980px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.rules-modal-head {
  padding: 24px 26px 16px;
  border-bottom: 1px solid var(--line);
}
.rules-modal-head h1 {
  margin-top: 10px;
  font-size: clamp(26px, 4vw, 42px);
}
.rules-modal-body {
  overflow: auto;
  padding: 18px 26px;
}
.rules-modal .rules-hero {
  grid-template-columns: 1fr;
  padding: 20px;
}
.rules-modal .rules-hero-cup {
  display: none;
}
.rules-modal .rules-hero h1 {
  font-size: 32px;
}
.rules-modal .rules-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rules-modal .rule-card {
  padding: 16px;
}
.rules-modal .rule-card h2 {
  font-size: 17px;
}
.rules-modal .rule-card p {
  font-size: 14px;
}
.rules-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px 26px 24px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.14);
}
@media (max-width: 860px) {
  .rules-grid,
  .rules-modal .rules-grid {
    grid-template-columns: 1fr;
  }
  .rules-hero {
    grid-template-columns: 1fr;
  }
  .rules-hero-cup {
    display: none;
  }
  .rules-modal-actions {
    grid-template-columns: 1fr;
  }
}

/* v44: disabled power play if already used for the day */
.power-toggle.disabled {
  opacity: .62;
  cursor: not-allowed;
}
.power-toggle.disabled input {
  cursor: not-allowed;
}

/* v45: collapse technical prediction audit log */
.audit-details {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.035);
  padding: 14px;
}
.audit-details summary {
  cursor: pointer;
  font-weight: 900;
  color: #f8fafc;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
}
.audit-details summary::-webkit-details-marker {
  display: none;
}
.audit-details summary::before {
  content: '▸';
  color: #f97316;
  transition: transform .18s ease;
}
.audit-details[open] summary::before {
  transform: rotate(90deg);
}
.audit-details[open] summary {
  background: linear-gradient(135deg, rgba(239,68,68,.18), rgba(249,115,22,.13));
}

/* v47: cleaner dashboard without hero */
.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.dashboard-stats {
  margin-top: 0;
}
.dashboard-stats .stat.card {
  min-height: 116px;
}
.dashboard-stats .stat span {
  min-height: 34px;
}
@media (max-width: 1180px) {
  .cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .cols-5 {
    grid-template-columns: 1fr;
  }
}

/* v48: protect match cards from long team names */
.match-line {
  grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr);
  gap: 14px;
}
.team {
  min-width: 0;
  max-width: 100%;
  line-height: 1.18;
  overflow-wrap: anywhere;
  word-break: normal;
}
.team.right {
  justify-self: end;
}
.team .flag,
.flag {
  display: inline-block;
  margin-right: 4px;
}
.score-box {
  min-width: 78px;
  min-height: 62px;
  padding: 8px;
  font-size: 24px;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .match-line {
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    gap: 10px;
  }
  .team {
    font-size: 18px;
  }
  .score-box {
    min-width: 68px;
    min-height: 56px;
    font-size: 22px;
  }
}
@media (max-width: 720px) {
  .match-line {
    grid-template-columns: 1fr;
  }
  .team,
  .team.right {
    justify-self: stretch;
    text-align: left;
  }
  .score-box {
    width: 100%;
  }
}

/* v49: remove outer background from rules page */
.rules-page-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible !important;
}
.rules-page-card .rules-content {
  gap: 22px;
}

/* v57: center the first-login rules modal button */
.rules-modal-actions {
  grid-template-columns: minmax(260px, 420px);
  justify-content: center;
}
.rules-modal-actions .btn {
  width: 100%;
}
@media (max-width: 860px) {
  .rules-modal-actions {
    grid-template-columns: 1fr;
  }
}

/* v65: remove playoff final connector lines to avoid overlap with final match cells */
.playoff-stage-col.is-final-side .playoff-node::before,
.playoff-stage-col.left.is-final-side .playoff-node::before,
.playoff-stage-col.right.is-final-side .playoff-node::before {
  display: none !important;
  content: none !important;
}

/* v66: replace final trophy image and make it cleaner */
.worldcup-trophy {
  max-width: 170px;
  padding: 8px 8px 7px;
}
.worldcup-trophy img {
  width: 118px;
  max-height: 150px;
  object-fit: contain;
  border-radius: 14px;
}
@media (max-width: 1360px) {
  .worldcup-trophy {
    max-width: 150px;
  }
  .worldcup-trophy img {
    width: 104px;
    max-height: 136px;
  }
}

/* v67: user admin actions */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.row-actions form {
  margin: 0;
}
.row-actions .btn {
  padding: 9px 12px;
  white-space: nowrap;
}


/* v77 true mobile layout
   Аккуратная мобильная версия без вмешательства в desktop.
*/
@media (max-width: 768px) {
  :root {
    --m-x: 12px;
    --m-card: 18px;
    --m-radius: 22px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0 !important;
    overflow-x: hidden !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
  }

  * {
    box-sizing: border-box;
  }

  img, svg, video, canvas {
    max-width: 100%;
    height: auto;
  }

  input, select, textarea, button {
    font-size: 16px !important;
  }

  .layout,
  main.layout {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 14px var(--m-x) 28px !important;
    margin: 0 !important;
  }

  .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    padding: 10px var(--m-x) 12px !important;
    border-radius: 0 0 20px 20px !important;
    backdrop-filter: blur(18px);
  }

  .topbar-inner {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .brand-logo-link {
    justify-self: center !important;
    display: block !important;
    max-width: 210px !important;
  }

  .brand-logo-img {
    width: 210px !important;
    max-width: 70vw !important;
    height: auto !important;
    display: block !important;
  }

  .nav {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nav a {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 7px 4px !important;
    border-radius: 15px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .nav a::before {
    display: block;
    font-size: 18px;
    line-height: 1;
  }

  .nav a[href="/"]::before,
  .nav a[href$="/"]::before,
  .nav a[href*="page=dashboard"]::before,
  .nav a[href$="index.php"]::before { content: "🏠"; }
  .nav a[href$="/matches"]::before,
  .nav a[href*="/matches?"]::before,
  .nav a[href*="page=matches"]::before { content: "⚽"; }
  .nav a[href$="/groups"]::before,
  .nav a[href*="/groups?"]::before,
  .nav a[href*="page=groups"]::before { content: "📊"; }
  .nav a[href$="/leaderboard"]::before,
  .nav a[href*="/leaderboard?"]::before,
  .nav a[href*="page=leaderboard"]::before { content: "🏆"; }
  .nav a[href$="/challenges"]::before,
  .nav a[href*="/challenges?"]::before,
  .nav a[href*="page=challenges"]::before { content: "🎯"; }
  .nav a[href$="/quests"]::before,
  .nav a[href*="/quests?"]::before,
  .nav a[href*="page=quests"]::before { content: "🔮"; }
  .nav a[href$="/rules"]::before,
  .nav a[href*="/rules?"]::before,
  .nav a[href*="page=rules"]::before { content: "📘"; }
  .nav a[href$="/admin"]::before,
  .nav a[href*="/admin?"]::before,
  .nav a[href*="page=admin"]::before { content: "⚙️"; }
  .nav a[href$="/logout"]::before,
  .nav a[href*="/logout?"]::before,
  .nav a[href*="page=logout"]::before { content: "↪"; }

  .card,
  .soft,
  .match-card,
  .group-table-card,
  .rules-card,
  .rule-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: var(--m-card) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: var(--m-radius) !important;
  }

  .grid,
  .grid.cols-2,
  .grid.cols-3,
  .groups-grid,
  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .stat-card,
  .stats-grid .card {
    min-height: 118px !important;
  }

  h1 {
    font-size: clamp(28px, 8vw, 36px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.035em !important;
    margin-bottom: 14px !important;
  }

  h2 {
    font-size: clamp(20px, 6vw, 26px) !important;
    line-height: 1.12 !important;
  }

  .section-head {
    gap: 10px !important;
    align-items: flex-start !important;
  }

  .tabs,
  .admin-tabs,
  .table-tabs,
  .filter-tabs {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .tabs a,
  .tabs button,
  .admin-tabs a,
  .table-tabs a {
    flex: 1 1 auto !important;
    min-width: max-content !important;
    padding: 10px 12px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    text-align: center !important;
  }

  /* Match cards */
  .match-card {
    padding: 18px !important;
  }

  .match-top {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }

  .match-date,
  .match-time {
    margin-left: auto !important;
    text-align: right !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  .teams,
  .match-teams,
  .teams-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin: 18px 0 !important;
    text-align: left !important;
  }

  .team-name,
  .team-label,
  .team {
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: clamp(22px, 7vw, 30px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
  }

  .vs,
  .versus {
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 18px !important;
    font-size: 26px !important;
  }

  .odds,
  .odds-row,
  .coefficients {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  .odd-pill,
  .pill,
  .badge {
    white-space: nowrap !important;
  }

  .form,
  form {
    max-width: 100% !important;
  }

  .field {
    min-width: 0 !important;
  }

  input,
  select,
  textarea {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 14px !important;
  }

  textarea {
    min-height: 100px !important;
  }

  button,
  .btn,
  input[type="submit"] {
    min-height: 46px !important;
    border-radius: 15px !important;
  }

  .score-inputs,
  .prediction-inputs,
  .form-grid,
  .bet-slip-grid,
  .calc-grid,
  .prediction-calc,
  .actions,
  .actions.compact {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .actions.compact input,
  .actions.compact select,
  .actions.compact button {
    width: 100% !important;
  }

  /* Mobile tables become cards */
  .table-wrap,
  .table-scroll,
  .standings-table,
  .admin-table-wrap {
    width: 100% !important;
    overflow: visible !important;
  }

  table.mobile-card-table {
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    display: block !important;
  }

  table.mobile-card-table thead {
    display: none !important;
  }

  table.mobile-card-table tbody {
    display: grid !important;
    gap: 12px !important;
  }

  table.mobile-card-table tr {
    display: grid !important;
    gap: 9px !important;
    padding: 14px !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.035) !important;
  }

  table.mobile-card-table td {
    display: grid !important;
    grid-template-columns: minmax(90px, 40%) 1fr !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 14px !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  table.mobile-card-table td::before {
    content: attr(data-label);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
    font-weight: 800;
  }

  table.mobile-card-table td .person {
    align-items: center !important;
  }

  table.mobile-card-table td .avatar {
    flex: 0 0 auto !important;
  }

  /* Dashboard lists */
  .next-matches,
  .top-list,
  .list,
  .feed {
    width: 100% !important;
  }

  /* Auth / first login */
  .auth-page,
  .login-page,
  .complete-profile-page {
    min-height: 100svh !important;
    padding: 16px var(--m-x) !important;
    align-items: center !important;
  }

  .auth-card,
  .login-card,
  .profile-card,
  .complete-profile-card {
    width: 100% !important;
    max-width: 430px !important;
    padding: 20px !important;
    border-radius: 24px !important;
  }

  .auth-logo,
  .login-logo,
  .profile-logo {
    max-width: 100% !important;
    height: auto !important;
  }

  .rules-content .rules-grid,
  .rules-grid {
    grid-template-columns: 1fr !important;
  }

  .rules-modal,
  .modal {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100svh - 24px) !important;
    overflow: auto !important;
  }

  .empty-state {
    display: grid !important;
    gap: 8px !important;
    padding: 18px !important;
    min-height: auto !important;
  }

  .empty-state strong,
  .empty-state span {
    display: block !important;
  }

  .playoff-bracket,
  .playoff,
  .bracket-wrap {
    overflow: visible !important;
  }

  .playoff-inner,
  .bracket-inner {
    min-width: 0 !important;
  }
}

@media (max-width: 420px) {
  :root {
    --m-x: 10px;
    --m-card: 16px;
  }

  .nav {
    gap: 6px !important;
  }

  .nav a {
    min-height: 40px !important;
    font-size: 10px !important;
    padding: 6px 3px !important;
  }

  .nav a::before {
    font-size: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  table.mobile-card-table td {
    grid-template-columns: 96px 1fr !important;
  }
}

/* v78 navigation + empty state polish */
.nav-short { display: none; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
}
.empty-state strong,
.empty-state span {
  display: block;
}

@media (max-width: 768px) {
  .topbar .nav,
  .nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .nav a {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
    line-height: 1.05 !important;
    padding: 7px 4px !important;
  }

  .nav-text { display: none !important; }
  .nav-short { display: inline !important; }

  .nav a::before {
    display: block !important;
    margin-bottom: 2px !important;
  }

  .empty-state {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 16px !important;
  }
}

@media (max-width: 420px) {
  .topbar .nav,
  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .nav a {
    font-size: 10.5px !important;
    min-height: 40px !important;
  }
}

/* v79 mobile compact fixes */
@media (max-width: 768px) {
  :root {
    --m-x: 10px;
    --m-card: 14px;
    --m-radius: 20px;
  }

  .layout,
  main.layout {
    padding: 10px var(--m-x) 26px !important;
  }

  .topbar {
    padding: 8px var(--m-x) 10px !important;
  }

  .topbar-inner {
    gap: 8px !important;
  }

  .brand-logo-link {
    max-width: 176px !important;
  }

  .brand-logo-img {
    width: 176px !important;
    max-width: 58vw !important;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    align-items: stretch !important;
  }

  .nav a {
    min-height: 46px !important;
    height: auto !important;
    padding: 6px 3px !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: normal !important;
    word-break: keep-all !important;
  }

  .nav a::before {
    font-size: 16px !important;
    line-height: 1 !important;
    margin: 0 0 2px !important;
  }

  .nav-text { display: none !important; }
  .nav-short {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  h1 {
    font-size: clamp(26px, 7.5vw, 32px) !important;
    margin-bottom: 10px !important;
  }

  h2 {
    font-size: clamp(20px, 5.8vw, 24px) !important;
  }

  .card,
  .soft,
  .match-card,
  .group-table-card,
  .rules-card,
  .rule-card {
    padding: var(--m-card) !important;
    border-radius: var(--m-radius) !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .stat-card,
  .stats-grid .card {
    min-height: 96px !important;
  }

  .stat-card strong,
  .stats-grid .card strong {
    font-size: 32px !important;
  }

  .match-card {
    padding: 16px !important;
  }

  .match-date,
  .match-time {
    width: 100% !important;
    margin-left: 0 !important;
    text-align: left !important;
  }

  .teams,
  .match-teams,
  .teams-row {
    gap: 10px !important;
    margin: 14px 0 !important;
  }

  .team-name,
  .team-label,
  .team {
    font-size: clamp(23px, 6.8vw, 30px) !important;
    line-height: 1.1 !important;
  }

  .odds,
  .odds-row,
  .coefficients {
    gap: 7px !important;
    padding: 10px !important;
  }

  .odd-pill,
  .pill,
  .badge {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }

  .bet-slip-preview {
    padding: 12px !important;
    gap: 8px !important;
  }

  .bet-slip-grid,
  .calc-grid,
  .prediction-calc {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .bet-slip-grid div,
  .calc-grid div,
  .prediction-calc div {
    min-height: 58px !important;
    padding: 9px !important;
  }

  .power-toggle {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px !important;
    min-height: 64px !important;
    overflow: hidden !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  .power-toggle input {
    width: 22px !important;
    min-width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    margin: 0 !important;
  }

  .power-toggle,
  .power-toggle * {
    overflow-wrap: anywhere !important;
  }

  .score-inputs,
  .prediction-inputs,
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  input,
  select,
  textarea {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  /* Mobile card tables: общая компактная схема без горизонтального скролла */
  table.mobile-card-table tbody {
    gap: 10px !important;
  }

  table.mobile-card-table tr {
    padding: 12px !important;
    border-radius: 18px !important;
  }

  table.mobile-card-table td {
    grid-template-columns: minmax(88px, 36%) minmax(0, 1fr) !important;
    gap: 8px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  table.mobile-card-table td::before {
    font-size: 10px !important;
    letter-spacing: .07em !important;
  }

  /* Рейтинг: карточки становятся аккуратнее и читабельнее */
  table.mobile-leaderboard-table tr {
    gap: 10px !important;
  }

  table.mobile-leaderboard-table td[data-label="Участник"] {
    align-items: center !important;
  }

  table.mobile-leaderboard-table td[data-label="Участник"] .person {
    display: grid !important;
    grid-template-columns: 42px 1fr !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  table.mobile-leaderboard-table td[data-label="Участник"] strong {
    display: block !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  table.mobile-leaderboard-table .avatar {
    width: 42px !important;
    height: 42px !important;
  }

  table.mobile-leaderboard-table .badge {
    max-width: 100% !important;
    white-space: normal !important;
  }

  /* Групповые таблицы: команда сверху, статистика компактной сеткой */
  table.mobile-standings-table tr {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  table.mobile-standings-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  table.mobile-standings-table td::before {
    flex: 0 0 auto !important;
  }

  table.mobile-standings-table td[data-label="#"],
  table.mobile-standings-table td[data-label="Команда"] {
    grid-column: 1 / -1 !important;
  }

  table.mobile-standings-table td[data-label="Команда"] {
    align-items: flex-start !important;
  }

  table.mobile-standings-table td[data-label="Команда"] strong {
    display: block !important;
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    text-align: right !important;
  }

  table.mobile-standings-table td[data-label="Команда"] .muted {
    text-align: right !important;
    font-size: 13px !important;
  }

  /* Пустые состояния */
  .empty-state strong + span {
    margin-top: 4px !important;
  }
}

@media (max-width: 420px) {
  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .nav a {
    font-size: 9.5px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  table.mobile-card-table td {
    grid-template-columns: 84px minmax(0, 1fr) !important;
  }
}


/* v80 mobile compact rows: прогнозы + таблица групп */
@media (max-width: 768px) {
  :root {
    --m-x: 8px;
    --m-card: 12px;
    --m-radius: 18px;
  }

  body {
    font-size: 14px !important;
  }

  .layout,
  main.layout {
    padding: 8px var(--m-x) 24px !important;
  }

  .card,
  .soft,
  .match-card,
  .group-table-card,
  .rules-card,
  .rule-card {
    padding: var(--m-card) !important;
    border-radius: var(--m-radius) !important;
  }

  h1 {
    font-size: clamp(24px, 6.8vw, 30px) !important;
    line-height: 1.08 !important;
  }

  h2 {
    font-size: clamp(19px, 5.4vw, 23px) !important;
  }

  .section-head,
  .match-top {
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  /* Прогнозы: возвращаем нормальную компактную строку команд */
  .match-card {
    gap: 10px !important;
    padding: 12px !important;
  }

  .match-line,
  .teams,
  .match-teams,
  .teams-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 10px 0 !important;
  }

  .team,
  .team-name,
  .team-label {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: clamp(16px, 4.9vw, 20px) !important;
    line-height: 1.12 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .team.right {
    text-align: right !important;
  }

  .flag {
    margin-right: 4px !important;
  }

  .score-box,
  .vs,
  .versus {
    width: 54px !important;
    min-width: 54px !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    border-radius: 15px !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  .match-date,
  .match-time {
    width: auto !important;
    margin-left: auto !important;
    text-align: right !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  .odds,
  .odds-row,
  .coefficients {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px !important;
    margin-top: 8px !important;
    border-radius: 14px !important;
  }

  .odds > *,
  .odds-row > *,
  .coefficients > *,
  .odd-pill,
  .pill,
  .badge {
    font-size: 12px !important;
    line-height: 1.1 !important;
    padding: 5px 7px !important;
    white-space: nowrap !important;
  }

  .prediction-form {
    gap: 9px !important;
  }

  .score-inputs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .score-inputs .field {
    gap: 5px !important;
  }

  .score-inputs .field label,
  .field label {
    font-size: 12px !important;
    line-height: 1.15 !important;
  }

  input,
  select,
  textarea {
    min-height: 40px !important;
    padding: 9px 10px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
  }

  .field.mini input {
    font-size: 18px !important;
  }

  .bet-slip-preview {
    padding: 10px !important;
    gap: 8px !important;
    border-radius: 15px !important;
  }

  .bet-slip-head strong {
    font-size: 15px !important;
  }

  .bet-slip-grid,
  .prediction-calc,
  .calc-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .bet-slip-grid div,
  .prediction-calc div,
  .calc-grid div {
    min-height: 50px !important;
    padding: 8px !important;
    border-radius: 12px !important;
  }

  .bet-slip-grid span,
  .prediction-calc span,
  .calc-grid span {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }

  .bet-slip-grid strong,
  .prediction-calc strong,
  .calc-grid strong {
    font-size: 16px !important;
  }

  .bet-points-box {
    padding: 9px 10px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
  }

  .power-toggle {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: 52px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    overflow: visible !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    font-size: 14px !important;
  }

  .power-toggle input {
    appearance: auto !important;
    flex: 0 0 20px !important;
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
    margin: 0 !important;
  }

  .power-toggle strong,
  .power-toggle span,
  .power-toggle label {
    min-width: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .btn,
  button,
  input[type="submit"] {
    min-height: 42px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    border-radius: 14px !important;
  }

  /* Таблица групп: карточка-команда + компактная строка статистики */
  table.mobile-standings-table,
  table.mobile-standings-table tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  table.mobile-standings-table thead {
    display: none !important;
  }

  table.mobile-standings-table tbody {
    display: grid !important;
    gap: 10px !important;
  }

  table.mobile-standings-table tr {
    display: grid !important;
    grid-template-columns: 34px repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 10px !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,.045) !important;
    border: 1px solid rgba(255,255,255,.09) !important;
  }

  table.mobile-standings-table td {
    min-width: 0 !important;
    border: 0 !important;
    padding: 5px 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    text-align: center !important;
    background: transparent !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  table.mobile-standings-table td::before {
    display: block !important;
    flex: 0 0 auto !important;
    font-size: 10px !important;
    line-height: 1 !important;
    color: var(--muted) !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
  }

  table.mobile-standings-table td[data-label="#"] {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    justify-content: flex-start !important;
    color: var(--muted) !important;
    font-weight: 800 !important;
  }

  table.mobile-standings-table td[data-label="#"]::before {
    display: none !important;
  }

  table.mobile-standings-table td[data-label="Команда"] {
    grid-column: 2 / -1 !important;
    grid-row: 1 !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 0 8px !important;
    text-align: left !important;
  }

  table.mobile-standings-table td[data-label="Команда"]::before {
    display: none !important;
  }

  table.mobile-standings-table td[data-label="Команда"] strong {
    display: inline !important;
    max-width: 100% !important;
    font-size: 17px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-align: left !important;
  }

  table.mobile-standings-table td[data-label="Команда"] .muted {
    display: none !important;
  }

  table.mobile-standings-table td[data-label="О"],
  table.mobile-standings-table td[data-label="Очки"] {
    color: var(--yellow) !important;
    font-weight: 950 !important;
  }

  table.mobile-standings-table td[data-label="ГЗ"],
  table.mobile-standings-table td[data-label="ГП"],
  table.mobile-standings-table td[data-label="+/-"] {
    font-size: 12px !important;
  }
}

@media (max-width: 390px) {
  .match-line,
  .teams,
  .match-teams,
  .teams-row {
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .score-box,
  .vs,
  .versus {
    width: 46px !important;
    min-width: 46px !important;
    height: 40px !important;
    min-height: 40px !important;
    font-size: 16px !important;
  }

  .team,
  .team-name,
  .team-label {
    font-size: clamp(15px, 4.7vw, 18px) !important;
  }

  .odds > *,
  .odds-row > *,
  .coefficients > *,
  .odd-pill,
  .pill,
  .badge {
    font-size: 11px !important;
    padding: 4px 6px !important;
  }

  table.mobile-standings-table tr {
    grid-template-columns: 30px repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
    padding: 9px !important;
  }

  table.mobile-standings-table td {
    font-size: 12px !important;
  }

  table.mobile-standings-table td::before {
    font-size: 9px !important;
  }

  table.mobile-standings-table td[data-label="Команда"] strong {
    font-size: 16px !important;
  }
}


/* v89 server-side PNG flags from classic_3_64 */
.team-flag-img {
  display: inline-block;
  width: 1.25em;
  height: auto;
  min-width: 1.25em;
  margin-right: 0.32em;
  vertical-align: -0.14em;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.10);
}

.flag .team-flag-img {
  margin-right: 0;
}

@media (max-width: 768px) {
  .team-flag-img {
    width: 1.18em;
    min-width: 1.18em;
  }
}


/* v90 flag polish: no frame around flags */
.team-flag-img {
  border-radius: 1px !important;
  box-shadow: none !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  width: 1.22em !important;
  min-width: 1.22em !important;
  margin-right: 0.32em !important;
  vertical-align: -0.12em !important;
}

.flag,
.match-card .flag {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

@media (max-width: 768px) {
  .team-flag-img {
    width: 1.16em !important;
    min-width: 1.16em !important;
    margin-right: 0.28em !important;
  }
}


/* v91: PNG flags in dashboard mini matches and group tables */
.team-label-with-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  min-width: 0;
  vertical-align: -0.08em;
}

.team-label-with-flag .team-flag-img {
  flex: 0 0 auto;
  margin-right: 0 !important;
  vertical-align: 0 !important;
}

.team-label-with-flag > span:last-child {
  min-width: 0;
}

.mini-match-teams,
.match-teams-with-flags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.36em;
  min-width: 0;
}

.mini-match-teams {
  line-height: 1.35;
}

.match-separator,
.match-score-inline {
  color: var(--muted);
  font-weight: 900;
}

.match-score-inline {
  color: #fbbf24;
}

.group-team-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

/* v92: align PNG flags with team names in prediction match cards */
.match-line .team {
  display: flex !important;
  align-items: center !important;
  gap: 0.48em !important;
  line-height: 1.18 !important;
}

.match-line .team.right {
  justify-content: flex-end !important;
  text-align: right !important;
}

.match-line .team .flag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  margin-right: 0 !important;
  line-height: 0 !important;
  vertical-align: middle !important;
}

.match-line .team .flag .team-flag-img {
  display: block !important;
  margin-right: 0 !important;
  vertical-align: middle !important;
}

@media (max-width: 720px) {
  .match-line .team.right {
    justify-content: flex-start !important;
    text-align: left !important;
  }
}

/* v94: prediction opening window */
.prediction-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
}

.prediction-locked strong {
  display: block;
  margin-bottom: 4px;
}

.prediction-locked p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.prediction-locked.future {
  border-color: rgba(56,189,248,.26);
  background: linear-gradient(135deg, rgba(56,189,248,.10), rgba(0,0,0,.18));
}

.prediction-locked.closed {
  border-color: rgba(255,255,255,.10);
  opacity: .9;
}

@media (max-width: 720px) {
  .prediction-locked {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v96: emoji avatars */
.avatar.emoji-avatar {
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  text-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.avatar.large {
  width: 76px;
  height: 76px;
  border-radius: 26px;
  font-size: 38px;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 9px;
}
.avatar-choice {
  position: relative;
  cursor: pointer;
}
.avatar-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.avatar-choice span {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  font-size: 25px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.avatar-choice:hover span,
.avatar-choice input:focus-visible + span {
  transform: translateY(-1px);
  border-color: rgba(251,191,36,.45);
  background: rgba(251,191,36,.10);
}
.avatar-choice input:checked + span {
  border-color: rgba(251,191,36,.85);
  background: linear-gradient(135deg, rgba(251,191,36,.18), rgba(239,68,68,.16));
  box-shadow: 0 0 0 3px rgba(251,191,36,.12);
}
.profile-layout {
  align-items: start;
}
.profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.profile-main h1 {
  margin-bottom: 6px;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.profile-stats-grid div {
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius: 18px;
  padding: 13px;
}
.profile-stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.profile-stats-grid strong {
  font-size: 24px;
  color: #fbbf24;
}
@media (max-width: 720px) {
  .profile-stats-grid { grid-template-columns: 1fr 1fr; }
  .avatar-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .avatar-choice span { min-height: 42px; font-size: 22px; border-radius: 14px; }
}

/* v97: SVG avatar set */
.avatar.image-avatar {
  overflow: hidden;
  padding: 3px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10), 0 10px 22px rgba(0,0,0,.18);
}
.avatar.image-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}
.avatar.image-avatar.large {
  padding: 5px;
}
.avatar-image-choice span {
  padding: 4px;
}
.avatar-image-choice span img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  border-radius: 14px;
}
.avatar-image-choice input:checked + span img {
  transform: scale(1.03);
}
@media (max-width: 720px) {
  .avatar-image-choice span img { width: 34px; height: 34px; }
}


/* v98: team SVG avatars */
.avatar-image-picker {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.avatar-image-picker::-webkit-scrollbar {
  width: 8px;
}
.avatar-image-picker::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}
@media (max-width: 720px) {
  .avatar-image-picker { max-height: 430px; }
}

/* v99: compact profile, avatar editor under avatar, password change */
.grid.cols-2.profile-settings-layout {
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: start;
}
.profile-card-clean {
  overflow: visible;
}
.profile-main.profile-main-centered {
  align-items: center;
  gap: 22px;
  margin-bottom: 0;
}
.profile-avatar-area {
  display: grid;
  justify-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.profile-avatar-wrap {
  position: relative;
  width: max-content;
}
.avatar.profile-avatar-xl {
  width: 116px;
  height: 116px;
  border-radius: 38px;
  font-size: 54px;
}
.avatar.image-avatar.profile-avatar-xl {
  padding: 6px;
}
.avatar-edit-trigger {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: linear-gradient(135deg, #f43f2f, #ff6a19);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0,0,0,.35), 0 0 0 4px rgba(20,20,24,.9);
  transition: transform .15s ease, filter .15s ease;
}
.avatar-edit-trigger:hover,
.avatar-edit-trigger:focus-visible {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.06);
  outline: none;
}
.avatar-edit-link {
  padding: 9px 13px;
  min-height: auto;
  font-size: 12px;
}
.profile-user-info h1 {
  margin-bottom: 8px;
}
.profile-avatar-editor {
  display: none;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.profile-avatar-editor.open {
  display: block;
}
.profile-editor-head {
  margin-bottom: 14px;
}
.profile-editor-head h2 {
  margin-bottom: 6px;
}
.profile-avatar-editor .avatar-image-picker {
  max-height: 360px;
}
.profile-password-card h2 {
  margin-bottom: 8px;
}
.profile-password-card .form {
  margin-top: 18px;
}
@media (max-width: 900px) {
  .grid.cols-2.profile-settings-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .profile-main.profile-main-centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .avatar.profile-avatar-xl {
    width: 104px;
    height: 104px;
    border-radius: 34px;
  }
  .profile-avatar-editor .avatar-image-picker {
    max-height: 420px;
  }
}
