/* Fan Lounge: "Across the Hall" */

/* ---------- Tokens ---------- */
:root {
  --f-display: "Alfa Slab One", Rockwell, Georgia, serif;
  --f-ui: "Libre Franklin", "Franklin Gothic Medium", Arial, sans-serif;
  --f-type: "Courier Prime", "Courier New", monospace;
  --f-prose: Georgia, "Times New Roman", serif;

  --paper: #F5EEDF;
  --card: #FFF9EC;
  --foam: #FCEFD3;
  --ink: #2B1D14;
  --muted: #6A5848;
  --line: #2B1D14;
  --door: #5E3B87;
  --on-door: #F5EEDF;
  --frame: #E0A526;
  --cta: #A8431A;
  --cta-hover: #8F3815;
  --on-cta: #FFF9EC;
  --link: #A8431A;
  --selected: #5E3B87;
  --good: #23683F;
  --on-good: #FFF9EC;
  --bad: #B3261E;
  --focus: #5E3B87;
  --shadow: #2B1D14;
  --trim: #EFE4CF;
  --halftone: rgba(43, 29, 20, .06);
  --stain: rgba(120, 72, 36, .16);
  --umbrella: #5E3B87;
  --zigzag: #2B1D14;
  --couch-arm: #B34A19;

  --hard: 3px 3px 0 var(--shadow);
  --gutter: 16px;
  --max: 1040px;
  --narrow: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B1420;
    --card: #261D2C;
    --foam: #33283A;
    --ink: #F3EADB;
    --muted: #BFB2A3;
    --line: #8F8274;
    --door: #3D2A5C;
    --on-door: #F3EADB;
    --frame: #E9B23A;
    --cta: #E2703A;
    --cta-hover: #F0844F;
    --on-cta: #1B1420;
    --link: #FF9A6B;
    --selected: #6E4FA3;
    --good: #6CCB8F;
    --on-good: #1B1420;
    --bad: #FF7A6B;
    --focus: #E9B23A;
    --shadow: #000000;
    --trim: #2A2030;
    --halftone: rgba(243, 234, 219, .04);
    --stain: rgba(233, 178, 58, .10);
    --umbrella: #E9B23A;
    --zigzag: #BFB2A3;
    --couch-arm: #9E4116;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper) radial-gradient(var(--halftone) 1px, transparent 1.3px) 0 0 / 6px 6px;
  color: var(--ink);
  font: 400 17px/1.55 var(--f-ui);
}

img, svg { max-width: 100%; }

a { color: var(--link); }

h1, h2, h3 { margin: 0 0 .5em; font-weight: 400; }

p { margin: 0 0 1em; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.hidden { display: none !important; }

.label,
.kicker {
  font: 700 13px/1.3 var(--f-type);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.caption { font: 400 14px/1.4 var(--f-type); color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 2px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font: 400 22px/1 var(--f-display);
  text-decoration: none;
  white-space: nowrap;
}

.logo .mug { width: 24px; height: 24px; flex: none; color: var(--cta); }
.logo .mug .m-body { fill: var(--cta); }

.nav { display: flex; }

.nav a {
  padding: 12px 8px;
  color: var(--ink);
  font: 700 15px/20px var(--f-ui);
  text-decoration: none;
}

.nav a:last-child { padding-right: 0; }

.nav a[aria-current="page"] {
  text-decoration: underline 3px var(--frame);
  text-underline-offset: 6px;
}

@media (hover: hover) {
  .nav a:hover {
    text-decoration: underline 3px var(--frame);
    text-underline-offset: 6px;
  }
}

@media (max-width: 359px) {
  .logo { font-size: 19px; gap: 6px; }
  .nav a { padding: 12px 6px; }
}

/* ---------- Illustrations ---------- */
.mug .m-body { fill: #FFF9EC; stroke: #2B1D14; stroke-width: 3; }
.mug .m-handle { fill: none; stroke: #2B1D14; stroke-width: 3; }
.mug .m-coffee { fill: #6B3E21; stroke: #2B1D14; stroke-width: 3; }
.mug .m-steam { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

.couch .c-arm { fill: var(--couch-arm); }

.umbrella { fill: currentColor; }

.fountain .f-water { stroke: var(--frame); }

.stain {
  position: absolute;
  width: 96px;
  height: 96px;
  top: -18px;
  right: -14px;
  color: var(--stain);
  transform: rotate(18deg);
  pointer-events: none;
}

/* ---------- Painted wall ---------- */
.wall {
  background: var(--door) repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 7px);
  color: var(--on-door);
  padding-top: 32px;
  overflow: hidden;
}

/* Baseboard: the wall itself has no side padding, so this spans edge to edge. */
.wall::after {
  content: "";
  display: block;
  height: 14px;
  background: var(--trim);
  border-top: 2px solid var(--line);
}

.wall a:not(.btn) { color: var(--on-door); }

/* ---------- Home hero ---------- */
.hero .container { display: grid; gap: 24px; }

.hero .kicker { margin: 0 0 12px; }

.hero h1 {
  font: 400 40px/1 var(--f-display);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.hero .dek { max-width: 34ch; margin: 0 0 24px; }

.hero-art {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: -2px;
}

.hero-art .couch { display: block; width: 260px; max-width: calc(100% - 60px); height: auto; }
.hero-art .mug { display: block; width: 48px; height: 48px; flex: none; margin-bottom: -5px; color: var(--on-door); }

/* ---------- Sections ---------- */
.section { padding-top: 40px; overflow: hidden; }

.section-head {
  border-top: 4px double var(--ink);
  padding-top: 16px;
  margin: 0 0 16px;
  font: 400 26px/1.1 var(--f-display);
}

.ad-slot { margin: 24px 0; min-height: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 24px;
  background: var(--cta);
  color: var(--on-cta);
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--hard);
  font: 800 18px/1.2 var(--f-ui);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn.secondary {
  min-height: 52px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font: 700 17px/1.2 var(--f-ui);
}

@media (hover: hover) {
  .btn:hover { background: var(--cta-hover); }
  .btn.secondary:hover { background: var(--foam); }
}

.btn:not(.secondary):active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

@media (max-width: 479px) {
  .btn:not(.secondary) { display: flex; width: 100%; }
}

.btn-text {
  min-height: 44px;
  padding: 0 8px;
  background: none;
  border: 0;
  color: var(--link);
  font: 700 16px/1.2 var(--f-ui);
  text-decoration: underline 2px;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- Stamp ---------- */
.stamp {
  display: inline-block;
  padding: 2px 6px;
  color: var(--link);
  border: 1.5px solid currentColor;
  border-radius: 3px;
  font: 700 13px/1.3 var(--f-type);
  text-transform: uppercase;
  letter-spacing: .04em;
  transform: rotate(-2deg);
}

/* ---------- Frame ---------- */
.frame {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border: 10px solid var(--frame);
  border-radius: 0;
  box-shadow: 0 0 0 2px var(--line), inset 0 0 0 2px var(--line), 6px 8px 0 2px rgba(0, 0, 0, .25);
  padding: 24px 20px;
}

/* ---------- Quiz cards ---------- */
.quiz-grid,
.card-grid {
  display: grid;
  gap: 16px;
}

.featured { margin-top: 24px; margin-bottom: 8px; }
.featured .label { margin: 0 0 12px; color: var(--muted); }
.featured h3 { font: 800 20px/1.2 var(--f-ui); margin: 0 0 8px; }
.featured p { color: var(--muted); margin: 0 0 20px; max-width: 46ch; }
.featured-mug { display: none; }

a.card {
  display: block;
  padding: 16px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--hard);
  text-decoration: none;
}

a.card:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.card h3 { font: 800 20px/1.2 var(--f-ui); margin: 12px 0 6px; }
.card p { color: var(--muted); margin: 0; }

@media (hover: hover) {
  a.card:hover h3 { text-decoration: underline 3px var(--frame); text-underline-offset: 4px; }
}

/* ---------- Coming soon ---------- */
.soon-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.soon-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.soon-list .umbrella { width: 20px; height: 20px; margin-top: 2px; color: var(--umbrella); }
.soon-title { font: 700 17px/1.3 var(--f-ui); margin: 8px 0 4px; }
.soon-dek { font-size: 15px; color: var(--muted); margin: 0 0 4px; }
.soon-list .caption { margin: 0; }

/* ---------- Quiz intro ---------- */
.wall-intro .container { padding-bottom: 24px; }
.wall-intro .frame { margin-top: 16px; }
.wall-intro h1 { font: 400 34px/1.05 var(--f-display); margin: 16px 0 12px; }
.wall-intro p { color: var(--muted); margin: 0 0 24px; }

.frame-mug {
  position: absolute;
  top: -22px;
  right: 16px;
  width: 40px;
  height: 40px;
  color: var(--on-door);
}

/* ---------- Question and answers ---------- */
#quiz-body .container { padding-top: 24px; padding-bottom: 48px; }

.progress {
  height: 12px;
  margin: 0 0 10px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: visible;
}

#progress-bar {
  position: relative;
  height: 100%;
  width: 0;
  background: var(--cta);
  border-radius: 4px 0 0 4px;
  transition: width .3s;
}

#progress-bar::after {
  content: "";
  position: absolute;
  right: -12px;
  top: -9px;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M4 20h44v18a18 18 0 0 1-18 18h-8A18 18 0 0 1 4 38z' fill='%23FFF9EC' stroke='%232B1D14' stroke-width='3'/%3E%3Cpath d='M48 26h4a8 8 0 0 1 0 16h-5' fill='none' stroke='%232B1D14' stroke-width='3'/%3E%3Cellipse cx='26' cy='20' rx='22' ry='4' fill='%236B3E21' stroke='%232B1D14' stroke-width='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

#progress-label { margin-bottom: 20px; color: var(--muted); }

.question h2 { font: 800 23px/1.25 var(--f-ui); margin: 0 0 20px; }
.question:focus { outline: none; }

.answers { display: grid; gap: 10px; counter-reset: ans; }

.answer {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px 12px 12px;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 6px;
  font: 500 17px/1.35 var(--f-ui);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.answer-text { min-width: 0; overflow-wrap: anywhere; }

.answer::before {
  counter-increment: ans;
  content: counter(ans, upper-alpha);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid currentColor;
  border-radius: 4px;
  font: 700 16px var(--f-type);
}

@media (hover: hover) {
  .answer:not(:disabled):hover { background: var(--foam); }
  .answer:not(:disabled):hover::before { background: var(--ink); color: var(--card); border-color: var(--ink); }
}

/* Outline only, never a background: a focused answer must not look picked. */
.answer:focus { outline: none; }
.answer:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.answer:disabled { cursor: default; }
.answer:disabled:not(.selected):not(.correct):not(.wrong) { opacity: .5; }

.answer.selected { background: var(--selected); border-color: var(--selected); color: #FFF9EC; }
.answer.selected::before { background: var(--frame); color: #2B1D14; border-color: var(--frame); }

.answer.correct { background: var(--good); border-color: var(--good); color: var(--on-good); }

.answer.correct::after,
.answer.wrong::after {
  font: 700 13px var(--f-type);
  text-transform: uppercase;
  border: 2px solid currentColor;
  border-radius: 3px;
  padding: 2px 6px;
  transform: rotate(-4deg);
}

.answer.correct::after { content: "Right!"; }
.answers:has(.wrong) .correct::after { content: "This one"; }
.answer.wrong { border-color: var(--bad); }
.answer.wrong .answer-text { text-decoration: line-through 2px var(--bad); }
.answer.wrong::after { content: "Nope"; color: var(--bad); }

/* ---------- Result ---------- */
.result-wall .container { padding-bottom: 24px; }

.result-card { text-align: center; }

.result-card .eyebrow {
  font: 700 14px/1.3 var(--f-type);
  color: var(--muted);
  margin: 0 0 12px;
}

#result-title {
  font: 400 clamp(32px, 9vw, 64px)/1.2 var(--f-display);
  color: var(--ink);
  text-decoration: underline 6px var(--frame);
  text-underline-offset: 8px;
  text-decoration-skip-ink: none;
  overflow-wrap: anywhere;
  margin: 0 0 24px;
}

#result-text { max-width: 52ch; margin: 0 auto; text-align: left; }

.share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.share-row .btn { width: 100%; padding: 0 12px; }

#share-fb { grid-column: 1 / -1; background: #1466D8; color: #FFFFFF; border-color: #2B1D14; }

@media (hover: hover) {
  #share-fb:hover { background: #0F56B8; }
}

.share-row:has(#share-native.hidden) #copy-link { grid-column: 1 / -1; }

.retake-row { margin: 16px 0 0; text-align: center; }

.next-up .card-grid { margin-top: 8px; }

/* ---------- 404 ---------- */
.wall-404 .container { padding-bottom: 48px; }
.wall-404 .fountain { display: block; width: 120px; height: 100px; margin: 0 0 20px; color: var(--on-door); }
.wall-404 .kicker { margin: 0 0 12px; }
.wall-404 h1 { font: 400 34px/1.05 var(--f-display); margin: 0 0 12px; }
.wall-404 p { margin: 0 0 24px; }

/* ---------- Prose pages ---------- */
.prose { padding-top: 32px; font: 400 18px/1.65 var(--f-prose); }
.prose h1 { font: 400 34px/1.05 var(--f-display); margin: 0 0 20px; }
.prose h2 { font: 400 24px/1.15 var(--f-display); margin: 1.6em 0 .5em; }
.prose a { color: var(--link); text-decoration: underline; }
.prose .meta { font: 400 14px/1.4 var(--f-type); color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 64px;
  padding: 28px 0 40px;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--zigzag);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 11L12 1l12 10' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 11L12 1l12 10' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
}

.windows { display: none; }

.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-bottom: 8px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font: 700 15px/1.2 var(--f-ui);
}

.footer-note { font: 400 14px/1.4 var(--f-type); color: var(--muted); margin: 0 0 8px; }
.disclaimer { font: 400 13px/1.5 var(--f-type); color: var(--muted); margin: 0; }

/* ---------- 768px and up ---------- */
@media (min-width: 768px) {
  :root { --gutter: 24px; }

  .site-header .container { min-height: 64px; }
  .logo { font-size: 26px; }

  .wall { padding-top: 48px; }

  .hero { display: flex; flex-direction: column; justify-content: flex-end; min-height: 440px; }
  .hero > .container { width: 100%; grid-template-columns: 7fr 5fr; align-items: end; }
  .hero-text { padding-bottom: 48px; }
  .hero h1 { font-size: 64px; }
  .hero-art .couch { width: 360px; }

  .section-head { font-size: 32px; }

  .quiz-grid,
  .card-grid { grid-template-columns: 1fr 1fr; }

  .featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    gap: 24px;
    padding: 32px;
  }
  .featured-mug { display: block; width: 120px; height: 120px; color: var(--muted); }

  a.card { padding: 20px; }
  .card h3,
  .featured h3 { font-size: 22px; }

  .soon-list { grid-template-columns: repeat(3, 1fr); gap: 24px; }

  .frame { padding: 32px; }
  .wall-intro h1 { font-size: 48px; }
  .question h2 { font-size: 28px; }

  .wall-404 h1 { font-size: 48px; }

  .prose h1 { font-size: 48px; }

  .windows {
    display: block;
    height: 40px;
    margin-bottom: 20px;
    opacity: .25;
    background: var(--line);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='40'%3E%3Cpath d='M1 5h22v30H1zM12 5v30M1 20h22' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='40'%3E%3Cpath d='M1 5h22v30H1zM12 5v30M1 20h22' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
  }
}

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

/* ---------- Home: quiz picker inside the frame (matches the quiz intro and answer styles) ---------- */
.question h2:focus { outline: none; }
.windows { display: none !important; }

.home-intro .frame > p { margin-bottom: 20px; }

.quiz-list { display: grid; gap: 10px; counter-reset: ans; }

.quiz-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px 12px 12px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  transition: background .12s, color .12s;
}

.wall a.quiz-row:not(.btn) { color: var(--ink); }

.quiz-row::before {
  counter-increment: ans;
  content: counter(ans);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid currentColor;
  border-radius: 4px;
  font: 700 16px var(--f-type);
}

.quiz-row strong { display: block; font: 700 17px/1.3 var(--f-ui); }
.quiz-row small {
  display: block;
  margin-top: 2px;
  font: 700 12px/1.4 var(--f-type);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

@media (hover: hover) {
  .quiz-row:hover { background: var(--foam); }
  .quiz-row:hover::before { background: var(--ink); color: var(--card); border-color: var(--ink); }
}

.quiz-row:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.quiz-row:active { background: var(--foam); }

@media (min-width: 768px) {
  .home-intro h1 { font-size: 48px; }
}

/* ---------- Shop ---------- */
.shop-row { min-height: 72px; }
.shop-row em { display: block; margin-top: 4px; font: 400 15px/1.4 var(--f-ui); font-style: normal; color: var(--muted); }
.wall-intro .frame > p.shop-note { margin: 20px 0 0; font: 400 13px/1.5 var(--f-type); color: var(--muted); }
.soon-copy { color: var(--muted); max-width: 52ch; }
.shop-row { grid-template-columns: 64px 1fr; gap: 14px; }
.shop-row::before { content: none; }
.shop-row .thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--foam);
  border: 2px solid var(--line);
  border-radius: 4px;
  color: #2B1D14;
}
.shop-row .thumb svg { width: 44px; height: 44px; }
.shop-row .thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 2px; }

/* ---------- "See all quizzes" link ---------- */
.all-link { margin: 20px 0 0; }
.next-up .all-link { text-align: center; margin-top: 24px; }

/* ---------- Random quiz buttons ---------- */
.random-box { display: grid; gap: 12px; margin-top: 4px; }
.btn-big { min-height: 64px; font-size: 20px; justify-content: center; text-align: center; display: flex; align-items: center; }
.random-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.random-types .btn { width: 100%; justify-content: center; text-align: center; display: flex; align-items: center; padding: 0 10px; }
.browse-link { margin: 4px 0 0; text-align: center; }
.wall .browse-link a, .browse-link a { color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.all-link .btn { margin: 0 6px 10px; }
@media (max-width: 359px) { .random-types { grid-template-columns: 1fr; } }
