/* «Подпиши кадр» (0.41, caption-game.js): its entry in «Игры», the start dialog and what the card adds to the hall
   game's (hall-game.css gives the card — a bottom sheet on a phone —, the countdown, the options, the board and the
   podium; write-games.css «Играю / Смотрю»). */
.cg-entry { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.cg-entry[hidden], .cg-entry-btn[hidden] { display: none; }
.cg-entry-btn { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 56px; 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; }
.cg-entry-btn:hover { border-color: rgba(229, 160, 13, .6); }
.cg-entry-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cg-entry-ico { font-size: 26px; line-height: 1; }
.cg-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-entry-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.cg-entry-go { font-size: 22px; color: var(--muted); }

body.cg-on.lobby-on .video-wrap { overflow: hidden; } /* the lobby does not scroll away under the game */
.cg-card { background: #101218; }
.cg-card .hg-body { gap: 10px; min-width: 0; }
/* The frame: letterboxed in a dark 16:9 box (a poster stands in it whole). */
.cg-frame { position: relative; margin: 0; width: 100%; height: clamp(150px, 38vh, 360px); border-radius: 11px; overflow: hidden; background: #07080b; display: flex; align-items: center; justify-content: center; }
.cg-frame img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.cg-frame.cg-small { height: clamp(120px, 26vh, 240px); }
.cg-frame.broken::after { content: '🎞️'; font-size: 40px; opacity: .4; }
.cg-prompt { padding: 10px 14px; border-radius: 11px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); font-size: 18px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.cg-ask, .cg-gask { font-size: 14.5px; font-weight: 700; }
.cg-ask small, .cg-gask small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cg-lead-p { max-width: 36ch; text-align: center; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.cg-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "input send" "left left"; gap: 4px 8px; align-items: center; }
.cg-input { grid-area: input; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .35); color: var(--text); font: inherit; font-size: 16px; } /* 16 px: no zoom on a phone */
.cg-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229, 160, 13, .2); }
.cg-send { grid-area: send; min-height: 48px; padding: 0 18px; border-radius: 11px; border: 0; background: var(--accent); color: #111; font: inherit; font-weight: 700; cursor: pointer; }
.cg-send:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cg-left { grid-area: left; justify-self: end; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cg-left.low { color: var(--bad); }
.cg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cg-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cg-opt { min-width: 0; }
.cg-opt .hg-t { min-width: 0; overflow-wrap: anywhere; }
.cg-opt.own { opacity: .62; border-style: dashed; }
.cg-own { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cg-fans { margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* The reveal: the film named, then the captions one after another, the most voted last. */
.cg-mine { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cg-mine small { font-size: 13px; color: var(--muted); }
.cg-film { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px; border-radius: 11px; border: 1px solid rgba(229, 160, 13, .45); background: rgba(229, 160, 13, .08); animation: cg-in .45s ease-out both; }
.cg-fposter { flex: none; width: 34px; aspect-ratio: 2 / 3; border-radius: 5px; overflow: hidden; background: #1a1d24; }
.cg-fposter img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-ftext { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cg-ftext small { flex-basis: 100%; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.cg-year { color: var(--muted); font-weight: 500; }
.cg-reveal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cg-rrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text pts" "who pts" "picks pts"; column-gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid transparent;
  animation: cg-in .45s ease-out both; animation-delay: calc(.3s + var(--i, 0) * .9s); }
.cg-rtext { grid-area: text; font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.cg-rwho { grid-area: who; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cg-rwho b { color: var(--accent); }
.cg-rpicks { grid-area: picks; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cg-rfans { grid-column: 1; font-size: 12.5px; color: var(--muted); } /* 0.66: the row after «Голоса» (or after «Угадали») */
/* 0.66 «угадай автора» (three voters or fewer): each other caption with the names to pick; the reveal says who saw through it */
.cg-guess { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cg-grow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cg-gtext { flex: 1 1 160px; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; color: var(--text, #fff); }
.cg-gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-gchip { min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.cg-gchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 700; }
.cg-gchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cg-rguess { grid-column: 1; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cg-rfans b { color: var(--accent); }
.cg-pts { grid-area: pts; align-self: center; font-size: 17px; color: var(--ok); font-variant-numeric: tabular-nums; }
.cg-rrow.own { box-shadow: inset 3px 0 0 var(--accent); }
.cg-rrow.sweep, .cg-rrow.prize { border-color: var(--accent); }
.cg-rrow.sweep { background: rgba(229, 160, 13, .12); }
.cg-rrow.fav { box-shadow: inset -3px 0 0 var(--accent); }
@keyframes cg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* The podium: the caption of the night with its frame. */
.cg-best { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(229, 160, 13, .35); }
.cg-best .cg-frame { height: auto; aspect-ratio: 16 / 9; }
.cg-best-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cg-best-text small { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.cg-best-text b { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.cg-best-text span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cg-fans-podium { margin-top: 10px; font-size: 13.5px; color: inherit; }
.cg-fans-podium b { color: var(--accent); }
.cg-fans-podium .me { font-weight: 700; }

@media (max-width: 760px) {
  .cg-frame { height: 28vh; }
  .cg-frame.cg-small { height: 20vh; }
  .cg-prompt { padding: 9px 12px; font-size: 16.5px; }
  .cg-opts { grid-template-columns: 1fr; }
  .cg-card .hg-btn { min-height: 44px; }
  .cg-card .hg-min { width: 44px; height: 44px; }
  .cg-best { grid-template-columns: 1fr; }
  /* The phone's keyboard is open: the sheet sits on it and fits what is left of the screen. */
  .cg-card.cg-kb { bottom: var(--cg-kb, 0px); max-height: calc(var(--cg-vh, 60vh) - 8px); padding-bottom: 10px; }
  .cg-card.cg-kb .cg-frame { height: 16vh; }
  .cg-card.cg-kb .cg-ask { display: none; }
}
@media (max-height: 520px) and (max-width: 960px) { .cg-frame { height: 34vh; } .cg-frame.cg-small { height: 26vh; } } /* a phone on its side */
@media (min-width: 1100px) { .hg-card.cg-card[data-phase] { width: min(700px, calc(100% - 20px)); } } /* the same width in every phase (hall-game.css widens a riddle's reveal) */
@media (prefers-reduced-motion: reduce) { .cg-rrow, .cg-film { animation: none; } }
