:root {
  --asphalt-black: #050808;
  --asphalt-ink: #0b0f10;
  --surface: #101918;
  --surface-raised: #121c1a;
  --surface-soft: #182522;
  --border: #1c2b28;
  --border-strong: #29433d;
  --fire: #ff5c1a;
  --fire-dark: #c94414;
  --green: #1ed97a;
  --text: #f4f1e8;
  --muted: #8a9693;
  --danger: #ff8d6b;
  --focus: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--asphalt-black);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 12%, rgba(30, 217, 122, 0.12), transparent 30%),
    linear-gradient(135deg, var(--asphalt-black), var(--asphalt-ink) 56%, #06110e);
  color: var(--text);
  font-family:
    "DM Sans",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  position: fixed;
}

.app-shell {
  isolation: isolate;
  min-height: 100vh;
  position: relative;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px clamp(16px, 4vw, 56px);
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  height: 44px;
  width: 44px;
}

.mark-outline {
  fill: var(--asphalt-ink);
  stroke: var(--fire);
  stroke-linejoin: round;
  stroke-width: 4;
}

.runner-head,
.runner-fire {
  fill: var(--fire);
}

.runner-green {
  fill: var(--green);
}

.brand-text {
  align-items: baseline;
  display: inline-flex;
  font-family:
    "Bebas Neue",
    Impact,
    "Arial Narrow",
    sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.brand-text span:first-child {
  color: var(--fire);
}

.brand-text span:last-child {
  color: var(--green);
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--fire);
  font-size: 0.74rem;
  font-weight: 800;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

h1,
.hero-line {
  color: var(--text);
  font-family:
    "Bebas Neue",
    Impact,
    "Arial Narrow",
    sans-serif;
  font-weight: 800;
  line-height: 1;
}

h2,
h3 {
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  line-height: 1.18;
}

h1 {
  font-size: clamp(3.4rem, 11vw, 7.8rem);
  margin-bottom: 10px;
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  margin-bottom: 8px;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

main {
  padding: 0 clamp(16px, 4vw, 56px) 42px;
}

.login-screen {
  align-items: center;
  display: grid;
  gap: clamp(24px, 5vw, 64px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  min-height: calc(100vh - 118px);
  padding: 18px 0 32px;
}

.login-copy {
  max-width: 720px;
}

.hero-line {
  color: var(--green);
  font-size: clamp(1.4rem, 4vw, 3.2rem);
  margin-bottom: 18px;
}

.hero-copy {
  color: var(--text);
  font-size: 1.08rem;
  max-width: 620px;
}

.login-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.microcopy {
  color: var(--muted);
  margin: 0;
}

.button {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  border-color: var(--green);
}

.button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.button.primary {
  background: var(--fire);
  border-color: var(--fire);
  color: #fff7ef;
}

.button.primary:hover {
  background: var(--fire-dark);
  border-color: var(--fire-dark);
}

.button.ghost {
  background: rgba(16, 25, 24, 0.72);
}

.notice {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  margin-top: 16px;
  max-width: 640px;
  padding: 12px 14px;
}

.notice.success {
  background: rgba(30, 217, 122, 0.1);
  border-color: rgba(30, 217, 122, 0.42);
  color: var(--green);
}

.notice.danger {
  background: rgba(255, 92, 26, 0.12);
  border-color: rgba(255, 92, 26, 0.42);
  color: var(--danger);
}

.notice a {
  color: var(--text);
  display: inline-block;
  font-weight: 800;
  margin-left: 10px;
}

.preview-card {
  display: flex;
  justify-content: center;
}

.phone-frame {
  background: #07100e;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  overflow: hidden;
  padding: 22px;
  width: min(100%, 380px);
}

.phone-head {
  align-items: center;
  color: var(--fire);
  display: flex;
  font-family:
    "Bebas Neue",
    Impact,
    "Arial Narrow",
    sans-serif;
  font-size: 1.6rem;
  gap: 10px;
  margin-bottom: 24px;
}

.mini-mark {
  background: linear-gradient(135deg, var(--fire) 0 52%, var(--green) 52% 100%);
  clip-path: polygon(50% 0, 92% 24%, 92% 76%, 50% 100%, 8% 76%, 8% 24%);
  display: inline-block;
  height: 34px;
  width: 34px;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric-grid > div,
.route-card,
.panel,
.activity,
.track,
.submission,
.profile-item {
  background: rgba(16, 25, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric-grid > div {
  min-height: 112px;
  padding: 14px;
}

.metric-grid p,
.route-card p {
  font-size: 0.78rem;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.metric-grid strong {
  color: var(--text);
  font-size: 1.7rem;
}

.route-card {
  padding: 14px;
}

.route-card h2 {
  font-size: 1.35rem;
}

.route-card svg {
  display: block;
  margin-top: 10px;
  width: 100%;
}

.route-card path {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-width: 5;
}

.runner-home {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  min-width: 0;
  padding-top: 12px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.status-panel,
.profile-panel {
  grid-column: 1 / -1;
}

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

.section-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.athlete {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: min(100%, 260px);
}

.athlete img {
  border: 2px solid var(--green);
  border-radius: 999px;
  height: 54px;
  object-fit: cover;
  width: 54px;
}

.athlete strong {
  color: var(--text);
  font-weight: 800;
  line-height: 1.2;
}

.athlete a,
.profile-item a {
  color: var(--green);
  font-weight: 800;
}

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

.profile-item {
  min-width: 0;
  padding: 12px;
}

.profile-item h3,
.profile-item p {
  overflow-wrap: anywhere;
}

.tag {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.status-chip {
  align-items: center;
  background: rgba(30, 217, 122, 0.12);
  border: 1px solid rgba(30, 217, 122, 0.42);
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 28px;
  padding: 5px 9px;
}

.status-chip.preview,
.status-chip.pending {
  background: rgba(255, 92, 26, 0.12);
  border-color: rgba(255, 92, 26, 0.42);
  color: var(--fire);
}

.activity-list,
.submission-list,
.track-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.activity {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto;
  min-width: 0;
  padding: 12px;
}

.activity-meta {
  color: var(--muted);
  margin-bottom: 0;
}

select {
  background: #07100e;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 44px;
  padding: 9px 10px;
  width: 100%;
}

.track,
.submission {
  min-width: 0;
  padding: 12px;
}

.track {
  border-left: 4px solid var(--green);
}

.track[data-pilot="body-war"] {
  border-left-color: var(--fire);
}

.submission h3,
.track h3 {
  font-size: 1.05rem;
}

.state-message {
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  margin: 0;
  padding: 12px;
}

.state-message.error {
  border-color: rgba(255, 92, 26, 0.48);
  color: var(--danger);
}

.submit-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .login-screen,
  .runner-home,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .login-screen {
    align-items: start;
    min-height: auto;
  }

  h1 {
    max-width: 9ch;
  }
}

@media (max-width: 560px) {
  .topbar,
  .top-actions,
  .status-panel,
  .section-head,
  .login-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    width: 100%;
  }

  .login-copy,
  .login-actions {
    min-width: 0;
    width: 100%;
  }

  h1 {
    font-size: 3rem;
    max-width: 100%;
  }

  .button {
    max-width: 100%;
    width: 100%;
  }

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

  .phone-frame {
    border-radius: 20px;
    padding: 16px;
  }

  main {
    padding-inline: 10px;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 2.65rem;
  }
}
