/* Cheapseats. Ticket stub colors, loud type, big tap targets. */
:root {
  --ink: #18131f;
  --ink-2: #2a2333;
  --paper: #fbf3e4;
  --paper-2: #f3e6cf;
  --line: #e2d2b4;
  --muted: #6f6478;
  --tomato: #ff5a36;
  --gold: #ffc531;
  --mint: #22b99a;
  --sky: #3d9bff;
  --plum: #8a4fd1;
  --pink: #ff6fae;
  --lime: #8cc63f;
  --rust: #c8642a;
  --radius: 14px;
  --display: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.05; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { color: var(--tomato); font-weight: 800; }

/* Ticket card */
.ticket {
  position: relative;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 5px 5px 0 var(--ink);
}
.ticket.notched::before, .ticket.notched::after {
  content: ''; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 50%;
}
.ticket.notched::before { left: -13px; clip-path: inset(0 0 0 50%); }
.ticket.notched::after { right: -13px; clip-path: inset(0 50% 0 0); }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); background: var(--gold); color: var(--ink);
  font-weight: 700; border-radius: 999px; padding: 11px 20px; text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.red { background: var(--tomato); color: #fff; }
.btn.ghost { background: #fff; }
.btn.small { padding: 6px 12px; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.field { width: 100%; border: 2px solid var(--ink); border-radius: 10px; padding: 11px 13px; background: #fff; }
.field:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
label.lbl { display: block; font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); font-size: 13px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #bbb; display: inline-block; }
.dot.on { background: var(--mint); box-shadow: 0 0 0 3px rgba(34,185,154,.2); }
.code { font-family: var(--display); font-weight: 800; letter-spacing: .12em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 50; }

/* Home */
.home-top { padding: 22px 0; }
.hero { padding: 36px 0 28px; }
.hero h1 { font-size: clamp(44px, 8vw, 88px); margin: 0 0 16px; }
.hero h1 em { font-style: normal; color: var(--tomato); }
.hero p { font-size: 20px; max-width: 640px; margin: 0; }
.home-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; margin: 28px 0 40px; }
.home-grid h2 { margin: 0 0 14px; font-size: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 40px; }
.step { border-top: 3px dashed var(--ink); padding-top: 14px; }
.step b { font-family: var(--display); font-size: 40px; color: var(--tomato); display: block; }
.mine-list { list-style: none; padding: 0; margin: 10px 0 0; }
.mine-list li { padding: 8px 0; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; }
footer.foot { padding: 30px 0 40px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .home-grid, .steps { grid-template-columns: 1fr; } }

/* Audience (phone) */
.play { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; min-height: 100dvh; display: flex; flex-direction: column; }
.play-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.play-top .brand { font-size: 18px; }
.play-top .brand svg { width: 26px; height: 26px; }
.play-card { flex: 1; display: flex; flex-direction: column; }
.play h1 { font-size: 30px; margin: 4px 0 18px; }
.play .eyebrow { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--tomato); }
.choices { display: grid; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  border: 2px solid var(--ink); background: #fff; border-radius: var(--radius);
  padding: 16px; font-size: 19px; font-weight: 600; box-shadow: 4px 4px 0 var(--ink);
}
.choice .badge { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: #fff; border: 2px solid var(--ink); }
.choice.picked { background: var(--ink); color: #fff; }
.choice.picked::after { content: '✓'; margin-left: auto; font-size: 22px; }
.choices.locked .choice:not(.picked) { opacity: .5; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button { aspect-ratio: 1; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; font-family: var(--display); font-size: 30px; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.scale button.picked { background: var(--tomato); color: #fff; }
.scale-ends { display: flex; justify-content: space-between; font-size: 14px; margin-top: 8px; color: var(--muted); }
.words-form { display: flex; gap: 8px; }
.words-form .field { font-size: 20px; }
.note { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); font-weight: 600; }
.note.ok { background: #dff5ee; }
.note.warn { background: #ffe6dd; }
.waiting { text-align: center; margin: auto 0; padding: 30px 0; }
.waiting .big { font-size: 64px; }
.join-form { display: flex; gap: 8px; }
.join-form .field { text-transform: uppercase; letter-spacing: .2em; font-family: var(--display); font-weight: 800; font-size: 22px; }

/* Big screen */
body.stage { background: var(--ink); color: var(--paper); overflow: hidden; }
.stage-wrap { height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: 2.4vh 3vw; gap: 2vh; }
.stage-top { display: flex; justify-content: space-between; align-items: center; }
.stage-top .brand { font-size: 3vh; }
.stage-top .brand svg { width: 4.4vh; height: 4.4vh; }
.stage-join { display: flex; align-items: center; gap: 1.6vw; font-size: 2.6vh; }
.stage-join .code { color: var(--gold); font-size: 4.4vh; }
.mini-qr { background: #fff; padding: .6vh; border-radius: 1vh; width: 11vh; height: 11vh; }
.mini-qr svg, .big-qr svg { width: 100%; height: 100%; display: block; }
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 5vw; align-items: center; justify-content: center; }
.big-qr { background: #fff; padding: 2vh; border-radius: 2.4vh; width: 58vh; height: 58vh; box-shadow: 1.2vh 1.2vh 0 var(--tomato); }
.lobby h1 { font-size: 7.5vh; margin: 0 0 3vh; }
.lobby .url { font-size: 4vh; font-weight: 700; }
.lobby .code { font-size: 13vh; color: var(--gold); display: block; margin: 1vh 0 3vh; }
.seats { font-size: 3vh; color: #d9cfe0; }
.seats b { color: var(--mint); font-family: var(--display); }
.stage-q { display: grid; grid-template-rows: auto 1fr; gap: 3vh; min-height: 0; }
.stage-q h1 { font-size: clamp(32px, 7vh, 96px); margin: 0; max-width: 90%; }
.stage-q .eyebrow { font-size: 2.4vh; color: var(--tomato); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1.4vh; }
.stage-bottom { display: flex; justify-content: space-between; font-size: 2.6vh; color: #d9cfe0; }
.stage-bottom b { color: var(--paper); }
.closed-badge { background: var(--tomato); color: #fff; padding: .4vh 1.2vh; border-radius: 99px; font-weight: 800; }
.stage .end { text-align: center; align-self: center; }
.stage .end h1 { font-size: 12vh; margin: 0 0 2vh; color: var(--gold); }

/* Results */
.bars { display: grid; gap: 1.6vh; align-content: start; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: .6vh 2vw; }
.bar .label { font-weight: 700; font-size: 3.4vh; display: flex; align-items: center; gap: 1.2vw; }
.bar .label .badge { width: 4.6vh; height: 4.6vh; border-radius: 1vh; display: grid; place-items: center; font-family: var(--display); color: #fff; font-weight: 800; flex: none; }
.bar .num { font-family: var(--display); font-weight: 800; font-size: 3.6vh; align-self: center; }
.bar .num small { font-size: 2.2vh; opacity: .7; margin-left: .6vw; }
.bar .track { grid-column: 1 / -1; height: 3.2vh; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.vbars { display: grid; grid-template-columns: repeat(5, 1fr) minmax(16vw, auto); gap: 2vw; align-items: end; height: 100%; min-height: 0; }
.vbar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 1vh; }
.vbar .col { display: flex; align-items: flex-end; }
.vbar .fill { width: 100%; border-radius: 1.2vh 1.2vh 0 0; transition: height .5s cubic-bezier(.2,.8,.2,1); min-height: 3px; }
.vbar .n { font-family: var(--display); font-weight: 800; font-size: 3.4vh; }
.vbar .k { font-family: var(--display); font-weight: 800; font-size: 5vh; }
.avg { align-self: center; text-align: center; font-size: 2.6vh; color: #d9cfe0; }
.light .avg { font-size: 14px; color: var(--muted); }
.avg b { font-family: var(--display); font-size: 16vh; color: var(--gold); display: block; line-height: 1; }
.cloud { font-size: 4.6vh; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; gap: 1vh 2.4vw; height: 100%; overflow: hidden; }
.cloud span { font-family: var(--display); font-weight: 800; line-height: 1; transition: font-size .4s; }
.empty { opacity: .6; font-size: 3vh; align-self: center; text-align: center; }

/* Light variant for results inside the presenter view */
.light .bar .track { background: var(--paper-2); }
.light .bar .label { font-size: 17px; }
.light .bar .label .badge { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.light .bar .num { font-size: 18px; }
.light .bar .num small { font-size: 13px; }
.light .bar .track { height: 14px; }
.light .bars { gap: 10px; }
.light .vbars { height: 160px; }
.light .vbar .n { font-size: 15px; }
.light .vbar .k { font-size: 20px; }
.light .avg b { font-size: 54px; color: var(--tomato); }
.light .cloud { min-height: 140px; font-size: 16px; }
.light .empty { font-size: 16px; }

/* Presenter */
.host-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; flex-wrap: wrap; }
.tabs { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.tabs button { border: 0; background: none; padding: 8px 18px; font-weight: 700; }
.tabs button.on { background: var(--ink); color: #fff; }
.host-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; padding-bottom: 60px; }
.side { display: grid; gap: 18px; }
.side h3 { margin: 0 0 10px; font-size: 18px; }
.linkbox { display: flex; gap: 6px; }
.linkbox input { flex: 1; min-width: 0; font-size: 13px; padding: 7px 9px; }
.qcard { margin-bottom: 18px; }
.qcard .qhead { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.qcard .qnum { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--tomato); min-width: 34px; }
.qcard select { width: auto; padding: 7px 10px; }
.qcard .tools { margin-left: auto; display: flex; gap: 4px; }
.iconbtn { border: 2px solid var(--ink); background: #fff; border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; font-weight: 800; }
.opts { display: grid; gap: 8px; margin-top: 10px; }
.opt { display: flex; gap: 8px; align-items: center; }
.opt .badge { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff; border: 2px solid var(--ink); flex: none; font-family: var(--display); }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 20px; }
.run-now { min-height: 300px; }
.run-now h2 { font-size: 34px; margin: 6px 0 18px; }
.run-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin: 18px 0; }
.run-nav .btn { padding: 18px; font-size: 20px; }
.qlist { list-style: none; margin: 0; padding: 0; }
.qlist li button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; display: flex; gap: 10px; }
.qlist li button:hover { background: var(--paper-2); }
.qlist li.cur button { background: var(--ink); color: #fff; }
.qlist .n { font-weight: 800; width: 22px; flex: none; }
.toggles { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.toggles label { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.toggles input { width: 18px; height: 18px; accent-color: var(--tomato); }
.kbd { font-family: ui-monospace, monospace; background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.save-state { font-size: 13px; color: var(--muted); }
.title-input { font-family: var(--display); font-weight: 800; font-size: 22px; border: 2px dashed transparent; background: none; padding: 4px 8px; border-radius: 8px; min-width: 0; width: 360px; max-width: 100%; }
.title-input:hover, .title-input:focus { border-color: var(--line); outline: none; background: #fff; }
.gate { max-width: 520px; margin: 12vh auto; }
@media (max-width: 860px) { .host-grid { grid-template-columns: 1fr; } }
