/* Fonts are self-hosted (OFL licence, see fonts/) so pages make no third-party requests. */
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("/fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("/fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("/fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("/fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("/fonts/nunito-latin-800-normal.woff2") format("woff2"); }

:root {
  --plum: #2a1d3d;
  --plum-2: #3a2b52;
  --plum-3: #5a4776;
  --lilac: #cfc4de;
  --lilac-2: #e4dcef;
  --paper: #f4f0fa;
  --line: #8a7aa3;
  --cozy: #2f6bc0;
  --chaos: #f59e3b;
  --chaos-ink: #b5600a;
  --white: #ffffff;
  --display: "Fredoka", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--body); }
button { font: inherit; cursor: pointer; min-height: 44px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--chaos); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); margin: 0; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  background: var(--chaos);
  color: var(--plum);
}
.btn-dark { background: var(--plum); color: var(--white); }
.btn-cozy { background: var(--cozy); color: var(--white); }
.btn-ghost { background: transparent; color: inherit; border: 2px solid currentColor; }

/* Avatars: a coloured stand-in until real art is dropped into public/art/avatars. */
.avatar {
  position: relative;
  border-radius: 50%;
  background: var(--plum-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
  color: var(--white);
  text-align: center;
}
.avatar-dog { background: #7a5a3a; }
.avatar-cat { background: #5a4776; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-label { font-weight: 800; padding: 4px; line-height: 1.1; }
.avatar-sm { width: 52px; height: 52px; font-size: 11px; }
.avatar-md { width: 72px; height: 72px; font-size: 12px; }
.avatar-lg { width: 104px; height: 104px; font-size: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--plum);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 700;
  z-index: 10;
  max-width: calc(100% - 32px);
}

.art-slot {
  border: 3px dashed var(--chaos);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}
.art-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- TV ---------- */
.tv {
  min-height: 100vh;
  background: var(--plum);
  color: var(--white);
  padding: 32px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tv-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 40px; font-weight: 700; }
.brand span { color: var(--chaos); }
.muted { color: var(--lilac); }
.panel { background: var(--plum-2); border-radius: 24px; padding: 16px 24px; }
.lobby { display: flex; gap: 40px; flex-wrap: wrap; }
.code-box { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 380px; max-width: 100%; text-align: center; }
.code { font-family: var(--display); font-size: 64px; font-weight: 700; letter-spacing: 4px; color: var(--chaos); line-height: 1; }
.join-url { font-size: 24px; font-weight: 800; word-break: break-all; }
.roster { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; align-content: start; min-width: 320px; }
.seat { background: var(--plum-2); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-align: center; }
.seat { position: relative; }
.seat-remove { position: absolute; z-index: 1; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; color: var(--lilac); font-size: 26px; line-height: 1; cursor: pointer; }
.seat-remove:hover, .seat-remove:focus-visible { background: var(--plum-3); color: var(--white); }
.seat-empty { background: transparent; border: 3px dashed var(--plum-3); color: var(--lilac); min-height: 150px; justify-content: center; }
.seat-bath { opacity: 0.5; }
.reveal { display: flex; gap: 48px; align-items: center; flex: 1; flex-wrap: wrap; }
.reveal .art-slot { width: 460px; height: 460px; max-width: 100%; background: var(--plum-2); }
.reveal-copy { flex: 1; min-width: 320px; display: flex; flex-direction: column; gap: 20px; }
.kicker { font-size: 20px; font-weight: 800; color: var(--chaos); letter-spacing: 3px; }
.headline { font-family: var(--display); font-size: 60px; font-weight: 700; line-height: 1.05; }
.lede { font-size: 24px; line-height: 1.5; color: var(--lilac-2); }
.chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip { border-radius: 16px; padding: 12px 20px; font-size: 20px; font-weight: 800; }
.chip-cozy { background: var(--cozy); }
.chip-chaos { background: var(--chaos); color: var(--plum); }
.track { display: flex; flex-direction: column; gap: 12px; }
.track-head { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; }
.slots { display: grid; gap: 12px; }
.slot { height: 60px; border-radius: 14px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-weight: 800; font-size: 16px; }
.slot-cozy { border: 3px solid var(--cozy); }
.slot-chaos { border: 3px solid var(--chaos); }
.slot-cozy.filled { background: var(--cozy); }
.slot-chaos.filled { background: var(--chaos); color: var(--plum); }
.slot-power { font-size: 14px; font-weight: 700; color: var(--lilac-2); text-align: center; margin-top: 6px; }
.zoomies { display: flex; gap: 10px; align-items: center; font-weight: 700; color: var(--lilac-2); font-size: 18px; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--plum-3); }
.dot.on { background: var(--chaos); border-color: var(--chaos); }
.status { font-family: var(--display); font-size: 34px; font-weight: 600; }
.bottom { display: flex; gap: 20px; flex-wrap: wrap; }
.leaders { width: 300px; display: flex; flex-direction: column; gap: 10px; font-size: 18px; }
.leaders strong { font-size: 24px; display: block; }
.votes { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.voter { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; text-align: center; }
.tag { font-size: 14px; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.tag-wag { background: var(--cozy); color: var(--white); }
.tag-hiss { background: var(--chaos); color: var(--plum); }
.tag-wait { background: var(--plum-3); color: var(--white); }
.enacted { font-size: 22px; font-weight: 800; }
.winner { font-family: var(--display); font-size: 64px; font-weight: 700; }

/* ---------- Phone ---------- */
.phone {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  color: var(--plum);
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.phone-body { background: var(--paper); }
.phone-title { font-family: var(--display); font-size: 28px; font-weight: 700; text-align: center; }
.phone-title span { color: var(--chaos-ink); }
.small-head { font-size: 15px; font-weight: 800; color: var(--plum-3); text-align: center; }
.big-q { font-family: var(--display); font-size: 26px; font-weight: 600; text-align: center; line-height: 1.2; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 15px; }
.field input { font-size: 20px; height: 52px; padding: 0 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--white); color: var(--plum); }
.field input.code-input { font-family: var(--display); font-size: 32px; letter-spacing: 6px; text-align: center; text-transform: uppercase; }
.pet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pet { background: var(--white); border: 2px solid #e2d9ee; border-radius: 16px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--plum); font-size: 13px; font-weight: 700; }
.pet[aria-pressed="true"] { border: 3px solid var(--cozy); }
.pet:disabled { opacity: 0.4; }
.card-white { background: var(--white); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.push { margin-top: auto; }
.pick { display: flex; align-items: center; gap: 12px; background: var(--white); border: 2px solid #e2d9ee; border-radius: 18px; padding: 10px 14px; color: var(--plum); font-weight: 800; font-size: 18px; text-align: left; }
.vote-btn { border: none; border-radius: 28px; height: 120px; font-family: var(--display); font-size: 30px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.vote-btn small { font-family: var(--body); font-size: 16px; font-weight: 700; }
.vote-wag { background: var(--cozy); color: var(--white); }
.vote-hiss { background: var(--chaos); color: var(--plum); }
.rule { text-align: left; border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-height: 92px; border: 3px solid transparent; }
.rule small { font-size: 13px; font-weight: 800; letter-spacing: 2px; }
.rule span { font-family: var(--display); font-size: 22px; font-weight: 600; }
.rule-cozy { background: var(--cozy); color: var(--white); border-color: var(--cozy); }
.rule-chaos { background: var(--chaos); color: var(--plum); border-color: var(--chaos); }
.rule[aria-pressed="true"] { background: var(--white); color: var(--plum-3); border: 3px dashed var(--line); }
.rule[aria-pressed="true"] span { text-decoration: line-through; }
.role-card { background: var(--plum); color: var(--white); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.role-card .art-slot { width: 200px; height: 200px; background: var(--plum-2); font-size: 14px; }
.role-name { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1.05; }
.peek-btn { user-select: none; -webkit-user-select: none; touch-action: none; }
.waiting { text-align: center; font-size: 18px; color: var(--plum-3); font-weight: 700; padding: 24px 0; }
.note { background: var(--plum); color: var(--white); border-radius: 18px; padding: 14px 16px; font-weight: 700; }

@media (max-width: 900px) {
  .tv { padding: 24px 16px; }
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .headline { font-size: 40px; }
  .code { font-size: 56px; }
}
[hidden] { display: none !important; }
.qr { width: 200px; height: 200px; background: var(--white); border-radius: 16px; padding: 8px; image-rendering: pixelated; }
