* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e5edf6;
  --text: #111827;
  --muted: #6b7280;
  --brand: #155eef;
  --brand-dark: #0b3da8;
  --green: #059669;
  --orange: #f59e0b;
  --red: #dc2626;
  --shadow: 0 18px 50px rgba(17,24,39,.08);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, rgba(21,94,239,.06), transparent 360px), var(--bg);
}
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 18px;
  padding: 14px 32px;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  color: #fff; font-weight: 950; background: linear-gradient(135deg,var(--brand),#0f766e);
  box-shadow: 0 12px 26px rgba(21,94,239,.20);
}
.brand span:last-child { display: grid; }
.brand small, small { color: var(--muted); }

.nav { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.nav a {
  padding: 10px 12px; border-radius: 999px; color: var(--muted); font-weight: 800;
}
.nav a:hover { color: var(--brand); background: #eff6ff; }

.top-user { display: inline-flex; align-items: center; gap: 10px; justify-content: end; }
.top-user-text { display: grid; line-height: 1.16; }
.top-user-text strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 56px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px;
  background: #fff; color: var(--text); font-weight: 900; cursor: pointer;
  box-shadow: 0 8px 22px rgba(17,24,39,.04);
}
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: transparent; color: #fff; background: linear-gradient(135deg,var(--brand),var(--brand-dark)); }
.button-large { padding: 13px 20px; }
.button.full { width: 100%; }
.button.ghost { background: var(--surface-2); box-shadow: none; }
.button-disabled { pointer-events: none; opacity: .62; }

.kicker,.eyebrow {
  display: inline-flex; margin: 0 0 8px; color: var(--brand);
  font-size: .74rem; font-weight: 950; text-transform: uppercase; letter-spacing: .13em;
}

.hero-clean { display: grid; grid-template-columns: minmax(0,1fr) 390px; gap: 24px; align-items: stretch; margin-bottom: 24px; }
.hero-copy {
  padding: 44px; border: 1px solid var(--line); border-radius: 34px;
  background: radial-gradient(circle at 0% 0%, rgba(21,94,239,.10), transparent 24rem), #fff;
  box-shadow: var(--shadow);
}
.hero-copy h1 { max-width: 980px; margin: 0; font-size: clamp(2.2rem,4.6vw,5rem); line-height: .96; letter-spacing: -.065em; }
.hero-copy p { max-width: 820px; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.score-summary { display: grid; gap: 12px; }
.score-summary > div {
  display: flex; justify-content: space-between; align-items: center; padding: 22px;
  border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: var(--shadow);
}
.score-summary span { color: var(--muted); font-weight: 800; }
.score-summary strong { font-size: 2.8rem; line-height: 1; letter-spacing: -.06em; }

.ticker-section,.rules-strip,.match-board,.ranking-box,.side-note,.pred-section,.page-title,.profile-panel,.split-panels > div,.comment-form {
  border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow);
}
.ticker-section { padding: 22px; overflow: hidden; margin-bottom: 24px; }
.section-title,.page-title { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.section-title h2,.page-title h1,.side-note h3 { margin: 0; letter-spacing: -.035em; }
.section-title.inline { margin-bottom: 16px; }

.ticker { overflow: hidden; mask-image: linear-gradient(90deg, transparent, black 7%, black 93%, transparent); }
.ticker-track { display: flex; gap: 12px; width: max-content; animation: tickerMove 65s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  width: 340px; flex: 0 0 auto; padding: 14px; border: 1px solid var(--line);
  border-radius: 20px; background: linear-gradient(145deg,#fff,#f8fafc);
}
.ticker-teams { display: grid; gap: 8px; font-weight: 950; }
.ticker-teams span { display: flex; align-items: center; gap: 8px; }
.ticker-teams b { color: var(--muted); font-size: .8rem; }

.main-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; align-items: start; }
.content-main { display: grid; gap: 24px; }
.right-rail { display: grid; gap: 18px; position: sticky; top: 96px; }

.rules-strip { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: center; padding: 22px; }
.rules-strip.compact { grid-template-columns: 220px 1fr; }
.rules-strip h2 { margin: 0; letter-spacing: -.03em; }
.rules-strip p { grid-column: 1 / -1; margin: 0; color: var(--muted); line-height: 1.55; }
.rules-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.rules-grid span {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-radius: 999px; background: #f8fafc; border: 1px solid var(--line);
  color: var(--muted); font-weight: 800;
}
.rules-grid b { color: var(--brand); font-size: 1.05rem; }

.match-board,.ranking-box,.side-note,.pred-section,.profile-panel,.page-title,.split-panels > div,.comment-form { padding: 22px; }
.match-list { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; }
.match-row-display {
  display: grid; grid-template-columns: 190px minmax(0,1fr) 120px; gap: 16px; align-items: center;
  padding: 15px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.match-row-display:last-child { border-bottom: 0; }
.match-row-display:hover { background: #f8fafc; }
.match-row-meta { display: grid; gap: 6px; }
.round-pill,.count-pill {
  width: fit-content; padding: 6px 10px; border-radius: 999px; color: var(--brand-dark);
  background: #eff6ff; font-size: .74rem; font-weight: 950;
}
.team-pair { display: grid; grid-template-columns: 1fr 70px 1fr; align-items: center; gap: 14px; }
.team-pair span,.team-cell { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 900; }
.team-pair span:last-child { justify-content: flex-end; text-align: right; }
.team-pair strong { text-align: center; font-size: 1.1rem; }
.status-area { display: flex; justify-content: flex-end; }

.status {
  display: inline-flex; border-radius: 999px; padding: 6px 10px;
  font-size: .74rem; font-weight: 950; white-space: nowrap;
}
.status-scheduled { color: #475569; background: #f1f5f9; }
.status-live { color: #15803d; background: #dcfce7; }
.status-finished { color: #1d4ed8; background: #dbeafe; }
.status-open { color: #047857; background: #d1fae5; }
.status-saved { color: #1d4ed8; background: #dbeafe; }
.status-locked { color: #b91c1c; background: #fee2e2; }

.ranking-list { display: grid; gap: 10px; }
.ranking-row {
  display: grid; grid-template-columns: 30px 40px 1fr 48px; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.ranking-row:last-child { border-bottom: 0; }
.rank-position {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px;
  color: #92400e; background: #fef3c7; font-weight: 950;
}
.ranking-user { min-width: 0; display: grid; }
.ranking-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-line { display: flex; gap: 3px; margin-top: 3px; }

.avatar { width: 54px; height: 54px; border-radius: 18px; object-fit: cover; border: 1px solid var(--line); background: #f8fafc; }
.avatar-top { width: 42px; height: 42px; border-radius: 16px; }
.avatar-small { width: 38px; height: 38px; border-radius: 14px; }
.avatar-large { width: 88px; height: 88px; border-radius: 28px; }

.club-badge {
  display: grid; place-items: center; width: 46px; height: 34px; border-radius: 12px;
  border: 1px solid rgba(15,23,42,.1); color: #fff; font-size: .72rem; font-weight: 950;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.club-badge.mini { width: 42px; height: 32px; }
.club-badge-empty { color: var(--muted); background: #f1f5f9; text-shadow: none; }

.side-note { background: linear-gradient(145deg,#eff6ff,#fff); }
.side-note p { color: var(--muted); line-height: 1.6; }
.page-title.flat { margin-bottom: 24px; }
.page-title p { margin-bottom: 0; color: var(--muted); }

.predictions-form { display: grid; gap: 24px; }
.group-block { margin-top: 18px; }
.group-block h3 { margin: 0 0 10px; letter-spacing: -.02em; }
.prediction-table { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.prediction-row {
  display: grid; grid-template-columns: 185px minmax(170px,1fr) 150px minmax(170px,1fr) 70px;
  gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.prediction-row:last-child { border-bottom: 0; }
.prediction-row:hover { background: #f8fafc; }
.prediction-row.locked { opacity: .70; }
.match-date { display: grid; gap: 5px; color: var(--muted); font-size: .82rem; }
.match-date em { width: fit-content; font-style: normal; font-weight: 900; color: #b91c1c; }
.match-date em.saved { color: var(--brand); }
.match-date em.open { color: var(--green); }
.team-cell.away { justify-content: flex-end; text-align: right; }
.score-inputs { display: grid; grid-template-columns: 1fr 18px 1fr; align-items: center; gap: 8px; }
.score-inputs input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  color: var(--text); font-weight: 950; font-size: 1.05rem; text-align: center;
}
.score-inputs span { color: var(--muted); text-align: center; font-weight: 950; }
.points-cell { text-align: right; }
.points-cell b { color: var(--brand); font-size: 1.2rem; }
.points-cell small { display: block; }

.save-bar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 15px 18px; border: 1px solid rgba(21,94,239,.12); border-radius: 24px;
  background: rgba(255,255,255,.92); box-shadow: 0 24px 70px rgba(17,24,39,.16); backdrop-filter: blur(18px);
}
.save-bar div { display: grid; }

.flag {
  width: 30px; height: 22px; object-fit: cover; flex: 0 0 auto;
  border-radius: 6px; box-shadow: 0 0 0 1px rgba(17,24,39,.10); background: #fff;
}
.alert { padding: 13px 15px; border-radius: 18px; margin-bottom: 16px; border: 1px solid var(--line); }
.alert-error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.alert-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.empty-state { padding: 18px; border-radius: 18px; color: var(--muted); background: #f8fafc; border: 1px dashed #cbd5e1; }

.split-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.feed-list,.comment-list,.mini-list,.duel-list { display: grid; gap: 10px; }
.feed-item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 999px; background: var(--brand); }
.comment-item { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: 0; }
.comment-item p { margin: 4px 0 0; color: var(--text); line-height: 1.45; }
.mini-list > div,.duel-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.mini-list > div:last-child,.duel-row:last-child { border-bottom: 0; }

.comment-form,.extra-form,.profile-form { display: grid; gap: 16px; }
.comment-form label,.profile-form label { display: grid; gap: 8px; font-weight: 900; }
textarea, select, input {
  font: inherit;
}
.comment-form textarea,.comment-form select,.extra-row input,.profile-form input,.profile-form select {
  width: 100%; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); padding: 12px 14px;
}
.extra-table { display: grid; }
.extra-row {
  display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line);
}
.extra-row:last-child { border-bottom: 0; }

.profile-panel { max-width: 860px; margin: 0 auto; }
.profile-preview { display: flex; align-items: center; gap: 16px; padding: 16px; margin: 18px 0; border-radius: 22px; background: #f8fafc; }
.profile-preview div { display: grid; }
.badge-chips { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge-chips span { padding: 5px 8px; border-radius: 999px; background: #eff6ff; color: var(--brand); font-weight: 800; font-size: .82rem; }

@media (max-width: 1180px) {
  .topbar,.hero-clean,.main-layout,.rules-strip,.rules-strip.compact,.split-panels { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; }
  .top-user { justify-content: flex-start; }
  .right-rail { position: static; }
}
@media (max-width: 900px) {
  .page-shell { width: min(100% - 24px,1440px); }
  .hero-copy { padding: 28px; }
  .hero-copy h1 { font-size: 2.45rem; }
  .match-row-display,.prediction-row,.team-pair,.extra-row { grid-template-columns: 1fr; }
  .team-pair span:last-child,.team-cell.away,.status-area,.points-cell { justify-content: flex-start; text-align: left; }
  .save-bar { flex-direction: column; align-items: stretch; }
}


.access-page {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.access-card {
  max-width: 680px;
  width: 100%;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.access-card h1 {
  margin: 10px 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -.06em;
}

.access-card p {
  color: var(--muted);
  line-height: 1.7;
}

.kicker.danger {
  color: var(--red);
}

.muted-line {
  padding: 12px 16px;
  border-radius: 18px;
  background: #f8fafc;
}

.hero-actions.center {
  justify-content: center;
}

.admin-grid {
  display: grid;
  gap: 24px;
}

.admin-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-user-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.admin-user-info {
  min-width: 0;
  display: grid;
}

.admin-user-info strong,
.admin-user-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-button {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.profile-form input[type="file"] {
  padding: 10px;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .admin-user-row {
    grid-template-columns: 44px 1fr;
  }

  .admin-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
