/* Shared look for the games collection (public/games). Same family as Comeback's colors and font, kept in
   its own file so the games and Comeback's pages can change without stepping on each other. */
@font-face {
  font-family: Fredoka;
  src: url(/fonts/fredoka.woff2) format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --bg: #1d1146;
  --bg2: #3b1a78;
  --panel: #2a1b5e;
  --panel2: #34237a;
  --line: #4d3a99;
  --ink: #1d1433;
  --text: #fff8ec;
  --soft: #cfc4f2;
  --accent: #ffd23f;
  --pink: #ff5d8f;
  --teal: #2ec4b6;
  --violet: #7b6cff;
  --good: #4fd66b;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; color: var(--text); }
body {
  font: 500 17px/1.4 Fredoka, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 8%, #ff5d8f2e 0, transparent 34%),
    radial-gradient(circle at 92% 18%, #2ec4b62e 0, transparent 30%),
    radial-gradient(circle at 70% 100%, #ffd23f1f 0, transparent 40%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
}
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; margin: 0; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
button {
  min-height: 50px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 18px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, background .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
button.pink { background: var(--pink); color: #fff; }
button.teal { background: var(--teal); }
button.violet { background: var(--violet); color: #fff; }
button.quiet { background: transparent; color: var(--text); border: 2px solid var(--line); box-shadow: none; font-weight: 600; }
button.small { min-height: 40px; padding: 6px 12px; font-size: 16px; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--soft); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The on-screen Back arrow, top left, 44px (the phone back button rule). */
button.back { min-height: 44px; min-width: 44px; padding: 6px 14px 6px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.g-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 68px; }
.g-top h1 { font-size: 20px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "Leave?" pop-up from back.js and the games' own asks. */
.leave-ask { position: fixed; inset: 0; z-index: 50; background: #0d0826cc; display: grid; place-items: center; padding: 16px; }
.leave-ask .card { width: min(420px, 100%); background: var(--panel); border: 3px solid var(--ink); border-radius: 22px; padding: 22px; box-shadow: 0 8px 0 var(--ink); }
.leave-ask .card > * + * { margin-top: 14px; }
.leave-ask h2 { margin: 0; }
/* "Play full screen" (kit.js appBox): fits a sideways phone that still shows its browser bar. */
.app-ask .card { max-height: calc(100dvh - 24px); overflow-y: auto; }
.app-ask ol { margin-bottom: 0; padding-left: 22px; text-align: left; }
@media (max-height: 380px) {
  .app-ask { padding: 12px; }
  .app-ask .card { padding: 14px 18px; }
  .app-ask .card > * + * { margin-top: 8px; }
  .app-ask p, .app-ask ol { font-size: 15px; }
}

.card { background: var(--panel); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); }

/* A one-time how-to line. */
.howto { display: flex; gap: 10px; align-items: center; background: #fff8ec; color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 8px 8px 14px; font-weight: 600; font-size: 15px; box-shadow: 0 4px 0 var(--ink); }
.howto p { margin: 0; flex: 1; }
.howto button { min-height: 36px; padding: 4px 12px; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }

@keyframes g-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes g-rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Heavy Bomb: the whole page jolts once (never under reduced motion; the page also skips adding the class). */
@keyframes quake { 0%,100% { transform: translate(0, 0); } 10% { transform: translate(-14px, 8px) rotate(-.6deg); } 22% { transform: translate(12px, -10px) rotate(.5deg); } 36% { transform: translate(-10px, 6px); } 50% { transform: translate(8px, -6px) rotate(-.3deg); } 66% { transform: translate(-5px, 3px); } 82% { transform: translate(3px, -2px); } }
body.quake { animation: quake .7s cubic-bezier(.3,.7,.4,1); }
@media (prefers-reduced-motion: reduce) { body.quake { animation: none; } }

/* "More games" link back to the arcade's game list (Doug: every game has a way to the others). */
.more-games { display: inline-block; margin-top: 8px; padding: 10px 18px; border: 2px solid var(--line); border-radius: 999px; background: #ffffff10; color: var(--text); text-decoration: none; font-weight: 600; }
.more-games:hover, .more-games:focus-visible { border-color: #ffd23f; }

/* Full screen toggle and the "turn sideways" card (kit.js). */
.fs-btn { min-width: 44px; min-height: 44px; padding: 8px; display: inline-grid; place-items: center; }
.turn-hint { display: none; }
@media (orientation: portrait) and (max-width: 700px) {
  body.wide-wanted:not(.upright-ok) .turn-hint { display: block; position: fixed; left: 12px; right: 12px; top: max(64px, calc(env(safe-area-inset-top) + 56px)); z-index: 60; pointer-events: none; }
}
.turn-hint .card { pointer-events: auto; margin: 0 auto; max-width: 420px; display: grid; grid-template-columns: 56px 1fr 44px; gap: 10px; align-items: center; padding: 10px 12px; text-align: left; animation: g-pop .35s cubic-bezier(.2,1.5,.4,1) both; }
.turn-hint p { margin: 0; font-size: 14.5px; line-height: 1.3; }
.turn-hint button { min-width: 44px; min-height: 44px; padding: 0; }
.turn-phone { width: 56px; height: 56px; }
.turn-phone .tp { transform-origin: 62px 61px; animation: tp-turn 2.4s ease-in-out infinite; }
@keyframes tp-turn { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .turn-phone .tp { animation: none; transform: rotate(90deg); } }

/* Nothing in a game highlights like copied text (Doug, standing order 1 Oct: "all games we make should not have
   highlightable text"). Every page that loads this file is a game or the arcade, so nothing selects, long-press
   brings up no copy menu, taps don't flash and pictures don't drag. Typing boxes (names, codes) still select.
   Reading pages (privacy, stats) opt back in with body.read. test/no-select.test.js keeps every page covered. */
html, body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
img, svg, canvas, a { -webkit-user-drag: none; }
input, textarea, [contenteditable="true"], body.read, body.read * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Optional sign-in (public/account.js) */
.acct-age { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; cursor: pointer; }
.acct-age input { width: 24px; height: 24px; accent-color: #2ec4b6; }
.acct-btns { display: grid; gap: 10px; justify-items: stretch; }
.acct-btns[hidden], .acct-kid[hidden] { display: none; }
.acct-google { min-height: 44px; display: grid; place-items: center; }
.acct-btn { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 999px; border: 3px solid #1d1433; font-weight: 700; text-decoration: none; box-shadow: 0 4px 0 #1d1433; }
.acct-btn.fb { background: #1877f2; color: #fff; }
.acct-btn.x { background: #000; color: #fff; }
.acct-fine { font-size: 13px; margin: 0; }
.acct-delete summary { cursor: pointer; color: var(--soft, #c9c3dd); min-height: 40px; display: flex; align-items: center; }
.acct-link { display: block; margin: 6px auto 0; font-size: 14px; color: var(--teal, #2ec4b6); }
