@charset "UTF-8";

/* Form layout shared by desktop and narrow phones. */
.prediction-form { display: block; min-width: 0; }
.info-card > .admin-form { border: 0; padding: 0; background: transparent; }
.result-card .score-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 14px; }
.result-card .score-inputs .field { min-width: 0; }
.result-card .score-inputs .field input { width: 100%; min-width: 0; }
.result-card .score-inputs > span { align-self: end; padding-bottom: 13px; }

:root {
  color-scheme: light;
  --paper: #FFFAFB;
  --surface: #FFFAFB;
  --surface-raised: #fff;
  --surface-subtle: #f2f8f6;
  --surface-hover: #e6f3f0;
  --ink: #131515;
  --muted: #626967;
  --line: #e1e7e5;
  --green: #2B2C28;
  --green-dark: #131515;
  --lime: #7DE2D1;
  --accent: #339989;
  --danger: #a53d32;
  --control-bg: #fff;
  --control-line: #d7dfdc;
  --control-muted: #737b78;
  --button-ink: #FFFAFB;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #83aa38; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 1px; }
img, svg { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 1.25rem; line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; line-height: 1.3; }
p { line-height: 1.55; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 100; top: -100px; left: 12px; background: var(--lime); color: var(--ink); padding: 12px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 12px; }

.app-shell { max-width: 1180px; min-height: 100dvh; margin: auto; display: grid; grid-template-columns: 225px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 30px 20px 24px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1.55rem; font-weight: 850; letter-spacing: -.06em; white-space: nowrap; }
.brand-mark { width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; color: var(--lime); background: var(--ink); font-size: 1.35rem; letter-spacing: -.15em; padding-right: 3px; transform: rotate(-6deg); }
.brand-dot { color: #8b9d72; margin-left: 2px; }
.desktop-nav, .sidebar nav { display: grid; gap: 7px; }
.nav-button { display: flex; align-items: center; gap: 11px; min-height: 48px; width: 100%; border: 0; border-radius: 12px; padding: 10px 14px; color: #5d6c60; background: transparent; font-size: .9rem; font-weight: 650; text-align: left; }
.nav-button svg { width: 20px; height: 20px; flex: none; }
.nav-button.active, .nav-button[aria-current="page"] { background: var(--green); color: #fff; text-decoration: none; }
.nav-button:not(.active):not([aria-current="page"]):hover { background: #e9eee4; text-decoration: none; }
.sidebar-footer { margin-top: auto; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.sidebar-footer strong { display: block; color: var(--ink); }
.sidebar-footer.profile-shortcut { display: flex; align-items: center; gap: 10px; }
.profile-shortcut:hover { text-decoration: none; }
.workspace { min-width: 0; padding: 28px 42px 70px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; margin-bottom: 34px; }
.topbar-context, .eyebrow { color: var(--muted); font-size: .75rem; }
.eyebrow { font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.mobile-brand { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; overflow: hidden; border-radius: 50%; background: #e7ebdf; font-size: .75rem; font-weight: 800; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-card { display: grid; justify-items: start; gap: 20px; max-width: 610px; }
.profile-overview { display: flex; align-items: center; gap: 18px; }
.profile-overview p { margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
.profile-avatar { width: 88px; height: 88px; font-size: 1.8rem; }
.profile-label { color: var(--muted); font-size: .75rem; font-weight: 700; }
.profile-password-card { margin-top: 20px; }
.profile-nick-form, .profile-password-form, .profile-reminders-form { display: grid; justify-items: start; gap: 14px; width: 100%; }
.profile-nick-form .field, .profile-password-form .field, .profile-reminders-form .field { width: 100%; }
.profile-upload-form { display: grid; justify-items: start; gap: 12px; width: 100%; padding-top: 18px; border-top: 1px solid var(--line); }
.profile-upload-form .field { width: 100%; }
.profile-upload-form input[type="file"] { width: 100%; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.heading-copy { display: grid; gap: 8px; }
.heading-copy p { color: var(--muted); font-size: .9rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 27px 0 14px; }
.section-heading p, .section-heading > span { color: var(--muted); font-size: .8rem; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 10px; background: #e9ede2; color: #4e6150; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.small { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.hero-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 26px 28px; background: linear-gradient(115deg, #204632, #244f38); color: #fff; }
.hero-card::after { content: ""; position: absolute; top: -85px; right: -95px; width: 240px; height: 240px; border: 1px solid #ffffff19; border-radius: 50%; box-shadow: 0 0 0 36px #ffffff08, 0 0 0 75px #ffffff05; pointer-events: none; }
.hero-card .eyebrow, .hero-card p { color: #c5d8c2; }
.hero-card .pill { color: var(--lime); background: #ffffff18; }
.hero-top, .hero-stats { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-rules-link { color: #d6e7fa; font-size: .78rem; font-weight: 750; line-height: 1.35; text-align: right; text-underline-offset: 3px; }
.hero-rules-link:hover { color: #fff; }
.hero-title { position: relative; z-index: 1; margin-top: 14px; font-size: clamp(1.45rem, 4vw, 1.9rem); font-weight: 750; letter-spacing: -.04em; }
.hero-title span { display: block; margin-top: 6px; color: #c5d8c2; font-size: .8rem; font-weight: 400; letter-spacing: 0; }
.hero-stats { justify-content: flex-start; gap: 25px; margin-top: 24px; }
.stat { display: grid; gap: 4px; padding-right: 24px; border-right: 1px solid #ffffff29; }
.stat:last-child { border-right: 0; padding-right: 0; }
.stat strong { color: #effbdc; font-size: 1.6rem; line-height: 1; }
.stat span { color: #c5d8c2; font-size: .7rem; }

.banner, .notice, .validation-summary-errors { border: 1px solid #dce7c6; border-radius: 12px; padding: 13px 16px; background: #edf2df; color: #405e36; font-size: .85rem; line-height: 1.5; }
.banner.error, .notice.error, .validation-summary-errors { border-color: #efc9c4; background: #fdf0ee; color: var(--danger); }
.validation-summary-errors ul { margin: 0; padding-left: 20px; }
.validation-summary-valid { display: none; }
.field-validation-error { color: var(--danger); font-size: .78rem; }
.field-validation-valid { display: none; }
.input-validation-error { border-color: var(--danger) !important; }
.empty-state { padding: 40px 20px; border: 1px dashed #d5ddcc; border-radius: var(--radius); background: #fff; color: var(--muted); text-align: center; }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; color: var(--ink); }
.empty-state .primary-button { margin-top: 18px; }

.primary-button, .save-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px; padding: 10px 16px; font-size: .85rem; font-weight: 750; line-height: 1.2; text-align: center; }
.primary-button, .save-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.primary-button:hover, .save-button:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; text-decoration: none; }
.secondary-button { border: 1px solid #d7dfd1; background: #fff; color: var(--green); }
.secondary-button:hover { background: #f4f8ec; text-decoration: none; }
.text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 2px; border: 0; background: none; color: var(--green); font-size: .82rem; font-weight: 750; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pool-actions { justify-content: center; margin: 18px 0 24px; }
.danger-button { border: 1px solid var(--danger); background: transparent; color: var(--danger); }
.danger-button:hover { background: var(--danger); color: #fff; text-decoration: none; }

.segmented { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 18px 0 20px; scrollbar-width: thin; }
.filter-button { min-height: 46px; flex: none; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: .83rem; font-weight: 650; white-space: nowrap; }
.filter-button.active, .filter-button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }
.filter-button span { margin-left: 5px; border-radius: 5px; padding: 2px 5px; background: #e8eadf; font-size: .7rem; }
.match-filters { margin-top: 0; }
.list-tools { display: flex; justify-content: flex-end; margin: -12px 0 6px; }
.admin-match-list { display: grid; gap: 14px; }
.admin-match-list > .info-card.result-card { margin-top: 0; }

.match-list { display: grid; gap: 14px; }
.match-card, .pool-card, .info-card, .admin-form, .auth-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.match-card { padding: 18px 22px 14px; }
.match-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.sport-tag { display: inline-flex; align-items: center; gap: 6px; color: #536c54; font-weight: 750; }
.match-time { text-align: right; }
.teams-grid { display: grid; grid-template-columns: minmax(0, 1fr) 124px minmax(0, 1fr); align-items: center; gap: 8px; margin: 22px 0; }
.basketball .teams-grid { grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); }
.team { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; text-align: center; }
.team-badge { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid #e5ecdf; border-radius: 50%; background: #eff4e9; color: #476b48; font-size: .75rem; font-weight: 800; }
.team-name { font-size: .88rem; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.team-side { color: var(--muted); font-size: .7rem; }
.score-inputs { display: flex; align-items: center; justify-content: center; gap: 5px; }
.score-input { width: 48px; height: 54px; border: 1.5px solid #dce3d7; border-radius: 11px; background: #fafbf7; color: var(--ink); font-size: 1.6rem; font-weight: 750; text-align: center; appearance: textfield; padding: 0; }
.basketball .score-input { width: 60px; font-size: 1.35rem; }
.score-input::-webkit-inner-spin-button, .score-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.score-input::placeholder { color: #adb9a9; font-weight: 400; }
.score-input:focus { border-color: #85a845; background: #f6fce7; box-shadow: 0 0 0 3px #d5f56b50; outline: 0; }
.score-input:disabled { color: #7f8d80; background: #f1f3ee; }
.score-separator { color: #9eaa9b; font-size: 1.25rem; }
.score-caption { margin-top: 7px; color: var(--muted); font-size: .72rem; line-height: 1.3; text-align: center; }
.locked-score { color: var(--ink); font-size: 1.7rem; font-weight: 750; text-align: center; white-space: nowrap; }
.match-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; border-top: 1px solid #edf0e9; padding-top: 12px; }
.status { min-width: 0; color: var(--muted); font-size: .78rem; line-height: 1.4; overflow-wrap: anywhere; }
.status.saved, .status[data-state="saved"] { color: #386b40; }
.status.unsaved, .status[data-state="unsaved"] { color: #715a2b; }
.status.error, .status[data-state="error"] { color: var(--danger); }
.status.locked, .status[data-state="locked"] { color: #666e64; }
.save-button[disabled] { opacity: .65; cursor: default; }
.save-button.is-saved[disabled] { opacity: 1; border-color: #e1efd3; background: #e9f4dd; color: #45714a; }
.points-badge { border-radius: 9px; padding: 7px 10px; background: #eef6db; color: #406026; font-size: .8rem; font-weight: 750; }
.privacy-note { margin: 18px 0; color: var(--muted); font-size: .75rem; text-align: center; }

.leaderboard { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.rank-row { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #edf0e9; padding: 16px 19px; }
.rank-row:last-child { border-bottom: 0; }
.rank-row.you { background: #f0f6e3; }
.rank-number { min-width: 18px; color: #7d897b; font-size: .85rem; font-weight: 700; }
.player { flex: 1; min-width: 0; }
.rank-player { display: grid; gap: 5px; }
.player-name { font-size: .9rem; font-weight: 750; overflow-wrap: anywhere; }
.player-meta { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.rank-points { flex: none; font-size: 1.35rem; font-weight: 750; }
.rank-points small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.ranking-note { display: grid; justify-items: start; gap: 10px; margin-top: 20px; }
.scoring-rules { margin-top: 20px; scroll-margin-top: 24px; }
.scoring-rules > p { margin-bottom: 16px; }
.scoring-systems { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.scoring-system { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.scoring-system.is-active { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); background: var(--surface-raised); }
.scoring-system-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 10px; min-height: 66px; margin-bottom: 12px; }
.scoring-system-heading h3 { margin: 0; font-size: 1rem; }
.scoring-system-points { margin: 4px 0 0; color: var(--muted); font-size: .78rem; font-weight: 650; }
.scoring-system-status { display: inline-flex; align-items: center; border: 1px solid var(--lime); border-radius: 999px; padding: 5px 9px; color: var(--lime); font-size: .7rem; font-weight: 750; line-height: 1.2; }
.scoring-rule { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; font-size: .84rem; line-height: 1.45; }
.scoring-rule:last-child { padding-bottom: 0; }
.scoring-rule strong { color: var(--ink); white-space: nowrap; }
.tip-outcome { display: grid; justify-items: end; gap: 4px; text-align: right; }
.tip-points { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.podium { display: flex; align-items: end; justify-content: center; gap: 16px; margin: 16px 0 24px; }
.podium-player { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 13px 6px; border-radius: 70px 70px 14px 14px; background: linear-gradient(0deg, #e9ecdf80, transparent); color: var(--muted); font-size: .75rem; text-align: center; }
.podium-player.place-1 { background: linear-gradient(0deg, #e8f3ce, transparent); }
.podium-avatar { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border: 4px solid #fff; border-radius: 50%; background: #e4e9d9; color: #607052; font-weight: 750; }
.place-1 .podium-avatar { width: 65px; height: 65px; background: var(--lime); color: #3d572b; }
.podium-player strong { color: var(--ink); overflow-wrap: anywhere; }

.pool-grid, .info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pool-card { display: block; padding: 21px; }
.pool-card:hover { border-color: #abbf8a; box-shadow: 0 4px 20px #1726220a; text-decoration: none; }
.pool-card h2, .pool-card h3 { margin: 13px 0 7px; }
.pool-card p, .info-card p { color: var(--muted); font-size: .82rem; }
.pool-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; background: #eff4df; color: #456b37; font-size: 1rem; font-weight: 800; }
.pool-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; color: var(--muted); font-size: .78rem; }
.info-card { padding: 21px; }
.info-card h2, .info-card h3 { margin-bottom: 13px; }
.result-card { display: grid; gap: 16px; }
.result-card h3 { margin-bottom: 0; }
.result-card .admin-form { gap: 20px; margin-top: 2px; }
.result-card .admin-form > button { margin-top: 4px; }
.result-card .match-state { display: inline-flex; justify-self: start; width: fit-content; align-items: center; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-subtle); color: var(--ink); font-size: .78rem; font-weight: 750; line-height: 1.3; }
.result-card .match-state-open { border-color: #b2d6ca; background: #e6f4ef; color: #245b4f; }
.result-card .match-state-closed { border-color: #dccca4; background: #f7f0dc; color: #715624; }
.result-card .match-state-finished { border-color: #b9d2e9; background: #e9f2fa; color: #305b7d; }
.result-card .match-state-cancelled { border-color: #e7b9b4; background: #fbece9; color: #943b33; }
.detail-list { display: grid; }
.detail-row { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 12px 0; font-size: .82rem; }
.detail-row:last-child { border-bottom: 0; }
.detail-row > span:first-child { color: var(--muted); }
.detail-row strong { text-align: right; overflow-wrap: anywhere; }
.member-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; background: #fff; }
.member-row { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding: 18px 0; font-size: .85rem; }
.member-row:last-child { border-bottom: 0; }
.member-row .pill { margin-left: auto; }
.member-info { display: grid; gap: 6px; }
.member-name { font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.member-role { display: inline-flex; justify-self: start; padding: 4px 8px; border-radius: 7px; background: var(--surface-subtle); color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1.2; }
.member-row form { margin-left: auto; }

.superadmin-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.superadmin-summary .info-card { display: grid; gap: 8px; padding: 17px; }
.superadmin-summary span, .superadmin-muted { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.superadmin-summary strong { font-size: 1.6rem; line-height: 1; }
.superadmin-section { display: grid; gap: 15px; margin-top: 30px; }
.superadmin-section > .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.superadmin-section > .section-heading h2 { margin-top: 5px; }
.superadmin-pools, .superadmin-matches { display: grid; gap: 14px; }
.superadmin-pool { display: grid; gap: 17px; }
.superadmin-pool-heading, .superadmin-match-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.superadmin-pool-heading h3, .superadmin-match-heading h3 { margin-bottom: 5px; }
.superadmin-pool-heading .secondary-button { flex: none; }
.superadmin-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.superadmin-counts span, .count-pill { border-radius: 999px; padding: 6px 10px; background: var(--surface-subtle); color: var(--muted); font-size: .72rem; font-weight: 700; }
.superadmin-members { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.superadmin-member { display: flex; align-items: center; gap: 9px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 9px; }
.superadmin-member strong { min-width: 0; flex: 1; font-size: .82rem; overflow-wrap: anywhere; }
.superadmin-member .avatar { width: 32px; height: 32px; }
.superadmin-member .member-role { flex: none; }
.superadmin-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .8rem; }
.superadmin-private-note { border-left: 3px solid var(--accent); border-radius: 5px; padding: 10px 13px; background: var(--surface-subtle); color: var(--muted); font-size: .8rem; }
.superadmin-history-note { color: var(--muted); font-size: .78rem; }
.superadmin-match { display: grid; gap: 13px; }
.superadmin-match-heading h3 span { color: var(--muted); font-weight: 500; }
.superadmin-match .match-state { flex: none; }
.superadmin-predictions { display: grid; border-top: 1px solid var(--line); }
.superadmin-prediction { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding: 11px 2px; font-size: .82rem; }
.superadmin-prediction:last-child { border-bottom: 0; }
.superadmin-prediction strong { font-size: .95rem; white-space: nowrap; }
.superadmin-points { color: var(--muted); font-size: .75rem; text-align: right; white-space: nowrap; }
.superadmin-activity { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.superadmin-activity-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 14px 17px; }
.superadmin-activity-row:last-child { border-bottom: 0; }
.superadmin-activity-row > div { display: grid; gap: 4px; min-width: 0; }
.superadmin-activity-row strong { font-size: .84rem; }
.superadmin-activity-row span, .superadmin-activity-row time { color: var(--muted); font-size: .75rem; }
.superadmin-activity-row time { flex: none; text-align: right; }

@media (max-width: 480px) {
  .member-row { flex-wrap: wrap; }
  .member-row form { margin-left: 52px; }
}

@media (max-width: 800px) {
  .superadmin-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .superadmin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .superadmin-summary .info-card { padding: 14px; }
  .superadmin-pool-heading, .superadmin-match-heading { flex-direction: column; }
  .superadmin-pool-heading .secondary-button { width: 100%; }
  .superadmin-prediction { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; }
  .superadmin-points { grid-column: 1 / -1; text-align: left; }
  .superadmin-activity-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .superadmin-activity-row time { text-align: left; }
}

.admin-form, .auth-card { display: grid; gap: 17px; padding: 24px; }
.auth-card { width: min(100%, 430px); margin: 3rem auto; }
.auth-card h1 { font-size: 1.8rem; }
.field { display: grid; gap: 7px; font-size: .85rem; font-weight: 650; }
.field > label { display: grid; gap: 9px; line-height: 1.4; }
.field input, .field select, .field textarea { width: 100%; min-height: 47px; border: 1px solid #d7dfd1; border-radius: 10px; padding: 10px 12px; background: #fcfcf9; color: var(--ink); font-size: 1rem; font-weight: 400; }
.field textarea { min-height: 90px; resize: vertical; }
.field input[type="checkbox"] { width: 19px; min-height: 19px; height: 19px; accent-color: var(--green); }
.field:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 9px; }
.field-help { color: var(--muted); font-size: .76rem; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bottom-nav { display: none; }

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 15px; }
  .workspace { padding-inline: 25px; }
  .pool-grid, .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { padding: 18px 18px calc(103px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 27px; }
  .topbar-context { display: none; }
  .mobile-brand { display: inline-flex; font-size: 1.45rem; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; font-size: 1.15rem; }
  .page-heading { margin-bottom: 20px; }
  .heading-copy p { font-size: .83rem; }
  .hero-card { padding: 20px; }
  .hero-stats { gap: 17px; }
  .stat { padding-right: 17px; }
  .stat strong { font-size: 1.45rem; }
  .stat span { font-size: .67rem; }
  .match-card { padding: 16px 15px 13px; }
  .teams-grid { grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr); gap: 3px; margin: 20px 0; }
  .team-name { font-size: .84rem; }
  .score-input { width: 45px; height: 52px; font-size: 1.5rem; }
  .match-footer { gap: 9px; }
  .match-footer .status { flex: 1; font-size: .76rem; }
  .match-footer .save-button { flex: none; padding-inline: 12px; }
  .rank-row { padding: 14px 12px; gap: 8px; }
  .rank-points { font-size: 1.2rem; }
  .info-card, .admin-form, .auth-card { padding: 20px; }
  .bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; gap: 7px; border-top: 1px solid #e0e4d8; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fafbf7f5; backdrop-filter: blur(18px); box-shadow: 0 -7px 22px #17262208; }
  .bottom-nav .nav-button { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; min-height: 54px; padding: 4px 2px; color: #657562; font-size: .68rem; line-height: 1.15; text-align: center; }
  .bottom-nav .nav-button.active, .bottom-nav .nav-button[aria-current="page"] { background: #e9f0da; color: var(--green); }
  .bottom-nav .nav-button svg { width: 21px; height: 21px; }
}

@media (max-width: 370px) {
  .workspace { padding-inline: 12px; }
  .hero-card { padding: 18px; }
  .hero-stats { gap: 12px; }
  .stat { padding-right: 12px; }
  .match-card { padding-inline: 12px; }
  .teams-grid { grid-template-columns: minmax(0, 1fr) 109px minmax(0, 1fr); gap: 1px; }
  .team-name { font-size: .8rem; }
  .score-input { width: 44px; }
  .match-footer .save-button { padding-inline: 10px; }
  .bottom-nav { gap: 2px; padding-inline: 5px; }
  .bottom-nav .nav-button { font-size: .64rem; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  button, a, input, select, textarea { transition: background-color .15s, border-color .15s, box-shadow .15s; }
}

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--accent); background: var(--surface-subtle); }
.theme-toggle-icon { color: var(--accent); font-size: 1rem; line-height: 1; }
.auth-shell { position: relative; min-height: 100dvh; padding: 1px 18px; background: var(--paper); }
.auth-theme-toggle { position: absolute; top: 18px; right: 18px; }
@media (max-width: 640px) {
  .topbar { gap: 9px; }
  .theme-toggle { gap: 5px; min-height: 38px; padding: 7px 10px; font-size: .73rem; }
  .auth-theme-toggle { top: 12px; right: 12px; }
}
.primary-button:disabled { opacity: .5; cursor: default; }

/* Ranking trend, statistics and chart: colours come from the themed variables. */
:root { --trend-down: #f1a39b; }
:root[data-theme="light"] { --trend-down: #9e3c34; }
.rank-trend { flex: none; min-width: 2.2em; font-size: .78rem; font-weight: 750; text-align: right; color: var(--muted); }
.rank-trend.up { color: var(--lime); }
.rank-trend.down { color: var(--trend-down); }
.exact-mark { color: var(--lime); }
.stats-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .84rem; }
.stats-table th, .stats-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.stats-table th[scope="col"] { color: var(--muted); font-size: .72rem; font-weight: 650; }
.stats-table th[scope="row"], .stats-table th:first-child { text-align: left; }
.stats-table tr.you { background: var(--surface-raised); }
.award-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: .86rem; }
.trend-card { margin-top: 20px; }
.trend-chart { display: block; width: 100%; height: auto; max-height: 220px; }
.trend-axis { stroke: var(--line); stroke-width: 1; }
.trend-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-line.mine { stroke: var(--lime); }
.trend-line.leader { stroke: var(--muted); stroke-dasharray: 5 4; }
.trend-dot { fill: var(--lime); }
.trend-label { fill: var(--muted); font-size: 10px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: .78rem; }
.legend-mine::before, .legend-leader::before { content: ""; display: inline-block; width: 16px; margin-right: 6px; vertical-align: middle; border-top: 3px solid var(--lime); }
.legend-leader::before { border-top: 3px dashed var(--muted); }
@media (max-width: 640px) {
  .stats-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .stats-table, .stats-table tbody, .stats-table tr, .stats-table th, .stats-table td { display: block; }
  .stats-table tbody tr { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
  .stats-table th, .stats-table td { border: 0; padding: 6px 0; }
  .stats-table th[scope="row"] { font-size: .95rem; }
  .stats-table td { display: flex; justify-content: space-between; gap: 12px; }
  .stats-table td::before { content: attr(data-label); color: var(--muted); text-align: left; }
}

.reminder-group { display: grid; gap: 14px; width: 100%; padding-top: 16px; border-top: 1px solid var(--line); }
.reminder-group h3 { font-size: .95rem; }
.profile-reminders-form .primary-button:disabled { opacity: .5; cursor: not-allowed; }
