/* FabCafe talk app. White, one accent (sky blue), real gold for the winner. System fonts only,
   so nothing waits on a font download over the venue Wi-Fi. */
:root {
  --bg: #ffffff;
  --fg: #1b232c;
  --muted: #5d6b78;
  --line: #dde3ea;
  --accent: #3d6f96;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1f7;
  --error: #a3341f;
  --gold-deep: #6e5110;
  --gold-mid: #b8892b;
  --gold-light: #ecd27f;
  --gold-shine: #fff3c4;
  --gold-ink: #3a2a06;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
h1, h2, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
.ja, .en { display: block; }
.en { color: var(--muted); font-size: 0.86em; }

/* ---------- Phone pages: idea page and approve page ---------- */
.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
  display: grid;
  gap: 24px;
}
.kicker { font-size: 0.8rem; letter-spacing: 0.06em; color: var(--accent); font-weight: 600; }
.kicker .ja, .kicker .en { display: inline; color: inherit; font-size: inherit; }
.kicker .en::before { content: " · "; }
.top { display: grid; gap: 10px; }
.top h1 { font-size: 1.6rem; line-height: 1.3; }
.top h1 .en { font-size: 0.62em; font-weight: 600; margin-top: 2px; }
.lead .en { margin-top: 4px; }
body:not([data-view="form"]) .top h1,
body:not([data-view="form"]) .top .lead { display: none; }

form { display: grid; gap: 10px; }
.field-label { font-weight: 700; }
.field-label .en { font-weight: 500; }
.field-label.later { margin-top: 14px; }
textarea, input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 17px; /* 16px or more stops iOS from zooming in */
  color: var(--fg);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
textarea { resize: vertical; min-height: 104px; line-height: 1.5; }
textarea:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chars { font-size: 0.82rem; color: var(--muted); text-align: right; margin-top: -4px; font-variant-numeric: tabular-nums; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--accent); }
.note { font-size: 0.86rem; color: var(--muted); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.note .en { font-size: 0.95em; }
.error { color: var(--error); font-weight: 600; }
.error .en { color: var(--error); font-weight: 500; }

button { font: inherit; cursor: pointer; }
.primary {
  margin-top: 10px;
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
}
.primary .en { color: inherit; opacity: 0.85; font-size: 0.8em; font-weight: 500; }
.primary:disabled { opacity: 0.6; }

.panel { display: grid; gap: 14px; }
.panel h2 { font-size: 1.35rem; line-height: 1.35; }
.panel h2 .en { font-size: 0.72em; font-weight: 600; }
.count { font-size: 1.05rem; }
.count .ja { font-weight: 700; }
.big-count { font-size: 3.2rem; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.quote {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  border-left: 4px solid var(--accent);
  padding: 2px 0 2px 14px;
}
.shot { border-radius: 14px; background: #f3f5f8; width: 100%; height: auto; }
.foot { font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.foot .en { font-size: 1em; }

/* ---------- The golden ticket ---------- */
body.is-gold { color: var(--gold-ink); background: var(--gold-mid); }
body.is-gold::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 20% 0%, var(--gold-shine) 0%, transparent 55%),
    linear-gradient(160deg, var(--gold-deep) 0%, var(--gold-mid) 30%, var(--gold-light) 52%, var(--gold-mid) 74%, var(--gold-deep) 100%);
}
body.is-gold .kicker { color: var(--gold-ink); }
body.is-gold .foot { display: none; }
.ticket {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 22px 18px 24px;
  border-radius: 18px;
  background: linear-gradient(170deg, #fffaf0 0%, #fbefc8 100%);
  border: 2px solid var(--gold-mid);
  box-shadow: 0 0 0 5px rgba(255, 243, 196, 0.55), 0 14px 40px rgba(58, 42, 6, 0.35);
}
.ticket::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -60%;
  width: 40%;
  transform: rotate(18deg);
  z-index: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shine 4.5s ease-in-out infinite;
  pointer-events: none;
}
.ticket > * { position: relative; z-index: 1; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .ticket::after { animation: none; display: none; } }
.ticket .en { color: #6b5420; }
.ticket-kicker { font-size: 0.8rem; letter-spacing: 0.12em; font-weight: 700; color: var(--gold-mid); text-transform: uppercase; }
.ticket-kicker .ja, .ticket-kicker .en { display: inline; color: inherit; font-size: inherit; }
.ticket-kicker .en::before { content: " · "; }
.ticket h2 { font-size: 1.45rem; line-height: 1.3; }
.ticket h2 .en { font-size: 0.7em; font-weight: 600; }
.ticket .quote { border-left-color: var(--gold-mid); }
.ticket figure { display: grid; gap: 6px; }
.ticket figcaption { font-size: 0.85rem; }
.ticket figcaption .ja, .ticket figcaption .en { display: inline; }
.ticket figcaption .en::before { content: " · "; }
.ticket .shot { background: #fff; border: 1px solid #ead9a6; }
.collect { font-weight: 800; font-size: 1.15rem; line-height: 1.4; padding: 12px 14px; border-radius: 12px; background: rgba(184, 137, 43, 0.14); }
.collect .en { font-weight: 600; }
.ticket .small { font-size: 0.9rem; }

/* ---------- Big screen: 1920x1080 projector, everything in vh so it scales ---------- */
body.screen { height: 100vh; overflow: hidden; font-size: 2.6vh; line-height: 1.35; }
.screen .state { position: fixed; inset: 0; display: none; }
.screen .state.on { display: grid; }
#s-open { grid-template-columns: auto 1fr; align-items: center; gap: 6vw; padding: 7vh 6vw; }
.qr-box { display: grid; gap: 2vh; justify-items: center; }
#qr { width: 72vh; height: 72vh; display: grid; place-items: center; }
#qr svg { width: 100%; height: 100%; display: block; }
#qr.qr-missing { border: 0.4vh dashed var(--line); border-radius: 2vh; }
.url { font-size: 3.4vh; font-weight: 700; letter-spacing: 0.02em; color: var(--fg); }
.side { display: grid; gap: 4vh; align-content: center; }
.side h1 { font-size: 7.4vh; line-height: 1.2; }
.side h1 .en { font-size: 0.6em; font-weight: 600; }
.scan-here { font-size: 3.4vh; color: var(--accent); font-weight: 700; }
.scan-here .ja, .scan-here .en { display: inline; color: inherit; font-size: inherit; }
.scan-here .en::before { content: " · "; }
.tallies { display: flex; gap: 5vw; align-items: flex-end; }
.tally { display: grid; }
.tally b { font-size: 11vh; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; transition: transform 0.25s ease; }
.tally.main b { font-size: 26vh; color: var(--accent); }
.tally > span { font-size: 3.2vh; font-weight: 700; }
.tally > span .ja, .tally > span .en { display: inline; }
.tally > span .en::before { content: " · "; }
.tally b.bump { transform: scale(1.08); }
.screen .hint { font-size: 3vh; color: var(--muted); }
.screen .hint .en { font-size: 0.9em; }

#s-drawn { place-content: center; text-align: center; gap: 3vh; }
#s-drawn h1 { font-size: 11vh; line-height: 1.15; }
#s-drawn h1 .en { font-size: 0.5em; font-weight: 600; }
#s-drawn p { font-size: 4vh; color: var(--muted); }
#s-drawn .tallies { justify-content: center; margin-top: 4vh; opacity: 0.55; }
#s-drawn .tally b { font-size: 7vh; }

#s-reveal { grid-template-rows: auto 1fr auto; gap: 2.5vh; padding: 4vh 5vw; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 3vw; }
.steps li { font-size: 3vh; font-weight: 700; color: var(--line); padding-bottom: 0.6vh; border-bottom: 0.5vh solid transparent; }
.steps li .ja, .steps li .en { display: inline; color: inherit; font-size: inherit; }
.steps li .en::before { content: " · "; }
.steps li.done { color: var(--muted); }
.steps li.now { color: var(--accent); border-bottom-color: var(--accent); }
.stage { display: grid; place-items: center; min-height: 0; }
.stage img { max-width: 100%; max-height: 66vh; object-fit: contain; border-radius: 1.6vh; opacity: 0; transition: opacity 0.6s ease; }
.stage img.loaded { opacity: 1; }
.reveal-foot { display: grid; justify-items: center; gap: 1.2vh; text-align: center; }
.reveal-foot .quote { font-size: 5vh; border: 0; padding: 0; }
.flag { font-size: 2.8vh; font-weight: 700; padding: 0.6vh 1.6vw; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.flag .ja, .flag .en { display: inline; color: inherit; font-size: inherit; }
.flag .en::before { content: " · "; }
.flag.gold { background: var(--gold-shine); color: var(--gold-ink); }
#offline { position: fixed; right: 2vw; bottom: 2vh; font-size: 2vh; color: var(--muted); }
#offline .ja, #offline .en { display: inline; }
#offline .en::before { content: " · "; }

/* ---------- Approve page: Adel's phone ---------- */
.approve .wrap { gap: 18px; }
.approve h1 { font-size: 1.3rem; }
.approve .label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.approve .quote { font-size: 1.35rem; }
.meta, .status, .counts-line { color: var(--muted); font-size: 0.9rem; }
.status { color: var(--fg); font-weight: 600; font-size: 1rem; }
.buttons { display: grid; gap: 12px; }
.big {
  width: 100%;
  min-height: 72px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--fg);
  font-weight: 800;
  font-size: 1.25rem;
}
.big.go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.big.reveal { background: var(--gold-ink); border-color: var(--gold-ink); color: var(--gold-shine); }
.big.armed { background: #fff4e5; border-color: #c9761e; color: #7a3f00; }
.big:disabled { opacity: 0.4; cursor: default; }
.ready-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ready-item { display: grid; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.ready-item b { color: var(--fg); }
.ready-item .thumb { aspect-ratio: 1; border-radius: 10px; background: #f3f5f8; border: 1px solid var(--line); object-fit: cover; width: 100%; }
.ready-item.yes b { color: var(--accent); }
.reveal-why { font-size: 0.9rem; color: var(--muted); text-align: center; margin-top: -6px; }
.muted { color: var(--muted); }

/* Try a pair: a small button under the idea box. */
.under { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: -2px; }
.under .chars { margin-top: 0; }
.pair {
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 99px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
}
.pair .ja, .pair .en { display: inline; color: inherit; font-size: inherit; }
.pair .en { font-weight: 600; }
.pair .en::before { content: " · "; }

/* The two cards under tonight's idea: white on the reveal page and on the golden ticket. */
.cards { display: grid; gap: 16px; }
.card {
  display: grid;
  gap: 12px;
  padding: 18px 16px 20px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--fg);
}
.card h3 { margin: 0; font-size: 1.2rem; line-height: 1.35; }
.card h3 .en { font-size: 0.78em; font-weight: 600; }
.card-lead { font-size: 0.92rem; }
.card-lead .en { margin-top: 2px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice, .chip {
  min-height: 58px;
  padding: 8px 6px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--fg);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}
.chip { min-height: 52px; font-size: 0.9rem; }
.choice .en, .chip .en { font-weight: 500; font-size: 0.82em; margin-top: 2px; }
.choice[aria-pressed="true"], .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice[aria-pressed="true"] .en, .chip[aria-pressed="true"] .en { color: inherit; opacity: 0.88; }
.primary.small { min-height: 54px; font-size: 1.05rem; margin-top: 4px; }
.ok-line { font-weight: 600; color: var(--accent); }
.ok-line .en { color: var(--accent); }
body.is-gold .card { border-color: #ead9a6; box-shadow: 0 8px 24px rgba(58, 42, 6, 0.18); }

/* Approve page: the notes from the two cards. Read only. */
.notes { display: grid; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.notes h2 { font-size: 1.15rem; }
.notes .label { margin-top: 8px; }
.sc-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-counts div { display: grid; gap: 2px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: 0.82rem; color: var(--muted); }
.sc-counts b { font-size: 1.6rem; line-height: 1.1; color: var(--fg); font-variant-numeric: tabular-nums; }
.notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notes li { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.notes li.empty { color: var(--muted); border-style: dashed; }
.notes .emails li { grid-template-columns: 1fr auto; align-items: center; }
.notes .head { display: flex; justify-content: space-between; gap: 10px; }
.notes .tag { font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.notes .when { font-size: 0.8rem; color: var(--muted); }
.notes .mail { font-size: 0.9rem; user-select: all; }
.notes .mail.none { color: var(--muted); user-select: auto; }

/* This phone's own idea as a picture, under the thank-you. */
.mine { display: grid; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line, #dde3ea); }
.mine h3 { font-size: 1.05rem; line-height: 1.35; margin: 0; }
.mine h3 .en { font-size: 0.8em; font-weight: 600; }
.mine .why { display: block; margin-top: 4px; color: var(--fg, inherit); }
