/* Factory app base styles. Colours are tokens: change the palette here, not in components.
   Layout: a phone column that widens and scales up on tablets and desktops (like Verbal Dojo). */
:root {
  --bg: #fff8f0; --panel: #ffffff; --line: #f0dcc6; --text: #2a1d12; --muted: #7a6450;
  --accent: #e8590c; --accent-ink: #ffffff; --ok: #16803c; --bad: #c92a2a; --gold: #f59f00;
  --yes: #16803c; --yes-bg: #e6f6ec; --no: #c92a2a; --no-bg: #fdecec; --grab: #00b14f;
  --radius: 14px; --font: Inter, system-ui, -apple-system, sans-serif;
  --colw: 440px; --z: 1;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1a130d; --panel: #261c14; --line: #3d2e21; --text: #fbefe2; --muted: #c4ab92; --yes-bg: #10301c; --no-bg: #3a1616; --yes: #4ade80; --no: #f87171; }
}
@media (min-width: 700px) { :root { --colw: min(760px, calc(100vw - 48px)); --z: 1.1; } }
@media (min-width: 1000px) { :root { --colw: min(1080px, calc(100vw - 140px)); --z: 1.15; } }
@media (min-width: 1500px) { :root { --colw: 1200px; --z: 1.25; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
#app { max-width: calc(var(--colw) / var(--z)); zoom: var(--z); margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)); min-height: calc(100dvh / var(--z)); display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.narrow { width: 100%; max-width: 640px; margin: 0 auto; }   /* reading & answering screens: bigger on desktop, not stretched */
.row { display: flex; gap: 10px; align-items: center; } .between { justify-content: space-between; } .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; gap: 14px; } @media (min-width: 1000px) { .grid2 { grid-template-columns: 1fr 1fr; } }
h1, h2 { margin: 0; line-height: 1.15; } h1 { font-size: 28px; } h2 { font-size: 20px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
button { font: inherit; color: inherit; cursor: pointer; }
.btn { min-height: 48px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 16px; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 100%; }
.big { font-size: 64px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
/* PIN pad */
.dots { display: flex; gap: 14px; justify-content: center; margin: 18px 0 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.pin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 12px auto 0; width: 100%; }
.pin button { min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); font-size: 24px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; z-index: 50; }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* ---------- Lunch Vote ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.linkish { background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--muted); font-size: 14px; text-decoration: underline; cursor: pointer; }
.status { display: flex; flex-direction: column; gap: 6px; }
.okc { color: var(--yes); font-weight: 700; }
.cards { display: grid; gap: 12px; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, background .15s; }
.card.yes { border-color: var(--yes); }
.card.no { opacity: .62; }
.card.both { background: var(--yes-bg); box-shadow: 0 0 0 2px var(--yes); }
.c-top { display: flex; gap: 12px; align-items: center; }
.c-emoji { font-size: 42px; line-height: 1; }
.c-name { font-size: 19px; font-weight: 800; line-height: 1.2; }
.c-meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #3b2a1c; color: #fff; }
.c-blurb { font-size: 15px; color: var(--muted); line-height: 1.4; }
.c-votes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vote { min-height: 50px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); font-size: 17px; font-weight: 700; color: var(--text); }
.vote.yes.on { background: var(--yes); border-color: var(--yes); color: #fff; }
.vote.no.on { background: var(--no); border-color: var(--no); color: #fff; }
.vote:disabled { opacity: .5; }
.c-other { font-size: 14px; font-weight: 600; color: var(--muted); }
.match, .nomatch, .winner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.match { border-color: var(--yes); background: var(--yes-bg); }
.winner { border: 2px solid var(--accent); padding: 22px 16px; }
.w-emoji { font-size: 84px; line-height: 1; }
.w-name { font-size: 30px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.btn.grab { background: var(--grab); color: #fff; border-color: transparent; width: 100%; min-height: 56px; font-size: 18px; }
form.row input { flex: 1; }
.c-meta { flex-wrap: wrap; }
.tag.fav { background: #e8590c; }
.tag.treat { background: #6b4226; }
.card.treat-card { border-style: dashed; }
.section-h { font-size: 20px; margin: 10px 0 0; }
.torate { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); display: flex; flex-direction: column; gap: 8px; }
.torate-h { font-weight: 800; font-size: 18px; }
.torate-row { display: flex; align-items: center; gap: 8px; }
.vote.small { min-height: 48px; min-width: 56px; font-size: 20px; }
.tag.new { background: #b7791f; }
.other-box summary { cursor: pointer; font-weight: 700; font-size: 17px; min-height: 44px; display: flex; align-items: center; gap: 4px; }
.other-box .row { flex-direction: column; align-items: flex-start; gap: 6px; }
.other-box .pill { border-radius: 10px; }
