/* Matches Siddharth's personal site: near-black, Inter, quiet grays, one red (the marble). */
:root {
  font-family: Inter, sans-serif;
  --bg: #0b0b0c; --fg: #ededed; --mute: #8a8a8a; --dim: #5e5e62; --rule: #202023;
  --red: #d9412f; --bar: #6a6a70;
}
* { box-sizing: border-box; }
html, body { overscroll-behavior: none; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 15px; line-height: 1.55; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.hidden { display: none !important; }
.mute { color: var(--mute); } .dim { color: var(--dim); } .small { font-size: 13px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 28px 40px; font-size: 14px; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.meta { display: flex; gap: 28px; color: #cfcfcf; flex-wrap: wrap; }
.meta b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg); }

.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; padding: 0 40px 48px; }
.play { min-width: 0; }
#stage {
  position: relative; height: calc(100vh - 226px); min-height: 440px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #1b1b1d 0%, var(--bg) 66%);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#stage canvas { display: block; width: 100%; height: 100%; }
#finish-tag { position: absolute; left: 0; top: 0; pointer-events: none; font: 500 12px Inter, sans-serif; color: var(--fg); opacity: 0; transition: opacity .3s; white-space: nowrap; }

#count {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 96px; font-weight: 600; letter-spacing: -.04em; color: var(--fg); text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11, 11, 12, .55); }
#overlay-done { background: rgba(11, 11, 12, .35); }
.card { width: min(380px, calc(100% - 32px)); padding: 26px 28px; border-radius: 10px; background: #111113; border: 1px solid var(--rule); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.card h1 { font-size: 22px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 10px; }
.card p { margin: 0 0 10px; }
.card .big { font-size: 48px; font-weight: 600; letter-spacing: -.04em; line-height: 1.05; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.card #done-pct b { font-weight: 600; }
.row { display: flex; gap: 22px; align-items: center; margin: 18px 0 12px; }
.lab { font-size: 13px; color: var(--dim); margin: 0 0 12px; }
.card .lab { margin-bottom: 8px; }

button.primary { background: var(--fg); color: var(--bg); font-weight: 500; font-size: 14px; padding: 9px 18px; border-radius: 6px; margin-top: 8px; }
button.primary:hover { background: #fff; }
.row button.primary { margin-top: 0; }
button.link { font-size: 14px; color: #cfcfcf; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #555; }
button.link:hover { color: #fff; }

.bar { display: flex; align-items: baseline; gap: 22px; padding: 14px 2px 0; }
.clock { font-size: 14px; color: var(--mute); white-space: nowrap; }
.clock b { font-size: 26px; font-weight: 600; color: var(--fg); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ms { margin: 0; font-size: 13px; color: #9a9a9a; flex: 1; }
.ms button { text-decoration: underline; text-underline-offset: 3px; }

.side { display: flex; flex-direction: column; gap: 0; padding-top: 4px; }
.block { padding: 22px 0; border-top: 1px solid var(--rule); position: relative; }
.block:last-child { border-bottom: 1px solid var(--rule); }
#name {
  width: 100%; padding: 8px 0; margin: 0 0 18px; background: none; border: 0; border-bottom: 1px solid #333;
  color: var(--fg); font: 500 16px Inter, sans-serif; outline: none;
}
#name:focus { border-bottom-color: var(--fg); }
#name::placeholder { color: var(--dim); }
.hero-num { font-size: 40px; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.hero-num small { font-size: 15px; font-weight: 500; color: var(--mute); letter-spacing: 0; margin-left: 6px; }
.hero-sub { margin: 10px 0 0; color: var(--mute); font-size: 14px; }
.hero-sub b { color: var(--fg); font-weight: 500; white-space: nowrap; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .empty { font-size: 13px; color: var(--dim); padding: 20px 0; }
.chart text { font: 500 11px Inter, sans-serif; fill: var(--dim); }
.chart text.you-label { fill: var(--fg); }
.chart .hit { fill: transparent; }
.chart .bar.hover { filter: brightness(1.35); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; white-space: nowrap; font-size: 12px; padding: 3px 7px; border-radius: 4px;
  background: var(--fg); color: var(--bg);
}

.lb { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.lb li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 7px 0; border-top: 1px solid var(--rule); color: #cfcfcf; }
.lb li:first-child { border-top: 0; }
.lb .rk { color: var(--dim); font-variant-numeric: tabular-nums; }
.lb .t { font-variant-numeric: tabular-nums; color: var(--fg); }
.lb li.you { color: var(--fg); }
.lb li.you .nm::after { content: " · you"; color: var(--red); }
.lb li.gap { display: block; text-align: center; color: var(--dim); padding: 2px 0; border: 0; }
.lb li.empty { display: block; color: var(--dim); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 9; font-size: 12px; padding: 5px 10px; border-radius: 4px; background: var(--fg); color: var(--bg); }

@media (max-width: 960px) {
  .wrap { grid-template-columns: 1fr; gap: 24px; }
  #stage { height: min(78vh, 640px); }
}
@media (max-width: 600px) {
  .top { padding: 18px 20px; } .meta { gap: 16px; }
  .wrap { padding: 0 12px 32px; }
  #stage { height: min(70vh, 112vw); min-height: 360px; }
  .bar { flex-wrap: wrap; gap: 6px 18px; }
  .ms { order: 3; flex-basis: 100%; }
  .card .big { font-size: 40px; }
}

/* difficulty tabs */
.levels { display: flex; gap: 28px; padding: 0 2px 14px; flex-wrap: wrap; }
.levels button { text-align: left; color: var(--dim); transition: color .15s; padding-bottom: 6px; border-bottom: 1px solid transparent; }
.levels button:hover { color: #cfcfcf; }
.levels button.on { color: var(--fg); border-bottom-color: var(--fg); }
.levels .nm { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.levels .mt { display: block; font-size: 12px; }
.levels button.on .mt { color: var(--mute); }
@media (max-width: 600px) { .levels { gap: 18px; } }
