body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  --av-border: 2.5px;
}

button {
  font: 700 1.2rem var(--body);
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 16px 22px;
  cursor: pointer;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  touch-action: manipulation;
  transition:
    transform 0.08s,
    box-shadow 0.08s;
}
button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}
button.primary {
  font: 1.35rem var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--accent);
}
button:disabled {
  opacity: 0.45;
  box-shadow: none;
  transform: none;
}

/* ---------- Join ---------- */
#join {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 24px 0;
}
#join h1 {
  font-size: min(2.6rem, 9.5vw); /* fits a 320px-wide phone */
  align-self: center;
  margin: 0 0 18px;
  box-shadow: 7px 7px 0 var(--accent);
}
#join label {
  display: block;
  font: 700 0.9rem var(--body);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#join input {
  display: block;
  margin-top: 8px;
  font: 1.8rem var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 16px;
  width: 100%;
  outline: none;
}
#join input::placeholder {
  color: #c9bea6;
}
#join input:focus {
  box-shadow: 4px 4px 0 var(--blue);
}
#join-error {
  color: var(--bad-ink);
  text-align: center;
  font-weight: 700;
  min-height: 1.5em;
  margin: 0;
}

/* ---------- Game frame ---------- */
#game {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
#me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 12px;
  margin-bottom: 4px;
  font: 700 1.1rem var(--body);
  color: var(--frame-text);
  border-bottom: 3px solid var(--frame-text);
}
#me .score {
  margin-left: auto;
  font: 1rem var(--display);
  background: var(--accent);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--frame-shadow), var(--frame-ring);
  padding: 3px 8px;
  white-space: nowrap;
}
#screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 8px 4px 24px 0;
  text-align: center;
}
#screen h2 {
  font: 2rem/1.1 var(--display);
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere; /* "MMMMMMMMMMMM IS DRAWING!" on a 320px phone */
}
#screen p {
  color: var(--muted);
  font: 500 1.1rem var(--body);
  margin: 0;
  overflow-wrap: anywhere;
}
.big-icon {
  font-size: 4.2rem;
  line-height: 1;
  color: var(--ink);
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px;
  align-self: center;
  display: grid;
}
.avatar {
  --size: 64px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-content: center;
  font-size: calc(var(--size) * 0.6);
  line-height: 1;
  flex: none;
  margin: 0 auto;
}
#screen > .avatar {
  --av-border: 3px;
  box-shadow: 5px 5px 0 var(--ink);
}
#me .avatar {
  margin: 0;
}
/* A 12-letter name must not push the score and Leave button off a 320px screen. */
#me .me-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#me .team-tag {
  flex: none;
}
@media (max-width: 360px) {
  #me .team-tag .tt-name {
    display: none;
  }
}

/* ---------- Answer buttons ---------- */
.answers {
  display: grid;
  gap: 14px;
  flex: 1;
  grid-auto-rows: 1fr;
}
.answers button {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: var(--c);
  font-size: 1.2rem;
  min-height: 72px;
  padding: 12px 16px 12px 12px;
}
.answers .letter {
  flex: none;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-content: center;
  font: 1.3rem var(--display);
}
.locked {
  font: 6.5rem var(--display);
  width: 160px;
  height: 160px;
  margin: 0 auto;
  display: grid;
  place-content: center;
  background: var(--c);
  color: var(--ink);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

/* ---------- Result ---------- */
.result-good h2 {
  color: var(--good-ink);
}
.result-bad h2 {
  color: var(--bad-ink);
}
.result-good .big-icon {
  background: var(--good);
}
.result-bad .big-icon {
  background: var(--bad);
}
.result-good,
.result-bad {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.gain-big {
  font: 2.6rem var(--display);
  align-self: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 4px 16px;
}

/* ---------- Wager ---------- */
.wager-amount {
  font: 3.2rem var(--display);
  color: var(--ink);
  align-self: center;
  min-width: 60%;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 4px 16px;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--ink);
  height: 40px;
}
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.quick button {
  padding: 12px;
  font-size: 1rem;
}

#offline {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bad);
  color: var(--ink);
  font: 700 0.95rem var(--body);
  padding: 6px 16px;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 20;
}

/* ---------- Join: animals ---------- */
#avatar-section {
  display: grid;
  gap: 14px;
}
.label-text {
  font: 700 0.9rem var(--body);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 500;
}
#avatars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 4px 4px 0;
}
.animal {
  aspect-ratio: 1;
  padding: 0;
  font-size: 2.4rem;
  background: color-mix(in srgb, var(--c) 30%, #fff);
  color: var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  display: grid;
  place-items: center;
}
.animal.chosen {
  background: var(--c);
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.animal:disabled {
  opacity: 0.2;
}
.animal .icon {
  width: 62%;
  height: 62%;
}

/* ---------- Lobby ---------- */
.next-game {
  font: 1.3rem var(--display);
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 14px;
  align-self: center;
}
.game-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.game-option {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  font-size: 1rem;
}
.game-option .g-emoji {
  font-size: 2.4rem;
}
.game-option.selected {
  background: var(--accent);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.g-emoji {
  font-size: 2.2rem;
  line-height: 1;
  color: var(--ink);
  display: grid;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
}
.toggle b {
  font-weight: 700;
}
.toggle small {
  display: block;
  font: 500 0.9rem var(--body);
  color: var(--muted);
}
.toggle > span:nth-child(2) {
  flex: 1;
}
.switch {
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: #e9dfc8;
  border: 2.5px solid var(--ink);
  position: relative;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--ink);
  box-sizing: border-box;
  transition: transform 0.2s;
}
.toggle.on .switch {
  background: var(--good);
}
.toggle.on .switch::after {
  transform: translateX(22px);
}
.start {
  font-size: 1.6rem !important;
}

/* ---------- Shared bits ---------- */
#screen h2.small {
  font-size: 1.5rem;
}
#screen h2.good {
  color: var(--good-ink);
}
.icon-btn {
  padding: 9px 11px;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
}
.icon-btn .icon {
  display: block;
}
.go {
  font-size: 2.6rem !important;
  padding: 24px;
  background: var(--good) !important;
}

/* ---------- Draw ---------- */
#screen:has(.phone-board) {
  justify-content: flex-start;
  gap: 14px;
}
.prompt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 10px;
}
.prompt-bar .icon-btn {
  box-shadow: 2px 2px 0 var(--ink);
}
.p-emoji {
  font-size: 2.4rem;
  line-height: 1;
  color: var(--ink);
  display: grid;
}
.prompt-bar .icon-btn {
  flex: none;
}
.p-word {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
  font: 1.5rem var(--display);
  text-transform: uppercase;
  color: var(--ink);
}
.phone-board {
  width: calc(100% - 11px);
  margin: 3px 8px 5px 3px;
  aspect-ratio: 4 / 3;
  background: #fff;
  /* Outline as a shadow so the canvas's measured size (used for drawing) stays exact. */
  box-shadow:
    0 0 0 3px var(--ink),
    7px 7px 0 var(--ink);
  touch-action: none;
}
.tools {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.swatch {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--c);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.swatch.on {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  transform: scale(1.12);
}
.size {
  width: 48px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 3px 3px 0 var(--ink);
}
.size.on {
  background: var(--accent);
}
.size i {
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: var(--ink);
}
.guess-count {
  min-height: 1.4em;
}
.pics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 4px 4px 0;
}
button.pic {
  display: grid;
  justify-items: center;
  gap: 4px;
  background: #fff;
  color: var(--ink);
  padding: 14px 6px 10px;
}
.pic-emoji {
  font-size: 3.6rem;
  line-height: 1.1;
}
.pic-word {
  font: 700 0.95rem var(--body);
  color: var(--muted);
}
button.pic.wrong {
  background: color-mix(in srgb, var(--bad) 25%, #fff);
  color: var(--bad-ink);
  box-shadow: none;
  border-style: dashed;
}
button.pic:disabled:not(.wrong) {
  opacity: 0.5;
}
.hint-phone {
  font: 1.7rem var(--display);
  letter-spacing: 0.25em;
}
.guess-form {
  display: flex;
  gap: 10px;
}
.guess-form input {
  flex: 1;
  min-width: 0;
  font: 700 1.3rem var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 14px;
  outline: none;
}
.guess-form input:focus {
  box-shadow: 4px 4px 0 var(--blue);
}
.close-msg {
  min-height: 1.4em;
  color: var(--ink) !important;
  font-weight: 700 !important;
}
.close-msg:not(:empty) {
  background: var(--accent);
  border: 2.5px solid var(--ink);
  padding: 4px 10px;
  align-self: center;
}

/* ---------- Act ---------- */
.act-card {
  position: relative;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 22px 58px;
}
.act-card .icon-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--ink);
}
.act-emoji {
  font-size: 5rem;
  line-height: 1.1;
  color: var(--blue);
}
@media (max-width: 360px) {
  /* Room for the word under the read-aloud button instead of beside it. */
  .act-card {
    padding: 58px 14px 20px;
  }
}
.act-word {
  font: 1.8rem/1.1 var(--display);
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.act-hint {
  margin-top: 8px;
  font: 700 0.95rem var(--body);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.whos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* long names must not push a player off screen */
  gap: 12px;
}
.who > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--c);
  color: var(--ink);
  font-size: 0.85rem;
}
.who-emoji {
  font-size: 2.4rem;
  line-height: 1.1;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
}
.skip-btn {
  align-self: center;
}
.watching {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 700 1.1rem var(--body);
  color: var(--ink);
}
.watching .avatar {
  margin: 0;
}

/* ---------- Lobby settings + teams ---------- */
.section-label {
  font: 700 0.85rem var(--body);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  margin-bottom: -4px;
}
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.seg-btn {
  background: transparent;
  border: 0;
  border-right: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 6px;
  font-size: 1rem;
}
.seg-btn:last-child {
  border-right: 0;
}
.seg-btn:active {
  transform: none;
  box-shadow: none;
}
.seg-btn.on {
  background: var(--accent);
}
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
  justify-content: center;
}
.cat {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 0.95rem;
  border-width: 2.5px;
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
}
.cat.on {
  background: var(--accent);
}
.team-btns {
  display: flex;
  gap: 10px;
}
.team-btn {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: color-mix(in srgb, var(--t) 28%, #fff);
}
.team-btn small {
  font: 500 0.8rem var(--body);
  color: var(--ink);
}
.team-btn.mine {
  background: var(--t);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.team-btn .g-emoji {
  color: var(--ink);
}
.team-tag {
  font: 700 0.85rem var(--body);
  padding: 2px 8px;
  border: 2px solid var(--ink);
  background: var(--t);
  color: var(--ink);
  white-space: nowrap;
}
#screen:has(.seg) {
  justify-content: flex-start;
  gap: 14px;
}

/* Keep Start reachable when the lobby settings get long. */
#screen:has(.seg) .start {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 1;
}

/* ---------- Trivia: vote + huddle ---------- */
.votes {
  display: grid;
  gap: 14px;
}
.vote-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.3rem;
  text-align: left;
  background: color-mix(in srgb, var(--c) 30%, #fff);
  padding: 14px;
}
.vote-btn .vote-emoji {
  font-size: 2.2rem;
  line-height: 1;
  color: var(--ink);
  background: var(--c);
  border: 2.5px solid var(--ink);
  padding: 6px;
  display: grid;
}
.vote-btn > span:nth-child(2) {
  flex: 1;
}
.vote-btn.mine {
  background: var(--c);
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.vote-btn.mine .vote-emoji {
  background: #fff;
}
.check {
  font-size: 1.6rem;
  color: var(--ink);
  display: grid;
}
.huddle-msg {
  color: var(--ink) !important;
  font-weight: 700 !important;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 6px 12px;
  align-self: center;
}
.answers button.mine {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}
.answers .txt {
  flex: 1;
}
.mates {
  display: flex;
  gap: 4px;
}
.mate {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  font-size: 1.2rem;
  color: var(--ink);
  border: 2px solid var(--ink);
  overflow: hidden;
}

/* ---------- Icon helpers ---------- */
.skip-btn,
.cat,
.next-game,
.team-tag,
.huddle-msg,
.guess-count,
.close-msg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- Draw-your-own picture ---------- */
.sketch {
  position: fixed;
  inset: 0;
  z-index: 10;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.6px);
  background-size: 14px 14px;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}
.sketch-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  text-align: center;
}
.sketch-panel h2 {
  font: 1.7rem var(--display);
  text-transform: uppercase;
  margin: 0;
}
.sketch-frame {
  width: min(78vw, 320px);
  aspect-ratio: 1;
  margin: 0 auto 6px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.sketch-board {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.bg-tools {
  align-items: center;
  font: 700 0.85rem var(--body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.swatch.bg {
  border-radius: 4px;
}
.sketch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
button.ghost {
  background: var(--paper);
}
.animal.draw-tile {
  color: var(--ink);
  background: var(--paper);
  border-style: dashed;
  box-shadow: none;
}
.animal.draw-tile.has-drawing {
  border-style: solid;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.redraw {
  min-height: 44px;
  font-size: 0.95rem;
  padding: 8px 14px;
  align-self: center;
  justify-self: center;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  box-shadow: 3px 3px 0 var(--ink);
}
.who-emoji img.pic,
.mate img.pic {
  border-radius: 50%;
}

/* ---------- Selfie avatars ---------- */
.picture-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.photo-tile {
  color: var(--ink, #111);
}
.photo-hint {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}
.photo-zoom {
  width: min(78vw, 320px);
  margin: 0 auto;
  accent-color: #111;
}
.photo-view {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.cancel-photo {
  justify-self: center;
}

/* ---------- Leave / remove players ---------- */
.leave-btn {
  flex: none;
  margin-left: 4px;
  padding: 6px 8px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.1rem;
  line-height: 1;
  background: #fff;
  color: #111;
}
.pm {
  display: grid;
  gap: 8px;
}
.pm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 700;
  background: #fff;
  border: 3px solid #111;
  box-shadow: 3px 3px 0 #111;
  padding: 6px 8px;
}
.pm-row > span {
  flex: 1;
}
.pm-row .avatar {
  margin: 0;
}
.pm-row.away {
  opacity: 0.55;
}
.pm-row small {
  font-weight: 500;
}
.pm-kick {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 1rem;
  line-height: 1;
  background: #fff;
  color: #111;
  box-shadow: none;
}

/* ---------- Popular Vote ---------- */
#screen:has(.pv-form),
#screen:has(.pv-reveal-list) {
  justify-content: flex-start;
  gap: 14px;
}
.pv-phone-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pv-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 0.85rem var(--body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--ink);
  padding: 4px 10px;
}
.pv-chip.light {
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 2px 8px;
}
.pv-phone-prompt {
  font: 1.35rem/1.15 var(--display);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 16px;
  text-wrap: balance;
}
.pv-mine {
  font: 1.6rem var(--display);
  text-transform: uppercase;
  align-self: center;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 6px 16px;
  overflow-wrap: anywhere;
}
#screen p.pv-own {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--ink);
}
.pv-own b {
  background: var(--accent);
  border: 2px solid var(--ink);
  padding: 0 6px;
}
#screen p.pv-last {
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--ink);
}
.pv-last span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2.5px solid var(--ink);
  background: var(--paper);
  padding: 5px 10px;
}
.pv-last.hit span {
  background: var(--good);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.15rem;
}
.pv-last.miss span {
  background: color-mix(in srgb, var(--bad) 22%, #fff);
}
.pv-last.own span,
.pv-last.taken span {
  background: var(--accent);
}
.pv-last.bump span {
  animation: pop-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
#screen p.pv-found {
  font: 700 0.9rem var(--body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pv-hits,
.pv-reveal-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 4px 0;
  display: grid;
  gap: 8px;
}
.pv-hits li,
.pv-reveal-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 1.05rem var(--body);
  text-align: left;
  background: var(--good);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 12px;
  animation: fade-up 0.3s both;
}
.pv-hits li span,
.pv-reveal-list li span {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
}
.pv-hits li b,
.pv-reveal-list li b {
  font: 1rem var(--display);
}
.pv-reveal-list li {
  background: var(--paper);
}
.pv-reveal-list li.mine {
  background: var(--good);
}
.pv-reveal-list li.missed {
  border-style: dashed;
  box-shadow: none;
  color: var(--muted);
}
#screen p.pv-phone-kids {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Bluff ---------- */
.bluff-q {
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 14px;
}
.bluff-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 0.8rem var(--body);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 6px;
}
.bluff-q-text {
  font: 700 1.2rem/1.3 var(--body);
  color: var(--ink);
}
.blank-phone {
  display: inline-block;
  width: 4.5em;
  height: 0.95em;
  vertical-align: -0.1em;
  margin: 0 3px;
  background: var(--accent);
  border: 2.5px solid var(--ink);
}
.my-lie {
  font: 1.4rem var(--display);
  align-self: center;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 16px;
  overflow-wrap: anywhere;
}
.bluff-opts {
  display: grid;
  gap: 12px;
  padding: 0 4px 4px 0;
}
.bluff-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  font-size: 1.2rem;
  padding: 14px 16px;
  overflow-wrap: anywhere;
}
.bluff-opt.mine {
  border-style: dashed;
  background: #f1e8d4;
}
.bluff-opt small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 0.8rem var(--body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bluff-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.bluff-lines li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 700 1rem var(--body);
  color: var(--ink);
}
#screen:has(.bluff-opts) {
  justify-content: flex-start;
}
.too-close:empty {
  display: none;
}
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

/* ---------- Picture trivia (kids mode) ---------- */
.answers.art-answers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.answers button.art-btn {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-align: center;
  background: var(--paper);
  border-top: 12px solid var(--c);
  padding: 10px 8px;
  font-size: 1.05rem;
}
.answers button.art-btn .letter {
  display: none;
}
.art-btn .art,
.answer-art .art,
.locked-art .art {
  /* Two pictures side by side must fit a 320px phone. */
  width: min(128px, 30vw);
  height: min(128px, 30vw);
  font-size: min(104px, 24vw);
}
.art-btn .art-swatch,
.answer-art .art-swatch,
.locked-art .art-swatch {
  width: min(104px, 24vw);
  height: min(104px, 24vw);
}
.answers button.art-btn .txt {
  flex: none;
  font-weight: 700;
}
.locked.locked-art {
  display: grid;
  place-items: center;
  background: var(--paper);
}
.answer-art {
  display: grid;
  place-items: center;
}

/* ---------- Night Heist ----------
   Always shown in the "After Hours" theme: the colors come from its tokens
   (--ah-*, see public/themes/after-hours.css). */
.hx-status {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font: 0.95rem var(--display);
  text-transform: uppercase;
  color: var(--accent);
  background: #141c36;
  border: 2.5px solid var(--ah-line);
  padding: 8px 12px;
}
.hx-status-icon {
  display: grid;
  font-size: 1.5rem;
}
.hx-where {
  margin-left: auto;
  font: 700 0.8rem var(--body);
  letter-spacing: 0.08em;
  color: var(--ah-muted);
}
/* In the van: the status bar turns into caution tape. */
.hx-status.caught {
  color: #111;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 16px, #111 16px 32px);
  border-color: #111;
}
.hx-status.caught b,
.hx-status.caught .hx-where {
  background: var(--accent);
  color: #111;
  padding: 2px 8px;
}
.hx-status.caught .hx-status-icon {
  background: var(--accent);
  padding: 2px;
}
.hx-status b {
  font-weight: 400;
}
.hx-mini-q {
  margin: 0;
  text-align: left;
  font: 500 1.05rem/1.3 var(--body);
  color: var(--ah-text);
  opacity: 0.85;
}
.hx-center {
  display: grid;
  justify-items: center;
  gap: 16px;
}
/* Laser pad */
.hx-laser-how {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700 !important;
}
.hx-swatch {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #05070f;
}
.hx-swatch.safe {
  background: var(--ah-neon);
  box-shadow: 0 0 8px rgba(61, 255, 176, 0.7);
}
.hx-swatch.laser {
  background: var(--ah-alarm);
  box-shadow: 0 0 8px rgba(255, 59, 92, 0.7);
}
.hx-pad-wrap {
  position: relative;
  width: min(100%, 52dvh);
  align-self: center;
}
.hx-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 7px;
  background: #05070f;
  border: 2px solid var(--ah-line);
  box-shadow: 5px 5px 0 #000;
  touch-action: none;
}
.hx-tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  padding: 0;
  border: 1.5px solid #1d2a47;
  border-radius: 2px;
  background: #121a30;
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  color: #05070f;
}
.hx-tile:active {
  transform: none;
  box-shadow: none;
}
.hx-tile.safe {
  background: var(--ah-neon);
  box-shadow: 0 0 18px rgba(61, 255, 176, 0.8);
}
.hx-tile.laser {
  background: var(--ah-alarm);
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.9);
}
.hx-tile.laser::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  top: 0;
  height: 3px;
  background: #fff;
  box-shadow: 0 0 8px 2px #fff8;
  animation: hx-scan 0.5s linear infinite;
}
@keyframes hx-scan {
  to {
    top: 100%;
  }
}
.hx-tile.hit {
  outline: 4px solid #fff;
  outline-offset: -4px;
}
.hx-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font: 6rem var(--display);
  color: var(--accent);
  text-shadow: 0 0 20px rgba(255, 210, 63, 0.6);
  pointer-events: none;
}
.hx-laser-score {
  font: 700 1.1rem var(--body);
  color: var(--ah-text);
}
.hx-laser-score b {
  font: 700 1.6rem 'JetBrains Mono', monospace;
  color: var(--ah-neon);
  text-shadow: 0 0 10px var(--ah-neon);
}
/* Loot bags */
.hx-bag-btns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 0 4px 4px 0;
}
.hx-bag-btn {
  grid-column: span 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: #c9a227;
  background-image: radial-gradient(ellipse at 50% 20%, #ffe58a, #c9a227 70%);
  border-color: #000;
  border-radius: 22px 22px 6px 6px;
  box-shadow: 4px 4px 0 #000, 0 0 18px rgba(255, 210, 63, 0.25);
  font-size: 1.6rem;
}
.hx-bag-btn:nth-child(4) {
  grid-column: 2 / span 2;
}
.hx-bag-btn b {
  font: 2rem/1 var(--display);
}
.hx-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}
.hx-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.hx-bag-big {
  align-self: center;
  display: grid;
  justify-items: center;
  font-size: 3.6rem;
  background-image: radial-gradient(ellipse at 50% 20%, #ffe58a, #c9a227 70%);
  color: var(--ink);
  border: 3px solid #000;
  border-radius: 32px 32px 8px 8px;
  box-shadow: 5px 5px 0 #000, 0 0 30px rgba(255, 210, 63, 0.35);
  padding: 14px 30px;
}
.hx-bag-big b {
  font: 3.4rem/1 var(--display);
}
/* Alibis: dark glass cards */
.hx-ballots {
  display: grid;
  gap: 14px;
  padding: 0 4px 4px 0;
}
.hx-ballot {
  text-align: left;
  display: grid;
  gap: 8px;
  background: var(--ah-glass);
  color: var(--ah-text);
  border: 2px solid var(--ah-line);
  box-shadow: 4px 4px 0 #000;
  padding: 10px 12px 12px;
}
.hx-ballot-who {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hx-ballot-who .avatar {
  margin: 0;
}
.hx-ballot q {
  font: 700 1.15rem/1.3 var(--body);
  overflow-wrap: anywhere;
}
.hx-ballot-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hx-ballot-btns button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 1rem;
  box-shadow: 3px 3px 0 #000;
}
.hx-ballot-btns button.on.yes {
  background: var(--accent);
}
.hx-ballot-btns button.on.no {
  background: var(--ah-alarm);
  color: #fff;
}
#screen:has(.hx-ballots),
#screen:has(.hx-bag-btns) {
  justify-content: flex-start;
}
.guess-form.hx-alibi-form {
  flex-direction: column;
  align-items: stretch;
}
/* Getaway track: a dark road with you on it. */
.hx-track {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  background: #121a30;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000, 0 0 0 2px var(--ah-ring);
  background-image: linear-gradient(90deg, #ffd23f80 50%, transparent 50%);
  background-size: 16px 2px;
  background-repeat: repeat-x;
  background-position: 0 50%;
}
.hx-track span {
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: var(--accent);
}
.hx-track .back {
  background: #2a0610aa;
}
.hx-track .goal {
  filter: drop-shadow(0 0 6px rgba(255, 210, 63, 0.8));
}
.hx-track .you {
  color: #111;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 210, 63, 0.6);
}
