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

    :root {
      --brick:          #8B2118;
      --brick-hover:    #6E1A13;
      --ink:            #1C1C1C;
      --paper:          #FAFAF7;
      --cream:          #F4EFE6;
      --rule:           #1C1C1C;
      --muted:          #666;
      --correct-fg:     #1B5E20;
      --correct-bg:     rgba(27, 94, 32, 0.09);
      --incorrect-fg:   #7B1C1C;
      --incorrect-bg:   rgba(123, 28, 28, 0.09);
    }

    html { font-size: 18px; scroll-behavior: smooth; }

    body {
      background: var(--paper);
      color: var(--ink);
      font-family: 'EB Garamond', Georgia, serif;
      min-height: 100vh;
    }

    /* ── PAPER TEXTURE ──────────────────────────────────── */
    body::after {
      content: '';
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 9999;
      opacity: 0.07;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    }

    /* ── PAGES ─────────────────────────────────────────── */
    .page { display: none; }
    .page.active { display: block; }

    /* ── LAYOUT ─────────────────────────────────────────── */
    .wrap {
      max-width: 700px;
      margin: 0 auto;
      padding: 0 1.4rem;
    }

    /* ── MASTHEAD AUTH ───────────────────────────────────── */
    /* ── AUTH STRIP ─────────────────────────────────────── */
    .auth-strip-wrap {
      max-width: 700px;
      margin: 0 auto;
      padding: 0 1.4rem;
    }
    #auth-strip {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      height: 1.6rem;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.72rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--muted);
    }
    .as-name { color: var(--ink); font-style: italic; }
    .as-divider { opacity: 0.35; margin: 0 0.3em; }
    .as-btn {
      background: none; border: none; padding: 0; cursor: pointer;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase;
      color: var(--muted); transition: color 0.15s;
    }
    .as-btn:hover { color: var(--ink); }
    .as-btn.sign-in { color: var(--ink); font-style: italic; }
    @keyframes pulse-dot {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0.15; }
    }
    .as-name-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .as-name-link {
      color: var(--ink);
      font-style: italic;
      text-decoration: none;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.72rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      padding-right: 12px;
    }
    .as-name-link:hover .as-name-text { text-decoration: underline; }
    .as-pulse-dot {
      position: absolute;
      top: -3px;
      right: -8px;
      width: 7px;
      height: 7px;
      background: var(--brick);
      border-radius: 50%;
      animation: pulse-dot 1.4s ease-in-out infinite;
    }
    @media (prefers-reduced-motion: reduce) {
      .as-pulse-dot { animation: none; }
    }
    .as-bell {
      background: none; border: none; padding: 0; cursor: pointer;
      color: var(--muted); display: flex; align-items: center;
      margin-left: 0.55rem; transition: color 0.15s; line-height: 1;
    }
    .as-bell:hover { color: var(--brick); }
    .as-bell.active { color: var(--brick); }
    .as-bell.active svg { fill: currentColor; }

    /* keep old class names working (masthead desktop right col) */
    .mh-auth-btn {
      background: none; border: none; padding: 0; cursor: pointer;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase;
      color: var(--muted); transition: color 0.15s;
    }
    .mh-auth-btn:hover { color: var(--ink); }
    .mh-auth-btn.sign-in { color: var(--ink); font-style: italic; }
    .mh-auth-divider { opacity: 0.3; }

    /* ── MASTHEAD ────────────────────────────────────────── */
    .masthead {
      max-width: 700px;
      margin: 0 auto;
      padding: 0.4rem 1.4rem 0;
    }

    .mh-rule-top {
      border: none;
      border-top: 2px solid var(--rule);
      margin-bottom: 0;
    }

    .mh-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.55rem 0;
      gap: 0.5rem;
    }

    .mh-side {
      font-size: 0.72rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--muted);
      line-height: 1.55;
      min-width: 6rem;
    }

    .mh-side.right { text-align: right; }

    .mh-center { text-align: center; flex: 1; }

    .mh-title {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: clamp(2rem, 8vw, 3.8rem);
      font-weight: 700;
      letter-spacing: 0.03em;
      line-height: 1;
      color: var(--ink);
    }

    .mh-sub {
      font-family: 'EB Garamond', Georgia, serif;
      font-style: italic;
      font-size: 0.88rem;
      color: var(--brick);
      letter-spacing: 0.07em;
      margin-top: 0.2rem;
    }

    .mh-rule-mid {
      border: none;
      border-top: 1px solid var(--rule);
      margin: 0;
    }

    /* double rule below masthead */
    .double-rule {
      border: none;
      margin: 0;
      height: 5px;
      border-top: 1px solid var(--ink);
      border-bottom: 1px solid var(--ink);
    }

    /* ── TICKER STRIP ────────────────────────────────────── */
    .ticker {
      background: var(--brick);
      color: #fff;
      text-align: center;
      padding: 0.42rem 1rem;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.75rem;
      letter-spacing: 0.16em;
      min-height: 2.1rem;
      box-sizing: border-box;
    }


    /* ── TIME BONUS TOOLTIP ─────────────────────────────── */
    .tb-trigger {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 0.28em;
      cursor: pointer;
      text-decoration: underline;
      text-decoration-style: dotted;
      text-underline-offset: 3px;
      text-decoration-color: rgba(255,255,255,0.6);
    }
    .tb-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 1.05em;
      height: 1.05em;
      border-radius: 50%;
      border: 1.5px solid rgba(255,255,255,0.8);
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.78em;
      font-weight: bold;
      letter-spacing: 0;
      line-height: 1;
      flex-shrink: 0;
      vertical-align: middle;
    }
    .tb-box {
      position: absolute;
      top: calc(100% + 10px);
      left: 50%;
      transform: translateX(-50%);
      z-index: 300;
      min-width: 230px;
      background: var(--paper);
      color: var(--ink);
      border: 2px solid var(--ink);
      border-radius: 5px;
      padding: 0.8rem 1rem;
      box-shadow: 3px 4px 0 rgba(0,0,0,0.14);
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.95rem;
      letter-spacing: 0;
      text-transform: none;
      text-align: left;
      white-space: nowrap;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.15s ease, visibility 0.15s ease;
    }
    .tb-box::before {
      content: '';
      position: absolute;
      top: -8px;
      left: 50%;
      transform: translateX(-50%);
      width: 0;
      height: 0;
      border-left: 7px solid transparent;
      border-right: 7px solid transparent;
      border-bottom: 8px solid var(--ink);
    }
    .tb-trigger:hover .tb-box,
    .tb-trigger.is-open .tb-box {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    .tb-head {
      display: block;
      font-weight: 600;
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--muted);
      margin-bottom: 0.2em;
    }
    .tb-head + .tb-head { margin-top: 0.65em; padding-top: 0.65em; border-top: 1px solid rgba(0,0,0,0.1); }
    .tb-row {
      display: flex;
      justify-content: space-between;
      gap: 1.4em;
      line-height: 1.65;
    }
    .tb-pts { font-weight: 600; color: var(--brick); }

    /* Mobile: tap only — disable CSS hover, rely on .is-open */
    @media (hover: none) {
      .tb-trigger:hover .tb-box { opacity: 0; visibility: hidden; pointer-events: none; }
      .tb-trigger.is-open .tb-box { opacity: 1; visibility: visible; pointer-events: auto; }
      .tb-box { min-width: min(230px, 85vw); white-space: normal; }
    }

    /* ── TIMER ───────────────────────────────────────────── */
    .timer-bar {
      display: flex;
      justify-content: flex-end;
      align-items: baseline;
      gap: 0.4rem;
      padding: 0.45rem 0 0;
    }

    .timer-label {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.68rem;
      letter-spacing: 0.12em;
      color: var(--muted);
      text-transform: uppercase;
    }

    #timer-display {
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 1rem;
      font-weight: 500;
      color: var(--ink);
      letter-spacing: 0.06em;
      min-width: 3.2ch;
      text-align: right;
    }

    #timer-display.stopped { color: var(--brick); }

    /* ── QUIZ BODY ───────────────────────────────────────── */
    .quiz-section { padding: 1.8rem 0 2.4rem; }

    .feature-strip {
      border-left: 3px solid #b84c2e;
      padding: 0.45rem 0.75rem;
      margin-bottom: 1.4rem;
      font-size: 0.84rem;
      color: #444;
      line-height: 1.5;
    }
    .feature-strip-link {
      background: none;
      border: none;
      padding: 0;
      font: inherit;
      color: #b84c2e;
      text-decoration: underline;
      cursor: pointer;
    }
    .feature-strip-badge {
      display: inline-block;
      background: #b84c2e;
      color: #fff;
      font-size: 0.6rem;
      letter-spacing: 0.13em;
      text-transform: uppercase;
      font-weight: 700;
      padding: 0.1em 0.45em;
      border-radius: 2px;
      margin-right: 0.45rem;
      vertical-align: middle;
      position: relative;
      top: -1px;
    }

    .quiz-headline {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: clamp(1.5rem, 4.5vw, 2.1rem);
      font-weight: 900;
      line-height: 1.18;
      margin-bottom: 0.55rem;
    }

    .quiz-deck {
      font-size: 1.05rem;
      font-style: italic;
      color: #333;
      line-height: 1.55;
      margin-bottom: 1rem;
    }

    .quiz-byline {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.73rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted);
      border-top: 1px solid #c8c8c8;
      border-bottom: 1px solid #c8c8c8;
      padding: 0.35rem 0;
      margin-bottom: 1.6rem;
    }

    .byline-label {
      font-family: 'Playfair Display SC', Georgia, serif;
      color: var(--brick);
      font-weight: 700;
      letter-spacing: 0.12em;
    }

    .byline-dot { color: var(--brick); }

    /* ── BYLINE SHARE BUTTON ─────────────────────────────── */
    .byline-share {
      margin-left: auto;
      background: none;
      border: none;
      padding: 0.1rem 0.25rem;
      cursor: pointer;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: 0.3rem;
      font-family: inherit;
      font-size: 0.73rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      position: relative;
      transition: color 0.15s;
      line-height: 1;
    }
    .byline-share:hover { color: var(--brick); }
    .byline-share svg { flex-shrink: 0; }
    .byline-share .copied-tip {
      position: absolute;
      bottom: calc(100% + 5px);
      right: 0;
      background: var(--ink);
      color: #fff;
      font-size: 0.65rem;
      letter-spacing: 0.05em;
      padding: 0.2rem 0.55rem;
      border-radius: 3px;
      white-space: nowrap;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s;
    }
    .byline-share .copied-tip.show { opacity: 1; }

    /* ── ARTICLE TEXT ────────────────────────────────────── */
    .article-body {
      font-size: 1.2rem;
      line-height: 1.82;
      color: var(--ink);
    }

    .article-body p { margin-bottom: 1.3em; }

    .article-body > p:first-child::first-letter {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: 4em;
      font-weight: 900;
      float: left;
      line-height: 0.76;
      margin-right: 0.07em;
      margin-top: 0.09em;
      color: var(--brick);
    }

    /* ── BLANK INPUTS ────────────────────────────────────── */
    .blank-input {
      display: inline-block;
      border: none;
      border-bottom: 2px solid var(--ink);
      background: transparent;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 1em;
      line-height: 1;
      padding: 0 3px 2px;
      outline: none;
      text-align: center;
      vertical-align: baseline;
      color: var(--ink);
      border-radius: 0;
      -webkit-appearance: none;
      transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
      font-size: max(1em, 16px);
    }

    .blank-input:focus {
      border-bottom-color: var(--brick);
      background-color: rgba(139, 33, 24, 0.04);
    }

    .blank-input.is-correct {
      border-bottom-color: var(--correct-fg);
      background-color: var(--correct-bg);
      color: var(--correct-fg);
    }

    .blank-input.is-incorrect {
      border-bottom-color: var(--incorrect-fg);
      background-color: var(--incorrect-bg);
      color: var(--incorrect-fg);
    }

    .blank-input:disabled { cursor: default; opacity: 1; }

    /* ── SUBMIT AREA ─────────────────────────────────────── */
    .submit-area {
      margin-top: 2rem;
      border-top: 3px double var(--ink);
      padding-top: 1.6rem;
      text-align: center;
    }

    /* ── SCORE CARD ──────────────────────────────────────── */
    .score-card {
      display: none;
      position: relative;
      background: var(--cream);
      padding: 1.6rem 1.5rem;
      margin-bottom: 1.5rem;
    }

    .score-card.visible { display: block; }

    .score-eyebrow {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.58rem;
      letter-spacing: 0.28em;
      color: var(--brick);
      margin-bottom: 0.8rem;
    }

    .score-main {
      display: flex;
      align-items: flex-end;
      justify-content: center;
      gap: 1.1rem;
      margin-bottom: 1rem;
      text-align: left;
    }

    .score-pts {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: clamp(5rem, 12vw, 6.5rem);
      font-weight: 900;
      color: var(--ink);
      line-height: 0.85;
      flex-shrink: 0;
    }

    .score-side {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      padding-bottom: 0.3rem;
    }

    .score-label {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--muted);
      line-height: 1;
    }

    .score-pts-label {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.56rem;
      letter-spacing: 0.2em;
      color: var(--muted);
    }

    .score-emojis {
      font-size: 1.5rem;
      letter-spacing: 0.12em;
      margin-bottom: 0.75rem;
    }

    .score-rule {
      border: none;
      border-top: 1px solid rgba(0,0,0,0.12);
      margin-bottom: 0.85rem;
    }

    .score-msg {
      font-style: italic;
      color: var(--muted);
      font-size: 0.95rem;
    }

    /* ── BUTTONS ─────────────────────────────────────────── */
    .btn {
      display: inline-block;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.8rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      padding: 0.72rem 1.9rem;
      border: 2px solid transparent;
      cursor: pointer;
      transition: all 0.18s ease;
      background: none;
      vertical-align: middle;
    }

    .btn-primary {
      background: var(--brick);
      border-color: var(--brick);
      color: #fff;
    }

    .btn-primary:hover:not(:disabled) {
      background: var(--brick-hover);
      border-color: var(--brick-hover);
    }

    .btn-primary:disabled {
      background: #aaa;
      border-color: #aaa;
      cursor: default;
    }

    .btn-outline {
      background: transparent;
      border-color: var(--ink);
      color: var(--ink);
    }

    .btn-outline:hover {
      background: var(--ink);
      color: var(--paper);
    }

    .reveal-btn {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.68rem;
      letter-spacing: 0.15em;
      color: var(--ink);
      background: none;
      border: none;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
      padding: 0.25rem 0;
      opacity: 0.7;
      transition: opacity 0.18s ease;
    }

    .reveal-btn:hover { opacity: 1; }

    /* ── SCORE CARD SHARE ICON ──────────────────────────── */
    .score-share-corner {
      position: absolute;
      top: 0.85rem;
      right: 1rem;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 0.25rem;
    }

    .score-share-btn {
      background: none;
      border: none;
      padding: 0.2rem;
      cursor: pointer;
      color: var(--muted);
      line-height: 0;
      transition: color 0.18s ease;
    }

    .score-share-btn:hover { color: var(--brick); }

    .copy-notice {
      font-size: 0.75rem;
      font-style: italic;
      color: var(--correct-fg);
      opacity: 0;
      transition: opacity 0.3s ease;
      white-space: nowrap;
    }

    .copy-notice.show { opacity: 1; }

    /* ── SHARE ROW (Reveal Answers only) ─────────────────── */
    .share-row {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      margin-top: 1.25rem;
    }

    .share-row.visible { display: flex; }

    /* ── ANON LOGIN PROMPT ──────────────────────────────── */
    .anon-login-prompt {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 0.65rem;
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid rgba(0,0,0,0.12);
      text-align: center;
    }

    .anon-login-prompt.visible { display: flex; }

    .anon-login-label {
      font-size: 0.88rem;
      color: var(--muted);
      font-style: italic;
    }

    .anon-login-cta {
      display: inline-block;
      padding: 0.55rem 1.4rem;
      background: var(--brick);
      color: #fff;
      border: none;
      border-radius: 2px;
      font-size: 0.9rem;
      font-family: inherit;
      cursor: pointer;
      letter-spacing: 0.14em;
      transition: all 0.18s ease;
    }

    .anon-login-cta:hover { background: var(--brick-hover); }

    .save-retry-row {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
      margin-top: 1.25rem;
    }

    .blank-warn {
      font-size: 0.88rem;
      font-style: italic;
      color: var(--brick);
      text-align: center;
      margin: 0.4rem 0 0;
    }

    .save-error-msg {
      font-size: 0.88rem;
      font-style: italic;
      color: var(--brick);
      text-align: center;
    }

    .btn-retry {
      background: transparent;
      border: 1.5px solid var(--brick);
      color: var(--brick);
      padding: 0.55rem 1.6rem;
    }

    .btn-retry:hover { background: var(--brick); color: var(--cream); }

    /* ── FOOTER ──────────────────────────────────────────── */
    .site-footer {
      max-width: 700px;
      margin: 2.5rem auto 0;
      padding: 1.4rem;
      text-align: center;
      border-top: 1px solid #ddd;
    }

    .footer-admin {
      background: none;
      border: none;
      color: #c0c0c0;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.78rem;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      cursor: pointer;
    }

    .footer-admin:hover { color: #888; }

    /* ── NO-QUIZ STATE ───────────────────────────────────── */
    .no-quiz {
      text-align: center;
      padding: 4rem 1rem;
    }

    .no-quiz-main {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: 1.4rem;
      font-style: italic;
      color: var(--ink);
      margin-bottom: 0.5rem;
    }

    .no-quiz-sub {
      font-size: 0.9rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .no-quiz-hint {
      margin-top: 1.6rem;
      font-size: 0.85rem;
      font-style: italic;
      color: var(--muted);
      line-height: 1.6;
    }

    .no-quiz-hint .bell-icon {
      display: inline-block;
      vertical-align: middle;
      margin: 0 0.1em;
    }

    /* ── AUTH MODAL ──────────────────────────────────────── */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(28, 28, 28, 0.6);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }

    .modal-overlay.open {
      display: flex;
    }

    .modal-box {
      background: var(--paper);
      width: 100%;
      max-width: 420px;
      border: 2px solid var(--ink);
      position: relative;
      animation: modal-in 0.2s ease;
    }

    @keyframes modal-in {
      from { opacity: 0; transform: translateY(-12px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .modal-masthead {
      background: var(--ink);
      color: #fff;
      padding: 1.2rem 1.4rem 1rem;
      text-align: center;
      border-bottom: 3px solid var(--brick);
    }

    .modal-masthead h2 {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 1rem;
      letter-spacing: 0.08em;
      font-weight: 400;
      margin-bottom: 0.25rem;
    }

    .modal-masthead p {
      font-size: 0.82rem;
      font-style: italic;
      opacity: 0.65;
    }

    .modal-close {
      position: absolute;
      top: 0.7rem;
      right: 0.9rem;
      background: none;
      border: none;
      color: #fff;
      font-size: 1.3rem;
      cursor: pointer;
      opacity: 0.6;
      line-height: 1;
      font-family: Georgia, serif;
    }

    .modal-close:hover { opacity: 1; }

    .modal-tabs {
      display: flex;
      border-bottom: 1px solid #ddd;
    }

    .modal-tab {
      flex: 1;
      background: none;
      border: none;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.75rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 0.75rem;
      cursor: pointer;
      color: var(--muted);
      border-bottom: 2px solid transparent;
      transition: all 0.15s;
      margin-bottom: -1px;
    }

    .modal-tab.active {
      color: var(--brick);
      border-bottom-color: var(--brick);
    }

    .modal-tab:hover:not(.active) { color: var(--ink); }

    .modal-body {
      padding: 1.4rem;
    }

    .modal-form { display: none; }
    .modal-form.active { display: block; }

    .modal-field {
      margin-bottom: 1rem;
    }

    .modal-label {
      display: block;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.72rem;
      letter-spacing: 0.1em;
      color: #444;
      margin-bottom: 0.35rem;
    }

    .modal-input {
      width: 100%;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 1rem;
      color: var(--ink);
      border: 1px solid #ccc;
      padding: 0.5rem 0.75rem;
      background: #fff;
      outline: none;
      border-radius: 0;
      transition: border-color 0.15s;
    }

    .modal-input:focus { border-color: var(--brick); }

    .modal-error {
      font-size: 0.82rem;
      color: var(--incorrect-fg);
      font-style: italic;
      min-height: 1.2em;
      margin-bottom: 0.75rem;
    }

    .modal-submit {
      width: 100%;
      display: block;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.8rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      padding: 0.75rem;
      border: 2px solid var(--brick);
      background: var(--brick);
      color: #fff;
      cursor: pointer;
      transition: all 0.18s;
    }

    .modal-submit:hover:not(:disabled) { background: var(--brick-hover); border-color: var(--brick-hover); }
    .modal-submit:disabled { background: #aaa; border-color: #aaa; cursor: default; }

    .modal-hint {
      font-size: 0.88rem;
      color: var(--muted);
      font-style: italic;
      margin-bottom: 1rem;
    }

    .modal-ok {
      font-size: 0.82rem;
      color: var(--correct-fg);
      font-style: italic;
      margin-bottom: 0.75rem;
    }

    .modal-footer-note {
      text-align: center;
      font-size: 0.8rem;
      color: var(--muted);
      font-style: italic;
      margin-top: 0.85rem;
    }

    .modal-switch-link {
      background: none;
      border: none;
      color: var(--brick);
      cursor: pointer;
      font-family: inherit;
      font-size: inherit;
      font-style: italic;
      text-decoration: underline;
      padding: 0;
    }

    /* OAuth buttons */
    .oauth-btn {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      padding: 0.65rem;
      border: 1px solid #dadce0;
      background: #fff;
      color: #3c4043;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.95rem;
      cursor: pointer;
      transition: background 0.15s;
      margin-bottom: 0.5rem;
    }
    .oauth-btn:hover { background: #f8f9fa; }
    .oauth-btn svg { flex-shrink: 0; }

    .oauth-divider {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin: 0.75rem 0;
      font-size: 0.8rem;
      color: var(--muted);
      font-style: italic;
    }
    .oauth-divider::before,
    .oauth-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: #e0ddd6;
    }

    /* success state */
    .modal-success {
      display: none;
      text-align: center;
      padding: 1.5rem 1rem;
    }

    .modal-success.show { display: block; }

    .modal-success-icon {
      font-size: 2rem;
      margin-bottom: 0.5rem;
    }

    .modal-success p {
      font-style: italic;
      color: var(--correct-fg);
      font-size: 0.95rem;
    }

    /* ── SCORE BREAKDOWN & STREAK ────────────────────────── */
    .score-breakdown {
      font-size: 0.8rem;
      color: var(--ink);
    }

    .score-streak {
      font-size: 0.8rem;
    }

    /* ── LEADERBOARD ─────────────────────────────────────── */
    .leaderboard {
      margin-top: 2.2rem;
      border-top: 2px solid var(--ink);
      padding-top: 1.4rem;
    }

    .lb-heading {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.58rem;
      letter-spacing: 0.28em;
      color: var(--muted);
      margin-bottom: 1rem;
    }

    .lb-tabs {
      display: flex;
      gap: 0;
      margin-bottom: 1rem;
      border-bottom: 1px solid rgba(0,0,0,0.15);
    }

    .lb-tab {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.68rem;
      letter-spacing: 0.14em;
      color: var(--muted);
      background: none;
      border: none;
      padding: 0.4rem 1.2rem 0.4rem 0;
      cursor: pointer;
      position: relative;
      bottom: -1px;
      border-bottom: 2px solid transparent;
      transition: color 0.15s, border-color 0.15s;
    }

    .lb-tab.active {
      color: var(--brick);
      border-bottom-color: var(--brick);
    }

    .lb-tab:hover:not(.active) { color: var(--ink); }

    .lb-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.88rem;
    }

    .lb-table th {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.58rem;
      letter-spacing: 0.14em;
      color: var(--muted);
      padding: 0.3rem 0.5rem;
      border-bottom: 1px solid rgba(0,0,0,0.12);
    }

    .lb-table td {
      padding: 0.45rem 0.5rem;
      border-bottom: 1px solid rgba(0,0,0,0.06);
      vertical-align: middle;
    }

    .lb-table tr.lb-me td {
      background: rgba(139, 32, 32, 0.06);
    }

    /* Column headers — explicit alignment per column */
    .lb-th-rank   { width: 2rem;   text-align: center; }
    .lb-th-player { text-align: left; }
    .lb-th-score  { width: 4.5rem; text-align: right; }
    .lb-th-streak { width: 4.5rem; text-align: right; }
    .lb-th-time   { width: 4.5rem; text-align: right; }

    /* Cell classes — mirror the header alignment exactly */
    .lb-rank-cell   { text-align: center; color: var(--muted); font-size: 0.78rem; }
    .lb-player-cell { text-align: left; }
    .lb-score-cell  { text-align: right; font-weight: 700; }
    .lb-streak-cell { text-align: right; color: var(--muted); font-size: 0.85rem; }
    .lb-ghost { font-size: 0.8em; margin-right: 0.25rem; opacity: 0.7; }
    .lb-claim-btn {
      font-size: 0.72rem;
      padding: 0.15rem 0.5rem;
      border: 1px solid var(--brick);
      border-radius: 3px;
      background: transparent;
      color: var(--brick);
      cursor: pointer;
      margin-left: 0.5rem;
      white-space: nowrap;
    }
    .lb-claim-btn:hover { background: var(--brick); color: #fff; }
    .lb-time-cell   { text-align: right; color: var(--muted); font-size: 0.85rem; }

    .lb-own {
      margin-top: 0.75rem;
    }

    .lb-own-label {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.58rem;
      letter-spacing: 0.14em;
      color: var(--muted);
      padding: 0.4rem 0.5rem 0.2rem;
      border-top: 1px solid rgba(0,0,0,0.12);
    }

    .lb-more-btn {
      display: block;
      width: 100%;
      margin-top: 0.75rem;
      padding: 0.45rem 0;
      background: none;
      border: 1px solid rgba(0,0,0,0.18);
      border-radius: 3px;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.62rem;
      letter-spacing: 0.12em;
      color: var(--muted);
      cursor: pointer;
      transition: color 0.15s, border-color 0.15s;
    }
    .lb-more-btn:hover { color: var(--ink); border-color: rgba(0,0,0,0.4); }

    /* ── HOW TO PLAY MODAL ───────────────────────────────── */
    .htp-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(28, 28, 28, 0.55);
      z-index: 400;
      align-items: center;
      justify-content: center;
      padding: 1.2rem;
    }
    .htp-overlay.open { display: flex; }

    .htp-box {
      background: var(--paper);
      border: 2px solid var(--ink);
      max-width: 480px;
      width: 100%;
      padding: 0 2rem 2rem;
      box-shadow: 5px 6px 0 rgba(0,0,0,0.18);
      max-height: 90vh;
      overflow-y: auto;
    }

    .htp-double-rule {
      border: none;
      height: 5px;
      border-top: 1px solid var(--ink);
      border-bottom: 1px solid var(--ink);
      margin: 0 -2rem 1.6rem;
    }

    .htp-head {
      text-align: center;
      padding-top: 1.6rem;
      margin-bottom: 1.2rem;
    }

    .htp-title {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 1.5rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      color: var(--ink);
      line-height: 1.1;
    }

    .htp-subtitle {
      font-family: 'EB Garamond', Georgia, serif;
      font-style: italic;
      font-size: 0.95rem;
      color: var(--muted);
      margin-top: 0.3rem;
      letter-spacing: 0.04em;
    }

    .htp-rule {
      border: none;
      border-top: 1px solid var(--ink);
      margin: 0 -2rem 1.4rem;
    }

    .htp-section {
      margin-bottom: 1.2rem;
    }

    .htp-section-head {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.68rem;
      letter-spacing: 0.16em;
      color: var(--ink);
      margin-bottom: 0.35rem;
    }

    .htp-section p {
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 1rem;
      line-height: 1.6;
      color: var(--ink);
    }

    .htp-footer {
      border-top: 1px solid #ddd;
      padding-top: 1.4rem;
      margin-top: 0.4rem;
      text-align: center;
    }

    .htp-begin-btn {
      background: var(--brick);
      color: #fff;
      border: none;
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.82rem;
      letter-spacing: 0.14em;
      padding: 0.7rem 2.4rem;
      cursor: pointer;
      transition: background 0.15s;
    }
    .htp-begin-btn:hover { background: var(--brick-hover); }

    .mh-htp-link {
      display: block;
      background: none;
      border: none;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.68rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--muted);
      cursor: pointer;
      padding: 0;
      margin-top: 0.3rem;
      transition: color 0.15s;
    }
    .mh-htp-link:hover { color: var(--ink); }

    /* ── BACK BUTTON ─────────────────────────────────────── */
    .back-btn {
      background: none;
      border: none;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.8rem;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      color: var(--muted);
      cursor: pointer;
      padding: 0 0 1.6rem;
      display: inline-block;
      transition: color 0.15s;
    }
    .back-btn:hover { color: var(--ink); }

    /* ── DATE CAROUSEL ────────────────────────────────────── */
    .date-carousel {
      margin-top: 2.2rem;
      border-top: 1px solid #ddd;
      padding-top: 1.4rem;
    }

    .carousel-label {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.72rem;
      letter-spacing: 0.16em;
      color: var(--muted);
      margin-bottom: 0.75rem;
    }

    .carousel-track {
      display: flex;
      gap: 0.5rem;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding-bottom: 0.3rem;
    }
    .carousel-track::-webkit-scrollbar { display: none; }

    .date-chip {
      flex-shrink: 0;
      background: none;
      border: 1.5px solid var(--ink);
      border-radius: 3px;
      font-family: 'EB Garamond', Georgia, serif;
      font-size: 0.82rem;
      padding: 0.3rem 0.8rem;
      cursor: pointer;
      white-space: nowrap;
      color: var(--ink);
      transition: background 0.15s, color 0.15s;
    }
    .date-chip:hover { background: var(--ink); color: var(--paper); }
    .date-chip.active { background: var(--ink); color: var(--paper); cursor: default; }

    .date-chip.see-all {
      border-color: var(--muted);
      color: var(--muted);
      font-style: italic;
    }
    .date-chip.see-all:hover { background: var(--muted); color: var(--paper); }

    /* ── ARCHIVE LIST ─────────────────────────────────────── */
    .archive-list { padding-top: 0.5rem; }

    .archive-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 0.25rem;
      border-bottom: 1px solid #eee;
      cursor: pointer;
      font-size: 1rem;
      color: var(--ink);
    }
    .archive-item:hover { background: var(--cream); }
    .archive-item-arrow { color: var(--muted); font-size: 0.85rem; }

    /* ── PAST QUIZ ───────────────────────────────────────── */
    .past-play-note {
      font-family: 'Playfair Display SC', Georgia, serif;
      font-size: 0.62rem;
      letter-spacing: 0.22em;
      color: var(--brick);
      text-align: center;
      margin-bottom: 1.2rem;
    }

    .past-quiz-actions {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.85rem;
      margin-top: 1.6rem;
      padding-top: 1.2rem;
      border-top: 1px solid #eee;
    }

    /* ── RESPONSIVE ──────────────────────────────────────── */
    @media (max-width: 540px) {
      html { font-size: 16px; }

      /* Both masthead side columns hidden on mobile — auth is in the strip above */
      .mh-side { display: none; }

      .mh-title { font-size: 2.4rem; }

      .article-body { font-size: 1.1rem; }

      .article-body > p:first-child::first-letter { font-size: 3.4em; }

      .btn { width: 100%; display: block; }

.admin-actions { flex-direction: column; }
      .admin-actions .btn { margin: 0; }

      .modal-tab { font-size: 0.68rem; padding: 0.6rem; }
    }