/* Site-local CSS layered on top of pkg/design's bundle. pkg/design
   supplies the tokens, themes, and base reset; the heisei-pixel motif
   kit (skins/heisei-pixel.css) dresses it as the Heisei retro world, and
   this file adds claude-quiz's chrome + the quiz flow on top. */

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  max-width: 40rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.site-wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
}

/* Quiz flow */
.quiz-heading {
  margin-top: 0;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.quiz-lede {
  color: var(--text-muted);
}

.quiz-progress {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quiz-options .button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* Home-row answer-key hint (A/S/D/F), seated at the button's trailing
   edge. The option .button is a flex row, so margin-left:auto pushes
   the keycap right. Muted — it's a discoverability affordance, not the
   label; aria-hidden keeps it out of the button's accessible name. */
.quiz-key {
  margin-left: auto;
  padding-left: 0.75rem;
  opacity: 0.8;
}

.quiz-score {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

/* Theme toggle — chrome and icon visibility both live in pkg/design's
   primitives.css now. heisei-pixel is a fixed world (always an explicit
   data-theme, ADR 0052), so the shared suffix rules resolve it to
   light-or-dark and the system icon never shows — same behaviour the
   two-line block here used to hand-roll. */

/* Header actions — language switch + theme toggle, grouped right. */
.site-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Language switch — a text sibling of the theme toggle, links to the
   same page in the other language. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.lang-switch:hover {
  color: var(--text-primary);
  background: var(--bg-tag, rgba(0, 0, 0, 0.06));
}

.lang-switch:focus-visible {
  outline: 2px solid var(--border-focus, currentColor);
  outline-offset: 1px;
}

/* Auth chrome (ADR 0053). The sign-in link mirrors .lang-switch; the
   logged-in chip pairs the Google avatar with the display name and a
   compact logout button. */
.auth-signin {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.auth-signin:hover {
  color: var(--text-primary);
  background: var(--bg-tag, rgba(0, 0, 0, 0.06));
}

.auth-signin:focus-visible {
  outline: 2px solid var(--border-focus, currentColor);
  outline-offset: 1px;
}

/* Header nav links (History / Admin), styled like the sign-in link. */
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0.375rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tag, rgba(0, 0, 0, 0.06));
}

.nav-link:focus-visible {
  outline: 2px solid var(--border-focus, currentColor);
  outline-offset: 1px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 12rem;
}

/* Admin user table: avatar + name cell, inline toggle form. */
.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-toggle {
  margin: 0;
}

.muted {
  color: var(--text-muted);
  opacity: 0.6;
}

.user-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form {
  display: inline-flex;
  margin: 0;
}

/* On narrow screens the name is noise beside the avatar. */
@media (max-width: 32rem) {
  .user-name {
    display: none;
  }
}

/* Two-state toggle: heisei-pixel is always explicit light or dark (a
   skin can't ride system mode, ADR 0052), so the monitor/system icon
   must never show. pkg/design's suffix rules give that for free — with
   an explicit data-theme they always resolve to exactly one of
   light/dark and hide the other two — so there's nothing to keep here. */
