/* «Шпион в кинозале» (0.34, spy-game.js): its entry in «Игры», the role card, the answers turn by turn, the vote,
   the caught spy's six films, the reveal (a card that turns over), the podium's rounds. Built on hall-game.css's
   .hg-* card and dialog. Emphasis = the one flat accent button; no glow, no pulse. */
.sg-entry { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.sg-entry[hidden], .sg-entry-btn[hidden] { display: none; }
.sg-entry-btn { width: 100%; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; min-height: 56px; margin-top: 8px; padding: 8px 12px; text-align: left; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; cursor: pointer; }
.hg-others > .sg-entry-btn { margin-top: 0; } /* 0.38: the dialog's grid spaces its buttons */
.sg-entry-btn:hover { border-color: rgba(229, 160, 13, .6); }
.sg-entry-ico { font-size: 26px; line-height: 1; }
.sg-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-entry-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.sg-talk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-rounds { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* 0.37: 2–5 */
.sg-rounds .hg-chip { grid-template-columns: 1fr; justify-items: center; font-size: 17px; }
body.sg-on.lobby-on .video-wrap { overflow: hidden; } /* the lobby does not scroll away under the game */

.sg-card { background: #101218; } /* opaque: the lobby's text must not show through while people read */
.sg-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sg-card .hg-label { margin: 4px 0 0; }
/* The role: the town's film, the spy's mask, the watcher's eyes */
.sg-role { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.sg-role.big { padding: 14px; }
.sg-town { border-color: rgba(229, 160, 13, .5); }
.sg-spy { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .08); }
.sg-rico { flex: none; font-size: 30px; line-height: 1; }
.sg-role.big .sg-rico { font-size: 46px; }
.sg-rposter { width: 44px; }
.sg-role.big .sg-rposter { width: 92px; }
.sg-rtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sg-rtext small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.sg-rk { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sg-rbig { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.sg-role.big .sg-rbig { font-size: 21px; }
.sg-spy .sg-rbig { color: var(--bad); }
.sg-hide { flex: none; align-self: flex-start; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.sg-veil { justify-content: center; min-height: 48px; width: 100%; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.sg-order { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 10px 3px 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 13.5px; }
.sg-chip.me { background: rgba(229, 160, 13, .16); }
.sg-num { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sg-go { align-self: center; min-height: 46px; min-width: 180px; padding: 0 26px; border: 0; border-radius: 11px; background: var(--accent); color: #111; font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; }
.sg-go:disabled { opacity: .45; cursor: default; }
.sg-go .ico { color: inherit; }
.sg-big { font-size: 19px; font-weight: 700; text-align: center; line-height: 1.3; }
.sg-red { color: var(--bad); }
/* A turn: the question, whose turn it is, the answer box */
.sg-ask { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.sg-ask.mine { flex-direction: column; align-items: stretch; gap: 8px; border-color: var(--accent); background: rgba(229, 160, 13, .1); }
.sg-askt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sg-k { font-size: 12px; font-weight: 700; color: var(--muted); }
.sg-ask.mine .sg-k { color: var(--accent); }
.sg-q { font-size: 17px; line-height: 1.3; }
.sg-said { font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.sg-form { display: flex; gap: 8px; }
.sg-input { flex: 1; min-width: 0; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--text); font: inherit; font-size: 16px; }
.sg-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sg-send { flex: none; min-height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: #111; font: inherit; font-weight: 700; cursor: pointer; }
.sg-send:disabled { opacity: .5; }
.sg-hint { color: var(--muted); font-size: 12px; }
.sg-ava { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #2a2e38; }
.sg-noava { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; font-size: 15px; }
.sg-big-ava { width: 64px; height: 64px; font-size: 26px; }
.sg-lap { display: flex; flex-direction: column; gap: 4px; }
.sg-turns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sg-t { display: flex; align-items: flex-start; gap: 9px; padding: 7px 10px; border-radius: 9px; background: rgba(255, 255, 255, .035); font-size: 14px; }
.sg-t.now { background: rgba(229, 160, 13, .12); box-shadow: inset 3px 0 0 var(--accent); }
.sg-t.next { opacity: .5; }
.sg-t.me .sg-who { color: var(--accent); }
.sg-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sg-who { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.sg-tq { color: var(--muted); font-size: 12px; }
.sg-a { font-weight: 600; overflow-wrap: anywhere; }
.sg-skip, .sg-typing { font-weight: 500; color: var(--muted); }
.sg-more summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--muted); font-size: 13px; }
.sg-talkbox { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); text-align: center; color: var(--muted); }
/* The vote: the seats as big buttons */
.sg-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.sg-seat { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 10px; text-align: left; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.sg-sname { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-weight: 600; overflow-wrap: anywhere; }
.sg-seat small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.sg-seat:hover:not(:disabled) { border-color: var(--accent); }
.sg-seat.on { border-color: var(--accent); background: rgba(229, 160, 13, .16); }
.sg-seat:disabled { cursor: default; }
.sg-seat:disabled:not(.on) { opacity: .6; }
.sg-done { align-self: center; font-weight: 700; color: var(--ok); }
.sg-pickhint { text-align: center; }
.sg-opts .sg-opt { min-height: 56px; }
.sg-othumb { flex: none; width: 34px; aspect-ratio: 2 / 3; border-radius: 5px; overflow: hidden; background: #1a1d24; }
.sg-othumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The reveal: the accused's card turns over */
.sg-flip { position: relative; min-height: 132px; perspective: 900px; }
.sg-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #1a1d25; backface-visibility: hidden; transition: transform .55s ease; text-align: center; font-size: 18px; }
.sg-back { transform: rotateY(180deg); }
.sg-flip.open .sg-front { transform: rotateY(-180deg); }
.sg-flip.open .sg-back { transform: rotateY(0deg); }
.sg-flip.spy .sg-back { border-color: var(--bad); background: #2c1b1f; color: var(--bad); }
.sg-flip.clean .sg-back { border-color: var(--line); }
.sg-banner { padding: 10px 12px; border-radius: 11px; text-align: center; font-weight: 700; font-size: 15.5px; background: rgba(255, 255, 255, .06); }
.sg-banner.sg-caught { background: rgba(62, 207, 122, .14); color: var(--ok); }
.sg-banner.sg-stolen, .sg-banner.sg-escaped { background: rgba(255, 107, 107, .12); color: var(--bad); }
.sg-spies { text-align: center; }
.sg-votes { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-vote { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12.5px; }
.sg-vote .sg-num { min-width: 20px; height: 20px; font-size: 11px; }
.sg-rounds-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.sg-card[data-phase="reveal"] .hg-board, .sg-card[data-phase="podium"] .hg-board { margin-top: 2px; }
@media (min-width: 1100px) { .sg-card[data-phase="answer"], .sg-card[data-phase="vote"], .sg-card[data-phase="discuss"] { width: min(820px, calc(100% - 20px)); } }
@media (max-width: 760px) {
  .sg-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-role.big .sg-rposter { width: 72px; }
  .sg-go { width: 100%; }
  .sg-talk { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .sg-face { transition: none; } }
