:root {
  color-scheme: dark;
  --ink: #101510;
  --panel: #171d17;
  --panel-2: #202720;
  --line: #313a31;
  --muted: #a5afa5;
  --paper: #f2f3ea;
  --accent: #caff3d;
  --accent-2: #8ee62f;
  --danger: #ff7a6b;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; min-width: 320px; background: var(--ink); color: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.loading-screen,
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 78% 20%, rgba(202,255,61,.12), transparent 28rem),
    linear-gradient(145deg, #0d110d, #151c15);
}

.loading-screen { align-content: center; gap: 24px; color: var(--muted); }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand i {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 14px; background: var(--accent); color: var(--ink);
  font-weight: 950; font-style: normal; letter-spacing: -.08em;
}
.brand span { display: grid; line-height: 1.05; }
.brand b { font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .15em; }

.login-card {
  width: min(960px, 100%); overflow: hidden; border: 1px solid var(--line);
  border-radius: 30px; background: var(--panel);
  display: grid; grid-template-columns: 1.2fr .8fr;
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
}
.login-intro { padding: clamp(32px, 6vw, 74px); background: var(--accent); color: var(--ink); }
.login-intro h1 { margin: 44px 0 20px; max-width: 640px; font-size: clamp(44px, 7vw, 80px); line-height: .92; letter-spacing: -.07em; }
.login-intro p { max-width: 500px; font-size: 18px; line-height: 1.55; }
.login-score { margin-top: 42px; display: flex; gap: 12px; }
.login-score span { padding: 10px 14px; border: 1px solid rgba(16,21,16,.22); border-radius: 999px; font-weight: 800; }
.login-form { padding: clamp(32px, 5vw, 62px); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-weight: 900; font-size: 11px; }
.login-form h2 { margin: 12px 0 8px; font-size: 34px; letter-spacing: -.04em; }
.login-form > p { margin: 0 0 30px; color: var(--muted); line-height: 1.5; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .03em; }
input, select {
  min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: #111611; color: var(--paper); padding: 12px 14px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(202,255,61,.1); }
.login-form label + label { margin-top: 16px; }
.primary-button {
  border: 0; border-radius: 13px; padding: 14px 20px; background: var(--accent);
  color: var(--ink); font-weight: 950; margin-top: 24px;
}
.primary-button:hover { background: #d7ff6b; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 22px; margin: 15px 0 0; color: var(--danger) !important; font-size: 13px; }

.app-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: rgba(16,21,16,.94); backdrop-filter: blur(14px); }
.header-inner { max-width: 1320px; margin: auto; padding: 13px 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.header-inner .brand i { width: 40px; height: 40px; border-radius: 11px; font-size: 14px; }
.header-inner .brand b { font-size: 14px; }
.header-inner nav { display: flex; gap: 4px; border-radius: 999px; background: var(--panel); padding: 4px; }
.header-inner nav button { border: 0; border-radius: 999px; background: none; color: var(--muted); padding: 9px 16px; font-weight: 800; font-size: 13px; }
.header-inner nav button.active { color: var(--ink); background: var(--accent); }
.user-menu { justify-self: end; display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--panel-2); color: var(--accent); font-weight: 950; }
.user-menu > span { display: grid; }
.user-menu strong { font-size: 13px; }
.user-menu small { color: var(--muted); font-size: 11px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); }
.logout-label { display: none; }

.page-shell { width: min(1320px, calc(100% - 40px)); margin: 28px auto 80px; }
.season-summary {
  display: grid; grid-template-columns: 1.4fr repeat(3, .7fr) 1fr;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); margin-bottom: 54px;
}
.season-summary > div { min-height: 104px; padding: 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.season-summary > div:last-child { border: 0; }
.summary-title { background: var(--accent); color: var(--ink); }
.summary-title span, .summary-stat span, .summary-next span { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; color: var(--muted); }
.summary-title span { color: rgba(16,21,16,.65); }
.summary-title strong { font-size: 25px; letter-spacing: -.04em; }
.summary-stat strong, .summary-next strong { font-size: 19px; }
.summary-next strong { color: var(--accent); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h1 { margin: 8px 0 0; font-size: clamp(36px, 5vw, 62px); line-height: .95; letter-spacing: -.065em; }
.section-heading p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.55; }
.rounds-page { margin-top: 12px; margin-bottom: 0; }
.rounds-page .season-summary { margin-bottom: 12px; }
.rounds-page .season-summary > div { min-height: 62px; padding: 10px 14px; }
.rounds-page .summary-title strong { font-size: 19px; }
.rounds-page .summary-stat strong, .rounds-page .summary-next strong { font-size: 16px; }
.rounds-footer { display: none; }

.rounds-workspace {
  height: calc(100vh - 166px); min-height: 500px; max-height: 680px;
  display: grid; grid-template-columns: 180px minmax(0, 1fr) 210px; gap: 12px;
}
.rounds-nav, .round-panel, .desktop-rpl-aside {
  min-width: 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: 18px; background: var(--panel);
}
.rounds-nav { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.rounds-nav-title {
  min-height: 60px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.rounds-nav-title > div { display: grid; gap: 3px; }
.rounds-nav-title strong { font-size: 17px; letter-spacing: -.03em; }
.mobile-home-controls, .mobile-standings { display: none; }
.rounds-nav-grid {
  min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(15, minmax(0, 1fr)); gap: 4px; padding: 8px;
}
.round-nav-button {
  min-width: 0; min-height: 0; display: grid;
  grid-template-columns: auto 1fr auto; align-items: center; gap: 5px;
  border: 1px solid transparent; border-radius: 8px; padding: 3px 6px;
  background: var(--panel-2); color: var(--muted); text-align: left;
}
.round-nav-button:hover { border-color: rgba(202,255,61,.45); color: var(--paper); }
.round-nav-number { color: var(--paper); font-size: 12px; font-weight: 950; }
.round-nav-label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.round-nav-state { font-size: 9px; font-weight: 900; }
.round-nav-button.completed {
  border-color: rgba(202,255,61,.2); background: rgba(202,255,61,.08);
}
.round-nav-button.completed .round-nav-state { color: var(--accent); font-size: 12px; }
.round-nav-button.active {
  border-color: var(--accent); background: var(--accent); color: rgba(16,21,16,.68);
}
.round-nav-button.active .round-nav-number,
.round-nav-button.active .round-nav-state { color: var(--ink); }
.rounds-nav-legend {
  min-height: 30px; display: flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em;
}
.rounds-nav-legend i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(202,255,61,.1);
}
.desktop-rpl-aside {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr);
}
.desktop-rpl-aside-head {
  min-height: 60px; display: grid; align-content: center; gap: 3px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.desktop-rpl-aside-head strong { font-size: 17px; letter-spacing: -.03em; }
.desktop-rpl-mini-list { min-height: 0; overflow-y: auto; }
.desktop-rpl-mini-row {
  min-width: 0; display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px 28px 24px;
  align-items: center; gap: 4px; padding: 6px 8px;
  border-bottom: 1px solid var(--line); color: var(--muted);
  font-size: 9px; text-align: center;
}
.desktop-rpl-mini-row:last-child { border-bottom: 0; }
.desktop-rpl-mini-header {
  background: var(--panel-2); font-size: 8px; font-weight: 900;
  text-transform: uppercase;
}
.desktop-rpl-mini-row > span:nth-child(2) { text-align: left; }
.desktop-rpl-mini-row > b { color: var(--paper); font-size: 11px; }
.desktop-rpl-team {
  min-width: 0; display: flex; align-items: center; gap: 6px;
}
.rpl-team-copy { min-width: 0; display: grid; gap: 3px; }
.team-form {
  min-height: 7px; display: flex; align-items: center; gap: 3px;
}
.team-form i {
  display: block; width: 7px; height: 7px; flex: 0 0 auto;
  border-radius: 50%;
}
.team-form i.win { background: #49d36a; }
.team-form i.draw { background: #f3c94b; }
.team-form i.loss { background: #ff6b5e; }
.desktop-rpl-team img,
.desktop-rpl-team .team-logo-fallback {
  flex: 0 0 auto; width: 20px; height: 20px; font-size: 6px;
}
.desktop-rpl-team strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--paper); font-size: 9px;
}
.round-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.round-panel-head {
  min-height: 60px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.round-panel-head > div { display: grid; gap: 3px; }
.round-panel-head strong { font-size: 22px; letter-spacing: -.04em; }
.round-panel-status {
  padding: 8px 11px; border-radius: 999px; background: var(--panel-2);
  color: var(--muted); font-size: 11px; font-weight: 900;
}
.round-panel-status.completed { background: rgba(202,255,61,.1); color: var(--accent); }
.round-panel .matches {
  min-height: 0; display: grid; grid-template-rows: repeat(8, minmax(0, 1fr));
}
.match-card { display: grid; grid-template-columns: 165px minmax(270px, 1.25fr) minmax(250px, .95fr) minmax(290px, 1.1fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.match-card:last-child { border: 0; }
.match-time, .fixture, .prediction-box, .others { padding: 20px; }
.match-time { display: flex; flex-direction: column; justify-content: center; gap: 5px; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.match-time strong { color: var(--paper); font-size: 15px; }
.match-time em { color: #ffd56b; font-style: normal; font-size: 10px; }
.match-live {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px;
  color: #ff6b5e; font-size: 10px; font-weight: 850;
}
.match-live i {
  width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%;
  background: #ff6b5e; box-shadow: 0 0 0 0 rgba(255,107,94,.45);
  animation: live-pulse 1.8s infinite;
}
.match-live b { color: inherit; }
.match-live span { color: var(--paper); font-weight: 750; }
@keyframes live-pulse {
  70% { box-shadow: 0 0 0 6px rgba(255,107,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,94,0); }
}
.fixture { display: grid; gap: 11px; border-right: 1px solid var(--line); }
.team { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; font-weight: 850; }
.team img, .team-logo-fallback { width: 28px; height: 28px; object-fit: contain; border-radius: 50%; background: white; }
.team-logo-fallback { display: grid; place-items: center; background: var(--panel-2); color: var(--accent); font-size: 10px; }
.match-team-copy { min-width: 0; display: grid; gap: 3px; }
.match-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team b { color: var(--accent); font-size: 19px; }
.team b.live-score { color: #ff6b5e; }
.prediction-box { display: flex; align-items: center; gap: 9px; border-right: 1px solid var(--line); }
.prediction-box > span { color: var(--muted); }
.score-input { width: 48px; height: 46px; padding: 0; text-align: center; font-size: 18px; font-weight: 900; }
.save-button { border: 0; border-radius: 11px; padding: 11px 13px; background: var(--accent); color: var(--ink); font-weight: 900; }
.save-button:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.locked-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.points { min-width: 42px; padding: 8px; border-radius: 10px; background: rgba(202,255,61,.12); color: var(--accent); text-align: center; font-weight: 950; }
.others { display: flex; flex-wrap: wrap; align-content: center; gap: 8px; }
.others-label { width: 100%; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.other-pick { padding: 7px 9px; border-radius: 9px; background: var(--panel-2); color: var(--muted); font-size: 11px; }
.other-pick b { color: var(--paper); }
.round-panel .match-card {
  min-height: 0; grid-template-columns: 100px minmax(155px, 1.15fr) minmax(155px, .8fr) minmax(180px, 1fr);
}
.round-panel .match-time,
.round-panel .fixture,
.round-panel .prediction-box,
.round-panel .others { min-width: 0; padding: 5px 9px; }
.round-panel .match-time { gap: 2px; font-size: 9px; }
.round-panel .match-time strong { font-size: 11px; white-space: nowrap; }
.round-panel .match-time em { font-size: 8px; }
.round-panel .match-live { gap: 3px; font-size: 7px; white-space: nowrap; }
.round-panel .match-live i { width: 6px; height: 6px; }
.round-panel .fixture { align-content: center; gap: 2px; }
.round-panel .team {
  min-width: 0; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; font-size: 11px;
}
.round-panel .match-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-panel .team img, .round-panel .team-logo-fallback { width: 20px; height: 20px; font-size: 7px; }
.round-panel .team b { font-size: 15px; }
.round-panel .prediction-box { gap: 5px; }
.round-panel .score-input { width: 36px; height: 34px; border-radius: 9px; font-size: 14px; }
.round-panel .save-button { padding: 8px 9px; border-radius: 9px; font-size: 10px; }
.round-panel .locked-note { font-size: 9px; line-height: 1.2; }
.round-panel .locked-note b { display: block; margin-top: 2px; color: var(--paper); }
.round-panel .points { min-width: 34px; padding: 6px; border-radius: 8px; font-size: 11px; }
.round-panel .others {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center; gap: 3px 5px;
}
.round-panel .others-label { display: none; }
.round-panel .other-pick {
  min-width: 0; overflow: hidden; padding: 3px 5px; border-radius: 6px;
  font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .match-live i { animation: none; }
}
.empty-rounds { padding: 50px; text-align: center; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); }

.leaderboard { width: 100%; border-collapse: collapse; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.leaderboard th, .leaderboard td { padding: 18px 20px; border-bottom: 1px solid var(--line); text-align: left; }
.leaderboard th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.leaderboard tbody tr:last-child td { border: 0; }
.leaderboard tbody tr.me { background: rgba(202,255,61,.06); }
.rpl-team-cell { display: inline-flex; align-items: center; gap: 10px; }
.rpl-team-cell img,
.rpl-team-cell .team-logo-fallback { width: 30px; height: 30px; font-size: 9px; }
.place { color: var(--accent); font-size: 22px; font-weight: 950; }
.participant-cell { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.big-points { color: var(--accent); font-size: 24px; font-weight: 950; }

.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rule-card { min-height: 230px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 26px; display: flex; flex-direction: column; justify-content: space-between; }
.rule-card > span { color: var(--muted); font-size: 12px; font-weight: 900; }
.rule-card h2 { margin: 18px 0 8px; font-size: 25px; }
.rule-card p { color: var(--muted); line-height: 1.5; }
.rule-card strong { color: var(--accent); font-size: 55px; letter-spacing: -.06em; }
.rules-copy { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rules-copy article { border-top: 1px solid var(--line); padding-top: 18px; }
.rules-copy h3 { margin: 8px 0; }
.rules-copy p { color: var(--muted); line-height: 1.5; }

.admin-toolbar, .sync-card { display: flex; align-items: center; gap: 16px; }
.admin-toolbar label { min-width: 150px; }
.admin-switcher {
  display: inline-flex; gap: 4px; margin-bottom: 24px; padding: 4px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
}
.admin-switcher button {
  border: 0; border-radius: 10px; padding: 11px 18px;
  background: transparent; color: var(--muted); font-weight: 900;
}
.admin-switcher button.active { background: var(--accent); color: var(--ink); }
.admin-copy {
  margin-bottom: 18px; padding: 18px 20px; border-left: 3px solid var(--accent);
  border-radius: 0 14px 14px 0; background: var(--panel);
}
.admin-copy p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.admin-users { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.admin-user {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel);
}
.admin-user-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.admin-user-title div, .profile-identity div { display: grid; gap: 4px; }
.admin-user-title span, .profile-identity span { color: var(--muted); font-size: 12px; }
.admin-user > button, .profile-card form > button {
  grid-column: 1 / -1; border: 0; border-radius: 11px; padding: 12px 15px;
  background: var(--accent); color: var(--ink); font-weight: 900;
}
.admin-filter-bar {
  display: flex; align-items: end; gap: 14px; margin-bottom: 18px;
  padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
.admin-filter-bar label { min-width: 190px; }
.admin-predictions { display: grid; gap: 10px; }
.admin-prediction {
  display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: center; gap: 18px;
  border: 1px solid var(--line); border-radius: 15px; padding: 16px 18px; background: var(--panel);
}
.admin-prediction-match { display: grid; gap: 4px; }
.admin-prediction-match span, .admin-prediction-match small { color: var(--muted); font-size: 11px; }
.admin-prediction-score { display: flex; align-items: center; gap: 8px; }
.admin-prediction-score input { width: 58px; text-align: center; font-weight: 900; }
.admin-prediction-score b { min-width: 40px; color: var(--accent); text-align: center; }
.sync-card { margin-bottom: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.sync-card .sync-icon { color: var(--accent); font-size: 28px; }
.sync-card div { flex: 1; }
.sync-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.sync-card button, .admin-actions button { border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); color: var(--paper); padding: 11px 14px; font-weight: 850; }
.admin-list { display: grid; gap: 12px; }
.admin-match { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel); display: grid; grid-template-columns: 1.4fr 1.4fr 1fr auto; gap: 14px; align-items: end; }
.admin-match .two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-match .result-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions button:first-child { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.admin-actions .reset-button { color: var(--accent); }
.admin-actions .danger-button { color: var(--danger); }
.override-badge { color: #ffd56b; font-size: 10px; font-weight: 900; }
.check-label { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.check-label input { width: auto; }

.profile-card {
  max-width: 760px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--panel);
}
.profile-identity { display: flex; align-items: flex-start; gap: 14px; }
.profile-identity .avatar { width: 56px; height: 56px; font-size: 18px; }
.profile-identity strong { font-size: 20px; }
.profile-card form { display: grid; gap: 14px; }

footer { width: min(1320px, calc(100% - 40px)); margin: auto; padding: 24px 0 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; transform: translateY(120px); opacity: 0; padding: 14px 18px; border-radius: 13px; background: var(--accent); color: var(--ink); font-weight: 900; box-shadow: 0 12px 40px rgba(0,0,0,.35); transition: .2s; }
.toast.show { transform: none; opacity: 1; }
.toast.error { background: var(--danger); }

@media (max-width: 1050px) {
  .season-summary { grid-template-columns: repeat(4, 1fr); }
  .summary-title { grid-column: 1 / -1; }
  .match-card { grid-template-columns: 140px 1fr 1fr; }
  .others { grid-column: 1 / -1; border-top: 1px dashed var(--line); }
  .rounds-page .season-summary { grid-template-columns: 1.2fr repeat(3, .7fr) 1fr; }
  .rounds-page .summary-title { grid-column: auto; }
  .rounds-workspace { grid-template-columns: 190px minmax(0, 1fr); gap: 9px; }
  .desktop-rpl-aside { display: none; }
  .round-panel .match-card {
    grid-template-columns: 88px minmax(160px, 1fr) minmax(145px, .8fr) minmax(175px, 1fr);
  }
  .round-panel .others { grid-column: auto; border-top: 0; }
  .round-panel .match-time,
  .round-panel .fixture,
  .round-panel .prediction-box,
  .round-panel .others { padding-inline: 6px; }
  .round-panel .save-button { padding-inline: 6px; }
  .admin-match { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 14px;
  }
  .header-inner .brand {
    min-width: 0;
    overflow: hidden;
  }
  .header-inner .brand i {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
  }
  .header-inner .brand span {
    min-width: 0;
    overflow: hidden;
  }
  .header-inner .brand b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-inner nav {
    position: fixed;
    z-index: 30;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    justify-content: flex-start;
    overflow-x: auto;
    box-shadow: 0 8px 35px rgba(0,0,0,.45);
  }
  .header-inner nav button {
    flex: 1 0 auto;
    padding-inline: 12px;
  }
  .user-menu {
    position: relative;
    z-index: 2;
    justify-self: end;
    flex: 0 0 auto;
  }
  .user-menu .avatar { display: none; }
  .user-menu #logout {
    width: auto;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 999px;
    background: var(--panel);
    color: var(--paper);
    font-size: 12px;
    font-weight: 900;
  }
  .user-menu #logout .logout-icon { color: var(--accent); font-size: 15px; }
  .user-menu #logout .logout-label { display: inline; }
  .user-menu > span,
  .header-inner .brand small { display: none; }
}
@media (max-width: 760px) {
  .login-card { grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .page-shell { width: min(100% - 24px, 1320px); margin-top: 16px; }
  .season-summary { grid-template-columns: 1fr 1fr; margin-bottom: 38px; }
  .rounds-page .season-summary { display: none; }
  .rounds-page { margin-bottom: 80px; }
  .summary-title, .summary-next { grid-column: 1 / -1; }
  .season-summary > div { min-height: 88px; border-bottom: 1px solid var(--line); }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading h1 { font-size: 40px; }
  .rounds-workspace {
    height: auto; min-height: 0; max-height: none; display: grid;
    grid-template-columns: 1fr; gap: 10px;
  }
  .mobile-home-controls {
    display: grid; grid-template-columns: repeat(3, 62px); gap: 8px;
  }
  .mobile-home-button {
    position: relative; width: 62px; height: 54px; display: grid;
    grid-template-rows: 1fr auto; place-items: center; gap: 1px; padding: 5px 5px 4px;
    border: 1px solid var(--line); border-radius: 13px;
    background: var(--panel); color: var(--muted);
  }
  .mobile-home-button > .mobile-home-icon { font-size: 21px; line-height: 1; }
  .mobile-home-button > .mobile-home-label {
    font-size: 8px; line-height: 1; font-weight: 950;
    text-transform: uppercase; letter-spacing: .05em;
  }
  .mobile-home-button > b {
    position: absolute; right: 3px; top: 3px; min-width: 18px;
    padding: 2px 4px; border-radius: 999px; background: var(--panel-2);
    color: var(--accent); font-size: 8px; line-height: 1.2;
  }
  .mobile-home-button.active { border-color: var(--accent); background: var(--accent); color: var(--ink); }
  .mobile-home-button.active > b { background: var(--ink); color: var(--accent); }
  .rounds-nav { display: none; overflow: visible; }
  .rounds-nav.mobile-open { display: grid; grid-template-rows: auto auto; }
  .rounds-nav-title { display: none; }
  .rounds-nav-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: none; gap: 4px;
  }
  .round-nav-button { min-height: 34px; grid-template-columns: 1fr auto; }
  .round-nav-label { display: none; }
  .round-panel { overflow: visible; display: block; }
  .round-panel .matches { display: block; }
  .match-card { grid-template-columns: 1fr; }
  .round-panel .match-card { grid-template-columns: 1fr; }
  .match-time, .fixture, .prediction-box, .others { border: 0; border-bottom: 1px solid var(--line); padding: 15px; }
  .round-panel .match-time,
  .round-panel .fixture,
  .round-panel .prediction-box,
  .round-panel .others { padding: 12px; }
  .match-time { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .others { grid-column: auto; border-bottom: 0; }
  .round-panel .others {
    grid-column: auto; border-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .round-panel .other-pick { padding: 6px 8px; font-size: 10px; }
  .mobile-standings.mobile-open {
    display: block; overflow: hidden; border: 1px solid var(--line);
    border-radius: 16px; background: var(--panel);
  }
  .mobile-standings-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 14px; border-bottom: 1px solid var(--line);
  }
  .mobile-standings-head > div { display: grid; gap: 3px; }
  .mobile-standings-head strong { font-size: 18px; }
  .mobile-standings-head button {
    border: 0; background: transparent; color: var(--accent);
    font-size: 11px; font-weight: 900;
  }
  .mobile-standings-list { display: grid; }
  .mobile-standing-row {
    min-width: 0; display: grid; grid-template-columns: 32px 30px minmax(0, 1fr) auto;
    align-items: center; gap: 9px; padding: 9px 13px; border-bottom: 1px solid var(--line);
  }
  .mobile-standing-row:last-child { border-bottom: 0; }
  .mobile-standing-row.me { background: rgba(202,255,61,.06); }
  .mobile-standing-row .avatar { width: 30px; height: 30px; font-size: 10px; }
  .mobile-standing-row > strong {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px;
  }
  .mobile-standing-row > span:last-child { color: var(--muted); font-size: 10px; }
  .mobile-standing-row > span:last-child b { color: var(--accent); font-size: 15px; }
  .mobile-place { color: var(--accent); font-size: 13px; font-weight: 950; }
  .mobile-rpl-table { max-height: 470px; overflow-y: auto; }
  .mobile-rpl-row {
    min-width: 0; display: grid;
    grid-template-columns: 22px minmax(96px, 1fr) repeat(4, 22px) 38px 26px;
    align-items: center; gap: 4px; padding: 7px 10px;
    border-bottom: 1px solid var(--line); color: var(--muted);
    font-size: 10px; text-align: center;
  }
  .mobile-rpl-row:last-child { border-bottom: 0; }
  .mobile-rpl-header {
    position: sticky; top: 0; z-index: 1; background: var(--panel-2);
    color: var(--muted); font-size: 8px; font-weight: 900;
    text-transform: uppercase;
  }
  .mobile-rpl-row > span:nth-child(2) { text-align: left; }
  .mobile-rpl-row > b { color: var(--paper); font-size: 12px; }
  .mobile-rpl-team {
    min-width: 0; display: flex; align-items: center; gap: 7px;
  }
  .mobile-rpl-team img,
  .mobile-rpl-team .team-logo-fallback {
    flex: 0 0 auto; width: 22px; height: 22px; font-size: 7px;
  }
  .mobile-rpl-team strong {
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; color: var(--paper); font-size: 10px;
  }
  .leaderboard { display: block; overflow-x: auto; }
  .leaderboard th, .leaderboard td { padding: 14px; white-space: nowrap; }
  .rules-grid, .rules-copy { grid-template-columns: 1fr; }
  .rule-card { min-height: 190px; }
  .admin-toolbar { width: 100%; justify-content: space-between; }
  .sync-card { align-items: flex-start; flex-wrap: wrap; }
  .admin-match { grid-template-columns: 1fr; }
  .admin-users { grid-template-columns: 1fr; }
  .admin-user { grid-template-columns: 1fr; }
  .admin-user-title, .admin-user > button { grid-column: auto; }
  .admin-filter-bar { align-items: stretch; flex-direction: column; }
  .admin-filter-bar label { min-width: 0; }
  .admin-prediction { grid-template-columns: 1fr; }
  .profile-card { grid-template-columns: 1fr; padding: 20px; }
  footer { padding-bottom: 90px; flex-direction: column; align-items: flex-start; gap: 12px; }
}
