:root {
  color-scheme: light;
  --ink: #151112;
  --muted: #6f6467;
  --line: #e1d7d7;
  --panel: #ffffff;
  --page: #f7f3f1;
  --soft: #fff1ef;
  --teal: #c81f32;
  --teal-strong: #7d101d;
  --gold: #c9972f;
  --red: #c81f32;
  --green: #2d7f54;
  --blue: #2f5f9e;
  --black: #100d0e;
  --charcoal: #1b1517;
  --shadow: 0 18px 44px rgba(40, 14, 18, 0.12);
  --display-font: Orbitron, "Bank Gothic", "Rajdhani", "Eurostile", "Arial Black", Impact, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--page);
  color: var(--ink);
}

button,
input,
select,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.logged-out .app-shell {
  grid-template-columns: 1fr;
}

.logged-out .sidebar,
.logged-out .topbar {
  display: none;
}

.logged-out .main {
  padding: 0;
}

.portal-shell .app-shell {
  grid-template-columns: 1fr;
}

.portal-shell .sidebar,
.portal-shell .topbar {
  display: none;
}

.portal-shell .main {
  padding: 0;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(200, 31, 50, 0.16), transparent 34%),
    var(--black);
  color: #fff8f6;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
  overflow: visible;
}

.mma-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #d9c5c6;
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #f3e9e8;
  text-align: left;
  padding: 9px 12px;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(200, 31, 50, 0.22);
  border-color: rgba(255, 255, 255, 0.18);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.15rem);
}

h2 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
}

.danger-button {
  border-color: rgba(200, 31, 50, 0.58);
  background: #c81f32;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(200, 31, 50, 0.18);
}

.danger-button:hover:not(:disabled) {
  background: #a7192a;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button {
  border-color: var(--teal);
  background: linear-gradient(135deg, #e63748, var(--teal-strong));
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(200, 31, 50, 0.24);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: linear-gradient(135deg, #e63748, var(--teal-strong));
  color: white;
  padding: 8px 12px;
  font-weight: 800;
  text-decoration: none;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.view {
  display: grid;
  gap: 18px;
}

.logged-out .view {
  min-height: 100vh;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.panel,
.metric,
.team-card,
.division-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(200, 31, 50, 0.06), rgba(16, 13, 14, 0.02));
  padding: 14px 16px;
}

.panel-body {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td.number,
th.number {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.green {
  background: #e4f7eb;
  color: var(--green);
}

.badge.gold {
  background: #fff1c9;
  color: #7d5a17;
}

.badge.red {
  background: #ffe1e4;
  color: var(--red);
}

.badge.blue {
  background: #e8f0ff;
  color: var(--blue);
}

.stack {
  display: grid;
  gap: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.score-row:last-child {
  border-bottom: 0;
}

.score-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.result-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(200, 31, 50, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #fff7f6 100%);
  padding: 14px;
}

.result-card.voided {
  opacity: 0.72;
  background: #f7f7f7;
  border-color: var(--line);
}

.result-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.result-card strong,
.result-card span,
.result-card small {
  display: block;
}

.result-card p {
  margin: 5px 0;
  color: var(--muted);
}

.result-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-event {
  margin-bottom: 6px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-card-score {
  min-width: 86px;
  border: 1px solid rgba(16, 17, 19, 0.12);
  border-radius: 8px;
  background: #101113;
  color: white;
  padding: 10px;
  text-align: center;
}

.result-card-score strong {
  font-size: 1.35rem;
}

.result-card-score span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}

.audit-row strong,
.audit-row span,
.audit-row small {
  display: block;
}

.audit-row strong {
  color: var(--red);
  text-transform: capitalize;
}

.audit-row span,
.audit-row small {
  margin-top: 4px;
  color: var(--muted);
}

.backup-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.backup-panel strong,
.backup-panel p {
  display: block;
}

.danger-button {
  color: var(--red);
  border-color: rgba(200, 31, 50, 0.38);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.team-card {
  padding: 14px;
  text-align: left;
}

.team-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(18, 108, 103, 0.12), var(--shadow);
}

.team-card strong,
.team-card span {
  display: block;
}

.team-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.create-team-box {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: end;
  border: 1px solid rgba(200, 31, 50, 0.16);
  border-radius: 8px;
  background: #fff2f0;
  padding: 14px;
}

.team-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.division-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.division-column {
  min-height: 210px;
  padding: 14px;
}

.fighter-pill {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 8px;
  margin-top: 8px;
}

.rank-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--soft);
  color: var(--teal-strong);
  font-size: 0.75rem;
  font-weight: 900;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px 10px;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.wide-field {
  grid-column: span 2;
}

.fighter-select {
  min-height: 190px;
  overflow-y: auto;
}

.formula-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17242a;
  color: #eff6f4;
  padding: 14px;
  overflow-x: auto;
}

.formula-box code {
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.score-output {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.score-output div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.score-output span,
.score-output strong {
  display: block;
}

.score-output span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.score-output strong {
  margin-top: 5px;
  font-size: 1.25rem;
}

.account-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.account-strip div,
.account-strip strong,
.account-strip span {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-strip span,
.muted-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-panel {
  border-color: rgba(191, 143, 47, 0.45);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.65fr);
  gap: 18px;
}

.claim-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rules-list {
  display: grid;
  gap: 12px;
}

.rules-page {
  display: grid;
  gap: 18px;
}

.scoring-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.scoring-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.scoring-card span,
.example-score span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scoring-card strong,
.scoring-card p,
.example-score span,
.example-score strong {
  display: block;
}

.scoring-card strong {
  margin-top: 6px;
}

.scoring-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.example-score {
  display: grid;
  gap: 12px;
}

.example-score div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.example-score div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.example-score strong {
  margin-top: 5px;
}

.rule-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.rule-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rule-row span {
  color: var(--muted);
}

.invite-code {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 900;
}

.score-save {
  margin-top: 14px;
}

.landing-shell,
.auth-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(200, 31, 50, 0.28), transparent 34%),
    linear-gradient(135deg, #100d0e 0%, #221719 48%, #f8f1ee 100%);
  color: #fff8f6;
  padding: 26px;
}

.landing-shell::before,
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("./assets/mma-mastermind-faceoff-bg.png") center 58% / min(1120px, 92vw) auto no-repeat;
  opacity: 0.28;
  filter: saturate(0.6) contrast(0.95);
}

.landing-shell::after,
.auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(16, 13, 14, 0.92), rgba(16, 13, 14, 0.42) 45%, rgba(248, 241, 238, 0.72)),
    linear-gradient(180deg, rgba(16, 13, 14, 0.34), rgba(200, 31, 50, 0.12));
}

.landing-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-brand .brand-mark {
  width: 78px;
  height: 78px;
  filter: drop-shadow(0 0 12px rgba(255, 44, 62, 0.42));
}

.landing-brand strong,
.landing-brand span {
  display: block;
}

.landing-brand span {
  color: #f0c8c6;
  font-size: 0.86rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-shell .ghost-button,
.auth-shell .ghost-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff8f6;
}

.landing-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 34px;
  align-items: center;
  max-width: 980px;
  min-height: calc(100vh - 250px);
  margin: 0 auto;
  padding: 44px 0;
  text-align: center;
}

.landing-copy {
  display: grid;
  gap: 26px;
  max-width: 900px;
  justify-items: center;
}

.landing-hero-logo {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: clamp(10px, 2vw, 18px);
  width: min(760px, 100%);
  min-height: auto;
  border: 0;
  background: transparent;
  padding: clamp(8px, 1.8vw, 18px);
  box-shadow: none;
}

.landing-hero-logo .brand-mark {
  width: clamp(190px, 24vw, 320px);
  height: clamp(190px, 24vw, 320px);
  border: 0;
  background: transparent;
  padding: 0;
  filter:
    drop-shadow(0 26px 36px rgba(0, 0, 0, 0.52))
    drop-shadow(0 0 18px rgba(200, 31, 50, 0.46));
  mix-blend-mode: screen;
}

.hero-wordmark {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}

.hero-wordmark strong {
  display: block;
  color: #fff8f6;
  font-family: var(--display-font);
  font-size: clamp(2.45rem, 6vw, 5.25rem);
  font-weight: 950;
  line-height: 0.82;
  text-transform: uppercase;
  transform: skewX(-7deg);
  text-shadow:
    0 0 16px rgba(255, 44, 62, 0.34),
    0 6px 0 rgba(125, 16, 29, 0.72),
    0 26px 48px rgba(0, 0, 0, 0.52);
}

.hero-wordmark span {
  display: block;
  color: #ff3b4f;
  font-family: var(--display-font);
  font-size: clamp(1.15rem, 2.3vw, 1.75rem);
  font-weight: 900;
  text-transform: uppercase;
  transform: skewX(-7deg);
  text-shadow: 0 14px 28px rgba(0, 0, 0, 0.42);
}

.landing-copy h1 {
  max-width: 900px;
  color: #fff8f6;
  font-size: clamp(3rem, 6.8vw, 6.4rem);
  line-height: 0.94;
  font-weight: 950;
  font-family: var(--display-font);
  text-shadow: 0 22px 58px rgba(0, 0, 0, 0.44);
}

.landing-copy p {
  max-width: 660px;
  color: #f3d7d4;
  font-size: 1.08rem;
  line-height: 1.65;
}

.landing-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
  align-items: stretch;
}

.landing-feature-grid div {
  display: grid;
  align-content: start;
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.91);
  padding: 18px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.landing-feature-grid strong,
.landing-feature-grid span {
  display: block;
}

.landing-feature-grid span {
  margin-top: 8px;
  color: #665759;
  line-height: 1.45;
}

.auth-shell {
  display: grid;
  align-content: start;
  gap: 46px;
}

.auth-page-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.auth-page-grid .panel {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.portal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 8%, rgba(200, 31, 50, 0.14), transparent 28%),
    linear-gradient(135deg, #fff8f6, #f3ebe8);
  color: var(--ink);
  padding: 26px;
}

.portal-nav,
.portal-brand-hero,
.league-list,
.portal-actions-grid,
.profile-header,
.profile-tabs,
.profile-grid {
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
}

.portal-nav,
.portal-left,
.portal-right,
.profile-header,
.profile-tabs,
.league-tile-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-nav {
  justify-content: space-between;
  max-width: none;
  margin: -26px -26px 34px;
  border-bottom: 1px solid rgba(200, 31, 50, 0.18);
  background:
    linear-gradient(90deg, rgba(16, 13, 14, 0.98), rgba(56, 18, 22, 0.96));
  padding: 14px 26px;
}

.portal-left,
.portal-right,
.profile-tabs,
.league-tile-actions {
  flex-wrap: wrap;
}

.portal-tab {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff8f6;
  padding: 8px 12px;
  font-weight: 800;
}

.portal-tab.active,
.portal-tab:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(200, 31, 50, 0.28);
}

.portal-brand-hero {
  display: grid;
  justify-items: center;
  margin-bottom: 28px;
}

.clean-home-hero {
  min-height: min(58vh, 620px);
  align-content: center;
  margin-bottom: 0;
}

.clean-home-hero .portal-brand-lockup {
  gap: 18px;
}

.clean-home-hero .portal-brand-lockup .brand-mark {
  width: clamp(150px, 18vw, 240px);
  height: clamp(150px, 18vw, 240px);
}

.home-action-panel {
  max-width: 1180px;
  margin: 0 auto 16px;
}

.single-home-panel {
  max-width: 640px;
}

.portal-brand-lockup {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.portal-brand-lockup .brand-mark {
  width: clamp(110px, 12vw, 160px);
  height: clamp(110px, 12vw, 160px);
  border: 0;
  background: transparent;
  filter:
    drop-shadow(0 20px 28px rgba(40, 14, 18, 0.28))
    drop-shadow(0 0 14px rgba(200, 31, 50, 0.28));
}

.portal-brand-lockup strong {
  display: block;
  color: var(--black);
  font-family: var(--display-font);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 950;
  line-height: 0.82;
  text-transform: uppercase;
  transform: skewX(-7deg);
}

.portal-brand-lockup span {
  display: block;
  color: var(--teal-strong);
  font-family: var(--display-font);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 900;
  text-transform: uppercase;
  transform: skewX(-7deg);
}

.profile-header h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
}

.profile-header p {
  max-width: 660px;
  color: var(--muted);
  line-height: 1.6;
}

.league-meta-grid div,
.profile-list div,
.profile-side div {
  display: grid;
  gap: 5px;
}

.league-meta-grid span,
.profile-list span,
.profile-side span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.league-meta-grid strong,
.profile-list strong,
.profile-side strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-notice {
  max-width: 1180px;
  margin: 0 auto 18px;
  border: 1px solid rgba(200, 31, 50, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--teal-strong);
  padding: 12px 14px;
  font-weight: 800;
}

.league-list,
.league-selector-layout,
.portal-actions-grid,
.profile-grid {
  display: grid;
  gap: 16px;
}

.league-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.league-selector-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: stretch;
  margin-bottom: 16px;
}

.league-select-panel,
.league-side-stack,
.create-league-panel {
  min-height: 100%;
}

.league-side-stack {
  display: grid;
  gap: 16px;
}

.portal-actions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-panel {
  border: 1px solid rgba(200, 31, 50, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.league-tile {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.league-detail-panel {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(200, 31, 50, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.league-tile-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.league-tile-header h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.league-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.league-tile-actions {
  justify-content: space-between;
  margin-top: auto;
}

.league-browser-list {
  display: grid;
  gap: 10px;
}

.league-browser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(200, 31, 50, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.league-browser-row strong,
.league-browser-row span {
  display: block;
}

.league-browser-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.league-browser-join {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(260px, 100%);
}

.league-browser-join input {
  min-height: 36px;
  min-width: 0;
  width: 150px;
  border: 1px solid rgba(200, 31, 50, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
}

.invite-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(200, 31, 50, 0.18);
  border-radius: 8px;
  background: #fff2f0;
  color: var(--teal-strong);
  padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 900;
}

.standard-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.standard-settings span {
  border: 1px solid rgba(200, 31, 50, 0.16);
  border-radius: 8px;
  background: #fff2f0;
  color: #6b3338;
  padding: 7px 9px;
  font-size: 0.84rem;
  font-weight: 800;
}

.ranking-import-panel {
  max-width: 1180px;
  margin: 0 auto 18px;
}

.ranking-import-panel textarea {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ranking-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ranking-import-result {
  border: 1px solid rgba(200, 31, 50, 0.16);
  border-radius: 8px;
  background: #fff8f6;
  color: var(--teal-strong);
  padding: 10px 12px;
  font-weight: 800;
}

.profile-header {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.centered-page-header {
  justify-content: center;
  text-align: center;
}

.centered-page-header > div {
  display: grid;
  justify-items: center;
}

.centered-page-header p {
  max-width: 720px;
}

.profile-tabs {
  margin-bottom: 16px;
}

.profile-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
  align-items: start;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-side {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 16px;
}

.message-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.message-row {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(200, 31, 50, 0.14);
  padding: 0 0 12px;
}

.message-row:last-child {
  border-bottom: 0;
}

.message-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.message-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.message-row p {
  margin-bottom: 0;
  color: var(--teal-strong);
  line-height: 1.45;
}

.empty-state {
  color: var(--muted);
  padding: 12px 0;
}

.inbox-button {
  white-space: nowrap;
}

.draft-control {
  display: grid;
  gap: 14px;
}

.draft-readiness-panel .panel-header {
  align-items: flex-start;
}

.draft-readiness-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 14px;
}

.readiness-checklist,
.readiness-teams > div {
  display: grid;
  gap: 10px;
}

.readiness-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(16, 17, 19, 0.12);
  border-radius: 8px;
  background: #fff7f6;
  padding: 10px;
}

.readiness-item.done {
  background: #f0fbf7;
  border-color: rgba(18, 108, 103, 0.22);
}

.readiness-item > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #101113;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.readiness-item strong,
.readiness-item small,
.readiness-team strong,
.readiness-team small {
  display: block;
}

.readiness-item small,
.readiness-team small,
.readiness-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.readiness-note {
  border-left: 3px solid var(--red);
  padding: 8px 10px;
  background: #fff7f6;
}

.readiness-teams {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}

.readiness-teams > strong {
  display: block;
  margin-bottom: 10px;
}

.readiness-team {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(16, 17, 19, 0.08);
  border-radius: 8px;
  background: white;
  padding: 9px;
}

.readiness-team > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #101113;
  color: white;
  font-weight: 900;
}

.draft-popout-shell .app-shell {
  display: block;
}

.draft-popout-shell .sidebar,
.draft-popout-shell .topbar {
  display: none;
}

.draft-popout-shell .main {
  min-height: 100vh;
  padding: 22px;
}

.draft-popout-page {
  display: grid;
  gap: 16px;
}

.draft-popout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(200, 31, 50, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 22, 28, 0.97), rgba(111, 18, 32, 0.92));
  color: #ffffff;
  padding: 16px 18px;
}

.draft-popout-header .eyebrow,
.draft-popout-header h1 {
  color: #ffffff;
}

.draft-popout-shell .draft-room {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
}

.draft-popout-shell .draft-filter-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}

.draft-popout-shell .draft-filter-tab {
  min-height: 48px;
  border-radius: 8px;
  white-space: normal;
}

.draft-popout-shell .draft-pool {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: calc(100vh - 370px);
}

.draft-room-launcher .panel-header {
  align-items: center;
}

.draft-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.draft-main {
  min-width: 0;
}

.draft-now {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(200, 31, 50, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 22, 28, 0.96), rgba(54, 19, 26, 0.94));
  color: #ffffff;
  padding: 12px;
}

.draft-now strong {
  font-size: 1.15rem;
}

.draft-now span {
  color: rgba(255, 255, 255, 0.76);
}

.draft-turn-alert {
  border: 1px solid rgba(200, 31, 50, 0.24);
  border-radius: 8px;
  background: #fff2f0;
  color: var(--red);
  padding: 10px 12px;
  font-weight: 900;
}

.draft-toolbar input {
  width: 100%;
  min-height: 42px;
}

.draft-filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 4px;
}

.draft-filter-tab {
  min-height: 38px;
  border: 1px solid rgba(28, 31, 38, 0.22);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 900;
  white-space: normal;
  box-shadow: inset 0 -1px 0 rgba(28, 31, 38, 0.08);
}

.draft-filter-tab.active,
.draft-filter-tab:hover {
  border-color: rgba(200, 31, 50, 0.34);
  background: #fff2f0;
  color: var(--red);
}

.draft-pool {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding: 4px 6px 4px 2px;
  overscroll-behavior: contain;
}

.draft-card {
  display: grid;
  gap: 5px;
  min-height: 104px;
  border: 1px solid rgba(20, 22, 28, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 250, 0.96)),
    linear-gradient(135deg, rgba(200, 31, 50, 0.16), rgba(20, 22, 28, 0.08));
  color: var(--ink);
  padding: 12px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(20, 22, 28, 0.08);
  overflow: hidden;
}

.draft-card:hover:not(:disabled) {
  border-color: rgba(200, 31, 50, 0.58);
  box-shadow: 0 0 0 2px rgba(200, 31, 50, 0.13), 0 12px 26px rgba(20, 22, 28, 0.12);
  transform: translateY(-1px);
}

.draft-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.draft-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.draft-card strong,
.draft-card span,
.draft-card small {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.draft-card small {
  color: var(--muted);
  font-size: 0.76rem;
}

.draft-roster-sidebar {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.draft-team-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 0 12px 12px;
}

.draft-team-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(20, 22, 28, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7f8fa);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(20, 22, 28, 0.07);
}

.draft-team-card.active {
  border-color: rgba(200, 31, 50, 0.42);
  background: #fff8f6;
  box-shadow: 0 0 0 2px rgba(200, 31, 50, 0.08);
}

.draft-team-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.draft-team-card-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.draft-team-card-header span {
  color: var(--muted);
  font-weight: 900;
}

.draft-team-division-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.draft-team-division-grid span {
  border: 1px solid rgba(20, 22, 28, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 5px 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.draft-team-division-grid span.filled {
  background: #e4f7eb;
  color: var(--green);
}

.draft-team-picks {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.draft-team-picks div {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(20, 22, 28, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 7px;
}

.draft-team-picks span,
.draft-team-picks small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.draft-team-picks small {
  color: var(--muted);
  font-size: 0.76rem;
}

.draft-table td {
  min-width: 180px;
  vertical-align: top;
}

.draft-table td strong,
.draft-table td span,
.draft-table td small {
  display: block;
}

.draft-table td span,
.draft-table td small {
  color: var(--muted);
}

.draft-cell-pick {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(36, 55, 54, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 7px;
}

.draft-cell-pick + .draft-cell-pick {
  margin-top: 7px;
}

.draft-cell-pick.active {
  border-color: rgba(200, 31, 50, 0.32);
  background: #fff8df;
}

.on-clock-cell {
  background: #f7edcf;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-two,
  .kpi-grid,
  .team-grid,
  .division-grid,
  .claim-grid,
  .auth-grid,
  .draft-pool,
  .draft-room,
  .scoring-grid,
  .landing-hero,
  .landing-feature-grid,
  .auth-page-grid,
  .league-selector-layout,
  .league-list,
  .portal-actions-grid,
  .profile-grid,
  .inbox-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-room,
  .draft-popout-shell .draft-room {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }

  .draft-pool,
  .draft-popout-shell .draft-pool {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-popout-shell .draft-filter-tabs,
  .draft-filter-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-list,
  .grid-two,
  .kpi-grid,
  .team-grid,
  .create-team-box,
  .team-create-form,
  .division-grid,
  .form-grid,
  .score-output,
  .admin-results-grid,
  .claim-grid,
  .scoring-grid,
  .auth-grid,
  .rule-row,
  .draft-pool,
  .draft-room,
  .draft-readiness-grid,
  .draft-now,
  .landing-hero,
  .landing-feature-grid,
  .auth-page-grid {
    grid-template-columns: 1fr;
  }

  .backup-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .draft-roster-sidebar {
    position: static;
    max-height: none;
  }

  .draft-team-list {
    max-height: 460px;
  }

  .draft-filter-tabs,
  .draft-popout-shell .draft-filter-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-filter-tab {
    min-height: 44px;
  }

  .landing-shell,
  .auth-shell,
  .portal-page {
    padding: 18px;
  }

  .portal-nav {
    margin: -18px -18px 28px;
    padding: 14px 18px;
  }

  .landing-shell::before,
  .auth-shell::before {
    background-size: 128vw auto;
    opacity: 0.16;
  }

  .landing-nav,
  .portal-nav,
  .profile-header {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-hero {
    min-height: auto;
    padding: 36px 0;
  }

  .landing-hero-logo {
    grid-template-columns: 1fr;
    max-width: 420px;
    background: radial-gradient(circle at 50% 30%, rgba(200, 31, 50, 0.18), transparent 58%);
  }

  .landing-hero-logo .brand-mark {
    width: 180px;
    height: 180px;
  }

  .hero-wordmark {
    justify-items: center;
    text-align: center;
  }

  .landing-feature-grid {
    margin-top: 0;
  }

  .wide-field {
    grid-column: span 1;
  }

  .account-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .league-selector-layout,
  .league-list,
  .portal-actions-grid,
  .profile-grid,
  .profile-list,
  .inbox-layout,
  .league-meta-grid {
    grid-template-columns: 1fr;
  }

  .portal-right,
  .portal-left,
  .league-tile-header,
  .league-browser-row,
  .league-tile-actions,
  .message-row div {
    align-items: stretch;
    flex-direction: column;
  }
}
