:root {
  --ink: #1b1b1b;
  --body: #4a4a4a;
  --muted: #6b6b6b;
  --paper: #fbfaf7;
  --card: #f3efe7;
  --orange: #ff9900;
  --otext: #9a4f00;
  --blue: #2f5d8a;
  --gray: #b9b4aa;
  --pale: #ffe3b8;
  --ok: #2f5d8a;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
h1,
h2,
.brand {
  font-family: Verdana, Arial, sans-serif;
  font-weight: 700;
  color: var(--ink);
}
h1 {
  font-size: 28px;
  margin: 8px 0 12px;
  line-height: 1.2;
}
h2 {
  font-size: 22px;
  margin: 6px 0 10px;
  line-height: 1.3;
}
p {
  line-height: 1.45;
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.pad {
  padding: 40px 20px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button.primary {
  background: var(--ink);
  color: var(--paper);
}
button.big {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  margin-top: 14px;
}
button.ghost {
  border-color: var(--gray);
  color: var(--body);
  font-weight: 600;
}
button.danger {
  color: #9b2c2c;
}
input[type="text"],
input:not([type]),
input[maxlength] {
  font: inherit;
  font-size: 18px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray);
  border-radius: 10px;
  background: #fff;
  margin-top: 8px;
}
input:focus {
  outline: none;
  border-color: var(--orange);
}

/* participant */
.pbar {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 4px solid var(--orange);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.card {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}
.part {
  font-size: 13px;
  font-weight: 700;
  color: var(--otext);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.prompt {
  color: var(--body);
  margin: 0 0 16px;
}
.foot {
  margin-top: 20px;
  font-size: 14px;
  text-align: center;
}
.done {
  background: var(--card);
  padding: 14px 16px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-left: 6px solid var(--blue);
}
.done button {
  padding: 6px 12px;
}
.slider {
  margin: 12px 0 4px;
}
.sval {
  font-family: Verdana, Arial, sans-serif;
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  color: var(--otext);
}
input[type="range"] {
  width: 100%;
  height: 44px;
  accent-color: var(--orange);
}
.ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}
.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  text-align: left;
  font-weight: 600;
  padding: 14px 16px;
  border-color: var(--gray);
  position: relative;
}
.opt.sel {
  border-color: var(--orange);
  background: var(--pale);
}
.opt.sel[data-rank]:not([data-rank=""])::after {
  content: attr(data-rank);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--paper);
  width: 26px;
  height: 26px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.wi {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 10px;
}
.wi button {
  flex: none;
}
.rf {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rfi {
  background: var(--card);
  padding: 12px 14px;
  border-radius: 10px;
}
.rfi p {
  margin: 0 0 10px;
  font-size: 15px;
}
.rfb {
  display: flex;
  gap: 8px;
}
.tog {
  flex: 1;
  padding: 10px;
  border-color: var(--gray);
  font-weight: 700;
}
.tog.sel[data-v="real"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.tog.sel[data-v="fake"] {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}
.slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.slot {
  border: 2px dashed var(--gray);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  min-height: 50px;
}
.slot.fill {
  border-style: solid;
  border-color: var(--orange);
  background: var(--pale);
}
.rk {
  background: var(--ink);
  color: var(--paper);
  width: 26px;
  height: 26px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: none;
}
.results.small {
  margin-top: 22px;
  border-top: 3px solid var(--orange);
  padding-top: 14px;
}

/* results (shared) */
.bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hb {
  display: grid;
  grid-template-columns: minmax(120px, 36%) 1fr auto;
  gap: 12px;
  align-items: center;
}
.hb-l {
  font-weight: 600;
  line-height: 1.3;
}
.hb-t {
  background: #e9e5dc;
  height: 26px;
  border-radius: 4px;
  overflow: hidden;
}
.hb-f {
  background: var(--gray);
  height: 100%;
  transition: width 0.4s;
}
.hb.win .hb-f {
  background: var(--orange);
}
.hb-v {
  font-weight: 700;
  white-space: nowrap;
}
.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.tag.real,
.tag.ok {
  background: var(--blue);
  color: #fff;
}
.tag.fake {
  background: var(--orange);
  color: var(--ink);
}
.note {
  color: var(--muted);
  font-size: 14px;
}
.cap {
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--body);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--card);
  border-radius: 14px;
  padding: 6px 12px;
}
.stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.stats .hl {
  color: var(--otext);
}
.histo {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  height: 200px;
}
.hc {
  display: flex;
  flex-direction: column;
}
.hcol {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  background: #f1ede5;
  border-radius: 4px 4px 0 0;
}
.hfill {
  width: 100%;
  background: var(--orange);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s;
}
.histo.gray .hfill {
  background: var(--gray);
}
.hn {
  position: absolute;
  top: 4px;
  font-weight: 700;
  font-size: 13px;
}
.hx {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.scorebar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  height: 120px;
  align-items: end;
}
.scorebar > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  font-size: 12px;
}
.sb {
  width: 100%;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

/* host */
.hbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  border-bottom: 5px solid var(--orange);
  background: #fff;
}
.brand {
  font-size: 20px;
}
.hmeta {
  color: var(--body);
  font-size: 18px;
}
#status {
  color: var(--otext);
  font-weight: 700;
}
.lobby {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  padding: 40px 48px;
  align-items: start;
}
.join {
  text-align: center;
}
.join h1 {
  font-size: 40px;
}
.qr {
  display: inline-block;
  padding: 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  margin: 8px 0;
}
.qr img,
.qr canvas {
  display: block;
}
.url {
  font-size: 22px;
  font-weight: 700;
  word-break: break-all;
}
.code {
  font-size: 28px;
  letter-spacing: 4px;
  color: var(--otext);
}
.who h2 {
  font-size: 34px;
}
.names {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
  min-height: 60px;
}
.name {
  background: var(--card);
  border-left: 5px solid var(--orange);
  padding: 10px 16px;
  font-size: 22px;
  font-weight: 600;
  border-radius: 6px;
}
.lobby-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.lobby-actions .big {
  width: auto;
  padding: 16px 48px;
  font-size: 24px;
  margin: 0;
}
.host-q {
  padding: 28px 48px 140px;
  max-width: 1500px;
  margin: 0 auto;
}
.host-q h1 {
  font-size: 40px;
}
.host-q .part {
  font-size: 16px;
}
.host-q .prompt {
  font-size: 22px;
}
.items {
  font-size: 20px;
  line-height: 1.4;
  columns: 2;
  column-gap: 40px;
}
.items li {
  break-inside: avoid;
  margin-bottom: 10px;
  list-style: none;
}
.answered {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 22px;
  margin: 20px 0;
}
.ab {
  width: 360px;
  height: 16px;
  background: #e9e5dc;
  border-radius: 8px;
  overflow: hidden;
}
.af {
  height: 100%;
  background: var(--blue);
  transition: width 0.3s;
}
.big-hint {
  font-size: 22px;
  margin-top: 40px;
}
.host-q .results {
  font-size: 20px;
}
.host-q .hb-t {
  height: 34px;
}
.host-q .histo {
  height: 320px;
}
.host-q .hx {
  font-size: 14px;
}
.host-q .note {
  font-size: 17px;
}
.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 32px;
  background: #fff;
  border-top: 2px solid var(--card);
  flex-wrap: wrap;
}
.controls select {
  font: inherit;
  padding: 9px;
  border: 2px solid var(--gray);
  border-radius: 10px;
  max-width: 340px;
}
.spacer {
  flex: 1;
}
@media (max-width: 700px) {
  .pair {
    grid-template-columns: 1fr;
  }
  .hb {
    grid-template-columns: 1fr auto;
  }
  .hb-l {
    grid-column: 1 / -1;
  }
  .histo {
    height: 150px;
  }
}
