/* The game's "Circuit" look: near-black panels, one bright green that means
   on or selected, and pale readout text. */
:root {
  color-scheme: dark;
  --bg: #070c0a;
  --panel: #0e1613;
  --panel-2: #141f1b;
  --line: #2a3a33;
  --text: #dbe7e1;
  --muted: #8fa39a;
  --accent: #39ff88;
  --accent-ink: #04140b;
  --fail: #ff6b5e;
  --fail-ink: #1d0503;
  --skip: #e3b95c;
  --skip-ink: #1b1303;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
.small { font-size: .85rem; color: var(--muted); }

.eyebrow {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Login, join and message pages */
.card {
  max-width: 26rem;
  margin: 12vh auto 2rem;
  padding: 1.5rem;
  width: calc(100% - 2rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.card > * + * { margin-top: .75rem; }

.button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: .75rem 1rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Chart */
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .6rem 1rem .5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto;
}

.who { min-width: 0; }

.name {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scores { display: flex; flex: none; gap: 1rem; text-align: center; }
.scores strong { display: block; color: var(--accent); font-size: 1.25rem; line-height: 1.1; }
.scores span { color: var(--muted); font-size: .7rem; }

.progress {
  max-width: 44rem;
  height: 4px;
  margin: .45rem auto .3rem;
  overflow: hidden;
  background: var(--panel-2);
  border-radius: 2px;
}

.progress > div {
  width: var(--fill, 0%);
  height: 100%;
  background: var(--accent);
  transition: width .25s ease;
}

#save-status.bad { color: var(--fail); font-weight: 600; }

.chart { max-width: 44rem; margin: 0 auto; padding: .75rem 1rem 1.5rem; }
.how { margin: .25rem 0 .75rem; color: var(--muted); font-size: .9rem; }
.set { margin-bottom: 1.5rem; }

.set h2 {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .5rem;
  font-size: 1.05rem;
}

.count { flex: none; color: var(--muted); font-weight: 400; }
.set ul { margin: 0; padding: 0; list-style: none; }

.item {
  margin-bottom: .6rem;
  padding: .75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
}

.item[data-mark="pass"] { border-left-color: var(--accent); }
.item[data-mark="fail"] { border-left-color: var(--fail); }
.item[data-mark="skip"] { border-left-color: var(--skip); }

.step { margin: 0 0 .6rem; }

.marks { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: .4rem; }

.mark {
  min-height: 46px;
  padding: .25rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .12s ease, color .12s ease;
}

.mark[data-value="pass"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mark[data-value="fail"][aria-pressed="true"] { background: var(--fail); border-color: var(--fail); color: var(--fail-ink); }
.mark[data-value="skip"][aria-pressed="true"] { background: var(--skip); border-color: var(--skip); color: var(--skip-ink); }

.note-toggle, .linklike {
  min-height: 36px;
  margin-top: .3rem;
  padding: .25rem 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  cursor: pointer;
}

.note {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .55rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.note[hidden] { display: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-size: .85rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
