/* ============================================================
   Inkling by AsianFeed — design system + components
   Light theme only. No dark mode.
   ============================================================ */

/* ---- tokens --------------------------------------------------------- */

:root {
  --bg:          #EAF4FF;
  --surface:     #FFFFFF;
  --ink:         #1A1A1A;
  --ink-muted:   #6B6B6B;
  --ink-faint:   #DCE5EF;
  --accent:      #6BB7FF;
  --accent-deep: #4A9FE8;
  --accent-soft: #D6E9FF;
  --wrong:       #C8443C;
  --correct:     #6BB7FF;

  --font-serif: "Fraunces", "Times New Roman", Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                "Helvetica Neue", Arial, sans-serif;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", emoji;

  --radius-pill: 4px;
  --radius-btn:  8px;
  --radius-card: 16px;

  --shadow-primary:
    0 2px 8px -2px rgba(107, 183, 255, 0.40),
    0 4px 16px -4px rgba(107, 183, 255, 0.30);
  --shadow-primary-hover:
    0 4px 12px -2px rgba(107, 183, 255, 0.50),
    0 6px 20px -4px rgba(107, 183, 255, 0.35);
  --shadow-secondary-hover:
    0 2px 8px -4px rgba(26, 26, 26, 0.08);
  --shadow-input-focus:
    0 4px 16px -8px rgba(107, 183, 255, 0.40);
  --shadow-card:
    0 4px 24px -8px rgba(74, 100, 140, 0.12),
    0 12px 48px -16px rgba(74, 100, 140, 0.08);

  --col-game:  480px;
  --col-admin: 640px;
}

/* ---- reset / base --------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html { overscroll-behavior: none; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

hr.hairline {
  border: 0;
  border-top: 1px solid var(--ink-faint);
  margin: 0;
}

/* ============================================================
   Animated background layers
   ============================================================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg__orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.bg__orb--a {
  width: 50vw;
  height: 50vw;
  left: 20%;
  top: 30%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center,
    rgba(107, 183, 255, 0.25) 0%,
    rgba(107, 183, 255, 0.10) 40%,
    transparent 70%);
  filter: blur(60px);
  animation: orbDriftA 75s ease-in-out infinite;
}

.bg__orb--b {
  width: 45vw;
  height: 45vw;
  left: 80%;
  top: 70%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center,
    rgba(107, 183, 255, 0.20) 0%,
    rgba(107, 183, 255, 0.08) 40%,
    transparent 70%);
  filter: blur(70px);
  animation: orbDriftB 75s ease-in-out infinite;
}

@keyframes orbDriftA {
  0%   { transform: translate(-50%, -50%); }
  25%  { transform: translate(-44%, -56%); }
  50%  { transform: translate(-42%, -47%); }
  75%  { transform: translate(-48%, -42%); }
  100% { transform: translate(-50%, -50%); }
}

@keyframes orbDriftB {
  0%   { transform: translate(-50%, -50%); }
  30%  { transform: translate(-57%, -45%); }
  60%  { transform: translate(-54%, -56%); }
  100% { transform: translate(-50%, -50%); }
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

@media (prefers-reduced-motion: reduce) {
  .bg__orb { animation: none; }
}

/* ============================================================
   AsianFeed wordmark — recolored via CSS mask
   The asset is white-on-transparent; we paint it via background-color
   so the same SVG can render in --accent, --ink, or any color.
   ============================================================ */

.wordmark {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("White AsianFeed Text.svg");
          mask-image: url("White AsianFeed Text.svg");
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  /* aspect of the SVG viewBox 417.52 × 72 ≈ 5.8 */
}

.wordmark--brand {
  --wm-h: 24px;
  width: calc(var(--wm-h) * 5.8);
  height: var(--wm-h);
  color: var(--accent);
}

@media (min-width: 640px) {
  .wordmark--brand { --wm-h: 28px; }
}

.wordmark--footer {
  --wm-h: 18px;
  width: calc(var(--wm-h) * 5.8);
  height: var(--wm-h);
  color: var(--ink);
  vertical-align: middle;
}

/* ============================================================
   Masthead (header)
   Single-row title with a hairline beneath the whole header.
   ============================================================ */

.masthead {
  text-align: center;
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--ink-faint);
}

.masthead__row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.masthead__divider {
  display: inline-block;
  width: 1.5px;
  height: 24px;
  background: #DCE5EF;
}

.masthead__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .masthead__title { font-size: 1.5rem; }
}

.masthead__date {
  margin: 16px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-muted);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
  font-variation-settings: "opsz" 24;
}

@media (max-width: 480px) {
  .masthead__date { font-size: 0.85rem; }
}

.masthead__role {
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  line-height: 1;
}

@media (max-width: 380px) {
  .masthead          { padding: 28px 0 24px; }
  .masthead__title   { font-size: 1.1rem; }
  .masthead__row     { gap: 10px; }
  .masthead__divider { height: 20px; }
}

/* ============================================================
   Game layout
   ============================================================ */

.app {
  width: 100%;
  max-width: var(--col-game);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.game {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 48px;
}

/* loading / empty / error -------------------------------------------- */

.state {
  text-align: center;
  padding: 64px 8px;
}

.state__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
}

.state__body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* ============================================================
   Clue area
   ============================================================ */

.clue {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.clue__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
}

.clue__category-rule {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.clue__category-text {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
}

/* clue card -------------------------------------------------------- */

.clue-card {
  width: 100%;
  max-width: 480px;
  margin: 32px 0 0;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 16px;
  box-shadow:
    0 2px 16px -8px rgba(74, 100, 140, 0.10),
    0 8px 32px -12px rgba(74, 100, 140, 0.06);
  text-align: left;
}

/* Mobile: more breathing room inside the card.
   28px horizontal eats into the usable width so text wraps onto
   more lines and feels framed rather than edge-to-edge.
   40px vertical lifts the clue away from the dot row and the
   bottom border. */
@media (max-width: 767.98px) {
  .clue-card { padding: 40px 28px; }
}

.clue-card.is-entering {
  animation: clueCardIn 350ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.clue-card.is-leaving {
  animation: clueCardOut 200ms ease-in both;
}

@keyframes clueCardIn {
  0%   { opacity: 0; transform: scale(0.96) translateY(12px); }
  50%  {
    box-shadow:
      0 4px 24px -8px rgba(74, 100, 140, 0.20),
      0 8px 32px -12px rgba(74, 100, 140, 0.06);
  }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes clueCardOut {
  to { opacity: 0; transform: scale(0.98) translateY(-8px); }
}

.clue-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clue-card__label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  line-height: 1;
}

.clue-card__dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clue-card__dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-sizing: border-box;
}

.clue-card__dot--past    { background: var(--ink-faint); }
.clue-card__dot--current { background: var(--accent); }
.clue-card__dot--future  {
  background: transparent;
  border: 1px solid var(--ink-faint);
}

.clue-card__text {
  margin: 24px 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-variation-settings: "opsz" 60;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-align: center;
  transition: opacity 200ms ease, color 200ms ease;
}

.clue-card__text.is-anim   { animation: clueTextIn 220ms ease-out both; }
.clue-card__text.is-fading { opacity: 0; }
.clue-card__text.is-correct {
  color: var(--accent);
  font-weight: 600;
  font-variation-settings: "opsz" 60, "wght" 600;
}

@keyframes clueTextIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .clue-card.is-entering,
  .clue-card.is-leaving { animation: none; }
}

/* ============================================================
   Guess input + actions
   ============================================================ */

.guess {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 56px;
}

.guess__input-wrap {
  position: relative;
  overflow: hidden;
  padding: 4px 2px 8px;
}

.guess__input {
  width: 100%;
  height: 64px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink-faint);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  padding: 0 8px;
  outline: none;
  transition: border-bottom-color 150ms ease, box-shadow 200ms ease;
  -webkit-appearance: none;
}

.guess__input::placeholder {
  color: var(--ink-muted);
  opacity: 0.6;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  text-align: center;
}

.guess__input:focus {
  border-bottom: 2.5px solid var(--accent);
  box-shadow: var(--shadow-input-focus);
}

.guess__input.is-wrong {
  border-bottom: 2.5px solid var(--wrong);
  box-shadow: 0 4px 16px -8px rgba(200, 68, 60, 0.40);
  animation: shake 250ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  50%      { transform: translateX(4px); }
  75%      { transform: translateX(-3px); }
}

.guess__feedback {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--wrong);
  text-align: center;
  margin: 0;
  opacity: 0;
  transition: opacity 200ms ease;
}

.guess__feedback.is-visible { opacity: 1; }

/* ============================================================
   Buttons
   ============================================================ */

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

@media (min-width: 480px) {
  .actions {
    flex-direction: row-reverse;
    gap: 4%;
  }
  .actions .btn--primary   { flex: 0 0 60%; }
  .actions .btn--secondary { flex: 0 0 36%; }
}

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-btn);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

.btn:disabled { cursor: not-allowed; }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* primary */
.btn--primary {
  padding: 16px 32px;
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-primary);
}

@media (hover: hover) {
  .btn--primary:hover:not(:disabled) {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    box-shadow: var(--shadow-primary-hover);
  }
}

.btn--primary:disabled {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 0.40;
  box-shadow: none;
}

.btn--primary.is-confirmed {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  box-shadow: var(--shadow-primary);
}

/* secondary */
.btn--secondary {
  padding: 16px 28px;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink-faint);
}

@media (hover: hover) {
  .btn--secondary:hover:not(:disabled) {
    border-color: var(--ink-muted);
    box-shadow: var(--shadow-secondary-hover);
  }
}

/* ============================================================
   Guess history
   ============================================================ */

.history-wrap { margin-top: 32px; }

.history {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.history__label {
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.history__item {
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--ink-muted);
  border: 1px solid var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(26, 26, 26, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 400;
}

/* ============================================================
   Result screen
   ============================================================ */

.result-wrap {
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: cardIn 320ms ease-out both;
  text-align: center;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result__logo {
  margin: 0 auto 24px;
}

.result__headline {
  font-family: var(--font-serif);
  font-weight: 600;
  font-variation-settings: "opsz" 60;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.result__answer {
  margin: 0;
}

.result__answer--win {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-muted);
}

.result__answer--win strong {
  color: var(--ink);
  font-weight: 500;
}

.result__answer-loss-prefix {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.result__answer-loss {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-variation-settings: "opsz" 36;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.result__share-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;            /* + flex gap of 20px on .result → 24px above heading */
  width: 100%;
}

.result__share-heading {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  font-variation-settings: "opsz" 36;
}

.share {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  font-family: var(--font-sans);
  color: var(--ink);
  user-select: text;
}

.share__msg {
  margin: 0;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.5;
}

.share__msg strong { font-weight: 600; }

.share__emoji {
  margin: 0;
  font-family: var(--font-emoji);
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

.share__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.share__prompt {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1;
}

.share__link {
  align-self: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

@media (hover: hover) {
  .share__link:hover { text-decoration: underline; }
}

.result__copy { width: 100%; }

.result__footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 24px 0 0;
}

/* ============================================================
   Colophon (footer)
   ============================================================ */

.colophon {
  margin-top: 80px;
  padding-bottom: 48px;
  text-align: center;
}

@media (min-width: 640px) {
  .colophon { margin-top: 120px; }
}

.colophon__lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.colophon__games {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 18;
}

.colophon__dots {
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.colophon__dots span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.colophon__copyright {
  margin: 24px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink-muted);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* ============================================================
   How to Play (collapsible)
   ============================================================ */

.howto {
  margin: 48px auto 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.howto__trigger {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 12px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 150ms ease;
}

@media (hover: hover) {
  .howto__trigger:hover { color: var(--ink); }
}

.howto__chevron {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-sans);
}

@media (hover: hover) {
  .howto__trigger:hover .howto__chevron { transform: rotate(105deg); }
}

.howto__trigger[aria-expanded="true"] .howto__chevron {
  transform: rotate(-90deg);
}

@media (hover: hover) {
  .howto__trigger[aria-expanded="true"]:hover .howto__chevron {
    transform: rotate(-105deg);
  }
}

.howto__card {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  margin-top: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    grid-template-rows 300ms cubic-bezier(0.16, 1, 0.3, 1),
    margin-top 300ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.howto__card.is-open {
  grid-template-rows: 1fr;
  margin-top: 16px;
  opacity: 1;
  transform: translateY(0);
}

.howto__card.is-closing {
  transition:
    grid-template-rows 200ms ease-in,
    margin-top 200ms ease-in,
    opacity 200ms ease-in,
    transform 200ms ease-in;
}

.howto__card-inner {
  overflow: hidden;
  min-height: 0;
}

.howto__card-content {
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 12px;
  box-shadow:
    0 2px 16px -8px rgba(74, 100, 140, 0.10),
    0 8px 32px -12px rgba(74, 100, 140, 0.06);
  padding: 28px 24px;
  text-align: center;
}

.howto__heading {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 36;
}

.howto__body {
  margin: 16px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
  text-align: left;
}

.howto__body + .howto__body { margin-top: 12px; }

.howto__body strong { font-weight: 600; }

.howto__hook {
  margin: 16px 0 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--accent);
  text-align: center;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .howto__card,
  .howto__card.is-open,
  .howto__card.is-closing,
  .howto__chevron { transition: none; }
}

/* ============================================================
   Admin — shared form primitives (used by login + editor)
   ============================================================ */

.field { display: flex; flex-direction: column; gap: 8px; }

.field__label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--ink);
  margin: 0;
}

.field__hint {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin: 0;
}

.field__error {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--wrong);
  margin: 0;
}

.input {
  width: 100%;
  height: 52px;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
}

.input:focus {
  border: 2px solid var(--accent);
  padding: 0 13px;          /* compensate for 1px → 2px border */
}

.input.is-error {
  border-color: var(--wrong);
}

.clue-textarea {
  width: 100%;
  min-height: 72px;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-variation-settings: "opsz" 18;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
}

.clue-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.clue-textarea.is-error {
  border-color: var(--wrong);
}

/* destructive button --------------------------------------------- */

.btn--destructive {
  padding: 16px 28px;
  background: var(--surface);
  color: var(--wrong);
  border-color: var(--wrong);
  font-weight: 600;
}

@media (hover: hover) {
  .btn--destructive:hover:not(:disabled) {
    background: var(--wrong);
    color: #FFFFFF;
  }
}

/* ============================================================
   Login screen
   ============================================================ */

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 16px;
  box-shadow: 0 4px 24px -8px rgba(74, 100, 140, 0.12);
  padding: 40px;
  display: flex;
  flex-direction: column;
  text-align: center;
  animation: cardIn 320ms ease-out both;
}

.login-card__brand {
  margin: 0 auto;
}

.login-card__title {
  margin: 24px 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 36;
}

.login-card__form {
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.login-card__error {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--wrong);
  margin: -8px 0 0;
}

.login-card__submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 24px;
}

.login-card__help {
  margin: 16px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.login-foot {
  margin-top: 24px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink-muted);
  opacity: 0.7;
}

/* ============================================================
   Admin shell
   ============================================================ */

.admin {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- top bar ---------------------------------------------------- */

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
  border-bottom: 1px solid var(--ink-faint);
}

.admin-bar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-bar__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  white-space: nowrap;
}

.admin-bar__suffix {
  font-family: var(--font-sans);
  font-weight: 400;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-muted);
  letter-spacing: 0;
  font-variation-settings: normal;
  margin-left: 8px;
}

.admin-bar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.admin-bar__email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.admin-bar__sep {
  color: var(--ink-faint);
  user-select: none;
}

.admin-bar__signout {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

@media (hover: hover) {
  .admin-bar__signout:hover { text-decoration: underline; }
}

@media (max-width: 600px) {
  .admin-bar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
  }
  .admin-bar__title { font-size: 1.1rem; }
}

/* ---- shell grid ------------------------------------------------- */

.admin-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 40px 0 0;
}

@media (min-width: 768px) {
  .admin-shell {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 32px;
  }
}

/* ---- schedule (left column) ------------------------------------ */

.schedule__head { margin: 0 0 16px; }

.schedule__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 36;
}

/* ---- calendar header --------------------------------------------- */

.calendar { display: block; }

.calendar__header {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.calendar__nav {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 120ms ease, background 120ms ease;
}

@media (hover: hover) {
  .calendar__nav:hover { color: var(--ink); background: rgba(26,26,26,0.04); }
}

.calendar__month {
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
  font-variation-settings: "opsz" 48;
}

.calendar__sub {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
  min-height: 18px;
}

.calendar__today-btn {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
}

@media (hover: hover) {
  .calendar__today-btn:hover { text-decoration: underline; }
}

/* ---- day-of-week labels ----------------------------------------- */

.calendar__dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.calendar__dow > span {
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  line-height: 1;
}

/* ---- calendar grid ---------------------------------------------- */

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink-faint);
  border: 1px solid var(--ink-faint);
}

/* ---- day cell --------------------------------------------------- */

.day-cell {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border: 0;
  padding: 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

@media (hover: hover) {
  .day-cell:hover { box-shadow: inset 0 0 0 1px var(--ink-muted); z-index: 1; }
}

.day-cell--today {
  box-shadow: inset 0 0 0 2px var(--accent);
  z-index: 1;
}

.day-cell--selected {
  box-shadow: inset 0 0 0 2px var(--ink),
              0 2px 8px -4px rgba(26, 26, 26, 0.12);
  z-index: 2;
}

/* if both today and selected: --ink border on the cell wins, but the
   date number stays --accent (see .day-cell--today rule below) */
.day-cell--today.day-cell--selected {
  box-shadow: inset 0 0 0 2px var(--ink),
              0 2px 8px -4px rgba(26, 26, 26, 0.12);
}

.day-cell--empty:hover {
  background: var(--accent-soft);
}

.day-cell__num {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1;
}

/* outside-month date number: muted (today rule below overrides) */
.day-cell--outside .day-cell__num {
  color: var(--ink-faint);
}

/* today date number wins (declared after .outside so it overrides) */
.day-cell--today .day-cell__num {
  color: var(--accent);
  font-weight: 600;
}

.day-cell__today-tag {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-left: 6px;
  line-height: 1;
}

.day-cell__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding-top: 2px;
}

.day-cell__answer {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--ink);
  font-variation-settings: "opsz" 18;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  max-width: 100%;
}

.day-cell__cat {
  margin-top: 2px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  max-width: 100%;
}

.day-cell__plus {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--ink-faint);
  line-height: 1;
  transition: color 120ms ease;
}

@media (hover: hover) {
  .day-cell--empty:hover .day-cell__plus { color: var(--ink-muted); }
}

/* compact dot indicator for mobile (puzzle exists) */
.day-cell__dot {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}

@media (max-width: 480px) {
  .day-cell {
    aspect-ratio: auto;
    min-height: 48px;
    padding: 6px;
  }
  .day-cell__num         { font-size: 0.75rem; }
  .day-cell__today-tag,
  .day-cell__answer,
  .day-cell__cat         { display: none; }
  .day-cell__plus        { font-size: 1rem; }
  .day-cell--has-puzzle .day-cell__dot { display: block; }
  .calendar__month       { font-size: 1.3rem; }
}

/* ---- editor (right column) ------------------------------------- */

.editor__head { margin: 0 0 32px; }

.editor__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 48;
}

.editor__status {
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.editor__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editor__section-head {
  margin: 8px 0 0;
}

.editor__section-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.editor__section-hint {
  margin: 4px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.editor__clues {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor__clue-label {
  display: block;
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.editor__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 600px) {
  .editor__actions {
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
  }
  .editor__actions--single { justify-content: flex-end; }
  .editor__actions .btn { flex: 0 0 auto; min-width: 160px; }
}

.editor__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 360px;
  gap: 16px;
  padding: 40px 24px;
}

.wordmark--empty {
  --wm-h: 32px;
  width: calc(var(--wm-h) * 5.8);
  height: var(--wm-h);
  color: var(--ink-faint);
}

.editor__empty-text {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-muted);
}

/* ============================================================
   Admin top nav (Schedule | Stats)
   ============================================================ */

.admin-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 0;
}

.admin-nav__tab {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

@media (hover: hover) {
  .admin-nav__tab:hover:not(.is-active) { border-color: var(--ink-muted); }
}

.admin-nav__tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* ============================================================
   Stats page
   ============================================================ */

.admin-shell--stats { display: block; padding: 40px 0 0; }

.stats { display: block; }

.stats-head { margin: 0 0 24px; }

.stats-head__title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 48;
}

.stats-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  align-items: baseline;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 12px;
}

.stats-subnav__link {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 2px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -14px;       /* tuck under the subnav's own border */
  transition: color 120ms ease, border-color 120ms ease;
}

@media (hover: hover) {
  .stats-subnav__link:hover:not(.is-active) { color: var(--ink); }
}

.stats-subnav__link.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.stats__content { padding-top: 24px; }

/* ---- loading + empty ----------------------------------------- */

.loading-state {
  padding: 48px 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.stats-empty {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-align: center;
  padding: 16px 0;
  margin: 0;
}

.stats-empty--large { padding: 48px 0; }

/* ---- Stats Calendar sub-view --------------------------------- */

.stats-cal-intro { margin: 0 0 16px; }

.stats-cal-intro__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 48;
}

.stats-cal-intro__note {
  margin: 6px 0 0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.stats-cell {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border: 0;
  padding: 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: box-shadow 120ms ease;
}

@media (hover: hover) {
  .stats-cell:hover {
    box-shadow: inset 0 0 0 1px var(--ink-muted),
                0 2px 8px -4px rgba(26, 26, 26, 0.10);
    z-index: 1;
  }
}

.stats-cell--today {
  box-shadow: inset 0 0 0 2px var(--accent);
  z-index: 1;
}

.stats-cell__date {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.65rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-cell--outside .stats-cell__date { color: var(--ink-faint); }

.stats-cell__count {
  margin: auto 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 36;
  text-align: center;
}

.stats-cell__rate {
  margin: 2px 0 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1;
}

.stats-cell__bar {
  display: block;
  margin: 6px 0 0;
  height: 4px;
  background: var(--ink-faint);
  border-radius: 2px;
  overflow: hidden;
}

.stats-cell__bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.stats-cell__placeholder {
  margin: auto;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink-faint);
  line-height: 1;
}

@media (max-width: 480px) {
  .stats-cell { aspect-ratio: auto; min-height: 64px; padding: 6px; }
  .stats-cell__date  { font-size: 0.6rem; }
  .stats-cell__count { font-size: 1rem; }
  .stats-cell__rate  { font-size: 0.6rem; }
}

/* ---- Stats Day Detail sub-view ------------------------------ */

.stats-back {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 16px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
}

@media (hover: hover) {
  .stats-back:hover { color: var(--accent-deep); }
}

.stats-back__chevron { font-size: 1rem; line-height: 1; }

.stats-detail__date {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 48;
}

.stats-detail__context {
  margin: 4px 0 24px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.stats-detail__context strong { color: var(--ink); font-weight: 600; }

/* ---- Stats metrics grid ------------------------------------- */

.stats-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 32px;
}

@media (min-width: 600px) {
  .stats-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .stats-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 12px;
  padding: 20px;
}

.metric-card__label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  line-height: 1;
}

.metric-card__value {
  margin: 10px 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
  font-variation-settings: "opsz" 48;
}

.metric-card__context {
  margin: 4px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink-muted);
  min-height: 1em;
  line-height: 1.3;
}

/* ---- Stats sections ----------------------------------------- */

.stats-section {
  margin: 32px 0 0;
}

.stats-section__title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 24;
}

/* ---- Clue bar chart (vertical) ------------------------------ */

.clue-chart {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 12px;
  height: 220px;
  padding: 0 4px;
}

.clue-chart__col {
  flex: 1;
  max-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.clue-chart__count {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1;
  min-height: 1em;
}

.clue-chart__bar-wrap {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
}

.clue-chart__bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 200ms ease;
}

.clue-chart__label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1;
}

/* ---- Funnel (horizontal bars) ------------------------------- */

.funnel { display: flex; flex-direction: column; gap: 10px; }

.funnel__row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 12px;
}

.funnel__label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink);
}

.funnel__bar-wrap {
  background: var(--ink-faint);
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
}

.funnel__bar {
  height: 100%;
  background: var(--accent);
  opacity: 0.8;
  border-radius: 4px;
  transition: width 200ms ease;
}

.funnel__count {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Sessions table ---------------------------------------- */

.sessions-wrap { overflow-x: auto; }

.sessions-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  min-width: 600px;
}

.sessions-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-faint);
  white-space: nowrap;
}

.sessions-table td {
  padding: 12px;
  border-bottom: 1px solid var(--ink-faint);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sessions-table tbody tr {
  transition: background 80ms ease;
}

.sessions-table tbody tr:hover { background: rgba(107, 183, 255, 0.04); }

/* ---- Overview range pills ---------------------------------- */

.stats-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.stats-range__btn {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

@media (hover: hover) {
  .stats-range__btn:hover:not(.is-active) { border-color: var(--ink-muted); }
}

.stats-range__btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* ---- Line chart (SVG) -------------------------------------- */

.line-chart {
  width: 100%;
  height: auto;
  max-height: 240px;
  display: block;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 12px;
  padding: 8px;
}

.line-chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart__dot { fill: var(--accent); }

.line-chart__axis {
  stroke: var(--ink-faint);
  stroke-width: 1;
}

.line-chart__tick {
  font-family: var(--font-sans);
  font-size: 10px;
  fill: var(--ink-muted);
}

/* ---- Best & worst puzzles ---------------------------------- */

.stats-puzzles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 760px) {
  .stats-puzzles { grid-template-columns: 1fr 1fr; }
}

.stats-puzzles__col { display: flex; flex-direction: column; }

.stats-puzzles__title {
  margin: 0 0 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.puzzles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.puzzles-list__row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--ink-faint);
  border-radius: 10px;
}

.puzzles-list__date {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.puzzles-list__answer {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.puzzles-list__rate {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Toast (admin)
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 30;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
