/* The Postcard look from the apps (App/Capitals/Theme/Postcard.swift and the
   mockup): bright sky, ink outlines, chunky cards with a solid drop shadow.
   It stays light in dark mode, like the apps. */
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url(fonts/Fredoka-Medium.ttf) format("truetype"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url(fonts/Fredoka-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url(fonts/Fredoka-Bold.ttf) format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url(fonts/Nunito-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/Nunito-Bold.ttf) format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url(fonts/Nunito-ExtraBold.ttf) format("truetype"); }

:root {
  --sky: #dff1ff; --ink: #14214a; --blue: #2d5bff; --sun: #ffc93c;
  --mint: #22c39a; --rose: #ff5d73; --card: #ffffff; --soft: #5a678f;
  --disp: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--sky); }
body {
  margin: 0; min-height: 100dvh; background: var(--sky); color: var(--ink);
  font-family: var(--body); font-weight: 700; font-size: 16px; line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 480px; margin: 0 auto; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.pad { padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }

/* Home */
.hero { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.hero img { width: 72px; height: 72px; border-radius: 18px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); flex: 0 0 auto; }
h1 { font-family: var(--disp); font-weight: 600; font-size: 34px; line-height: 1; margin: 0; letter-spacing: -.01em; }
h2 { font-family: var(--disp); font-weight: 600; font-size: 20px; margin: 8px 0 0; }
.sub { color: var(--soft); margin: 4px 0 0; }

.play-card { background: var(--card); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 var(--ink); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.play-card .row { display: flex; align-items: center; gap: 12px; }
.play-card .fl { font-size: 40px; line-height: 1; }
.play-card b { font-family: var(--disp); font-weight: 600; font-size: 22px; display: block; }
.play-card small { color: var(--soft); font-size: 14px; }

.stamps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 420px) { .stamps { grid-template-columns: repeat(3, 1fr); } }
.stamp {
  position: relative; background: var(--card); padding: 12px; text-decoration: none;
  display: flex; flex-direction: column; gap: 4px; min-height: 96px;
  -webkit-mask: radial-gradient(circle 5px at 50% 0, #0000 98%, #000) top/14px 51% repeat-x, radial-gradient(circle 5px at 50% 100%, #0000 98%, #000) bottom/14px 51% repeat-x;
  mask: radial-gradient(circle 5px at 50% 0, #0000 98%, #000) top/14px 51% repeat-x, radial-gradient(circle 5px at 50% 100%, #0000 98%, #000) bottom/14px 51% repeat-x;
}
.stamp .fl { font-size: 26px; line-height: 1; }
.stamp img { width: 30px; height: 30px; }
.stamp b { font-family: var(--disp); font-weight: 600; font-size: 16px; line-height: 1.1; }
.stamp span { font-size: 12px; color: var(--soft); }
.stamp .lock { position: absolute; right: 8px; top: 10px; font-size: 13px; background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 8px; font-family: var(--disp); font-weight: 600; }
.stamp .fl, .stamp img { filter: grayscale(.35); }

/* The App Store call to action */
.get { background: var(--ink); color: #fff; border-radius: 20px; padding: 16px; display: flex; gap: 14px; align-items: center; }
.get .txt { flex: 1; }
.get b { font-family: var(--disp); font-weight: 600; font-size: 19px; display: block; }
.get span { font-size: 14px; opacity: .85; }
.get .qr { display: none; width: 104px; height: 104px; border-radius: 10px; background: #fff; padding: 4px; flex: 0 0 auto; }
.get .qr img { width: 100%; height: 100%; display: block; }
/* Desktops get a QR code to scan with a phone. */
@media (hover: hover) and (pointer: fine) and (min-width: 700px) { .get .qr { display: block; } }
.badge img { height: 48px; display: block; }
.store-btn { display: inline-block; margin-top: 10px; background: var(--sun); color: var(--ink); border: 3px solid #fff; border-radius: 14px; padding: 8px 14px; font-family: var(--disp); font-weight: 600; text-decoration: none; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--soft); font-size: 13px; margin-top: 4px; }

/* Buttons */
.cta { display: block; width: 100%; text-align: center; text-decoration: none; background: var(--blue); color: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 14px; font-family: var(--disp); font-size: 20px; font-weight: 600; box-shadow: 0 4px 0 var(--ink); }
.cta.alt { background: var(--card); color: var(--ink); }
.cta.sun { background: var(--sun); color: var(--ink); }
.cta:active, .opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.linkbtn { background: none; border: none; color: var(--soft); font-size: 14px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; align-self: center; }

/* Play */
.bar { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 16px 0; }
.back { width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--ink); background: var(--card); font-weight: 800; font-size: 18px; line-height: 1; flex: 0 0 auto; }
.bar-t { flex: 1; font-family: var(--disp); font-weight: 600; font-size: 16px; }
.pill { font-family: var(--disp); font-weight: 600; background: var(--sun); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.prog { margin: 12px 16px 0; height: 12px; border-radius: 999px; background: #fff; border: 3px solid var(--ink); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--mint); transition: width .3s; }
.qcard { background: var(--card); border-radius: 24px; padding: 22px 18px; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); display: flex; flex-direction: column; gap: 10px; }
.qtop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kick { font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
/* The quiet stopwatch: a hint that the app scores speed. */
.clock { font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; opacity: .8; }
.qtext { font-family: var(--disp); font-weight: 600; font-size: 28px; line-height: 1.12; margin: 0; text-wrap: balance; }
.qtext em { font-style: normal; background: linear-gradient(transparent 58%, var(--sun) 58%); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { background: var(--card); border: 3px solid var(--ink); border-radius: 16px; padding: 14px 16px; text-align: left; font-family: var(--disp); font-size: 20px; font-weight: 500; box-shadow: 0 4px 0 var(--ink); display: flex; justify-content: space-between; align-items: center; color: var(--ink); }
.opt.right { background: var(--mint); color: #fff; }
.opt.wrong { background: var(--rose); color: #fff; }
/* After an answer only the player's pick and the right answer stay, so the
   feedback and Next fit on a phone even under a browser's bottom toolbar. */
.opt.dim { display: none; }
.opt:disabled { cursor: default; }
.fb { border-radius: 16px; padding: 12px 14px; background: #fff; border: 3px dashed var(--ink); display: flex; gap: 12px; align-items: center; }
.fb .txt { flex: 1; }
.fb b { font-family: var(--disp); font-weight: 600; font-size: 18px; display: block; }
.fb .flag { font-size: 34px; line-height: 1; }
.fb .time { color: var(--soft); font-size: 13px; display: block; margin-top: 2px; }

/* Results */
.ribbon { align-self: flex-start; background: var(--sun); border: 3px solid var(--ink); border-radius: 10px; padding: 3px 10px; font-family: var(--disp); font-weight: 600; transform: rotate(-3deg); }
.big { font-family: var(--disp); font-size: 72px; line-height: .9; font-weight: 700; }
.big small { font-size: 28px; color: var(--soft); }
.speed { background: #fff; border: 3px dashed var(--ink); border-radius: 16px; padding: 12px 14px; }
.speed b { font-family: var(--disp); font-weight: 600; }

/* Chooser at play.gbros.us */
.pick { display: flex; gap: 14px; align-items: center; background: var(--card); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); padding: 14px; text-decoration: none; }
.pick img { border-radius: 16px; border: 3px solid var(--ink); }
.pick b { font-family: var(--disp); font-weight: 600; font-size: 22px; display: block; }
.pick small { color: var(--soft); font-size: 14px; }

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

/* Fun Fast Facts (fff.js) */
h2 .count { font-family: var(--body); font-size: 14px; color: var(--soft); font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.chip { flex: 0 0 auto; background: var(--card); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
.chip.on { background: var(--sun); font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 440px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--card); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; min-height: 150px; }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tile.off { opacity: .6; box-shadow: none; }
.band { background: var(--blue); display: grid; place-items: center; height: 62px; font-size: 34px; line-height: 1; border-bottom: 3px solid var(--ink); }
.tile .words { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.tile b { font-family: var(--disp); font-weight: 600; font-size: 16px; line-height: 1.15; }
.tile small { color: var(--soft); font-size: 13px; }
.soon { align-self: flex-start; background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.pack-hero { display: flex; gap: 16px; align-items: center; }
.pack-hero h1 { font-size: 30px; }
.big-band { width: 96px; height: 96px; font-size: 52px; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); transform: rotate(-3deg); flex: 0 0 auto; }
.seg { display: flex; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--card); }
.seg button { flex: 1; border: 0; background: none; padding: 10px; font-family: var(--disp); font-weight: 600; font-size: 17px; }
.seg button + button { border-left: 3px solid var(--ink); }
.seg button.on { background: var(--sun); }
.qpic { font-size: 96px; line-height: 1.1; text-align: center; }
.answer-area { display: flex; flex-direction: column; gap: 10px; }
.typed-row { flex-direction: row; }
.typed { flex: 1; min-width: 0; border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px; font: 500 20px var(--disp); color: var(--ink); background: var(--card); }
.typed-row.right .typed { background: var(--mint); color: #fff; }
.typed-row.wrong .typed { background: var(--rose); color: #fff; }
.check { background: var(--blue); color: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 0 16px; font-family: var(--disp); font-size: 18px; font-weight: 600; box-shadow: 0 4px 0 var(--ink); }
.after { display: flex; flex-direction: column; gap: 16px; }
.fb .fact { display: block; margin-top: 6px; font-weight: 600; }
.misses { display: flex; flex-direction: column; gap: 8px; }
.miss { background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
/* After an answer, the feedback and Next question stick to the bottom of the
   screen, so they're in reach on a phone without scrolling (like the apps). */
.after:not(:empty) {
  position: sticky; bottom: 0; z-index: 2; gap: 10px;
  margin: 0 -16px calc(-1 * max(28px, env(safe-area-inset-bottom)));
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  background: var(--sky);
}
.after .fb { padding: 10px 12px; }
.after .fb b { font-size: 17px; }
.after .fb .fact { font-size: 14px; }
/* Short phone screens: a smaller question so the choices fit. */
@media (max-height: 740px) {
  .qcard { padding: 16px 16px; gap: 6px; }
  .qtext { font-size: 24px; }
  .qpic { font-size: 72px; }
  .opt { padding: 11px 14px; font-size: 18px; }
}

/* Sharing a score */
.share { display: flex; flex-direction: column; gap: 10px; }
.send { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.send[hidden] { display: none; }
.send .chip { text-decoration: none; }
.friend { background: var(--card); border: 3px dashed var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.friend b { font-family: var(--disp); font-weight: 600; font-size: 18px; }
.squares { letter-spacing: 1px; }
.vs { font-family: var(--disp); font-weight: 600; font-size: 20px; margin: 0; }

/* The full site, trivia.gbros.us (build-trivia.mjs) */
.site-head { max-width: 640px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--disp); font-weight: 600; font-size: 18px; text-decoration: none; }
.brand img { border-radius: 8px; border: 2px solid var(--ink); }
.site-head nav, .site-foot nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.site-head nav a, .site-foot nav a { color: var(--soft); text-underline-offset: 3px; }
.site-foot { max-width: 640px; margin: 8px auto 0; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); border-top: 3px dashed rgba(20, 33, 74, .2); color: var(--soft); font-size: 13px; }
.site-foot p { margin: 10px 0 0; }
/* While a question is up, only the game shows. */
body.playing .site-head, body.playing .site-foot, body.playing .notes { display: none; }
.site .pad { padding-top: 12px; }
.intro { margin: 0; font-weight: 600; }
h2 a { text-decoration: none; }
h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.get .txt > span { display: block; }
.soon.app { background: var(--sun); color: var(--ink); }
main.page.wide, .notes { max-width: 640px; margin: 0 auto; }
.prose { font-weight: 600; line-height: 1.5; }
.prose p, .prose ul { margin: 0; }
.prose li + li { margin-top: 6px; }
.prose h2 { margin-top: 10px; }
.prose a:not(.cta):not(.store-btn):not(.tile):not(.pack-list a) { color: var(--blue); text-underline-offset: 3px; }
.prose .cta { margin-top: 8px; }
.notes .pad { padding-top: 8px; }
.study { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; font-size: 15px; }
.study th { text-align: left; font-family: var(--disp); font-weight: 600; background: var(--sun); padding: 8px 12px; border-bottom: 3px solid var(--ink); }
.study td { padding: 8px 12px; vertical-align: top; border-top: 1px solid rgba(20, 33, 74, .15); }
.study tr:first-child td { border-top: 0; }
.study td:first-child { width: 45%; }
.study td.pic { font-size: 30px; line-height: 1.1; }
.study small { display: block; color: var(--soft); font-size: 13px; margin-top: 2px; }
.pack-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.pack-list a { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); padding: 10px; text-decoration: none; }
.pack-list .band { width: 56px; height: 56px; border: 3px solid var(--ink); border-radius: 14px; flex: 0 0 auto; font-size: 28px; }
.pack-list b { font-family: var(--disp); font-weight: 600; font-size: 18px; display: block; }
.pack-list small { color: var(--soft); display: block; }
.pack-list span span { display: block; font-weight: 600; font-size: 14px; margin-top: 4px; }
.stores { display: flex; gap: 10px; flex-wrap: wrap; }
.chips a.chip { text-decoration: none; }
