:root {
  --ice: #f4fbff;
  --ink: #111a1f;
  --muted: #5d6a70;
  --navy: #15253e;
  --gold: #f69e18;
  --burgundy: #842834;
  --green: #15253e;
  --green-2: #223957;
  --red: #842834;
  --blue: #1d6fa3;
  --page-bg: #f4fbff;
  --page-grid: rgba(21, 37, 62, 0.055);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: rgba(21, 37, 62, 0.04);
  --text: #111a1f;
  --text-muted: #5d6a70;
  --line: rgba(17, 26, 31, 0.12);
  --panel: var(--surface);
  --shadow: 0 18px 50px rgba(16, 31, 36, 0.14);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ice: #0d1420;
  --ink: #f6f8fb;
  --muted: #aeb8c7;
  --page-bg: #0d1420;
  --page-grid: rgba(246, 158, 24, 0.08);
  --surface: rgba(18, 29, 47, 0.94);
  --surface-solid: #121d2f;
  --surface-soft: rgba(246, 158, 24, 0.08);
  --text: #f6f8fb;
  --text-muted: #aeb8c7;
  --line: rgba(255, 255, 255, 0.14);
  --panel: var(--surface);
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, var(--page-grid) 1px, transparent 1px),
    linear-gradient(var(--page-grid) 1px, transparent 1px),
    var(--page-bg);
  background-size: 38px 38px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.theme-toggle {
  position: absolute;
  z-index: 5;
  top: 30px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  padding: 0 14px;
  font-size: 0.86rem;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(21, 37, 62, 0.92);
  color: white;
  border-color: rgba(246, 158, 24, 0.38);
}

.hero {
  position: relative;
  min-height: clamp(300px, 48vh, 520px);
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(116deg, transparent 0 54%, rgba(246, 158, 24, 0.95) 54.2% 56.4%, transparent 56.6%),
    linear-gradient(116deg, transparent 0 62%, rgba(132, 40, 52, 0.92) 62.2% 66.5%, transparent 66.7%),
    linear-gradient(116deg, transparent 0 72%, rgba(246, 158, 24, 0.88) 72.2% 73.6%, transparent 73.8%),
    radial-gradient(circle at 80% 24%, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(135deg, #15253e 0%, #15253e 52%, #21334f 78%, #842834 130%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: auto -4% -18% 54%;
  height: 78%;
  background: url("./assets/eagles-logo.svg") center / contain no-repeat;
  opacity: 0.12;
  transform: rotate(-9deg);
}

.hero::after {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(21, 37, 62, 0.94), rgba(21, 37, 62, 0.68) 44%, rgba(21, 37, 62, 0.08)),
    repeating-linear-gradient(116deg, transparent 0 26px, rgba(255, 255, 255, 0.035) 27px 28px);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(620px, 92%);
  padding: clamp(34px, 8vw, 86px);
  color: white;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.hero__copy {
  max-width: 520px;
  margin-bottom: 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.45;
}

.team-tagline {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--gold);
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 950;
  line-height: 1.25;
}

.team-logo {
  display: block;
  object-fit: contain;
}

.team-logo--hero {
  width: clamp(72px, 12vw, 120px);
  height: clamp(64px, 10vw, 104px);
  margin-bottom: 14px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.team-logo--panel {
  width: 58px;
  height: 52px;
  flex: 0 0 auto;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-panel,
.dashboard {
  margin-top: -34px;
  position: relative;
  z-index: 2;
}

.login-panel,
.topbar,
.meter-card,
.log-card,
.workouts,
.notification-panel,
.team-missions,
.badge-shelf,
.leaderboard,
.chirp-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 34px rgba(16, 31, 36, 0.1);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .login-panel,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .meter-card,
:root[data-theme="dark"] .log-card,
:root[data-theme="dark"] .workouts,
:root[data-theme="dark"] .notification-panel,
:root[data-theme="dark"] .team-missions,
:root[data-theme="dark"] .badge-shelf,
:root[data-theme="dark"] .leaderboard,
:root[data-theme="dark"] .chirp-board {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.login-panel {
  padding: clamp(18px, 3vw, 28px);
}

.login-grid,
.challenge-grid,
.chirp-targets,
.preset-row {
  display: grid;
  gap: 10px;
}

.login-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin: 18px 0;
}

.login-grid button,
.preset-row button,
.chirp-targets button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  min-height: 44px;
  font-weight: 800;
}

.login-grid button.is-selected {
  border-color: rgba(246, 158, 24, 0.72);
  background: rgba(246, 158, 24, 0.13);
  box-shadow: inset 0 0 0 2px rgba(246, 158, 24, 0.24);
}

.pin-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.pin-panel h3,
.pin-panel p {
  margin-bottom: 0;
}

.pin-panel #pinHelp {
  margin-top: 4px;
  color: var(--text-muted);
  line-height: 1.35;
}

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

.pin-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.pin-field input {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 950;
  letter-spacing: 0.24em;
}

.pin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.pin-actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.pin-actions button[type="button"] {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
}

.pin-actions #resetPinButton {
  margin-right: auto;
  color: var(--burgundy);
}

.pin-actions button[type="submit"] {
  border: 0;
  background: var(--navy);
  color: white;
}

.pin-error {
  min-height: 20px;
  color: var(--burgundy);
  font-size: 0.9rem;
  font-weight: 850;
}

.log-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface-solid);
  color: var(--text);
}

input::placeholder {
  color: color-mix(in srgb, var(--text-muted), transparent 18%);
}

.input-row button,
.primary-action {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 900;
}

.dashboard {
  display: grid;
  gap: 16px;
}

.topbar,
.section-heading,
.meter-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 18px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 900;
}

:root[data-theme="dark"] .icon-button {
  color: var(--gold);
}

.quick-log,
.team-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.72fr);
  gap: 16px;
}

.meter-card,
.log-card,
.workouts,
.notification-panel,
.team-missions,
.badge-shelf,
.leaderboard,
.chirp-board {
  padding: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(240, 189, 57, 0.22);
  color: #7a4100;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

:root[data-theme="dark"] .badge {
  background: rgba(246, 158, 24, 0.18);
  color: #ffd083;
}

.goal-meter {
  width: 100%;
  height: 18px;
  margin: 24px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 37, 62, 0.12);
}

:root[data-theme="dark"] .goal-meter {
  background: rgba(255, 255, 255, 0.12);
}

.goal-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  transition: width 220ms ease;
}

#goalText {
  margin-bottom: 0;
  color: var(--text-muted);
  font-weight: 750;
}

.shot-stepper {
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  gap: 8px;
}

.shot-stepper button {
  border: 0;
  border-radius: 8px;
  background: var(--burgundy);
  color: white;
  font-weight: 950;
}

.shot-stepper input {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 950;
}

.goalie-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.preset-row {
  grid-template-columns: repeat(4, 1fr);
  margin: 12px 0;
}

.workouts {
  display: grid;
  gap: 16px;
}

.notification-panel {
  display: grid;
  gap: 14px;
}

.notification-feed {
  display: grid;
  gap: 10px;
}

.notification-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: var(--surface-solid);
  padding: 12px;
}

.notification-item--chirp {
  border-left-color: var(--burgundy);
}

.notification-item--hype {
  border-left-color: var(--gold);
}

.notification-item strong,
.notification-item p,
.notification-item span {
  display: block;
}

.notification-item p {
  margin: 4px 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.notification-item span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.team-missions,
.badge-shelf {
  display: grid;
  gap: 14px;
}

.mission-meter {
  width: 100%;
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 37, 62, 0.12);
}

:root[data-theme="dark"] .mission-meter {
  background: rgba(255, 255, 255, 0.12);
}

.mission-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  transition: width 220ms ease;
}

.mission-stats,
.badge-grid {
  display: grid;
  gap: 10px;
}

.mission-stats {
  grid-template-columns: repeat(3, 1fr);
}

.mission-stats span,
.award-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  padding: 12px;
}

.mission-stats strong {
  display: block;
  color: var(--navy);
  font-size: 1.15rem;
}

:root[data-theme="dark"] .mission-stats strong {
  color: var(--gold);
}

.badge-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.award-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  opacity: 0.55;
}

.award-card.is-earned {
  opacity: 1;
  border-color: rgba(246, 158, 24, 0.45);
  background: linear-gradient(180deg, rgba(246, 158, 24, 0.1), var(--surface-solid));
}

.award-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(246, 158, 24, 0.15);
  font-size: 1.35rem;
}

.award-card strong,
.award-card p {
  display: block;
  margin: 0;
}

.award-card p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

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

.challenge-card {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-solid);
}

.challenge-card.is-done {
  border-color: rgba(246, 158, 24, 0.48);
  background: linear-gradient(180deg, rgba(246, 158, 24, 0.1), var(--surface-solid));
}

.challenge-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(246, 158, 24, 0.15);
  color: var(--burgundy);
  border: 1px solid rgba(246, 158, 24, 0.2);
  font-size: 1.45rem;
  line-height: 1;
}

:root[data-theme="dark"] .challenge-icon {
  background: rgba(246, 158, 24, 0.13);
  color: var(--gold);
  border-color: rgba(246, 158, 24, 0.28);
}

.challenge-card p {
  margin-bottom: 0;
  color: var(--text-muted);
  line-height: 1.35;
}

.workout-how {
  margin-top: 10px;
}

.workout-how summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--navy);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 950;
  list-style: none;
  cursor: pointer;
}

.workout-how summary::-webkit-details-marker {
  display: none;
}

.workout-how summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--gold);
  font-weight: 950;
}

.workout-how[open] summary::after {
  content: "-";
}

.workout-how p {
  margin-top: 8px;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  font-size: 0.9rem;
}

:root[data-theme="dark"] .workout-how summary {
  color: var(--gold);
}

.challenge-card button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.leaderboard ol,
.chirp-feed {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-solid);
  list-style: none;
}

.rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 950;
}

:root[data-theme="dark"] .rank {
  background: var(--gold);
  color: var(--navy);
}

.player-line {
  min-width: 0;
}

.player-line strong,
.player-line span {
  display: block;
}

.player-line span,
.chirp-item span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.score {
  color: var(--navy);
  font-weight: 950;
}

:root[data-theme="dark"] .score {
  color: var(--gold);
}

.chirp-targets {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  margin-top: 16px;
}

.chirp-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 4px;
}

.chirp-types button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-weight: 900;
}

.chirp-types button.is-active {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 6px 16px rgba(246, 158, 24, 0.22);
}

:root[data-theme="dark"] .chirp-types button.is-active {
  color: var(--navy);
}

.chirp-targets button {
  min-height: 38px;
  border-style: dashed;
  border-color: rgba(21, 37, 62, 0.22);
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
}

.chirp-targets button:hover {
  border-style: solid;
  border-color: rgba(246, 158, 24, 0.65);
  background: rgba(246, 158, 24, 0.1);
}

:root[data-theme="dark"] .chirp-targets button {
  border-color: rgba(255, 255, 255, 0.22);
}

.chirp-feed {
  max-height: 320px;
  overflow: auto;
}

.chirp-item {
  border-left: 5px solid var(--burgundy);
  border-radius: 8px;
  background: var(--surface-solid);
  padding: 12px;
  box-shadow: 0 8px 22px rgba(16, 31, 36, 0.07);
}

:root[data-theme="dark"] .chirp-item {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.chirp-item p {
  margin-bottom: 4px;
  line-height: 1.4;
  font-weight: 800;
}

.is-hidden {
  display: none;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 9px;
  }

  .hero {
    min-height: 380px;
  }

  .hero::before {
    inset: auto -18% -16% 34%;
    height: 58%;
  }

  .hero::after {
    background:
      linear-gradient(180deg, rgba(21, 37, 62, 0.96), rgba(21, 37, 62, 0.72)),
      repeating-linear-gradient(116deg, transparent 0 24px, rgba(255, 255, 255, 0.035) 25px 26px);
  }

  .hero__content {
    padding: 30px 22px;
  }

  .quick-log,
  .team-zone,
  .mission-stats,
  .challenge-grid,
  .input-row,
  .pin-fields {
    grid-template-columns: 1fr;
  }

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

  .pin-actions #resetPinButton {
    grid-column: 1 / -1;
    margin-right: 0;
  }
}
