:root {
  --bg: #f7f5f1;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #68635d;
  --line: #dfd9d1;
  --accent: #D85A30;
  --accent-weak: #f0c9b8;
  --shadow: 0 14px 40px rgba(17, 17, 17, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --panel: #191919;
    --ink: #f5f2ed;
    --muted: #a8a29a;
    --line: #2c2b29;
    --accent-weak: #563022;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

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

button {
  font: inherit;
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px;
}

.topbar,
.section-head,
.metric-grid,
.tabs {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  min-height: 44px;
}

.mark {
  height: 30px;
  width: auto;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.tabs {
  gap: 6px;
  margin: 20px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}

.tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--ink);
  color: var(--bg);
}

.status {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 42px;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.word,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  white-space: nowrap;
}

.snake {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin: 22px 0;
}

.dot {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 50%;
  background: var(--line);
}

.dot.done {
  background: var(--ink);
}

.dot.today {
  background: var(--accent);
}

.metric-grid {
  gap: 10px;
  align-items: stretch;
}

.metric {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

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

.submit-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.file-input {
  display: none;
}

.submit-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.submit-button:disabled {
  opacity: 0.55;
}

.upload-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.upload-state {
  color: var(--muted);
  font-size: 14px;
}

.result-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 800;
}

.result-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.result-card.pass {
  border-color: var(--ink);
}

.result-card.fail {
  border-color: var(--accent);
  color: var(--accent);
}

.result-card.review {
  border-color: var(--accent-weak);
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
}

.league {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.league-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.league-row.me {
  border-color: var(--accent);
}

.rank {
  color: var(--muted);
  font-weight: 700;
}

.name {
  font-weight: 700;
}

.sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.note {
  margin-top: 18px;
  color: var(--muted);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
}

.day.done {
  color: var(--bg);
  background: var(--ink);
}

.day.future {
  opacity: 0.45;
}

@media (max-width: 520px) {
  .shell {
    padding: 14px;
  }

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

  h1 {
    font-size: 36px;
  }

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

  .metric-grid .metric:last-child {
    grid-column: 1 / -1;
  }
}
