@font-face { font-family: "EBG"; src: url("/static/fonts/ebg-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "EBG"; src: url("/static/fonts/ebg-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #FBF7EF;
  --card: #F4EEE2;
  --ink: #1E2A24;
  --soft: #3A463F;
  --muted: #7A7C72;
  --green: #1F4D3A;
  --green-d: #163829;
  --green-l: #E2ECE5;
  --red: #A4282F;
  --red-l: #F6E3E1;
  --gold: #C98B2B;
  --gold-l: #F6D9A8;
  --rule: #E2D9C9;
  --serif: "EBG", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--green); margin: 0; line-height: 1.1; }
h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0 0 10px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.brand { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- buttons and fields ---------- */
.btn {
  display: block; width: 100%; text-align: center; background: var(--green); color: #fff;
  border-radius: 12px; padding: 15px 16px; font-weight: 700; font-size: 17px;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.btn.red { background: var(--red); }
.btn.gold { background: var(--gold-l); color: var(--red); }
.btn.small { display: inline-block; width: auto; padding: 8px 12px; font-size: 14px; border-radius: 9px; }
.link { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; border: 2px solid var(--rule); background: #fff; border-radius: 11px;
  padding: 12px 13px; font-size: 17px; outline: none;
}
.input:focus { border-color: var(--green); }
.input.code { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.error { color: var(--red); font-weight: 600; font-size: 15px; min-height: 1.2em; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.card.white { background: #fff; box-shadow: 0 0 0 1px var(--rule); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: #EEE8DC; color: var(--muted); white-space: nowrap; }
.tag.live { background: var(--red); color: #fff; }
.tag.done { background: #DCE6DF; color: var(--green); }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 11px 16px; border-radius: 11px; font-size: 15px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

/* ---------- swatches, people ---------- */
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; }
.swatch.on { outline: 3px solid var(--ink); outline-offset: 3px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: center; gap: 7px; background: #fff; border-radius: 99px;
  padding: 6px 12px 6px 7px; box-shadow: 0 0 0 1px var(--rule); font-weight: 600; font-size: 15px; }
.person .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.person .dot svg { width: 12px; height: 12px; }
.person.done { box-shadow: 0 0 0 2px var(--green); }

/* ---------- rating controls ---------- */
.rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.rate > .lbl { font-weight: 600; font-size: 17px; }
.dots { display: flex; gap: 6px; }
.dots button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.dots button i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--green); display: block; }
.dots button.on i { background: var(--green); }
.hats { display: flex; gap: 2px; color: var(--red); }
.hats button, .hats span { width: 38px; height: 38px; display: grid; place-items: center; }
.hats svg { width: 30px; height: 30px; }
.hats .off { color: #DCD2C2; }
.chips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.chips button { height: 42px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--rule); background: #fff; font-weight: 700; font-size: 15px; }
.chips button.on { background: var(--gold); box-shadow: none; color: #fff; }
.stepper { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--rule); padding: 6px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; background: var(--card); font-size: 24px; font-weight: 700; color: var(--green); }
.stepper .v { font-weight: 800; font-size: 22px; }
.stepper .v.unset { color: var(--muted); font-weight: 600; font-size: 17px; }
.sec-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------- phone shell ---------- */
.phone-app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.phone-app.joker { background: var(--red); color: #fff; max-width: none; }
.phone-app.joker > .inner { max-width: 444px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.phone-app.joker .brand { color: var(--gold-l); }
.phone-app.joker h2 { color: #fff; font-size: 28px; }
.opt { display: block; width: 100%; text-align: left; border-radius: 12px; padding: 14px 15px; font-size: 17px; font-weight: 600;
  background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); color: #fff; }
.opt.on { background: #fff; color: var(--red); box-shadow: none; }
.opt.own { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); border: 0; outline: 2px dashed transparent; }
.joker .input { border-color: transparent; color: var(--ink); }
.joker .note { color: #F2C4C4; font-size: 13px; text-align: center; }
.scale { display: flex; flex-direction: column; gap: 10px; }
.scale input[type=range] { width: 100%; accent-color: #fff; height: 40px; }
.scale .poles { display: flex; justify-content: space-between; font-weight: 700; gap: 12px; }
.scale .poles span:last-child { text-align: right; }
.big-check { width: 96px; height: 96px; border-radius: 50%; background: var(--card); display: grid; place-items: center; margin: 18px auto 4px; }
.big-check svg { width: 52px; height: 52px; }
.prog { height: 10px; border-radius: 6px; background: var(--card); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--gold); transition: width .4s; }
.reveal-card { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 0 0 1px var(--rule); }
.reveal-card .place { font-family: var(--serif); font-weight: 600; color: var(--red); font-size: 18px; }
.reveal-card .nm { font-weight: 800; font-size: 18px; color: var(--green); }
.badge { display: inline-block; background: var(--gold); color: #fff; font-weight: 800; border-radius: 10px; padding: 8px 12px; }
.verdict-text { font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.35; color: var(--soft); }

/* ---------- glasses ---------- */
.glass { width: 22px; height: 30px; flex: none; }

/* ---------- landing ---------- */
.landing { max-width: 560px; margin: 0 auto; padding: 32px 20px 40px; display: flex; flex-direction: column; gap: 22px; }
.landing .lineup { display: flex; gap: 10px; justify-content: space-between; }
.landing .lineup svg { width: 11%; height: auto; }
.dek { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--soft); line-height: 1.3; }

/* ---------- host ---------- */
.host-app { max-width: 1100px; margin: 0 auto; padding: 14px 18px 60px; }
.host-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: inline-flex; background: var(--card); border-radius: 12px; padding: 4px; }
.tabs button { padding: 9px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.host-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .host-grid { grid-template-columns: 1fr; } }
.beer { background: #fff; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--rule); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.beer.open { box-shadow: 0 0 0 2px var(--red); }
.beer .title { font-weight: 800; font-size: 18px; color: var(--green); }
.beer .facts { color: var(--muted); font-size: 14px; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; background: var(--card); font-weight: 700; color: var(--green); }
.iconbtn.danger { color: var(--red); }
.iconbtn.confirm { width: auto; padding: 0 10px; background: var(--red); color: #fff; }
.jbox { border-radius: 12px; box-shadow: inset 0 0 0 2px var(--red-l); padding: 12px 13px; display: flex; flex-direction: column; gap: 8px; }
.jbox .h { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.jbox .chosen { font-weight: 700; font-size: 16px; }
.jbox .alts { font-size: 14px; color: var(--soft); }
.sugg { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--paper); }
.sugg .q { flex: 1; font-size: 15px; }
.sugg .src { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--red); animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-weight: 600; }
.switch input { width: 46px; height: 28px; appearance: none; -webkit-appearance: none; background: var(--rule); border-radius: 99px; position: relative; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--green); }
.switch input:disabled { opacity: .45; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .choice { grid-template-columns: 1fr; } }
.choice button { text-align: left; background: #fff; border-radius: 12px; padding: 13px 14px; box-shadow: inset 0 0 0 2px var(--rule);
  font-size: 14px; line-height: 1.35; color: var(--soft); }
.choice button b { display: block; font-size: 17px; color: var(--green); margin-bottom: 3px; }
.choice button.on { box-shadow: inset 0 0 0 3px var(--green); background: var(--green-l); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets .opt { width: auto; padding: 10px 13px; font-size: 15px; }
.tal-show { font-family: var(--serif); font-weight: 600; font-size: 30px; min-height: 1.2em; color: #fff; }
.switch input:checked::after { left: 21px; }
.qr-img { width: 100%; max-width: 220px; border-radius: 10px; display: block; background: #fff; }
.codebig { font-weight: 800; font-size: 30px; letter-spacing: .12em; color: var(--green); }
.card .codebig { font-size: 24px; letter-spacing: .08em; word-break: break-all; }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, 94vw); background: var(--paper); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20,30,25,.45); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.colorpick { display: flex; gap: 8px; flex-wrap: wrap; }
.colorpick button { padding: 4px; border-radius: 8px; }
.colorpick button.on { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- control bar (host, evening) ---------- */
.evening { display: flex; flex-direction: column; gap: 12px; }
.controls { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--rule); z-index: 5; }
.controls .btn { width: auto; flex: 1; min-width: 220px; font-size: 19px; padding: 17px; }
.controls .info { color: var(--soft); font-size: 15px; }

/* ---------- the big screen (iPad) ---------- */
.screen { background: var(--green); color: #fff; border-radius: 20px; padding: 28px 32px; min-height: 560px; position: relative; overflow: hidden; }
.screen-page { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--green); }
.screen-page .screen { border-radius: 0; min-height: 100vh; min-height: 100dvh; padding: 36px 40px 40px; }
.screen .k { font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-l); }
.screen h1, .screen h2, .screen h3 { color: #fff; }
.screen h1 { font-size: clamp(40px, 6vw, 64px); }
.screen h2 { font-size: clamp(28px, 3.6vw, 40px); }
.screen .sub { color: #CFE0D6; font-size: 19px; }
.screen .cols { display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: start; }
@media (orientation: portrait), (max-width: 760px) { .screen .cols { grid-template-columns: 1fr; gap: 26px; } }
.screen .lobby-title { font-size: clamp(36px, 4.6vw, 58px); margin: 6px 0 18px; }
.screen .joinrow { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.screen .joininfo p { margin: 0 0 4px; }
.screen .qrwrap { background: #fff; border-radius: 18px; padding: 12px; width: min(270px, 34vh, 70vw); flex: none; }
.screen .qrwrap img { width: 100%; display: block; }
.screen .joinurl { font-size: 21px; font-weight: 700; color: #fff; word-break: break-all; }
.screen .codebig { color: #fff; font-size: 46px; }
.screen .people .person { background: #2C5F48; color: #fff; box-shadow: none; font-size: 17px; }
.screen .person .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.screen .people .person.done { background: #fff; color: var(--green); }
.screen .stat { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.screen .stat .num { font-weight: 800; font-size: clamp(52px, 7vw, 84px); line-height: 1; }
.screen .stat .lab { color: #CFE0D6; font-size: 17px; line-height: 1.2; }
.screen .hats { color: #F07A7F; }
.screen .hats .off { color: #3B6A55; }
.screen .hats span { width: 46px; height: 46px; }
.screen .hats svg { width: 42px; height: 42px; }
.screen .minis { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 22px; justify-content: start; color: #CFE0D6; font-size: 16px; }
.screen .minis b { color: #fff; font-size: 22px; }
.screen .quote { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.3; color: #E8F0EA; margin-top: 18px; }
.screen .jq { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; margin: 6px 0 16px; }
.screen .bars { display: flex; flex-direction: column; gap: 12px; }
.screen .bar { display: grid; grid-template-columns: minmax(140px, 38%) 1fr 34px; align-items: center; gap: 12px; font-size: 19px; }
.screen .bar .track { height: 22px; background: #2C5F48; border-radius: 6px; overflow: hidden; }
.screen .bar .track i { display: block; height: 100%; background: var(--gold-l); transition: width .6s; }
.screen .bar .c { font-weight: 800; text-align: right; }
.screen .scalebar { position: relative; height: 18px; background: #2C5F48; border-radius: 9px; margin: 22px 0 10px; }
.screen .scalebar .d { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--gold-l); opacity: .85; }
.screen .scalebar .m { position: absolute; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #F07A7F; box-shadow: 0 0 0 4px var(--green); }
.screen .poles { display: flex; justify-content: space-between; font-size: 19px; font-weight: 700; }
.screen .texts { display: flex; flex-wrap: wrap; gap: 10px; }
.screen .texts span { background: #2C5F48; border-radius: 10px; padding: 8px 13px; font-size: 19px; }
.screen .cornerqr { position: absolute; right: 22px; bottom: 20px; display: flex; align-items: center; gap: 12px; color: #CFE0D6; text-align: right; font-size: 14px; }
.screen .cornerqr img { width: 84px; height: 84px; background: #fff; border-radius: 8px; padding: 5px; }
.screen .cornerqr b { color: #fff; font-size: 18px; letter-spacing: .1em; }
.screen .progline { font-size: 22px; margin: 10px 0 14px; }
.screen .bigprog { height: 16px; background: #2C5F48; border-radius: 9px; overflow: hidden; margin-bottom: 18px; }
.screen .bigprog i { display: block; height: 100%; background: var(--gold-l); transition: width .5s; }
.screen .rev-main { background: #fff; color: var(--ink); border-radius: 18px; padding: 22px 26px; }
.screen .rev-main .place { font-family: var(--serif); font-weight: 600; color: var(--red); font-size: 26px; }
.screen .rev-main .nm { font-family: var(--serif); font-weight: 600; color: var(--green); font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; margin: 4px 0 6px; }
.screen .rev-main .facts { color: var(--soft); font-size: 19px; }
.screen .rev-main .hats .off { color: #E6DDCF; }
.screen .rev-list { display: flex; flex-direction: column; gap: 8px; }
.screen .rev-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 18px; color: #CFE0D6; border-bottom: 1px solid #2C5F48; padding-bottom: 6px; }
.screen .rev-list b { color: #fff; }
.screen .prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.screen .prize { background: #2C5F48; border-radius: 16px; padding: 16px 18px; }
.screen .prize .t { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--gold-l); }
.screen .prize .w { font-weight: 800; font-size: 21px; margin: 4px 0; }
.screen .prize .d { color: #CFE0D6; font-size: 15px; }
.screen .verdicts { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.screen .verdicts p { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.3vw, 25px); line-height: 1.35; color: #F1F5F2; margin: 0; }
.screen .verdicts p b { font-style: normal; color: var(--gold-l); font-family: var(--sans); font-size: .75em; letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.drum { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--gold-l); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.screen .lineup { display: flex; gap: 14px; margin: 10px 0 24px; }
.screen .lineup svg { width: 40px; height: auto; }
