:root {
  color-scheme: dark;
  --bg: #130b0c;
  --panel: #1a1011;
  --line: #392a2c;
  --line-strong: #4d3b3f;
  --text: #fff8f4;
  --muted: #918487;
  --red: #f10d33;
  --gold: #ffd23e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(116, 11, 18, 0.22), transparent 36rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 18px 42px 64px;
}

.home-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 18%, rgba(201, 164, 92, 0.2), transparent 30rem),
    linear-gradient(90deg, rgba(5, 5, 7, 0.96), rgba(5, 5, 7, 0.68) 48%, rgba(5, 5, 7, 0.8)),
    url("assets/triton-hero.png") center / cover;
}

.home-hero {
  min-height: 100vh;
  padding: 24px clamp(20px, 6vw, 76px) 72px;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.home-brand {
  position: relative;
  display: block;
  width: min(52vw, 288px);
  height: 72px;
}

.home-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  min-height: calc(100vh - 88px);
  align-items: center;
  gap: clamp(28px, 6vw, 82px);
}

.home-copy {
  max-width: 760px;
}

.home-kicker {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 1000;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-copy h1 {
  margin: 0 0 22px;
  font-size: clamp(2.85rem, 6.2vw, 6.4rem);
  line-height: 0.96;
}

.home-copy p {
  max-width: 660px;
  margin: 0;
  color: #d5ccce;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.65;
}

.premium-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(17, 10, 11, 0.72);
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.premium-panel div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 18px;
}

.premium-panel span,
.premium-panel strong {
  display: block;
}

.premium-panel span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.premium-panel strong {
  margin-top: 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.premium-section {
  padding: 72px clamp(20px, 6vw, 76px);
  background: linear-gradient(180deg, #10090a, #090506);
}

.premium-section h2 {
  max-width: 720px;
  margin: 0 0 24px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1;
  text-transform: uppercase;
}

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

.premium-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
}

.premium-grid span {
  color: var(--gold);
  font-weight: 1000;
}

.premium-grid h3 {
  margin: 20px 0 10px;
}

.premium-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.campaign-banner {
  overflow: hidden;
  border: 1px solid #2b1c1f;
  border-radius: 8px;
  background: #050303;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

.campaign-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.challenge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 442px);
  gap: 32px;
  padding: 34px 0 42px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-title h2,
.submit-card h2,
.participation-info h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  text-transform: uppercase;
}

.section-title p,
.muted,
.pick-status,
.participation-info p {
  color: var(--muted);
}

.section-title p {
  margin: 12px 0 0;
}

.selected-count {
  min-width: 112px;
  text-align: right;
}

.selected-count strong {
  color: #fff;
}

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

.group-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #170e10;
}

.group-card.has-selection {
  border-color: rgba(241, 13, 51, 0.62);
  box-shadow: 0 0 0 1px rgba(241, 13, 51, 0.12);
}

.group-header {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: #1c1214;
  color: var(--text);
  cursor: pointer;
  padding: 12px 16px;
  text-align: left;
}

.group-card.open .group-header {
  background: #241719;
}

.group-title {
  font-size: 1rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.group-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.selected-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 340px;
  overflow: hidden;
  border: 1px solid rgba(241, 13, 51, 0.45);
  border-radius: 999px;
  background: rgba(241, 13, 51, 0.12);
  color: #fff;
  padding: 6px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 1000;
  transition: transform 140ms ease;
}

.group-card.open .chevron {
  transform: rotate(180deg);
}

.group-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.group-panel[hidden] {
  display: none;
}

.team-card {
  display: grid;
  min-height: 84px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #1a1011;
  color: #d6ced0;
  cursor: pointer;
  padding: 8px 6px;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.team-card:hover {
  border-color: #665056;
  background: #211719;
  transform: translateY(-1px);
}

.team-card.selected {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(241, 13, 51, 0.18), #1c1012);
  box-shadow: 0 0 0 1px rgba(241, 13, 51, 0.18), 0 0 22px rgba(241, 13, 51, 0.16);
}

.team-card:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.team-flag {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.team-name {
  display: block;
  margin-top: 6px;
  font-size: 0.74rem;
  line-height: 1.12;
}

.rank-badge {
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 1000;
}

.submit-card {
  position: sticky;
  top: 20px;
  min-height: 388px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #180f10;
  padding: 26px;
}

.muted {
  margin: 18px 0 24px;
}

.selected-list {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.selected-list li {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #201516;
  padding: 10px 12px;
  font-weight: 850;
}

.selected-list .empty {
  color: #766a6d;
}

.selected-team {
  display: flex;
  align-items: center;
  gap: 9px;
}

.rank {
  color: var(--gold);
  font-weight: 1000;
}

.submit-button,
.join-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #060203;
  cursor: pointer;
  font-weight: 1000;
  transition: transform 140ms ease, opacity 140ms ease;
}

.submit-button:hover,
.join-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.pick-status {
  min-height: 24px;
  margin: 14px 0 0;
  text-align: center;
}

.participation-info {
  border-top: 1px solid var(--line);
  padding-top: 34px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.info-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.info-grid b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #322326;
  color: var(--gold);
}

.info-grid h3 {
  margin: 18px 0 8px;
}

.info-grid p {
  margin: 0;
  line-height: 1.55;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #161011;
  padding: 28px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #241a1c;
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
}

.modal-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-card h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.95;
}

.modal-card p {
  color: #b9afb2;
  line-height: 1.6;
}

.modal-picks {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.modal-picks span {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #201516;
  padding: 10px 12px;
  font-weight: 900;
}

@media (max-width: 1080px) {
  .page-shell {
    padding-inline: 22px;
  }

  .home-hero-grid {
    grid-template-columns: 1fr;
    padding-top: 74px;
  }

  .premium-panel {
    max-width: 640px;
  }

  .challenge-layout {
    grid-template-columns: 1fr;
  }

  .submit-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 12px 12px 48px;
  }

  .home-hero {
    padding: 18px 16px 48px;
  }

  .home-hero-grid {
    min-height: auto;
  }

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

  .section-title {
    display: block;
  }

  .selected-count {
    text-align: left;
  }

  .group-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .group-summary {
    width: 100%;
    justify-content: space-between;
  }

  .selected-indicator {
    max-width: calc(100vw - 108px);
  }

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

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

@media (max-width: 430px) {
  .team-card {
    min-height: 88px;
  }
}
