:root {
  color-scheme: light;
  --ink: #17181d;
  --muted: #8b919e;
  --line: #eceef3;
  --card: #ffffff;
  --bg: #f3f4f8;
  --purple: #7a5cff;
  --pink: #ff2e7e;
  --shadow: 0 18px 50px rgba(24, 16, 48, 0.08);
  --safe-top: env(safe-area-inset-top);
  --safe-bot: env(safe-area-inset-bottom);
  font-family: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100dvh; }
button, input { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }

.app { width: min(720px, 100%); margin: 0 auto; padding-bottom: calc(108px + var(--safe-bot)); }

.hero {
  position: relative;
  color: white;
  padding: calc(14px + var(--safe-top)) 18px 78px;
  background:
    radial-gradient(280px 160px at 86% 78%, rgba(255, 186, 92, 0.95), transparent 70%),
    linear-gradient(180deg, #120c28 0%, #3c1874 38%, #d43378 66%, #ff8a4c 78%, #1a102c 100%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 92px;
  background:
    linear-gradient(180deg, transparent, rgba(12, 8, 28, 0.25)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 80' preserveAspectRatio='none'><path fill='%23140d28' d='M0 80V48h18v-16h14v16h16v-28h20v28h12v-20h22v20h18v-36h16v36h24v-14h20v14h28v-44h12v44h18v-22h26v22h16v-30h22v30h18v-18h22v18h18V80Z'/></svg>") bottom / 100% 70px no-repeat;
  pointer-events: none;
}
.hero-top, .eyebrow, h1, .answer, .lede, .glass { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 750; letter-spacing: -0.03em; }
.brand b { font-weight: 800; }
.brand img { width: 28px; height: 28px; }
.fresh { font-size: 12px; color: rgba(255,255,255,.82); display: flex; align-items: center; gap: 6px; }
.dot, .fresh i {
  width: 8px; height: 8px; border-radius: 99px; background: #3dd68c; display: inline-block;
  box-shadow: 0 0 0 0 rgba(61, 214, 140, .7); animation: pulse 1.8s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-family: "Inter Tight", Inter, sans-serif; font-size: clamp(38px, 11vw, 64px); line-height: .92; letter-spacing: -0.045em; font-weight: 800; max-width: 11ch; }
.answer {
  display: inline-block;
  margin: 8px 0 0; font-family: "Inter Tight", Inter, sans-serif; font-weight: 800;
  font-size: clamp(42px, 12vw, 72px); letter-spacing: -0.05em; line-height: .9;
  background: linear-gradient(100deg, #ffb15a, #ff7a3d 55%, #ff5a6a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 12px 0 0; max-width: 38rem; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.45; }
.glass {
  margin-top: 16px; padding: 14px 14px 12px; border-radius: 22px;
  background: rgba(10, 8, 24, .38); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(16px);
}
.cd-label { margin: 0 0 8px; font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: #d7ffe8; }
.digits { display: grid; grid-template-columns: repeat(7, max-content); align-items: end; gap: 6px; }
.digits b { display: block; font-family: "Inter Tight", Inter, sans-serif; font-size: 32px; letter-spacing: -0.04em; line-height: 1; }
.digits span { display: block; margin-top: 2px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.62); }
.digits i { font-style: normal; font-size: 26px; opacity: .7; padding-bottom: 14px; }
.cd-foot { margin: 8px 0 0; color: rgba(255,255,255,.78); font-size: 13px; }
.cd-foot a { color: white; }
.pin p { margin: 0; font-size: 14px; line-height: 1.4; }
.pin b { display: block; margin-bottom: 4px; }

main { margin-top: -46px; padding: 0 14px; position: relative; z-index: 2; display: grid; gap: 14px; }
.card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 22px 18px 18px; }
.kicker { margin: 0; color: #9aa1ad; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.score-row { display: flex; align-items: flex-end; gap: 2px; margin-top: 6px; }
.score {
  display: inline-block;
  font-family: "Inter Tight", Inter, sans-serif; font-weight: 800; letter-spacing: -0.06em; line-height: .84;
  font-size: clamp(78px, 24vw, 116px);
  background: linear-gradient(102deg, #7a5cff 0%, #b44cff 34%, #ff2e7e 70%, #ff5d92 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.score small { font-size: .46em; margin-left: 1px; letter-spacing: -0.04em; }
.score.is-hot { animation: pop .45s ease; }
@keyframes pop { 50% { transform: scale(1.04); } }
.leader { margin: 10px 0 0; color: #667; font-size: 16px; line-height: 1.35; }
.leader a { color: var(--ink); font-weight: 750; text-underline-offset: 3px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.stat { background: #f6f7fa; border-radius: 16px; padding: 10px 12px 9px; }
.stat b { display: block; font-size: 16px; letter-spacing: -0.03em; }
.stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 4px; }
.pin a, .summary, .leader, .change span, .cd-foot { overflow-wrap: anywhere; }
.scale { display: flex; justify-content: space-between; gap: 2px; margin-top: 8px; color: #9aa0ab; font-size: 10px; font-weight: 700; }
.scale div { flex: 1; min-width: 0; text-align: center; line-height: 1.15; }
.scale div:first-child { text-align: left; }
.scale div:last-child { text-align: right; }
.scale b { display: block; color: #5c6370; font-size: 11px; }
.chip {
  flex: 0 0 auto; border-radius: 999px; background: #f4f5f8; padding: 7px 10px; font-size: 13px; font-weight: 650;
  text-decoration: none; color: #333;
}
.chip.is-leader { background: #fff0f6; color: #c41862; }
.bar { position: relative; height: 14px; border-radius: 99px; background: #eceef3; overflow: hidden; margin-top: 8px; }
.bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #7a5cff, #ff2e7e 72%, #ff8a3d);
  transition: width .6s ease;
}
.scale .on { color: #ff2e7e; }
.scale .on b { color: #ff2e7e; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 2px 0; }
.section-title h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.section-title span, .note { color: var(--muted); font-size: 13px; line-height: 1.4; }
.note { margin: 0 2px; }

.change { display: grid; grid-template-columns: 10px auto 1fr; gap: 8px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.change:first-child { border-top: 0; }
.change time { color: var(--muted); font-size: 12px; padding-top: 2px; }
.tick { width: 8px; height: 8px; border-radius: 99px; margin-top: 5px; background: #20a86a; }
.tick.down { background: #e23b4a; }
.tick.flag, .tick.claim { background: #f0a202; }
.tick.new { background: #7a5cff; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filters button, .ghost {
  border: 0; background: #f3f4f8; color: var(--ink); border-radius: 999px; padding: 8px 12px; font-weight: 650; font-size: 13px;
}
.filters button.on { background: var(--ink); color: white; }
.effort {
  background: white; border-radius: 22px; box-shadow: var(--shadow); padding: 14px 14px 12px; margin-top: 10px;
}
.effort.is-leader { outline: 2px solid #ffd0e2; }
.e-top { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.avatar, .fallback {
  width: 42px; height: 42px; border-radius: 14px; object-fit: cover; background: #efe8ff; color: #6846d6;
  display: grid; place-items: center; font-weight: 800;
}
.rank { color: var(--muted); font-size: 12px; font-weight: 700; }
.e-top h3 { margin: 0; font-size: 17px; letter-spacing: -0.03em; }
.e-top h3 a { text-decoration: none; }
.e-top p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.e-score { text-align: right; }
.e-score b {
  display: inline-block;
  font-family: "Inter Tight", Inter, sans-serif; font-size: 28px; letter-spacing: -0.04em;
  background: linear-gradient(100deg, #7a5cff, #ff2e7e); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.e-score b span { font-size: .55em; }
.e-score small { display: block; color: var(--muted); font-size: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: #f4f5f8; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; color: #444; }
.tag.amd { background: #ffe8ea; color: #c4233a; }
.tag.nv { background: #e7f8ee; color: #147a45; }
.tag.ok { background: #e7f8ee; color: #147a45; }
.tag.self { background: #fff6df; color: #8a5b00; }
.summary { margin: 10px 0 0; font-size: 14.5px; line-height: 1.45; color: #2a2d34; }
.mini-bar { height: 8px; margin-top: 10px; }
.more { margin-top: 8px; border: 0; background: transparent; color: #5b4bdc; font-weight: 700; padding: 6px 0; }
.details { display: grid; gap: 8px; }
.details h4 { margin: 8px 0 4px; font-size: 13px; }
.details li { margin: 0 0 4px 18px; font-size: 14px; line-height: 1.35; }
.works li::marker { color: #20a86a; }
.blocks li::marker { color: #e23b4a; }

.story, .tool, .watch-row {
  display: block; text-decoration: none; padding: 12px 0; border-top: 1px solid var(--line);
}
.story:first-of-type, .tool:first-of-type, .watch-row:first-of-type { border-top: 0; }
.story time, .tool small, .watch-row small { color: var(--muted); font-size: 12px; }
.story h3, .tool h3 { margin: 3px 0; font-size: 16px; letter-spacing: -0.02em; }
.story p, .tool p { margin: 0; color: #444; font-size: 14px; line-height: 1.4; }
.watch-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.watch-row b { font-variant-numeric: tabular-nums; }
details.fold { padding: 0; }
details.fold summary { padding: 16px 18px; font-weight: 750; cursor: pointer; }
details.fold .inner { padding: 0 18px 14px; }
.method p { margin: 8px 0 0; color: #444; font-size: 14px; line-height: 1.45; }
footer { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 4px 6px 10px; }
footer a { color: #4d43c8; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 14px calc(10px + var(--safe-bot));
  background: rgba(255,255,255,.92); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0,0,0,.06);
}
.dock-inner { width: min(720px, 100%); margin: 0 auto; display: grid; gap: 6px; }
.dock-status { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
.primary, .secondary {
  width: 100%; min-height: 52px; border: 0; border-radius: 16px; font-weight: 750; font-size: 16px;
}
.primary { color: white; background: linear-gradient(100deg, #7a5cff, #ff2e7e); }
.primary:disabled { opacity: .6; }
.secondary { background: #f3f4f8; color: var(--ink); min-height: 42px; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.actions .secondary { width: auto; padding: 0 14px; }

.sheet {
  position: fixed; inset: 0; z-index: 40; background: rgba(12, 10, 24, .46);
  display: grid; align-items: end;
}
.sheet[hidden] { display: none; }
.sheet-card {
  background: white; border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + var(--safe-bot));
  width: min(720px, 100%); margin: 0 auto;
}
.sheet-card h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.03em; }
.sheet-card ol { margin: 0 0 14px; padding-left: 20px; }
.sheet-card li { margin: 8px 0; font-size: 16px; line-height: 1.35; }
.sheet-card li b { font-weight: 750; }

@media (max-width: 430px) {
  h1 { font-size: 34px; }
  .answer { font-size: 40px; }
  .lede { font-size: 13.5px; margin-top: 8px; }
  .eyebrow { margin: 14px 0 6px; }
  .digits b { font-size: 26px; }
  .hero { padding-bottom: 40px; }
  .glass { margin-top: 10px; padding: 10px 12px 8px; }
  .pin p { font-size: 13px; }
}
.hero-grid, .hero-copy, .hero-side { position: relative; z-index: 1; }
.hero-side { display: grid; gap: 12px; align-content: end; }
.hero-side .glass { margin-top: 0; }
.col-main, .col-side { display: contents; }
#overall { order: 1; }
#changes { order: 2; }
#race { order: 3; }
#private { order: 4; }
#news { order: 5; }
#watchlist { order: 6; }
#toolkit { order: 7; }
.method { order: 8; }
footer { order: 9; }

@media (min-width: 760px) {
  .hero { border-radius: 0 0 28px 28px; }
  .overall-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: end; }
  .stats { margin-top: 0; }
}

@media (min-width: 1080px) {
  .app { width: 100%; padding-bottom: 56px; }
  .hero { padding: 22px 0 100px; border-radius: 0; }
  .hero-top, .hero-grid, main {
    width: min(1180px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
  }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .8fr); gap: 40px; align-items: end; }
  h1 { font-size: 76px; max-width: 12ch; }
  .answer { font-size: 84px; }
  .lede { font-size: 17px; max-width: 38rem; }
  main { margin-top: -64px; padding: 0; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); gap: 18px; align-items: start; }
  .col-main, .col-side { display: grid; gap: 14px; align-content: start; order: 0; }
  .col-main { grid-column: 1; grid-row: 2; }
  .col-side { grid-column: 2; grid-row: 2; }
  #overall, #watchlist, #toolkit, .method, footer { grid-column: 1 / -1; order: 0; }
  .dock {
    position: sticky;
    top: 0;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid rgba(20, 16, 40, .08);
    padding: 12px 16px;
  }
  .dock-inner {
    width: min(1180px, calc(100% - 48px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }
  .dock-status { text-align: left; font-size: 14px; }
  #dock-actions { width: auto; }
  #dock-actions .primary, #dock-actions .secondary { width: auto; min-height: 44px; padding: 0 18px; white-space: nowrap; }
  .score { font-size: 120px; }
  .stat b { font-size: 20px; }
}
