:root {
  --bg: #eaf4ff;
  --bg-accent: #cddff6;
  --panel: rgba(248, 252, 255, 0.84);
  --border: rgba(34, 74, 129, 0.14);
  --text: #10233f;
  --muted: #516b8e;
  --action: #2f6fb3;
  --action-dark: #21538a;
  --success: #1f7a64;
  --error: #9a2d2d;
  --shadow: 0 24px 60px rgba(32, 68, 116, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(135deg, var(--bg), var(--bg-accent));
}

.site-footer {
  padding: 0 20px 24px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
}

.shell {
  width: min(1040px, calc(100% - clamp(24px, 4vw, 40px)));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  padding: 48px 0;
}

.shell-single {
  grid-template-columns: 1fr;
  max-width: 760px;
}

.shell-dashboard {
  max-width: 1120px;
}

.shell-auth {
  max-width: 920px;
}

.shell-league {
  max-width: 1240px;
}

.shell-predictions {
  max-width: 1080px;
}

.hero,
.panel {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  max-width: 100%;
  min-width: 0;
}

.hero {
  padding: 48px;
}

.league-hero {
  margin-top: 28px;
  padding: 32px;
}

.shell-league .panel-wide {
  padding: 40px;
}

.shell-league .league-hero {
  padding: 34px;
}

.league-hero .section-title {
  margin-bottom: 16px;
}

.league-hero .form-copy {
  margin-bottom: 0;
}

.prediction-hero {
  margin-top: 28px;
  padding: 32px;
}

.eyebrow {
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.form-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1;
}

.section-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.intro {
  max-width: 36rem;
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.demo-card {
  margin-top: 30px;
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(47, 111, 179, 0.08);
  border: 1px solid rgba(47, 111, 179, 0.18);
}

.demo-label {
  margin-top: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.note-card {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(16, 35, 63, 0.05);
  border: 1px solid rgba(16, 35, 63, 0.1);
  line-height: 1.55;
}

.home-guide-card {
  margin-top: 24px;
  padding: 24px;
  background: rgba(243, 249, 255, 0.82);
  border-color: rgba(34, 74, 129, 0.12);
}

.home-guide-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.05;
}

.home-guide-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-guide-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(34, 74, 129, 0.1);
}

.home-guide-item h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.2;
}

.home-guide-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.panel {
  padding: 32px;
}

.panel-wide {
  padding: 36px;
  width: 100%;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 24px;
}

.brand-lockup-centered {
  justify-content: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: min(100%, 320px);
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 26px rgba(37, 95, 159, 0.12));
}

.brand-wordmark {
  font-family: "Arial Black", "Avenir Next Condensed", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 0.95;
  text-transform: uppercase;
  color: #12345d;
  text-shadow: 0 10px 24px rgba(47, 111, 179, 0.16);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form h2 {
  margin: 0;
  font-size: 2rem;
}

.form-copy {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 60ch;
  max-width: 100%;
  overflow-wrap: anywhere;
}

label {
  font-size: 0.95rem;
  color: var(--muted);
}

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

.form-grid > div {
  display: grid;
  gap: 12px;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--text);
  line-height: 1.45;
  cursor: pointer;
}

.consent-check input[type="checkbox"] {
  appearance: auto;
  width: 1.05rem;
  max-width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  align-self: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  justify-self: start;
  flex: none;
}

.consent-check span {
  display: block;
}

input {
  width: 100%;
  border: 1px solid rgba(34, 74, 129, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

select {
  width: 100%;
  border: 1px solid rgba(34, 74, 129, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(47, 111, 179, 0.3);
  border-color: var(--action);
}

select:focus {
  outline: 2px solid rgba(47, 111, 179, 0.3);
  border-color: var(--action);
}

button {
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  color: #f5fbff;
  background: linear-gradient(180deg, var(--action), var(--action-dark));
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(33, 83, 138, 0.24);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.primary-link-button {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  padding: 14px 18px;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  color: #503600;
  text-decoration: none;
  background: linear-gradient(180deg, #ffd85c, #f0b61a);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(240, 182, 26, 0.28);
}

.status {
  min-height: 1.4rem;
  margin: 4px 0 0;
  color: var(--muted);
  display: none;
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

.status.visible {
  display: block;
}

.message-group {
  display: grid;
  gap: 8px;
}

.secondary-action {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.secondary-action p {
  margin: 0;
  color: var(--muted);
}

.league-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.league-card {
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(34, 74, 129, 0.1);
  min-width: 0;
}

.league-card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.league-card p {
  margin: 0;
}

.league-link {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.league-link:hover {
  color: var(--action-dark);
  text-decoration: underline;
}

.empty-state {
  margin: 20px 0 0;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(16, 35, 63, 0.05);
  color: var(--muted);
}

.league-actions {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.league-form {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(34, 74, 129, 0.1);
  min-width: 0;
}

.league-form h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.prediction-summary {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.prediction-summary p {
  margin: 0;
  color: var(--muted);
  flex: 1 1 240px;
}

.prediction-summary .secondary-button {
  flex: 0 0 auto;
}

.predictions-form {
  margin-top: 24px;
}

.prediction-stage-block {
  display: grid;
  gap: 18px;
}

.prediction-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
}

.stage-deadline-copy {
  max-width: 34rem;
  margin-top: 12px;
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.stage-deadline-card {
  min-width: 230px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(34, 74, 129, 0.12);
  box-shadow: 0 10px 24px rgba(32, 68, 116, 0.08);
}

.stage-deadline-card p {
  margin: 0;
}

.stage-deadline-card p + p {
  margin-top: 8px;
}

.stage-deadline-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.stage-deadline-value {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
}

.stage-countdown {
  font-weight: 700;
  color: var(--action-dark);
  line-height: 1.4;
}

.randomize-stage-button {
  margin-top: 12px;
  width: 100%;
}

.sticky-save-bar {
  position: sticky;
  top: 12px;
  z-index: 25;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(248, 252, 255, 0.58);
  border: 1px solid rgba(34, 74, 129, 0.08);
  box-shadow: 0 10px 24px rgba(32, 68, 116, 0.08);
  backdrop-filter: blur(10px);
}

.sticky-save-button {
  margin-top: 0;
  display: inline-flex;
  margin-left: auto;
  margin-right: auto;
}

.admin-match-list {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.admin-match-card {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(34, 74, 129, 0.1);
}

.admin-match-form {
  display: grid;
  gap: 16px;
}

.admin-extra-fields {
  margin-top: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-clear-form {
  margin-top: 12px;
}

.danger-button {
  background: linear-gradient(180deg, #a53e31, #7f2c23);
}

.prediction-list {
  display: grid;
  gap: 18px;
}

.prediction-card {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(34, 74, 129, 0.1);
}

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

.prediction-card-head > *,
.prediction-stage-head > *,
.member-group-card-head > *,
.group-standings-card-head > *,
.page-actions > * {
  min-width: 0;
}

.prediction-card-locked {
  opacity: 0.78;
}

.prediction-match-title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.prediction-meta {
  text-align: right;
  color: var(--muted);
  max-width: 16rem;
}

.prediction-meta p {
  margin: 0;
  overflow-wrap: anywhere;
}

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

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

.penalty-field {
  display: none;
  margin-top: 16px;
}

.penalty-field.visible {
  display: grid;
  gap: 12px;
}

.penalty-label {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.saved-prediction {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.group-standings-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.group-standings-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.member-group-standings {
  margin-top: 22px;
  display: grid;
  gap: 22px;
}

.member-group-card {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(34, 74, 129, 0.1);
  min-width: 0;
}

.member-group-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.member-group-card-head h3 {
  margin: 0;
  font-size: 1.5rem;
}

.member-group-card-head p {
  margin: 0;
  color: var(--muted);
}

.group-standings-card {
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(245, 250, 255, 0.96), rgba(230, 239, 250, 0.92));
  border: 1px solid rgba(70, 120, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  min-width: 0;
}

.group-standings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.group-standings-card-head h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1;
}

.group-standings-meta {
  margin: 0;
  color: #5a7394;
  text-align: right;
  font-size: 0.86rem;
}

.mini-standings-wrap {
  margin-top: 0;
  border-radius: 20px;
  border: 1px solid rgba(70, 120, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(252, 254, 255, 0.98), rgba(236, 244, 252, 0.98));
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(32, 68, 116, 0.08);
}

.mini-standings-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mini-standings-table th,
.mini-standings-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(81, 107, 142, 0.08);
  text-align: left;
  color: #10233f;
  background: transparent;
}

.mini-standings-table thead th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5d7698;
  background:
    linear-gradient(180deg, rgba(201, 220, 245, 0.72), rgba(185, 207, 236, 0.52));
}

.mini-standings-table tbody tr:last-child td {
  border-bottom: 0;
}

.mini-standings-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.28);
}

.mini-standings-table tbody tr:hover td {
  background: rgba(47, 111, 179, 0.07);
}

.mini-standings-table th:first-child,
.mini-standings-table td:first-child {
  width: 82px;
  text-align: center;
  font-weight: 700;
}

.mini-standings-table th:nth-child(2),
.mini-standings-table td:nth-child(2) {
  white-space: normal;
}

.mini-standings-table td:nth-child(2) {
  font-weight: 700;
  color: #10233f;
  font-size: 1rem;
  line-height: 1.3;
}

.mini-standings-table tbody td:first-child {
  color: transparent;
  font-size: 0;
}

.mini-standings-table tbody td:first-child::before {
  content: attr(data-pos);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f4fbff;
  background: linear-gradient(180deg, #3f86d1, #255f9f);
  box-shadow: 0 8px 16px rgba(37, 95, 159, 0.18);
}

.prediction-table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(34, 74, 129, 0.1);
  background: rgba(255, 255, 255, 0.64);
  position: relative;
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.prediction-table-wrap,
.mini-standings-wrap,
.prediction-card,
.admin-match-card,
.member-group-standings,
.group-standings-grid {
  min-width: 0;
}

.standings-table-wrap {
  overflow: visible;
}

.prediction-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.prediction-table th,
.prediction-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(34, 74, 129, 0.08);
  text-align: left;
  vertical-align: top;
  background: rgba(250, 253, 255, 0.96);
}

.prediction-table th {
  background: rgba(229, 240, 252, 0.96);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(34, 74, 129, 0.08);
}

.prediction-table tbody tr:last-child td {
  border-bottom: 0;
}

.prediction-matrix-table th:first-child,
.prediction-matrix-table td:first-child {
  min-width: 220px;
  max-width: 220px;
  border-right: 1px solid rgba(34, 74, 129, 0.12);
  box-shadow: 10px 0 18px rgba(32, 68, 116, 0.06);
}

.prediction-matrix-table td:first-child {
  background: rgba(243, 249, 255, 0.98);
}

.prediction-matrix-table th:nth-child(2),
.prediction-matrix-table td:nth-child(2) {
  min-width: 88px;
  width: 88px;
}

.prediction-matrix-table {
  table-layout: fixed;
  --prediction-member-col-width: 7rem;
}

.prediction-matrix-table thead th:not(:first-child) {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.3;
}

.prediction-matrix-table thead th:nth-child(n + 2) {
  text-align: center;
}

.prediction-table td:not(:first-child),
.prediction-table th:not(:first-child) {
  white-space: nowrap;
}

.prediction-matrix-table thead th:not(:first-child) {
  white-space: normal;
}

.prediction-matrix-table th:nth-child(n + 3),
.prediction-matrix-table td:nth-child(n + 3) {
  width: var(--prediction-member-col-width);
}

.prediction-member-name {
  display: inline-grid;
  gap: 2px;
  justify-items: center;
}

.prediction-member-name-line {
  white-space: nowrap;
}

.prediction-member-meta {
  margin-top: 3px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.prediction-table-match {
  display: grid;
  gap: 4px;
}

.prediction-table-match strong {
  font-size: 0.95rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.prediction-table-match span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.prediction-table-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
}

.prediction-table-group::before {
  content: "· ";
}

.prediction-table-score {
  white-space: nowrap;
  font-weight: 700;
}

.prediction-matrix-table td.prediction-table-score,
.prediction-matrix-table th.prediction-table-score {
  text-align: center;
  vertical-align: middle;
}

.prediction-member-cell {
  display: inline-grid;
  gap: 3px;
  justify-items: center;
  min-width: 0;
}

.prediction-member-score {
  font-weight: 700;
  line-height: 1.15;
}

.prediction-member-points {
  font-size: 0.74rem;
  line-height: 1.1;
  color: var(--muted);
  white-space: nowrap;
}

.standings-table {
  min-width: 100%;
  table-layout: auto;
}

.standings-table .prediction-table-score {
  text-align: center;
  vertical-align: middle;
}

.standings-table thead th,
.prediction-matrix-table thead th {
  position: static;
  top: auto;
}

.standings-table th,
.standings-table td {
  text-align: center;
  vertical-align: middle;
  font-size: 0.95rem;
  white-space: normal;
}

.standings-table .prediction-table-match {
  justify-items: center;
  gap: 6px;
}

.standings-table .prediction-table-match strong {
  font-size: 0.96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.standings-player-name {
  display: grid;
  gap: 0.08rem;
}

.standings-player-line {
  display: block;
}

.standings-mobile-team {
  display: none;
}

.standings-table th:last-child {
  color: var(--action-dark);
}

.standings-table .standings-points {
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--action-dark);
}

.standings-table th:first-child,
.standings-table td:first-child {
  min-width: auto;
  max-width: none;
  box-shadow: none;
  border-right: 0;
}

.standings-table th:nth-child(1),
.standings-table td:nth-child(1) {
  width: 72px;
}

.standings-table th:nth-child(5),
.standings-table td:nth-child(5),
.standings-table th:nth-child(6),
.standings-table td:nth-child(6) {
  width: 92px;
}

.standings-table td:nth-child(2),
.standings-table td:nth-child(3) {
  overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
  .standings-table th:nth-child(4),
  .standings-table td:nth-child(4) {
    display: none;
  }
}

@media (min-width: 1201px) {
  .shell-dashboard {
    width: min(1120px, calc(100% - 56px));
  }

  .shell-auth {
    width: min(920px, calc(100% - 56px));
  }

  .shell-league {
    width: min(1240px, calc(100% - 56px));
  }

  .hero,
  .panel {
    padding: 40px;
  }

  .shell-league .panel-wide {
    padding: 44px;
  }

  .shell-league .league-hero {
    padding: 36px;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .shell-dashboard {
    width: min(100%, calc(100% - 40px));
    max-width: 980px;
  }

  .shell-auth {
    width: min(100%, calc(100% - 40px));
    max-width: 860px;
  }

  .shell-league {
    width: min(100%, calc(100% - 40px));
    max-width: 1100px;
  }

  .hero,
  .panel {
    padding: 32px;
  }

  .shell-league .panel-wide {
    padding: 32px;
  }

  .shell-league .league-hero {
    padding: 28px;
  }

  .shell-league .prediction-table th,
  .shell-league .prediction-table td {
    padding: 13px 14px;
  }
}

.secondary-button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 46px;
  text-decoration: none;
  color: var(--text);
  background: rgba(16, 35, 63, 0.06);
  border: 1px solid rgba(16, 35, 63, 0.1);
}

.secondary-button:hover,
.back-link:hover {
  background: rgba(16, 35, 63, 0.1);
}

.back-link {
  margin-bottom: 18px;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.page-actions .back-link {
  margin-bottom: 0;
}

.user-card {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: none;
}

.user-card h2 {
  margin: 0 0 16px;
}

.user-card.visible {
  display: block;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 16px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 0.4rem;
  background: rgba(16, 35, 63, 0.08);
  font-size: 0.95em;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100%, calc(100% - 40px));
    padding: 24px 0 32px;
  }

  .shell-dashboard,
  .shell-auth,
  .shell-league,
  .shell-predictions,
  .shell-single {
    max-width: 100%;
  }

  .hero,
  .panel {
    padding: 28px;
  }

  .panel-wide,
  .league-hero,
  .prediction-hero,
  .prediction-card,
  .admin-match-card,
  .member-group-card,
  .group-standings-card {
    padding: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .secondary-action {
    align-items: stretch;
    flex-direction: column;
  }

  .league-actions {
    grid-template-columns: 1fr;
  }

  .page-actions,
  .member-group-card-head,
  .group-standings-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions a {
    width: 100%;
  }

  .prediction-summary .secondary-button,
  .admin-actions > * {
    width: 100%;
  }

  .prediction-summary,
  .prediction-card-head,
  .prediction-stage-head {
    align-items: stretch;
    flex-direction: column;
  }

  .group-standings-meta,
  .member-group-card-head p,
  .prediction-meta {
    text-align: left;
  }

  .home-guide-grid {
    grid-template-columns: 1fr;
  }

  .prediction-inputs {
    grid-template-columns: 1fr;
  }

  .stage-deadline-card {
    min-width: 0;
    width: 100%;
  }

  .prediction-table-wrap {
    border-radius: 18px;
  }

  .prediction-table th,
  .prediction-table td {
    padding: 12px 14px;
  }

  .prediction-matrix-table th:first-child,
  .prediction-matrix-table td:first-child {
    min-width: 208px;
    max-width: 208px;
  }

  .prediction-matrix-table th:nth-child(2),
  .prediction-matrix-table td:nth-child(2) {
    min-width: 84px;
    width: 84px;
  }

  .mini-standings-table th,
  .mini-standings-table td {
    padding: 12px 14px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .shell-dashboard,
  .shell-auth,
  .shell-league {
    width: min(100%, calc(100% - 32px));
  }

  .shell-dashboard .panel-wide,
  .shell-auth .panel-wide {
    padding: 24px;
  }

  .shell-league .panel-wide,
  .shell-league .league-hero,
  .shell-league .member-group-card,
  .shell-league .group-standings-card {
    padding: 22px;
  }

  .shell-league .prediction-table-wrap {
    border-radius: 18px;
  }

  .shell-league .prediction-table th,
  .shell-league .prediction-table td {
    padding: 12px 13px;
  }

  .shell-league .prediction-table-match strong {
    font-size: 0.98rem;
  }

  .shell-league .prediction-table-match span {
    font-size: 0.88rem;
  }

  .shell-league .standings-table th,
  .shell-league .standings-table td {
    font-size: 0.9rem;
  }

  .shell-league .standings-table .standings-points {
    font-size: 1rem;
  }

  .shell-league .prediction-matrix-table th:first-child,
  .shell-league .prediction-matrix-table td:first-child {
    min-width: 196px;
    max-width: 196px;
  }

  .shell-league .prediction-matrix-table th:nth-child(2),
  .shell-league .prediction-matrix-table td:nth-child(2) {
    min-width: 80px;
    width: 80px;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100%, calc(100% - 32px));
  }

  .shell-dashboard,
  .shell-auth {
    width: min(100%, calc(100% - 20px));
  }

  .hero,
  .panel {
    padding: 24px;
  }

  .panel-wide,
  .league-hero,
  .prediction-hero,
  .prediction-card,
  .admin-match-card,
  .member-group-card,
  .group-standings-card {
    padding: 20px;
  }

  .home-guide-card {
    padding: 20px;
  }

  .home-guide-grid {
    gap: 12px;
  }

  .home-guide-item {
    padding: 14px 15px;
  }

  .brand-wordmark {
    letter-spacing: 0.12em;
  }

  .page-actions {
    gap: 12px;
  }

  .back-link,
  .secondary-button {
    width: 100%;
  }

  .form-title {
    line-height: 1.05;
  }

  .section-title {
    line-height: 1.08;
  }

  .login-form {
    gap: 12px;
  }

  input,
  select {
    padding: 13px 14px;
  }

  .stage-deadline-copy,
  .form-copy,
  .intro {
    font-size: 0.96rem;
    line-height: 1.6;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  dd {
    margin-bottom: 10px;
  }

  .prediction-table-wrap {
    margin-top: 18px;
    border-radius: 16px;
  }

  .prediction-table th,
  .prediction-table td {
    padding: 11px 12px;
    font-size: 0.94rem;
  }

  .prediction-table th {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
  }

  .prediction-table-match strong {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .prediction-table-match span {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .prediction-matrix-table th:first-child,
  .prediction-matrix-table td:first-child {
    min-width: 188px;
    max-width: 188px;
  }

  .prediction-matrix-table th:nth-child(2),
  .prediction-matrix-table td:nth-child(2) {
    min-width: 74px;
    width: 74px;
  }

  .prediction-member-name {
    gap: 1px;
  }

  .prediction-member-meta {
    font-size: 0.6rem;
  }

  .prediction-member-points {
    font-size: 0.68rem;
  }

  .mini-standings-table th,
  .mini-standings-table td {
    padding: 11px 12px;
  }

  .mini-standings-table td:nth-child(2) {
    font-size: 0.94rem;
  }

  .shell-league {
    width: min(100%, calc(100% - 20px));
  }

  .shell-league .panel-wide,
  .shell-league .league-hero,
  .shell-league .member-group-card,
  .shell-league .group-standings-card {
    padding: 18px;
  }

  .shell-league .eyebrow {
    margin-bottom: 12px;
    letter-spacing: 0.14em;
  }

  .shell-league .prediction-table-wrap {
    border-radius: 14px;
  }

  .shell-league .standings-table th,
  .shell-league .standings-table td {
    padding: 9px 7px;
    font-size: 0.84rem;
  }

  .shell-league .standings-table th:nth-child(1),
  .shell-league .standings-table td:nth-child(1) {
    width: 54px;
  }

  .shell-league .standings-table th:nth-child(6),
  .shell-league .standings-table td:nth-child(6) {
    width: 64px;
  }

  .shell-league .standings-table th:nth-child(3),
  .shell-league .standings-table td:nth-child(3) {
    display: none;
  }

  .shell-league .standings-table th:nth-child(5),
  .shell-league .standings-table td:nth-child(5) {
    display: none;
  }

  .shell-league .standings-table .prediction-table-match {
    gap: 2px;
    justify-items: start;
  }

  .shell-league .standings-table .prediction-table-match strong {
    font-size: 0.8rem;
    line-height: 1.18;
    word-break: break-word;
  }

  .shell-league .standings-player-name {
    gap: 0.02rem;
  }

  .shell-league .standings-mobile-team {
    display: block;
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--muted);
  }

  .shell-league .standings-table td:nth-child(2),
  .shell-league .standings-table th:nth-child(2) {
    text-align: left;
    padding-left: 4px;
    padding-right: 4px;
  }

  .shell-league .standings-table .standings-points {
    font-size: 0.94rem;
  }

  .shell-league .prediction-table th,
  .shell-league .prediction-table td {
    padding: 10px 11px;
    font-size: 0.88rem;
  }

  .shell-league .prediction-table th {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }

  .shell-league .prediction-table-match strong {
    font-size: 0.92rem;
    line-height: 1.28;
  }

  .shell-league .prediction-table-match span {
    font-size: 0.82rem;
    line-height: 1.32;
  }

  .shell-league .prediction-matrix-table th:first-child,
  .shell-league .prediction-matrix-table td:first-child {
    min-width: 168px;
    max-width: 168px;
  }

  .shell-league .prediction-matrix-table th:nth-child(2),
  .shell-league .prediction-matrix-table td:nth-child(2) {
    min-width: 70px;
    width: 70px;
  }

  .prediction-table-stage {
    display: none;
  }

  .prediction-table-group::before {
    content: "";
  }
}
