/* Spot the Bot. Every rule here is scoped under .g-bot so it cannot leak into another game.
   Colours and the headline font come from the theme variables in style.css, so the pirate, western
   and space themes restyle these screens without any rules of their own. */

/* ---------- TV ---------- */
/* The screen fills the stage: one line across the top (the round, and the bot's running total),
   and a body that centres whatever the stage is showing. Sizes are in vh so it reads from a couch. */
.tv .g-bot.bb-tv { align-self: stretch; justify-self: stretch; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1.2vh; padding-bottom: 1.6vh; text-align: center; }
.g-bot .bb-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.g-bot .bb-top .step { font-size: 2.8vh; text-align: left; }
.g-bot .bb-rival { flex: none; display: flex; align-items: baseline; gap: 1vw; padding: 0.7vh 1.4vw; font-size: 2.4vh; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; background: var(--panel); border: 0.4vh solid var(--pink); border-radius: 99vh; }
.g-bot .bb-rival b { font-family: var(--display, 'Bungee'), 'Arial Black', sans-serif; font-size: 3.2vh; color: var(--pink); letter-spacing: 0.02em; }
.g-bot .bb-body { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6vh; }

.g-bot .bb-q { font-size: 7vh; line-height: 1.05; max-width: 88vw; color: var(--lime); text-shadow: 0.05em 0.05em 0 var(--pink); }
.g-bot .bb-q.small { flex: none; font-size: 3.6vh; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.g-bot .bb-big { font-size: 9vh; line-height: 1; max-width: 88vw; color: var(--lime); text-shadow: 0.05em 0.05em 0 var(--pink); animation: breathe 3.4s ease-in-out 0.6s infinite; }
.g-bot .bb-how { font-size: 3.6vh; line-height: 1.25; max-width: 72vw; margin-top: 1vh; }
.g-bot .bb-stat { flex: none; font-size: 3vh; font-weight: 700; color: var(--yellow); min-height: 1.3em; }
.g-bot .bb-stat b { color: var(--ink); }
.g-bot .bb-dots { margin-top: 2vh; gap: 1.4vh; }
.g-bot .bb-dots i { width: 1.8vh; height: 1.8vh; }

/* Every answer on one screen. bot.tv.js sets --cols, --rh (the most a row may take) and --fs (the type
   size) from how many answers there are; the rows then share whatever height the screen has. */
.g-bot .bb-grid { flex: 0 1 auto; min-height: 0; width: min(94vw, calc(var(--cols) * 46vw + 24vw * (2 - var(--cols)))); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, var(--rh)); align-content: center; gap: 0.9vh 1.2vw; }
.g-bot .bb-row { min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; gap: 1vw; padding: 0 1.2vw; text-align: left; background: var(--panel); border: 0.35vh solid var(--line); border-radius: 1.4vh; }
.g-bot .bb-say { flex: 1 1 0; min-width: 0; }
.g-bot .bb-text { font-size: var(--fs); font-weight: 700; line-height: 1.15; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.g-bot .bb-sus { font-size: calc(var(--fs) * 0.62); line-height: 1.2; min-height: 1.2em; margin-top: 0.2vh; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bot .bb-sus .sus { color: var(--pink); }
.g-bot .bb-sus .fun { color: var(--yellow); }
.g-bot .bb-sus .got { color: var(--lime); }
.g-bot .bb-who { flex: none; max-width: 15vw; display: flex; flex-direction: column; align-items: flex-end; font-size: calc(var(--fs) * 0.82); line-height: 1.15; }
.g-bot .bb-who b { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bot .bb-who .amt { font-family: var(--display, 'Bungee'), 'Arial Black', sans-serif; color: var(--lime); }
.g-bot .bb-row.isbot .bb-who b { padding: 0.2vh 0.8vw; border-radius: 0.8vh; background: var(--pink); color: #fff; }
.g-bot .bb-row.isbot .bb-who .amt { color: var(--pink); }

/* The vote: answers arrive one at a time (--i is the answer's place, --step the gap between two). */
.g-bot.st-vote .bb-row { animation: bb-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) calc(0.9s + var(--i) * var(--step)) both; }
@keyframes bb-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }

/* The reveal follows the vote on the same rows, so the screen does not rise in again. --s is when the
   suspicions show; --d is when a row's author shows, set per row from the server's timings. */
.tv #stage > .g-bot.st-reveal, .tv #stage > .g-bot.st-duelresult { animation: none; }
.g-bot.st-reveal .bb-sus { animation: bb-in 0.4s ease var(--s) both; }
.g-bot.st-reveal .bb-who { animation: bb-in 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) var(--d) both; }
.g-bot.st-reveal .bb-row.isbot { animation: bb-unmask 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) var(--d) forwards; }
@keyframes bb-unmask { 50% { transform: scale(1.06); } to { transform: none; border-color: var(--pink); background: color-mix(in srgb, var(--pink) 30%, var(--panel)); } }

/* Impostor duel: two answers, A and B. */
.g-bot .bb-ask { font-size: 6vh; line-height: 1.05; max-width: 90vw; color: var(--lime); text-shadow: 0.05em 0.05em 0 var(--pink); }
.g-bot .bb-ask span { text-shadow: none; }
.g-bot .bb-qs { font-size: 3vh; color: var(--muted); max-width: 80vw; }
.g-bot .bb-duel { width: min(92vw, 165vh); display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; margin-top: 2.4vh; }
.g-bot .bb-card { position: relative; min-width: 0; min-height: 24vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2vh; padding: 3.4vh 2vw 2.4vh; background: #fff; color: #170b30; border-radius: 2.4vh; box-shadow: 0 1.4vh 0 rgba(0, 0, 0, 0.3); }
.g-bot .bb-card p { font-size: 4.8vh; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.g-bot .bb-card p.long { font-size: 3.8vh; }
.g-bot .bb-tag { position: absolute; top: -1.8vh; left: 2vw; padding: 0.3vh 1.4vw; font-family: var(--display, 'Bungee'), 'Arial Black', sans-serif; font-size: 3.6vh; background: var(--yellow); color: #170b30; border-radius: 1vh; box-shadow: 0 0.5vh 0 rgba(0, 0, 0, 0.3); }
.g-bot.st-duel .bb-card:first-child { animation: fromLeft 0.6s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.g-bot.st-duel .bb-card:last-child { animation: fromRight 0.6s cubic-bezier(0.2, 1.2, 0.4, 1) 0.12s both; }

/* The duel result holds for a moment (--at, from the server), both cards shaking, then the real one is stamped. */
.g-bot.st-duelresult .bb-duel { animation: jitter 0.12s linear 0s 10; }
.g-bot .bb-card.real { outline: 0.9vh solid transparent; animation: bb-ring 0.25s ease var(--at) forwards; }
@keyframes bb-ring { to { outline-color: var(--lime); } }
.g-bot .bb-card.fake { animation: bb-fade 0.6s ease-in var(--at) forwards; }
@keyframes bb-fade { to { filter: grayscale(0.85) brightness(0.7); transform: scale(0.94); } }
.g-bot .bb-card .stamp { top: -2vh; right: 1.5vw; animation: stampIn 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) var(--at) both; } /* kept inside the card so the edge of the screen cannot clip it */
.g-bot .bb-card.fake .stamp { background: var(--pink); color: #fff; }
.g-bot .bb-card p.bb-names { font-size: 2.6vh; font-weight: 700; color: #5b4a86; animation: bb-in 0.4s ease calc(var(--at) + 0.5s) both; }

/* The verdict: the bot's total against the best human's. */
.g-bot .bb-final { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3vw; width: min(86vw, 150vh); margin-top: 2vh; }
.g-bot .bb-side { min-width: 0; display: flex; flex-direction: column; gap: 0.6vh; padding: 2.4vh 2vw; background: var(--panel); border: 0.5vh solid var(--line); border-radius: 2.4vh; }
.g-bot .bb-side.won { border-color: var(--lime); }
.g-bot .bb-side span { font-size: 3vh; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bot .bb-side span i { font-style: normal; }
.g-bot .bb-side b { font-family: var(--display, 'Bungee'), 'Arial Black', sans-serif; font-size: 8vh; line-height: 1; color: var(--lime); }

/* ---------- phone ---------- */
/* The question, and a typed answer shown back. */
.g-bot .bb-pq { font-size: 13px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bot .bb-pq.big { font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.phone.typing .g-bot .bb-pq.big { font-size: 16px; }
.g-bot .bb-mine { padding: 10px 12px; font-size: 18px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; }

/* The vote list. Up to twelve answers have to fit a small phone with no scrolling, so the rows share
   the height: --row is the most one row may take, worked out from the visible height (--vvh, kept by
   player.js) less everything above the list (144px: the bar, the padding, the heading and the
   question), and the type steps down as the list grows (bb-l, bb-m, bb-s, bb-xs, set by bot.phone.js). */
.phone #app > section.card.g-bot.bb-vote { gap: 6px; padding: 10px; }
.g-bot.bb-vote .head h2 { font-size: 17px; }
.g-bot.bb-vote .lead { font-size: 14px; }
.g-bot .bb-opts {
  --gap: 5px;
  --row: min(64px, calc((var(--vvh, 100dvh) - 144px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - (var(--n) - 1) * var(--gap)) / var(--n)));
  flex: 1 1 0; min-height: 0; display: grid; grid-auto-rows: minmax(0, var(--row)); align-content: start; gap: var(--gap);
}
.g-bot .bb-opt { min-height: 0; overflow: hidden; display: flex; align-items: center; padding: 0 10px; font: 600 16px/1.15 'Rubik', sans-serif; color: var(--ink); background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; touch-action: manipulation; outline: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.g-bot .bb-opt span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.g-bot .bb-opt:active { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 20%, var(--panel-2)); }
.g-bot .bb-opt.flagged { opacity: 0.4; text-decoration: line-through; cursor: default; }
.g-bot .bb-opt.flagged:active { border-color: var(--line); background: var(--panel-2); }
.g-bot.bb-m .bb-opt { font-size: 14px; }
.g-bot.bb-s .bb-opts { --gap: 4px; }
.g-bot.bb-s .bb-opt { font-size: 13px; line-height: 1.12; }
.g-bot.bb-xs .bb-opts { --gap: 3px; }
.g-bot.bb-xs .bb-opt { padding: 0 8px; font-size: 12px; line-height: 1.1; border-width: 1.5px; border-radius: 8px; }

/* The duel: two big answers to choose between. */
.g-bot .bb-pair { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.g-bot .bb-pick { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 8px 14px; font: 700 19px/1.2 'Rubik', sans-serif; color: #170b30; background: #fff; border-radius: 14px; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28); cursor: pointer; touch-action: manipulation; outline: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; animation: riseIn 0.4s ease backwards; }
.g-bot .bb-pick:nth-child(2) { animation-delay: 0.1s; }
.g-bot .bb-pick:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28); }
.g-bot .bb-pick b { flex: none; font-family: var(--display, 'Bungee'), 'Arial Black', sans-serif; font-size: 26px; color: #b0185f; }
.g-bot .bb-pick span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; overflow-wrap: anywhere; }
