/* Phone pages: admin, audience voting, question submission, start page. */

html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  font-size: 17px;
  line-height: 1.4;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(48, 86, 230, .45), transparent 60%),
    radial-gradient(ellipse 120% 70% at 50% 120%, #0a1a5e 0%, #030a2e 50%, #01040f 85%) fixed;
  background-color: var(--night);
}
a { color: var(--gold-hi); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
h1, h2, h3 { line-height: 1.15; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
.brand .emblem { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 0 12px rgba(90, 140, 255, .5)); }
.brand h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--gold-hi); }
.brand p { margin: 0; font-size: 14px; color: var(--muted); }

.card {
  border-radius: 18px; padding: 16px;
  background: linear-gradient(180deg, rgba(20, 40, 130, .55), rgba(4, 12, 51, .8));
  border: 1px solid rgba(207, 218, 243, .22);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
}
.card + .card { margin-top: 12px; }
.card h2 { margin: 0 0 10px; font-size: 19px; }
.card h3 { margin: 0 0 6px; font-size: 16px; color: var(--ice); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 16px; border-radius: 14px;
  border: 1px solid rgba(207, 218, 243, .35);
  background: linear-gradient(180deg, #24439f, #13256b);
  color: #fff; font-size: 17px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, filter .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 64px; font-size: 21px; font-weight: 700; border-radius: 18px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: #1a0d00; border-color: #ffe3a6; }
.btn.go { background: linear-gradient(180deg, #8fe46f, var(--green) 55%, var(--green-lo)); color: #031a03; border-color: #c2f7a3; }
.btn.danger { background: linear-gradient(180deg, #ff7b7f, var(--red) 55%, #8a1d20); border-color: #ffb3b5; }
.btn.ghost { background: rgba(255,255,255,.04); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 15px; border-radius: 11px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-grid.three { grid-template-columns: 1fr 1fr 1fr; }

/* Forms */
label.field { display: block; }
label.field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ice); }
input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px; border-radius: 12px;
  border: 1px solid rgba(207, 218, 243, .3); background: rgba(1, 4, 15, .55); color: #fff;
  font: inherit; font-size: 17px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
::placeholder { color: #6f7ca3; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button {
  min-height: 52px; padding: 6px; border-radius: 12px; border: 1px solid rgba(207, 218, 243, .3);
  background: rgba(1, 4, 15, .45); color: var(--ice); font-size: 15px; font-weight: 600; cursor: pointer; line-height: 1.15;
}
.seg button small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.seg button.on { background: linear-gradient(180deg, #2f55d8, #13256b); color: #fff; border-color: var(--ice); }
.seg button.on small { color: var(--ice); }

/* Answer rows in the question form */
.ans-edit { display: grid; grid-template-columns: 46px 1fr 50px; gap: 8px; align-items: center; }
.ans-edit + .ans-edit { margin-top: 8px; }
.ans-edit .l { height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--gold); background: rgba(1, 4, 15, .5); border: 1px solid rgba(207, 218, 243, .25); }
.ans-edit .mark {
  height: 48px; border-radius: 12px; border: 1px solid rgba(207, 218, 243, .3); background: rgba(1, 4, 15, .45);
  color: transparent; font-size: 22px; cursor: pointer; display: grid; place-items: center;
}
.ans-edit .mark::after { content: '✓'; color: rgba(207, 218, 243, .35); }
.ans-edit.right .mark { background: linear-gradient(180deg, #8fe46f, var(--green-lo)); border-color: var(--green-hi); }
.ans-edit.right .mark::after { color: #fff; }
.ans-edit.right input { border-color: var(--green); }

.ai-box { border-radius: 14px; padding: 12px; background: rgba(247, 165, 49, .08); border: 1px dashed rgba(247, 165, 49, .5); }
.note { border-radius: 12px; padding: 10px 12px; font-size: 15px; background: rgba(207, 218, 243, .08); border-left: 4px solid var(--ice); }
.note.warn { background: rgba(247, 165, 49, .12); border-left-color: var(--gold); }
.note.ok { background: rgba(63, 191, 63, .12); border-left-color: var(--green); }
.note.err { background: rgba(229, 72, 77, .14); border-left-color: var(--red); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(26, 13, 0, .3); border-top-color: #1a0d00; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; z-index: 50;
  background: #10204f; border: 1px solid rgba(207, 218, 243, .35); box-shadow: 0 10px 30px rgba(0,0,0,.5);
  font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #5a1316; border-color: #ff9b9e; }

/* Mobile lozenge buttons (vote page, admin preview) */
.loz.m { --cut: 22px; min-height: 64px; padding: 8px 26px; font-size: 19px; font-weight: 600; }
.loz.m .letter { font-size: 19px; }
button.loz { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; font-size: 19px; font-weight: 600; color: var(--ink); -webkit-tap-highlight-color: transparent; }
button.loz:active { transform: scale(.985); }
button.loz:disabled { cursor: default; }
.loz.q.m { --cut: 26px; min-height: 84px; justify-content: center; text-align: center; padding: 12px 34px; font-size: 20px; }

/* Bar chart (vote page) */
.mbars { display: flex; gap: 12px; align-items: flex-end; height: 200px; padding-top: 10px; }
.mbars .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.mbars .bar { width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #9ec0ff, #3c6cf0 45%, #1636a8); border: 1px solid rgba(255,255,255,.5); transition: height 1.6s cubic-bezier(.3,.1,.2,1); height: 2%; }
.mbars .col.top .bar { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo)); }
.mbars .pct { font-weight: 800; font-size: 18px; }
.mbars .lbl { font-weight: 800; color: var(--gold); }
.field > .flabel { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ice); }

/* ---------- admin ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: rgba(2, 6, 28, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(207, 218, 243, .15);
}
.topbar .emblem { width: 34px; height: 34px; }
.topbar b { font-size: 16px; letter-spacing: .03em; text-transform: uppercase; color: var(--gold-hi); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(2, 6, 28, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(207, 218, 243, .18);
}
.tabbar button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 56px; border: 0; border-radius: 12px; background: none; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.tabbar button .ico { font-size: 22px; line-height: 1.1; }
.tabbar button.on { color: #fff; background: rgba(47, 85, 216, .35); }
.tabbar .badge { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #1a0d00; font-size: 12px; font-weight: 800; display: grid; place-items: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: rgba(207, 218, 243, .12); color: var(--ice); }
.pill.live { background: rgba(63, 191, 63, .2); color: var(--green-hi); }
.pill.tense { background: rgba(247, 165, 49, .22); color: var(--gold-hi); }
.pill.bad { background: rgba(229, 72, 77, .22); color: #ffb3b5; }
.big-line { font-size: 24px; font-weight: 700; margin: 8px 0 2px; }
.big-line b { color: var(--gold-hi); }

.qa { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.qa li {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: rgba(1, 4, 15, .45); border: 1px solid rgba(207, 218, 243, .2);
  font-weight: 600; cursor: default;
}
.qa li .l { color: var(--gold); font-weight: 800; }
.qa li .meta { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.qa li.right { border-color: var(--green); background: rgba(63, 191, 63, .14); }
.qa li.right .meta { color: var(--green-hi); }
.qa li.removed { opacity: .4; text-decoration: line-through; }
.qa li.locked { background: linear-gradient(180deg, rgba(255, 214, 122, .35), rgba(196, 106, 0, .35)); border-color: var(--gold); }
.qa li.sel { outline: 3px solid var(--gold); outline-offset: 1px; }
.qa.pickable li:not(.removed) { cursor: pointer; }
.qa li.hiddenOnScreen .t { opacity: .55; }
.q-big { font-size: 20px; font-weight: 700; line-height: 1.3; }
.info { margin-top: 10px; font-size: 15px; color: var(--ice); border-left: 3px solid var(--gold); padding-left: 10px; }

.jk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jk .btn { flex-direction: column; gap: 0; min-height: 70px; font-size: 16px; }
.jk .btn small { font-size: 12px; font-weight: 600; opacity: .8; }
.votebox { margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(247, 165, 49, .1); border: 1px solid rgba(247, 165, 49, .45); }
.votebox .secs { font-size: 34px; font-weight: 800; color: var(--gold-hi); }

details.plan { border-radius: 14px; background: rgba(1, 4, 15, .4); border: 1px solid rgba(207, 218, 243, .2); }
details.plan + details.plan { margin-top: 8px; }
details.plan summary { list-style: none; cursor: pointer; padding: 12px 14px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
details.plan summary::-webkit-details-marker { display: none; }
details.plan summary .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: rgba(247, 165, 49, .18); color: var(--gold-hi); }
details.plan.safe summary .n { background: rgba(255,255,255,.18); color: #fff; }
details.plan.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
details.plan.done { opacity: .6; }
details.plan .sumtxt { min-width: 0; }
details.plan .sumtxt b { display: block; font-size: 15px; color: var(--gold-hi); }
details.plan .sumtxt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
details.plan .body { padding: 0 14px 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(207, 218, 243, .12); color: var(--ice); }
.tag.ai { background: rgba(247, 165, 49, .2); color: var(--gold-hi); }
.tag.new { background: rgba(63, 191, 63, .2); color: var(--green-hi); }

.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(1, 4, 15, .72); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel-in { width: 100%; max-width: 680px; max-height: 94dvh; overflow: auto; padding: 18px 16px 28px; border-radius: 22px 22px 0 0; background: linear-gradient(180deg, #0e2070, #040c33); border: 1px solid rgba(207, 218, 243, .25); }
.sheet h2 { margin: 0 0 12px; }
.qr-inline { width: 150px; height: 150px; background: #fff; border-radius: 12px; padding: 6px; }
.url { font-family: ui-monospace, Consolas, monospace; font-size: 14px; word-break: break-all; color: var(--ice); }

/* ---------- submit: already submitted, by category ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(207, 218, 243, .3); background: rgba(1, 4, 15, .45); color: var(--ice);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip b { color: var(--gold-hi); }
details.cat { border-radius: 14px; background: rgba(1, 4, 15, .4); border: 1px solid rgba(207, 218, 243, .2); }
details.cat + details.cat { margin-top: 8px; }
details.cat summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 700; }
details.cat summary::-webkit-details-marker { display: none; }
details.cat summary::after { content: '▾'; color: var(--muted); transition: transform .2s ease; }
details.cat[open] summary::after { transform: rotate(180deg); }
.qlist { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 8px; }
.qlist li { font-size: 15px; line-height: 1.35; padding-top: 8px; border-top: 1px solid rgba(207, 218, 243, .12); }
.qlist .tag { margin-right: 4px; }

/* ---------- picture questions ---------- */
.img-pick { display: grid; gap: 8px; }
.img-preview, .q-img { display: block; max-width: 100%; max-height: 240px; border-radius: 12px; border: 1px solid rgba(207, 218, 243, .3); background: #000; object-fit: contain; }
.q-img { margin-top: 10px; }
.vote-img { display: block; max-width: 100%; max-height: 38vh; margin: 10px auto 0; border-radius: 14px; border: 2px solid #dfe6f3; background: #000; }
.img-choose { cursor: pointer; }
