/* 12 Pubs: loud & playful.
   Cream background, a colour per pub, thick black outlines, chunky shadows, big tap targets. */
/* Fonts are self-hosted (SIL Open Font License), so no visitor data goes to Google. */
@font-face { font-family: "Fredoka"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
:root {
  --bg: #fff7e8;
  --ink: #17171a;
  --muted: #5f5a52;
  --white: #ffffff;
  --pink: #ff7eb6;
  --orange: #ff8a3d;
  --blue: #6ea8ff;
  --green: #4ade80;
  --purple: #b794f6;
  --yellow: #ffd23f;
  --teal: #2dd4bf;
  --coral: #ff6b6b;
  --water: #9be7ff;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 20px;
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 600 16px/1.4 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px 130px; }

/* ---------- type ---------- */
h1, h2, h3, .display { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 30px; font-weight: 700; line-height: 1.05; }
h3.h { font-size: 20px; font-weight: 700; margin: 26px 2px 10px; }
.lead { font-size: 18px; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.label { font: 700 13px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.center { text-align: center; }

/* ---------- surfaces ---------- */
.card {
  background: var(--white); border: var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.card.tight { padding: 12px 14px; }
.sticker {
  display: inline-block; font: 700 13px var(--display); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--ink); color: var(--white); padding: 5px 11px; border-radius: 999px; transform: rotate(-2deg);
}
.sticker.light { background: var(--white); color: var(--ink); border: 2px solid var(--ink); }
.step { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step .num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); border: var(--line);
  display: flex; align-items: center; justify-content: center; font: 700 15px var(--display); flex: none;
}
.step h3 { font-size: 20px; font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  font: 700 19px var(--display); padding: 16px 14px; border: var(--line); border-radius: 16px;
  box-shadow: var(--shadow); background: var(--white); color: var(--ink);
  transition: transform 0.05s, box-shadow 0.05s; margin: 0 0 12px;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.5; }
.btn.pink { background: var(--pink); }
.btn.yellow { background: var(--yellow); }
.btn.green { background: var(--green); }
.btn.blue { background: var(--blue); }
.btn.purple { background: var(--purple); }
.btn.ink { background: var(--ink); color: var(--white); }
.btn.big { font-size: 22px; padding: 20px 14px; }
.btn.sm { font-size: 16px; padding: 10px 12px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); margin: 0; }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; font-size: 16px; padding: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.iconbtn {
  width: 44px; height: 44px; border: var(--line); border-radius: 14px; background: var(--white);
  box-shadow: 3px 3px 0 var(--ink); font: 700 20px var(--display); display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.iconbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.linkbtn { background: none; border: 0; padding: 4px 0; font: 700 15px var(--display); text-decoration: underline; text-underline-offset: 3px; }
.back { background: none; border: 0; font: 700 16px var(--display); padding: 6px 0; margin-bottom: 10px; }

/* sticky action bar at the bottom: the one button you need, always under your thumb */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255, 247, 232, 0), var(--bg) 35%);
}
.bar .inner { max-width: 520px; margin: 0 auto; }
.bar .btn { margin: 0; }

/* ---------- inputs ---------- */
.input {
  width: 100%; border: var(--line); border-radius: 14px; padding: 13px 14px; background: var(--white);
  font: 700 17px var(--body); color: var(--ink); outline: none;
}
.input:focus { box-shadow: 3px 3px 0 var(--ink); }
.input.code { text-transform: uppercase; letter-spacing: 0.25em; font: 700 20px var(--display); text-align: center; }
.namelist { display: grid; gap: 8px; }
.namerow { display: flex; gap: 8px; align-items: center; }
.namerow .dot { width: 34px; height: 34px; border-radius: 50%; border: var(--line); flex: none; display: flex; align-items: center; justify-content: center; font: 700 14px var(--display); }
.namerow .x { width: 36px; height: 36px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); flex: none; }
.addbtn { margin-top: 10px; }

/* chunky option tiles (modes, pub source) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  border: var(--line); border-radius: 16px; background: var(--white); padding: 12px 6px; text-align: center;
  box-shadow: 3px 3px 0 var(--ink); font: 700 16px var(--display);
}
.tile .em { display: block; font-size: 28px; line-height: 1.1; margin-bottom: 4px; }
.tile small { display: block; font: 600 12px var(--body); color: var(--muted); margin-top: 2px; }
.tile[aria-pressed="true"] { background: var(--yellow); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--ink); border-radius: 999px; background: var(--white); padding: 8px 13px; font: 700 15px var(--body);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 2px dashed #e6dcc8; }
.toggle:first-child { border-top: 0; padding-top: 2px; }
.toggle b { display: block; font: 700 17px var(--display); }
.toggle small { color: var(--muted); font-size: 13.5px; }
.switch { width: 58px; height: 34px; border: var(--line); border-radius: 999px; background: #eee5d3; position: relative; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); transition: left 0.15s; }
.switch[aria-pressed="true"] { background: var(--green); }
.switch[aria-pressed="true"]::after { left: 27px; }
.stepper { display: flex; gap: 6px; }
.stepper button { width: 40px; height: 36px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); font: 700 16px var(--display); }
.stepper button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.typed { display: grid; gap: 8px; }
.typed label { display: flex; gap: 8px; align-items: center; }
.typed .n { width: 26px; font: 700 15px var(--display); text-align: right; flex: none; }
.typed .tag { font: 700 12px var(--display); white-space: nowrap; }
.routelist { list-style: none; margin: 12px 0 0; padding: 0; }
.routelist li { display: flex; gap: 10px; padding: 7px 0; border-top: 2px dashed #e6dcc8; font-size: 15px; }
.routelist li:first-child { border-top: 0; }
.routelist small { color: var(--muted); margin-left: auto; white-space: nowrap; padding-left: 8px; }

/* ---------- home ---------- */
.hero { padding: 26px 0 22px; text-align: center; }
.logo { display: inline-flex; align-items: center; gap: 10px; transform: rotate(-3deg); }
.logo .n {
  width: 96px; height: 96px; border-radius: 50%; background: var(--yellow); border: 4px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; font: 700 52px var(--display);
}
.logo .w {
  font: 700 60px/1 var(--display); background: var(--pink); border: 4px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  border-radius: 18px; padding: 10px 16px 12px;
}
.feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.feat { border: var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 12px; font: 700 16px/1.2 var(--display); }
.feat .em { display: block; font-size: 30px; margin-bottom: 6px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.minilogo { font: 700 20px var(--display); flex: 1; }
.minilogo span { background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; margin-right: 4px; }
.codechip { font: 700 15px var(--display); letter-spacing: 0.18em; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px; background: var(--white); }

/* ---------- the pub card ---------- */
.pub {
  background: var(--c, var(--orange)); border: var(--line); border-radius: 26px; box-shadow: 6px 6px 0 var(--ink);
  padding: 18px; margin-bottom: 18px; position: relative;
}
.pubtop { display: flex; justify-content: space-between; align-items: center; }
.pubtop .t { font: 700 14px var(--display); }
.pubname { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 2px; }
.pubname h1 { font-size: 36px; line-height: 1.02; font-weight: 700; flex: 1; word-break: break-word; }
.pubname .input { font-size: 20px; }
.maplink { font: 700 14px var(--display); text-decoration: underline; text-underline-offset: 3px; }
.dots { display: flex; gap: 5px; margin: 14px 0; }
.dots i { flex: 1; height: 10px; border-radius: 999px; border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.55); }
.dots i.on { background: var(--ink); }
.dots i.now { background: var(--white); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scaleY(1.4); } }
.rule { background: var(--white); border: var(--line); border-radius: 18px; padding: 14px; }
.rule .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rule p { margin: 0; font: 800 21px/1.3 var(--body); }
.rule .picked { margin-top: 8px; font-size: 15px; }
.stack { margin-top: 10px; font-size: 14.5px; line-height: 1.4; }
.special { text-align: center; padding: 22px 14px; }
.special .em { font-size: 54px; line-height: 1; }
.special p { font: 800 21px/1.3 var(--body); margin: 8px 0 0; }

/* challenges & forfeits */
.chal { border: var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); padding: 14px; margin-bottom: 16px; }
.chal .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chal p { margin: 0 0 10px; font: 800 19px/1.3 var(--body); }
.chal .who { font-size: 15px; margin-bottom: 12px; }
.chal.drop { background: var(--yellow); }
.chal.done { opacity: 0.55; box-shadow: none; }
.chal .acts { display: flex; gap: 8px; }
.chal .acts .btn { flex: 1; }
.chal .acts .btn.dice { flex: 0 0 52px; }
.forfeit { background: var(--coral); }
.forfeit.mine { outline: 4px dashed var(--ink); outline-offset: 3px; }
.int { font: 700 15px var(--display); letter-spacing: 2px; }
.pending { display: block; width: 100%; text-align: center; border: 2px dashed var(--ink); border-radius: 16px; background: transparent; padding: 12px; font: 700 15px var(--display); margin-bottom: 16px; }

/* who got caught: big faces */
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.face {
  border: var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow);
  padding: 14px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 700 16px var(--display);
  min-height: 112px; word-break: break-word; text-align: center;
}
.face:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.face:disabled { opacity: 0.4; }
.face small { font: 600 12.5px var(--body); color: var(--muted); }
.av {
  width: 52px; height: 52px; border-radius: 50%; border: var(--line); display: inline-flex; align-items: center; justify-content: center;
  font: 700 22px var(--display); color: var(--ink); flex: none;
}
.av.s { width: 30px; height: 30px; font-size: 14px; border-width: 2px; }

/* scores: one row of chips */
.scores { display: flex; gap: 8px; flex-wrap: wrap; }
.score { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); padding: 3px 12px 3px 3px; font: 700 15px var(--display); }
.score.mine { background: var(--yellow); }
.score .tk { font-size: 12px; }

/* tonight so far (collapsed by default) */
details.log { margin-top: 22px; border: var(--line); border-radius: 18px; background: var(--white); padding: 0 14px; }
details.log summary { font: 700 17px var(--display); padding: 14px 0; list-style: none; display: flex; justify-content: space-between; }
details.log summary::after { content: "＋"; }
details.log[open] summary::after { content: "－"; }
details.log summary::-webkit-details-marker { display: none; }
.feed { list-style: none; margin: 0; padding: 0 0 8px; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 2px dashed #e6dcc8; font-size: 14.5px; }
.feed .tm { margin-left: auto; color: var(--muted); font-size: 12.5px; flex: none; }

/* plan list */
.plan { list-style: none; margin: 0; padding: 0; }
.plan li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 2px dashed #e6dcc8; }
.plan li:first-child { border-top: 0; padding-top: 2px; }
.plan .n { width: 34px; height: 34px; border-radius: 10px; border: var(--line); background: var(--c); display: flex; align-items: center; justify-content: center; font: 700 15px var(--display); flex: none; }
.plan .body { flex: 1; min-width: 0; }
.plan b { font: 700 17px var(--display); display: block; }
.plan .r { font-size: 15px; margin-top: 2px; }
.plan .acts { display: flex; gap: 6px; flex: none; }
.plan .acts button { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); font-size: 17px; }
.editbox { display: grid; gap: 8px; margin-top: 6px; }

/* awards / recap */
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.award { border: var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 12px; }
.award .label { font-size: 11.5px; }
.award b { display: block; font: 700 22px/1.1 var(--display); margin: 6px 0 2px; word-break: break-word; }
.award span { font-size: 13px; }
.recapimg { width: 100%; display: block; border: var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.mrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 2px dashed #e6dcc8; }
.mrow:first-child { border-top: 0; padding-top: 0; }
.mrow .res { margin-left: auto; font-size: 22px; flex: none; }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.verdict .btn { margin: 0; font-size: 17px; }
.verdict .btn[aria-pressed="true"].yes { background: var(--green); }
.verdict .btn[aria-pressed="true"].no { background: var(--coral); }

/* overlays & sheets */
.overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(23, 23, 26, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade 0.15s;
}
.overlay .card { width: 100%; max-width: 460px; margin: 0; animation: pop 0.2s ease-out; }
.overlay.sheet { align-items: flex-end; padding: 0; }
.overlay.sheet .card { border-radius: 26px 26px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-width: 520px; box-shadow: none; }
.bigmission { font: 700 28px/1.15 var(--display); margin: 10px 0 14px; }
.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: var(--coral); border-bottom: var(--line); text-align: center; font: 700 14px var(--display); padding: 8px; }
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--white);
  padding: 12px 18px; border-radius: 999px; font: 700 15px var(--display); max-width: 90vw; text-align: center; animation: pop 0.2s;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.chal .acts .btn.sm { font-size: 15px; padding: 11px 6px; white-space: nowrap; }

/* ---------- added: safe areas, QR, play-it-sound, legal ---------- */
.wrap { padding-top: calc(16px + env(safe-area-inset-top)); }
.qr { width: 220px; max-width: 70vw; margin: 4px auto 12px; background: var(--white); border: var(--line); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.qr svg { display: block; width: 100%; height: auto; }
.codechip.big { font-size: 20px; padding: 8px 14px; flex: 0 0 auto; }
.safe { display: grid; gap: 10px; text-align: left; }
.saferow { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.saferow .em { font-size: 22px; line-height: 1.1; flex: none; width: 28px; text-align: center; }
.legal { max-height: 86vh; overflow-y: auto; text-align: left; }
.legal h3 { font-size: 19px; margin: 16px 0 6px; }
.legal ul { margin: 0; padding-left: 20px; font-size: 15px; }
.legal li { margin-bottom: 6px; }

/* ---------- recap slides (Wrapped-style) ---------- */
.slides { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 11% 14px; margin: 0 -16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 78%; scroll-snap-align: center; }
.slide img { display: block; width: 100%; aspect-ratio: 9 / 16; border: var(--line); border-radius: 20px; box-shadow: var(--shadow); background: var(--white); }
.slide.loading { aspect-ratio: 9 / 16; border: 3px dashed var(--ink); border-radius: 20px; display: flex; align-items: center; justify-content: center; font: 700 18px var(--display); }
.sdots { display: flex; justify-content: center; gap: 6px; margin: 2px 0 8px; flex-wrap: wrap; }
.sdots i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; }
.sdots i.on { background: var(--ink); }
#morebtns:empty { display: none; }

/* ---------- profile pictures ---------- */
.av.photo { background-size: cover; background-position: center; }
.av.emoji { font-size: 28px; }
.av.s.emoji { font-size: 16px; }
.namerow .dot { padding: 0; font-size: 18px; cursor: pointer; background-size: cover; background-position: center; }
.namerow .dot:not(.photo) { line-height: 1; }
.namerow .dot { width: 46px; height: 46px; }
.emojigrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emojigrid button { aspect-ratio: 1; font-size: 26px; border: 2px solid var(--ink); border-radius: 12px; background: var(--white); padding: 0; }
.emojigrid button[aria-pressed="true"] { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.overlay.sheet .card { max-height: 88vh; overflow-y: auto; }
.pics { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 4px; scrollbar-width: none; }
.pic { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 13px var(--display); flex: none; }
#mypic { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---------- planted surprises ---------- */
.gift { display: inline-block; margin-top: 6px; margin-right: 6px; font: 700 12.5px var(--display); background: var(--orange); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 9px; }
.coming { margin-top: 12px; text-align: center; font: 700 15px var(--display); background: rgba(255, 255, 255, 0.6); border: 2px dashed var(--ink); border-radius: 14px; padding: 8px; }
.rule.planted { background: #fff3d6; }
.plantacts { display: flex; gap: 6px; flex: none; }
.plantacts button { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); font-size: 17px; padding: 0; }
textarea.input { resize: none; font: 700 17px var(--body); }

/* ---------- recap expiry ---------- */
.expiry { text-align: center; font: 600 14.5px var(--body); background: var(--white); border: 2px dashed var(--ink); border-radius: 14px; padding: 9px 12px; margin: 0 0 14px; }
.expiry b { font-family: var(--display); }

/* ---------- comings and goings ---------- */
.score.gone { opacity: 0.5; }

/* ---------- look after each other ---------- */
.lookafter { background: var(--yellow); max-height: 92vh; overflow-y: auto; }
.lookafter .la { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 2px dashed rgba(23, 23, 26, 0.25); }
.lookafter .la:first-of-type { border-top: 0; }
.lookafter .la .em { font-size: 34px; line-height: 1; flex: none; width: 40px; text-align: center; }
.lookafter .la b { display: block; font: 700 23px/1.15 var(--display); }
.lookafter .la span { display: block; font-size: 15px; margin-top: 3px; }
.lookafter .sos { background: var(--white); border: var(--line); border-radius: 16px; padding: 12px 14px; font-size: 16px; margin-top: 6px; }
.lookafter .sos a { font: 700 20px var(--display); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
