/* ==================================================================
   Trivia Swipe website: one style sheet for every page.
   Same look as the game's Kasumi Town: cream cards with notched pixel frames,
   pink accent, Silkscreen for labels, Fredoka for reading, and the game's own
   pixel town (assets/town.png, exported from trivia.html) behind everything.
   Fonts are bundled in fonts/ (SIL Open Font License), so the site never contacts Google.
   ================================================================== */
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka/Fredoka[wdth,wght].ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("fonts/pixelifysans/PixelifySans[wght].ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("fonts/silkscreen/Silkscreen-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("fonts/silkscreen/Silkscreen-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  /* the game's Kasumi Town colours */
  --fog: #f6dade; --ink: #2a1e24; --muted: #7a6460;
  --card: #fbf3e6; --surface: #fffaf2; --line: #e6d6c0; --key: #f3dfc4;
  --accent: #e8608a; --accent-text: #c23e6a; --good: #3a9a5a; --gold: #e9b95f;
  --drop: rgba(30, 15, 20, .4);
  --wood: #8a5a3a; --wood-text: #fbe7c8; --wood-pink: #ffc2d8; --wood-shadow: #4a2a1c;
  --c-science: #7fb8e8; --c-history: #e8a070; --c-geography: #7fcf9a; --c-nature: #b8d870;
  --c-sport: #f08a8a; --c-arts: #c8a0e8; --c-food: #f4c860; --c-tech: #a3adc8;
  --display: "Silkscreen", "Pixelify Sans", system-ui, sans-serif;
  --body: "Fredoka", system-ui, sans-serif;
  /* town pixel size: 3 on phones (like the game), bigger on big screens */
  --s: 3;
}
@media (min-width: 700px) { :root { --s: 4; } }
@media (min-width: 1500px) { :root { --s: 5; } }

* { box-sizing: border-box; }
html { background: var(--fog); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { position: relative; margin: 0; min-height: 100vh; font-family: var(--body); font-size: 17px; line-height: 1.55;
  display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
/* the town: the game's map, scrolling with the page, so you go "down" through the times of day as you read */
body::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("assets/town.png") center top / calc(125px * var(--s)) auto repeat;
  image-rendering: crisp-edges; image-rendering: pixelated; }

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px dashed var(--accent-text); outline-offset: 4px; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 5; padding: 6px 12px; background: var(--card); }
.skip:focus { left: 12px; }

/* ---------- the notched pixel frame (same trick as the game: four hard shadows leave the corners empty) ---------- */
.px { --w: 4px; --edge: var(--ink); --d: var(--drop);
  box-shadow: 0 calc(-1 * var(--w)) 0 0 var(--edge), 0 var(--w) 0 0 var(--edge),
              calc(-1 * var(--w)) 0 0 0 var(--edge), var(--w) 0 0 0 var(--edge),
              0 calc(2 * var(--w)) 0 0 var(--d); }
.px-6 { --w: 6px; }
.px-3 { --w: 3px; }

/* ---------- top bar: small sign + pills ---------- */
.top { width: 100%; max-width: 980px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 18px; padding: 22px 4px 8px; }
.top.home-top { justify-content: flex-end; }
.mini-sign { display: inline-block; padding: 6px 14px 7px; background: var(--wood); color: var(--wood-text);
  font-family: "Pixelify Sans", var(--display); font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: 2px;
  text-decoration: none; text-shadow: 2px 2px 0 var(--wood-shadow);
  background-image: repeating-linear-gradient(180deg, transparent 0 6px, rgba(0,0,0,.14) 6px 8px); }
.mini-sign span { color: var(--wood-pink); }
.mini-sign:hover { color: var(--wood-text); }
.nav { display: flex; flex-wrap: wrap; gap: 12px; }
.nav a { padding: 5px 11px; background: var(--card); font-family: var(--display); font-size: 12px; letter-spacing: 1px;
  text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav a:hover { background: var(--key); color: var(--ink); }
.nav a[aria-current="page"]:hover { background: var(--accent); color: #fff; }

/* ---------- buttons (like PLAY in the game) ---------- */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 12px 22px; background: var(--accent); color: #fff; font-family: var(--display); font-weight: 700;
  font-size: 15px; letter-spacing: 1px; text-decoration: none; text-align: center; line-height: 1.2; border: 0; cursor: pointer; }
.btn:hover { color: #fff; filter: brightness(1.05); }
.btn:active { transform: translateY(4px); --d: transparent; }
.btn.alt { background: var(--surface); color: var(--ink); }
.btn.alt:hover { color: var(--ink); background: var(--key); }
.btn small { font-family: var(--body); font-weight: 500; font-size: 12px; letter-spacing: 0; opacity: .85; }
.btn.soon { cursor: default; background: var(--surface); color: var(--ink); }
.btn.soon:active { transform: none; --d: var(--drop); }
.btn.soon small { color: var(--muted); }

/* ---------- home: the hanging sign with Kitsu on top ---------- */
.hero { width: 100%; max-width: 620px; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4px; }
.perch { position: relative; width: 220px; height: 92px; display: flex; justify-content: center; align-items: flex-end; }
.kitsu { position: relative; width: 80px; height: 92px; padding: 0; margin-bottom: -2px; background: none; border: 0; cursor: pointer; }
.kitsu img { display: block; width: 80px; height: 92px; image-rendering: pixelated; }
.kitsu.hop { animation: hop .45s steps(4); }
@keyframes hop { 40% { transform: translateY(-22px); } 70% { transform: translateY(-6px); } }
.sign { margin: 0; padding: 12px 26px 14px; background: var(--wood); color: var(--wood-text); text-align: center;
  font-family: "Pixelify Sans", var(--display); font-weight: 700; line-height: .95;
  background-image: repeating-linear-gradient(180deg, transparent 0 9px, rgba(0,0,0,.14) 9px 12px); }
.sign span { display: block; font-size: clamp(44px, 13vw, 64px); letter-spacing: 3px; text-shadow: 3px 3px 0 var(--wood-shadow); }
.sign span + span { color: var(--wood-pink); }
.sign.px { --edge: #2a1e24; }
.lead { margin: 28px 0 0; padding: 16px 18px; background: var(--card); font-size: 18px; line-height: 1.5; max-width: 520px; }
.stores { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.stores .btn { min-width: 200px; }
.stores .btn svg { width: 18px; height: 18px; margin-bottom: 2px; }

/* ---------- sections on the home page ---------- */
.section { width: 100%; max-width: 980px; margin-top: 64px; display: flex; flex-direction: column; align-items: center; }
.label { display: inline-block; padding: 4px 12px; background: var(--card); font-family: var(--display); font-size: 13px; letter-spacing: 1px; margin: 0 0 22px; }

/* feature cards */
.features { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 30px 26px; }
.feature { background: var(--card); padding: 18px 18px 20px; }
.feature h3 { margin: 12px 0 6px; font-size: 21px; line-height: 1.2; }
.feature p { margin: 0; color: var(--ink); font-size: 16px; }
.feature p + p { margin-top: 8px; }
.cat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; background: var(--cat, var(--key));
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 1px; }
.cat svg { width: 14px; height: 14px; }
.cat.px { --w: 2px; --d: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.chips .cat { font-weight: 400; }

/* ---------- reading pages (privacy, terms, support, legal) ---------- */
.paper { width: 100%; max-width: 780px; margin-top: 26px; background: var(--card); padding: 26px 26px 30px; }
.paper h1 { margin: 0; font-family: var(--display); font-size: 28px; line-height: 1.15; letter-spacing: 1px; }
.paper .updated { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.paper h2 { margin: 38px 0 10px; font-family: var(--display); font-size: 18px; line-height: 1.3; letter-spacing: .5px; scroll-margin-top: 20px; }
.paper h3 { margin: 24px 0 6px; font-size: 18px; line-height: 1.3; }
.paper p, .paper li { overflow-wrap: anywhere; }
.paper ul, .paper ol { padding-left: 22px; }
.paper li + li { margin-top: 5px; }
.paper small { color: var(--muted); }
.paper .btn small { color: inherit; opacity: 1; }
.paper .btn.alt small { color: var(--muted); }
.summary { margin: 22px 0 0; padding: 14px 16px; background: var(--surface); }
.summary.px { --w: 3px; --edge: var(--accent); --d: transparent; }
.summary h2 { margin: 0 0 6px; font-size: 14px; }
.summary ul { margin: 6px 0 0; }
.toc { margin: 22px 0 0; padding: 12px 16px; background: var(--surface); font-size: 15.5px; }
.toc.px { --w: 2px; --edge: var(--line); --d: transparent; }
.toc b { font-family: var(--display); font-size: 12px; letter-spacing: 1px; }
.toc ol { margin: 6px 0 0; columns: 2 240px; column-gap: 26px; }
.toc li + li { margin-top: 3px; }
.tablewrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.4; background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border: 2px solid var(--line); }
th { font-family: var(--display); font-weight: 400; font-size: 11.5px; letter-spacing: .5px; background: var(--key); }
.box { margin: 14px 0; padding: 12px 14px; background: var(--surface); }
.box.px { --w: 2px; --edge: var(--line); --d: transparent; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
dl.facts dt { font-family: var(--display); font-size: 11.5px; letter-spacing: .5px; padding-top: 4px; }
dl.facts dd { margin: 0; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; gap: 0; } dl.facts dd { margin-bottom: 8px; } }

/* support: contact buttons and questions you can open */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px 18px; margin: 18px 0 8px; }
.contact .btn { width: 100%; font-size: 13px; padding: 12px 10px; }
details { margin: 14px 0; background: var(--surface); }
details.px { --w: 2px; --edge: var(--line); --d: transparent; }
details[open].px { --edge: var(--ink); }
summary { cursor: pointer; padding: 11px 14px; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: baseline; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-family: var(--display); color: var(--accent-text); flex: none; width: 14px; }
details[open] summary::before { content: "-"; }
details > div { padding: 0 16px 12px 38px; }
details > div p:first-child { margin-top: 0; }

/* ---------- footer ---------- */
.foot { width: 100%; max-width: 980px; margin: 70px 0 26px; padding: 18px 20px 20px; background: var(--card); text-align: center; font-size: 15px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.foot p { margin: 10px 0 0; color: var(--muted); }

/* ---------- details still to fill in (site.js marks [LIKE THIS] text) ---------- */
mark.fill { background: #ffd2e4; color: var(--accent-text); padding: 0 3px; font-weight: 600; outline: 2px dashed var(--accent); }
.todo { width: calc(100% + 32px); margin: 0 -16px; padding: 7px 14px; background: var(--ink); color: #ffd2e4;
  font-family: var(--display); font-size: 11px; letter-spacing: .5px; text-align: center; }

/* ---------- page not found ---------- */
.lost { width: 100%; max-width: 440px; margin-top: 60px; padding: 26px 22px 28px; background: var(--card); text-align: center; }
.lost img { width: 80px; height: 92px; image-rendering: pixelated; }
.lost h1 { margin: 14px 0 6px; font-family: var(--display); font-size: 24px; }
.lost p { margin: 0 0 22px; }

@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .top { justify-content: center; padding-top: 16px; }
  .paper { padding: 20px 16px 24px; }
  .paper h1 { font-size: 23px; }
  .paper h2 { font-size: 16px; }
  .section { margin-top: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .kitsu.hop { animation: none; }
  .btn:active { transform: none; }
}
