/* Fakeopedia's play site in the cards' comic look (games-kiosk-workshop esmaa-menni/brand/README.md): a yellow page
   under red halftone dots, black outlines with a hard drop, speech balloons in the four categories' colours, FAKE! in
   Bangers and فيكوبيديا! in Lalezar. Phones first. No letter-spacing on Arabic: it breaks the joins. */
:root {
  --page-a: #FAD73B; --page-b: #EFB932; --dot: rgba(227, 38, 47, .4);
  --yellow: #FFD60A; --red: #C8102E; --ink: #111; --white: #fff; --muted: #4a3f1f;
  --blue: #8EC5FF; --blue-ink: #1D5AA3; --green: #7DDBA3; --green-ink: #0E7A41;
  --pink: #FF9393; --pink-ink: #B3161E; --lav: #C9B6F2; --lav-ink: #5B3FA0;
  --edge: 2.5px solid var(--ink); --drop: 3px 3px 0 var(--ink);
  --display: "Lalezar", system-ui, sans-serif; --body: "Cairo", system-ui, sans-serif; --bang: "Bangers", Impact, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--page-b); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font: 600 16px/1.6 var(--body);
  background: radial-gradient(var(--dot) 1.3px, transparent 1.4px) 0 0 / 6px 6px, linear-gradient(var(--page-a), var(--page-b));
  background-attachment: fixed; padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}
html[lang="en"] body { font-family: var(--body); }
button, input, textarea { font: inherit; color: inherit; }

/* the title, as on the cards: FAKE! over فيكوبيديا!, tilted */
.top { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; max-width: 560px; margin: 0 auto; padding-top: 12px; }
.brand { justify-self: center; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); transform: rotate(-4deg); line-height: .95; }
.fk { font: 400 34px/1 var(--bang); color: var(--red); letter-spacing: .02em;
  text-shadow: 1.5px 0 var(--ink), -1.5px 0 var(--ink), 0 1.5px var(--ink), 0 -1.5px var(--ink), 1px 1px var(--ink), -1px -1px var(--ink), 1px -1px var(--ink), -1px 1px var(--ink), 3px 3px 0 var(--ink); }
.ar { font: 400 22px/1.1 var(--display); }
.lang, .menu-btn { min-width: 44px; padding: 0 6px; height: 40px; border: var(--edge); border-radius: 10px; background: var(--white); box-shadow: var(--drop); font: 700 14px var(--body); cursor: pointer; }
.menu-btn { justify-self: end; font-size: 20px; line-height: 1; }
.lang { justify-self: start; }
html[dir="ltr"] .lang { justify-self: start; }
.menu { position: fixed; z-index: 5; inset-inline-end: 16px; top: 62px; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--white); border: var(--edge); border-radius: 12px; box-shadow: var(--drop); }
.menu button { border: 0; background: none; text-align: start; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.menu button:hover { background: #f4f0e0; }
.menu .danger { color: var(--red); }

main { max-width: 560px; margin: 14px auto 0; display: flex; flex-direction: column; gap: 14px; }

/* a speech balloon: the comic panel every screen is built from */
.balloon { position: relative; background: var(--white); border: var(--edge); border-radius: 18px; box-shadow: var(--drop); padding: 16px; }
.balloon.tail::after { content: ""; position: absolute; bottom: -14px; inset-inline-start: 34px; width: 18px; height: 18px; background: inherit; border-inline-end: var(--edge); border-bottom: var(--edge); transform: skewX(30deg) rotate(45deg); }
.blue { background: var(--blue); } .green { background: var(--green); } .pink { background: var(--pink); } .lav { background: var(--lav); }
.tag { display: inline-block; background: var(--white); border: 2px solid var(--ink); border-radius: 8px; padding: 0 10px; font: 700 13px/1.8 var(--body); margin-bottom: 8px; }
.blue .tag { color: var(--blue-ink); } .green .tag { color: var(--green-ink); } .pink .tag { color: var(--pink-ink); } .lav .tag { color: var(--lav-ink); }
h1, h2 { margin: 0; font: 400 28px/1.25 var(--display); }
h2 { font-size: 22px; }
p { margin: 0; }
.hint { color: var(--muted); font-size: 14px; font-weight: 600; }
.big { font: 400 30px/1.35 var(--display); overflow-wrap: anywhere; }
.center { text-align: center; }

.btn { display: block; width: 100%; border: var(--edge); border-radius: 14px; box-shadow: var(--drop); background: var(--white); padding: 12px 16px; font: 700 18px var(--body); cursor: pointer; text-align: center; text-decoration: none; color: var(--ink); }
.btn.go { background: var(--red); color: var(--white); }
.btn.yes { background: var(--yellow); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row > * { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
input[type="text"], textarea { width: 100%; border: var(--edge); border-radius: 12px; padding: 10px 12px; background: var(--white); font-size: 18px; font-weight: 700; }
textarea { resize: none; min-height: 84px; line-height: 1.5; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.code-in { text-transform: uppercase; text-align: center; font: 400 30px/1 var(--bang) !important; letter-spacing: .25em; direction: ltr; }
label { font-weight: 700; font-size: 15px; display: block; margin-bottom: 6px; }

/* the room code, big, and its QR */
.code { font: 400 56px/1 var(--bang); letter-spacing: .12em; direction: ltr; text-align: center; color: var(--red);
  text-shadow: 1.5px 0 var(--ink), -1.5px 0 var(--ink), 0 1.5px var(--ink), 0 -1.5px var(--ink), 3px 3px 0 var(--ink); }
.qr { display: flex; justify-content: center; }
.qr svg { width: 180px; height: 180px; background: var(--white); border: var(--edge); border-radius: 10px; }
.link { direction: ltr; text-align: center; font: 600 13px ui-monospace, monospace; overflow-wrap: anywhere; }

/* players: a chip each, its score, online and sent */
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.players li { display: flex; align-items: center; gap: 6px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: 15px; }
.players li.off { opacity: .45; }
.players li.host { background: var(--yellow); }
.players li .pts { font-family: var(--bang); font-size: 18px; color: var(--red); direction: ltr; }
.players li .ok { color: var(--green-ink); }
.players li.me { box-shadow: 2px 2px 0 var(--ink); }

/* the countdown */
.timer { display: flex; align-items: center; gap: 12px; }
.timer .bar { flex: 1; height: 14px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: var(--red); transform-origin: right; }
html[dir="ltr"] .timer .bar i { transform-origin: left; }
.timer .sec { font: 400 34px/1 var(--bang); min-width: 2ch; text-align: center; direction: ltr; }

/* the answer showing while votes are cast */
.showing { min-height: 160px; display: flex; flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
.count { font: 400 22px/1 var(--bang); direction: ltr; }

/* review and reveal lists */
.answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.answers li { background: var(--white); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.answers li.real { background: var(--yellow); }
.answers li.right { background: var(--green); }
.answers .who { font-size: 13px; color: var(--muted); font-weight: 700; }
.answers .txt { font: 400 20px/1.35 var(--display); overflow-wrap: anywhere; }
.answers .pts { font: 400 18px var(--bang); color: var(--red); direction: ltr; }
.answers .line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.toggle { flex: none; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; background: var(--white); font-weight: 700; cursor: pointer; }
.toggle[aria-pressed="true"] { background: var(--green-ink); color: var(--white); }
.scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scores li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; background: var(--white); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 12px; font-weight: 700; }
.scores .plus { color: var(--green-ink); direction: ltr; }
.scores .tot { font: 400 24px var(--bang); color: var(--red); direction: ltr; min-width: 2ch; text-align: center; }
.scores li.win { background: var(--yellow); }

.toast { position: fixed; z-index: 9; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: var(--white); border-radius: 12px; padding: 10px 16px; font-weight: 700; text-align: center; }
.offline { text-align: center; font-weight: 700; color: var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .pop { animation: pop .25s ease-out; }
  @keyframes pop { from { transform: scale(.94) rotate(-1deg); } to { transform: none; } }   /* no fade: a panel never shows half-clear */
}
