/* Structure and sizes shared by every look. Colour, type and character live in /looks/*.css. */

:root {
  --bg: #fff; --ink: #111; --paper: #fff; --soft: rgba(0, 0, 0, .08);
  --start: #ddd; --join: #eee; --yes: #cfc; --no: #fff; --err-bg: #111; --err-ink: #fff;
  --font-display: system-ui, sans-serif; --font-body: system-ui, sans-serif; --font-caption: var(--font-display);
  --display-w: 800;
  --r: 16px; --r-sm: 12px; --r-lg: 24px; --bw: 3px; --line: var(--ink);
  --shadow: none; --focus: var(--ink);
  --fur: #fff; --fur-alt: #f9a; --art-ink: var(--ink); --art-sw: 5; --art-line: var(--ink); --art-lw: 4;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }
/* Looks hang decoration past the edge of the page. Cut here, or a phone zooms out to fit it all in. */
#app { overflow-x: clip; }
h1, h2, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- art ---------- */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art .a-die { display: none; }
.art .a-fur { fill: var(--fur); stroke: var(--art-ink); stroke-width: var(--art-sw); stroke-linejoin: round; }
.art .a-alt { fill: var(--fur-alt); }
.art .a-ink { fill: none; stroke: var(--art-line); stroke-width: var(--art-lw); stroke-linecap: round; stroke-linejoin: round; }
.art .a-dot { fill: var(--art-line); }
.art .a-tail, .art .a-thread { stroke: var(--tail, var(--art-line)); stroke-width: var(--tail-w, 9); }
.decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.d, .qr-cat, .frame-cat, .perch { position: absolute; display: none; }

/* ---------- buttons and fields ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 64px; padding: 12px 22px; text-align: center; text-decoration: none; cursor: pointer;
  border: var(--bw) solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: var(--display-w); font-size: 21px; line-height: 1.1;
  box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-start { background: var(--start); }
.btn-join { background: var(--join); }
.btn-yes { background: var(--yes); }
.btn-no { background: var(--no); }
.btn-quiet { box-shadow: none; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 16px; }
.btn-text {
  background: none; border: 0; min-height: 44px; padding: 10px 8px; cursor: pointer; color: inherit;
  font-weight: 700; text-decoration: underline; text-underline-offset: 3px; align-self: center;
}
.danger { color: var(--danger, inherit); }
.text-input {
  width: 100%; min-height: 54px; padding: 12px 14px; font-size: 18px;
  border: var(--field-bw, var(--bw)) solid var(--line); border-radius: var(--r-sm); background: var(--field, var(--paper)); color: var(--field-ink, var(--ink));
}
textarea.text-input { resize: none; display: block; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .key-form label, .join-label { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; }
.count { font-weight: 400; opacity: .7; font-variant-numeric: tabular-nums; }
.form-error { font-weight: 700; padding: 10px 14px; border-radius: var(--r-sm); background: var(--err-bg); color: var(--err-ink); }
.fine { font-size: 14px; text-align: center; opacity: .82; }
.fine a { color: inherit; font-weight: 700; text-underline-offset: 3px; white-space: nowrap; }
.add-note { text-align: left; margin-top: 16px; }
.privacy { gap: 18px; }
.privacy p, .privacy li { font-size: 17px; line-height: 1.45; }
.privacy ul { list-style: disc; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.privacy section p + ul, .privacy section ul + p { margin-top: 10px; }
.empty { opacity: .78; padding: 6px 2px; }

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(92vw, 460px); padding: 14px 18px; z-index: 20; text-align: center; font-weight: 700;
  background: var(--err-bg); color: var(--err-ink); border-radius: var(--r);
}

/* ---------- phone frame for every view ---------- */
.view {
  position: relative; min-height: 100dvh; max-width: 560px; margin: 0 auto;
  padding: 14px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 22px;
}
.view > * { position: relative; }
.view > .decor { position: absolute; }
h2 { font-family: var(--font-display); font-weight: var(--display-w); font-size: 24px; line-height: 1.1; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.view-foot { display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding-top: 8px; }

.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-mark { display: block; width: 110px; }
.wordmark { font-family: var(--font-display); font-weight: var(--display-w); font-size: calc(var(--wm, 1) * clamp(56px, 17.5vw, 100px)); line-height: .9; margin: 0; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.brand-sm { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.brand-sm .brand-mark { width: 38px; }
.brand-sm .wordmark { font-size: 24px; line-height: 1; }
.room-chip, .people-chip {
  font-family: var(--font-display); font-weight: var(--display-w); font-size: 19px; line-height: 1; white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; border: var(--bw) solid var(--line); background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.people-chip { font-family: var(--font-body); font-weight: 700; font-size: 14px; border: 0; background: none; padding: 0; margin-left: auto; }
@media (max-width: 460px) { .host .brand-sm .wordmark { display: none; } }

/* ---------- home ---------- */
.home { padding-top: 24px; }
.home-top { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.tagline { font-size: 21px; line-height: 1.25; max-width: 15em; font-weight: 600; }
.home-actions { display: flex; flex-direction: column; gap: 14px; }
.home .btn { min-height: 72px; font-size: 24px; }
.join-form, .key-form, .choice { display: flex; flex-direction: column; gap: 12px; }
.choice-title { font-family: var(--font-display); font-weight: var(--display-w); font-size: 26px; }
.your-rooms { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.your-rooms-title { font-family: var(--font-display); font-weight: var(--display-w); font-size: 20px; }
.your-rooms-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.room-link {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 12px 16px; min-height: 54px; text-decoration: none; color: var(--ink);
  background: var(--paper); border: var(--row-bw, 2px) solid var(--line); border-radius: var(--r);
}
.room-code { font-family: var(--font-display); font-weight: var(--display-w); font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.room-when { font-size: 14px; opacity: .82; }
.code-input {
  width: 100%; height: 88px; text-align: center; font-family: var(--font-display); font-weight: var(--display-w);
  font-size: 46px; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  border: var(--bw) solid var(--line); border-radius: var(--r); background: var(--field, var(--paper)); color: var(--field-ink, var(--ink));
}
.code-input::placeholder { opacity: .28; color: inherit; }

/* ---------- guest ---------- */
.adder-title { font-family: var(--font-display); font-weight: var(--display-w); font-size: 44px; line-height: 1; margin-bottom: 14px; }
.add-buttons { display: flex; flex-direction: column; gap: 12px; }
.add-buttons .btn { min-height: 72px; font-size: 23px; }
.busy { font-weight: 700; margin-top: 10px; }
.composer { display: flex; flex-direction: column; gap: 14px; }
.composer-preview { display: flex; justify-content: center; }
.composer-preview img, .composer-preview video { display: block; max-height: 40vh; width: auto; max-width: 100%; border-radius: var(--r); }
.composer-actions { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.progress { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--ink); transition: width .15s linear; }
.progress-note { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shrink-note { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shrink-note .btn-text { font-size: 15px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px; border-radius: var(--r); background: var(--paper); border: var(--row-bw, 2px) solid var(--line);
}
.thumb { width: 68px; height: 68px; object-fit: cover; border-radius: calc(var(--r) - 6px); display: block; background: var(--soft); }
.thumb-link { display: grid; place-items: center; padding: 14px; }
.row-comment { font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-status { font-size: 14px; opacity: .85; margin-top: 2px; }
.row.s-removed .thumb { filter: grayscale(1); opacity: .6; }
.row-actions { display: flex; flex-direction: column; gap: 6px; }
.lineup .row { grid-template-columns: 56px minmax(0, 1fr); }
.lineup .thumb { width: 56px; height: 56px; }
.lineup .row-actions { grid-column: 1 / -1; flex-direction: row; gap: 8px; }
.lineup .row-actions .btn { flex: 1; white-space: nowrap; }
.nowshowing .row { grid-template-columns: 68px minmax(0, 1fr); }

/* ---------- host ---------- */
.host-panel { display: flex; flex-direction: column; gap: 26px; }
.now-box .row { grid-template-columns: 68px minmax(0, 1fr); }
.controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 10px; }
.btn-ctl { min-height: 56px; font-size: 18px; padding: 8px; }
.badge {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-family: var(--font-body); font-weight: 800; font-size: 17px;
}
.badge.is-zero { opacity: .4; }
.cards { display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--paper); border: var(--bw) solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.card-img { display: block; width: 100%; height: auto; max-height: 34vh; object-fit: contain; background: var(--card-bg, #17130f); }
.card-body { padding: 12px 16px 4px; }
.card-comment { font-weight: 800; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.card-comment.is-blank { font-weight: 400; opacity: .7; }
.card-by { font-size: 15px; opacity: .85; margin-top: 2px; }
.card-actions { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 16px 16px; }
.card-actions .btn { white-space: nowrap; }
.card-link { padding: 0 0 4px; }
.card-link-title { font-weight: 800; padding: 12px 16px 0; }
.card-link-url { display: inline-block; padding: 8px 16px; font-weight: 700; color: inherit; }
.card-more { padding: 0 16px 10px; font-size: 15px; }
.card-more summary { cursor: pointer; min-height: 32px; opacity: .8; }
.setup { border-radius: var(--r); padding: 4px 0; }
.setup summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; justify-content: center; }
.setup p { margin: 8px 0; }
.qr-plate { background: #fff; padding: 10px; border-radius: var(--r); line-height: 0; }
.qr-svg { display: block; width: 100%; height: auto; }
.qr-small { width: min(240px, 70%); margin: 12px auto; }
.end { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.end-warn { font-weight: 700; }
.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- ended ---------- */
.gone { justify-content: center; gap: 18px; }
.gone-title { font-family: var(--font-display); font-weight: var(--display-w); font-size: 40px; line-height: 1; }
.gone-text { font-size: 20px; }

/* ---------- home on a laptop or TV ---------- */
@media (min-width: 900px) and (min-aspect-ratio: 4/3) {
  .home { max-width: none; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 5vw; padding: 6vh 7vw; }
  .home .brand-mark { width: 12vw; }
  .home .wordmark { font-size: calc(var(--wm, 1) * clamp(90px, 9vw, 200px)); }
  .tagline { font-size: clamp(24px, 2.4vw, 48px); }
  .home-actions { gap: 22px; }
  .room-link { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .home .btn { min-height: clamp(84px, 11vh, 130px); font-size: clamp(28px, 2.6vw, 48px); }
  .code-input { height: clamp(100px, 14vh, 160px); font-size: clamp(54px, 5vw, 96px); }
  .join-label, .choice-title { font-size: clamp(20px, 1.8vw, 34px); }
}

/* ---------- the big screen ---------- */
.is-screen { overflow: hidden; }
.screen { max-width: none; height: 100dvh; min-height: 0; padding: 0; gap: 0; overflow: hidden; display: block; }
.lobby {
  position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center; gap: 4vw; padding: 5vh 5vw;
}
.lobby > * { position: relative; }
.lobby > .decor { position: absolute; }
.lobby-copy { display: flex; flex-direction: column; gap: 2.2vh; align-items: flex-start; }
.lobby .brand { flex-direction: row; align-items: center; gap: 1.2vw; }
.lobby .brand-mark { width: 6vw; }
.lobby .wordmark { font-size: 4.2vw; line-height: 1; }
.lobby-title { font-family: var(--font-display); font-weight: var(--display-w); font-size: 5.3vw; line-height: 1; max-width: 11em; text-wrap: balance; }
.lobby-how { font-size: 2.3vw; line-height: 1.25; font-weight: 600; }
.lobby-url { font-weight: 800; }
.lobby-code { display: flex; gap: 2.2vw; font-family: var(--font-display); font-weight: var(--display-w); font-size: 10.5vw; line-height: 1; font-variant-numeric: tabular-nums; }
.digits { display: inline-flex; gap: .5vw; }
.lobby-people { font-size: 1.9vw; font-weight: 700; }
.lobby-qr { position: relative; justify-self: center; width: min(36vw, 68vh); }
.lobby-qr .qr-plate { padding: 1.6vw; border-radius: 2vw; }

.stage { position: relative; height: 100%; }
.slide-host { height: 100%; position: relative; }
.slide { height: 100%; display: grid; gap: 3vh 3.5vw; padding: 4.5vh 4.5vw; animation: slide-in .45s ease both; }
.frame { position: relative; --ar: 1.5; aspect-ratio: var(--ar); height: min(var(--mh), calc(var(--mw) / var(--ar))); align-self: center; justify-self: center; }
.slide-media { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; }
.shape-wide { grid-template-rows: minmax(0, 1fr) auto; }
.shape-wide .frame { --mw: 76vw; --mh: 60vh; }
.shape-wide .caption { padding-right: 21vw; }
.shape-wide.no-comment .frame { --mh: 72vh; }
.shape-tall { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.shape-tall .frame { --mw: 44vw; --mh: 86vh; }
.shape-tall .caption { padding-bottom: 20vh; }
.caption { display: flex; flex-direction: column; gap: 1.4vh; align-items: flex-start; min-width: 0; }
.comment { font-family: var(--font-caption); font-weight: var(--caption-w, 800); line-height: 1.06; overflow-wrap: anywhere; text-wrap: balance; }
.len-short .comment { font-size: 5vw; }
.len-mid .comment { font-size: 3.7vw; }
.len-long .comment { font-size: 2.9vw; }
.shape-tall.len-short .comment { font-size: 5.6vw; }
.shape-tall.len-mid .comment { font-size: 4.3vw; }
.shape-tall.len-long .comment { font-size: 3.2vw; }
.by { font-size: 2.2vw; font-weight: 700; line-height: 1.1; }
.slide-link { display: grid; grid-template-columns: 1fr auto; align-items: end; background: var(--paper); color: var(--ink); overflow: hidden; }
.slide-link-img { grid-column: 1 / -1; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.slide-link-text { padding: 1.6vw 2vw; }
.slide-link-title { font-size: 2.4vw; font-weight: 800; line-height: 1.1; }
.slide-link-site { font-size: 1.6vw; opacity: .8; }
.slide-link-qr { width: 9vw; margin: 1vw; padding: .6vw; }

.joinbug { position: absolute; right: 2.4vw; bottom: 3.2vh; display: flex; align-items: center; gap: 1vw; z-index: 2; }
.joinbug .qr-plate { width: 8.4vw; padding: .5vw; border-radius: .9vw; }
.bug-text { display: flex; flex-direction: column; line-height: 1.05; }
.bug-how { font-size: 1.35vw; font-weight: 800; }
.bug-url { font-size: 1.1vw; font-weight: 600; opacity: .9; }
.bug-code { font-family: var(--font-display); font-weight: var(--display-w); font-size: 2.7vw; font-variant-numeric: tabular-nums; white-space: nowrap; }

.strip { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .2s; }
.show-strip .strip, .strip:focus-within { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute; inset: 0 0 0 auto; width: min(440px, 94vw); z-index: 5; overflow-y: auto;
  background: var(--bg); color: var(--ink); padding: 70px 18px 28px; display: flex; flex-direction: column; gap: 24px;
  border-left: var(--bw) solid var(--line); box-shadow: -18px 0 40px rgba(0, 0, 0, .25);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { margin: 0; }

@keyframes slide-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  .btn { transition: none; }
}

.noscript { padding: 24px; font-size: 18px; }
