/* «Испорченный телефон» (0.46, phone-game.js): its entry in «Игры» («Творческие»), the start dialog and what the card
   adds to the hall game's (hall-game.css gives the card, the countdown, the board and the podium; draw-game.css the
   paper and the pens; write-games.css the «Играю / Смотрю» buttons). Motion: the ring of players before the game, a page
   flying in under the last one, a stamp at a chain's end, reactions floating up — none of it with reduced motion. */
.tel-entry { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.tel-entry[hidden], .tel-entry-btn[hidden] { display: none; }
.tel-entry-btn { width: 100%; display: grid; grid-template-columns: auto 1fr auto; 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 > .tel-entry-btn { margin-top: 0; } /* the dialog's grid spaces its buttons */
.tel-entry-btn:hover { border-color: rgba(229, 160, 13, .6); }
.tel-entry-ico { font-size: 26px; line-height: 1; }
.tel-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tel-entry-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.tel-entry-go { font-size: 22px; color: var(--muted); }
.tel-modes .hg-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; }
.tel-modes .hg-chip small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.tel-how { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 1.4; color: var(--text); }
.tel-how li[hidden] { display: none; }

body.tel-on.lobby-on .video-wrap { overflow: hidden; } /* the lobby does not scroll away under the game */
.tel-card { background: #101218; } /* opaque: the lobby must not show through (game-cards.test.js) */
.tel-card .hg-body { gap: 12px; position: relative; }
.tel-card .hg-kicker { white-space: nowrap; }
.tel-card .hg-step { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tel-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tel-kick { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.tel-big { font-size: 21px; font-weight: 800; line-height: 1.25; }
.tel-ask { font-size: 14px; font-weight: 700; color: var(--muted); }
.tel-ask.big { font-size: 17px; color: var(--text); }
.tel-ask small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.tel-ask.tel-fan { color: var(--accent); }
.tel-hint { font-size: 12px; color: var(--muted); }
.tel-quote { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: 18px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.tel-quote.stand { font-style: italic; font-weight: 500; color: #c9d1dc; }
.tel-quote small { font-size: 12px; font-weight: 500; font-style: normal; color: var(--muted); }
/* The faces: a picture over the person's initial. */
.tel-face { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--fs, 40px); height: var(--fs, 40px); border-radius: 50%; overflow: hidden; background: #2a2e38; color: var(--text); font-weight: 800; font-size: calc(var(--fs, 40px) * .42); }
.tel-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tel-face i { font-style: normal; }
.tel-mini { --fs: 24px; }
.tel-mid { --fs: 32px; }
.tel-proj { font-size: 13px; background: #20242d; }

/* The rules before the game: the players in a ring, a call going round it. */
.tel-lead { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; padding: 6px 2px; }
.tel-ring { --size: 168px; position: relative; width: var(--size); height: var(--size); border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .16); }
.tel-seat { --fs: 38px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--size) / -2)) rotate(calc(var(--a) * -1)); }
.tel-seat .tel-face { box-shadow: 0 0 0 2px #101218; }
.tel-seat.me .tel-face { box-shadow: 0 0 0 2px var(--accent); }
.tel-phone { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.tel-phone.big { position: static; font-size: 40px; }
.tel-signal { position: absolute; inset: -6px; border-radius: 50%; animation: tel-round 2.4s linear infinite; }
.tel-signal::after { content: ''; position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent); }
@keyframes tel-round { to { transform: rotate(360deg); } }
.tel-ltext { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tel-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.4; }
.tel-plist { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.tel-plist b { color: var(--text); font-weight: 650; }
.tel-soon { font-size: 13px; font-weight: 700; color: var(--accent); min-height: 18px; }
.tel-intro { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 8px; text-align: center; }
.tel-book { font-size: 56px; line-height: 1; animation: tel-open .7s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes tel-open { from { transform: rotateY(80deg) scale(.6); opacity: 0; } }
.tel-intro .tel-big { font-size: 28px; }
.tel-sub { font-size: 14px; color: var(--muted); }

/* A step: what to draw or to name, the paper or the field. */
.tel-task { display: flex; flex-direction: column; gap: 6px; }
.tel-film { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tel-poster { flex: none; width: 52px; height: 78px; border-radius: 7px; overflow: hidden; background: #1c2029; }
.tel-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tel-noposter { display: flex; align-items: center; justify-content: center; font-size: 26px; }
.tel-ftext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tel-ftitle { font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.tel-stage { display: flex; justify-content: center; }
.tel-paper { margin: 0 auto; }
.tel-tools .dg-act:disabled, .tel-tools .dg-sw:disabled, .tel-tools .dg-wd:disabled { opacity: .35; cursor: default; }
.tel-row { display: flex; justify-content: center; }
.tel-go { min-height: 46px; padding: 0 22px; border-radius: 11px; border: 0; background: var(--accent); color: #111; font: inherit; font-size: 15.5px; font-weight: 800; cursor: pointer; }
.tel-go .ico { color: inherit; }
.tel-go:disabled { opacity: .45; cursor: default; }
.tel-go:focus-visible, .tel-tile:focus-visible, .tel-react:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tel-donebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-weight: 700; color: #7fd18b; }
.tel-pic { position: relative; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.tel-pic canvas { display: block; width: 100%; aspect-ratio: 4 / 3; }
.tel-blank { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #1b1f27; color: #aab3c0; font-style: italic; font-size: 15px; text-align: center; padding: 10px; }
.tel-form { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.tel-input { width: 100%; min-height: 48px; padding: 10px 46px 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel, #171a21); color: var(--text); font: inherit; font-size: 16px; }
.tel-input:focus { outline: none; border-color: var(--accent); }
.tel-field { position: relative; min-width: 0; }
.tel-left { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.tel-left.low { color: #ff8a65; }
.tel-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.tel-suggest[hidden] { display: none; }
.tel-sug { min-height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.tel-sug:hover { border-color: var(--accent); }
.tel-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px; text-align: center; }
.tel-dots { display: flex; gap: 6px; }
.tel-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.tel-dots i.done { background: rgba(229, 160, 13, .55); }
.tel-dots i.now { background: var(--accent); }

/* The album: the chain's pages one under another. */
.tel-chain { display: flex; flex-direction: column; gap: 10px; }
.tel-chead { display: flex; align-items: center; gap: 10px; font-size: 16px; min-width: 0; }
.tel-chead b { overflow-wrap: anywhere; }
.tel-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tel-page { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07); }
.tel-page.tel-head { background: rgba(229, 160, 13, .08); border-color: rgba(229, 160, 13, .25); }
.tel-page + .tel-page::before { content: '↓'; position: absolute; top: -12px; left: 22px; font-size: 12px; color: var(--muted); }
.tel-pwho { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.tel-pwho > span:not(.tel-face) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tel-pn { margin-left: auto; flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(255, 255, 255, .08); color: var(--text); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tel-page .tel-pic { max-width: 520px; width: 100%; align-self: center; }
.tel-page.tel-in { animation: tel-fly .55s cubic-bezier(.2, .8, .25, 1.1) both; }
@keyframes tel-fly { from { transform: translateY(26px) scale(.94); opacity: 0; } }
.tel-card .hg-body.tel-pass { animation: tel-pass .42s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes tel-pass { from { transform: translateX(34px) rotate(1.2deg); opacity: 0; } }
.tel-reacts { display: flex; gap: 6px; }
.tel-react { min-width: 52px; min-height: 40px; padding: 0 10px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tel-react b { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tel-react:active { transform: scale(.94); }
.tel-afoot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding-top: 8px; background: #101218; }
.tel-afoot .hg-bar { flex: 1; }
.tel-turner { font-size: 13px; color: var(--muted); }
.tel-floats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tel-float { position: absolute; font-size: 26px; line-height: 1; animation: tel-float 1.6s ease-out forwards; }
@keyframes tel-float { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -14px) scale(1.15); } 100% { transform: translate(calc(-50% + var(--dx, 0px)), -150px) scale(1); opacity: 0; } }

/* A chain's end: the stamp, what it was and what it became. */
.tel-verdict { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; text-align: center; }
.tel-verdict .tel-chead { align-self: stretch; justify-content: center; }
.tel-stamp { display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; border-radius: 14px; border: 3px solid currentColor; font-size: 30px; font-weight: 900; letter-spacing: .02em; transform: rotate(-4deg); animation: tel-stamp .5s cubic-bezier(.2, .9, .3, 1.4) both; }
.tel-stamp.yes { color: #6fdc8c; }
.tel-stamp.no { color: #ff8a65; }
@keyframes tel-stamp { from { transform: rotate(-14deg) scale(1.9); opacity: 0; } 60% { opacity: 1; } }
.tel-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; width: 100%; }
.tel-compare > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); min-width: 0; }
.tel-compare > div span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tel-compare > div b { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.tel-compare > div.good { box-shadow: inset 0 0 0 1px rgba(111, 220, 140, .45); }
.tel-compare > div.bad { box-shadow: inset 0 0 0 1px rgba(255, 138, 101, .45); }
.tel-compare small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tel-arrow { font-size: 22px; color: var(--muted); }
.tel-vnotes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.tel-authors { display: flex; justify-content: center; gap: 4px; }
.tel-vbtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tel-save:disabled { opacity: .6; cursor: default; }

/* The vote: every step of every chain as a tile to tap. */
.tel-gallery { display: flex; flex-direction: column; gap: 14px; }
.tel-vchain { display: flex; flex-direction: column; gap: 8px; }
.tel-vhead { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; min-width: 0; }
.tel-vhead small { font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tel-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tel-tile { display: flex; flex-direction: column; gap: 6px; min-height: 64px; padding: 6px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tel-tile .tel-quote { padding: 8px 10px; font-size: 14.5px; }
.tel-tile:hover:not(:disabled) { border-color: rgba(229, 160, 13, .6); }
.tel-tile.on { border-color: var(--accent); background: rgba(229, 160, 13, .1); }
.tel-tile:disabled { cursor: default; }
.tel-tile.own { opacity: .55; }
.tel-tfoot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 16px; font-size: 12px; color: var(--muted); }
.tel-treacts { display: flex; gap: 6px; margin-left: auto; }
.tel-vgo { position: sticky; bottom: 0; display: flex; justify-content: center; padding: 8px 0 2px; background: #101218; }
.tel-vgo .tel-go { min-width: 180px; }
.tel-fans { font-size: 13px; color: var(--muted); }
.tel-fans .me { color: var(--accent); }

/* The funniest step. */
.tel-tally { display: flex; flex-direction: column; gap: 12px; }
.tel-tally > .tel-big { text-align: center; }
.tel-win { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.tel-win.big { background: rgba(229, 160, 13, .1); box-shadow: inset 0 0 0 2px rgba(229, 160, 13, .5); animation: tel-fly .6s cubic-bezier(.2, .8, .25, 1.1) both; }
.tel-win.big .tel-pic { max-width: 480px; width: 100%; align-self: center; }
.tel-wmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; }
.tel-wmeta small { flex-basis: 100%; color: var(--muted); }
.tel-rfans { color: var(--muted); }
.tel-rest { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tel-rest .tel-quote { font-size: 14px; padding: 8px 10px; }

/* The podium's extras: the funniest step, the chains to keep. */
.tel-psurv { font-size: 14px; font-weight: 700; text-align: center; }
.tel-pfunny { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.tel-pfunny .tel-pic { width: min(100%, 260px); }
.tel-pfunny small { color: var(--muted); }
.tel-keep ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tel-keep li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 4px 4px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.tel-keep li.me { box-shadow: inset 0 0 0 1px rgba(229, 160, 13, .4); }
.tel-kn { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tel-keep small { color: var(--muted); font-size: 12px; padding-right: 8px; }
.tel-keep .hg-btn { min-height: 40px; }

@media (max-width: 760px) {
  .tel-lead { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tel-rules { text-align: left; }
  .tel-ring { --size: 150px; margin: 18px 0 10px; }
  .tel-big { font-size: 19px; }
  .tel-compare { grid-template-columns: 1fr; }
  .tel-arrow { transform: rotate(90deg); justify-self: center; }
  .tel-tiles, .tel-rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tel-react { min-height: 44px; }
  .tel-card.tel-kb { bottom: var(--tel-kb, 0px); max-height: calc(100% - var(--tel-kb, 0px)); }
  .tel-card .hg-btn, .tel-card .hg-min, .tel-card .gseat-btn { min-height: 44px; } /* phones first: 44-px targets (the hall game's are 40 / 36) */
  .tel-card .hg-min { width: 44px; }
}
@media (max-width: 360px) { .tel-tiles, .tel-rest { grid-template-columns: 1fr 1fr; gap: 6px; } .tel-stamp { font-size: 24px; padding: 8px 16px; } }
@media (prefers-reduced-motion: reduce) {
  .tel-signal, .tel-book, .tel-page.tel-in, .tel-stamp, .tel-win.big, .tel-float, .tel-card .hg-body.tel-pass { animation: none; }
  .tel-signal { display: none; }
}
.tel-card.tel-still .tel-signal, .tel-card.tel-still .tel-book, .tel-card.tel-still .tel-stamp, .tel-card.tel-still .tel-win.big { animation: none; }
/* The card's head stays on top while the album or the vote scrolls; the card keeps its width through the phases. */
.tel-card .hg-head { position: sticky; top: -12px; z-index: 3; margin: -12px -14px 0; padding: 12px 14px 4px; background: #101218; }
@media (max-width: 760px) { .tel-card .hg-head { margin: -12px -12px 0; padding: 12px 12px 4px; } }
@media (min-width: 1100px) { .tel-card[data-phase="reveal"] { width: min(700px, calc(100% - 20px)); } .tel-card[data-phase="vote"] { width: min(820px, calc(100% - 20px)); } }
@media (min-width: 761px) { .tel-card[data-phase="draw"] { width: min(860px, calc(100% - 20px)); } } /* the paper as big as the stage allows, the pens beside it */
/* A drawing step: the prompt, the paper, the pens — on a wide card the prompt and the pens beside the paper. */
.tel-dstep { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "prompt" "paper" "side"; gap: 10px; }
.tel-dprompt { grid-area: prompt; min-width: 0; }
.tel-dstep .tel-stage { grid-area: paper; min-width: 0; }
.tel-dside { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tel-card.tel-wide .tel-dstep { grid-template-columns: minmax(0, 1fr) 236px; grid-template-areas: "paper prompt" "paper side"; grid-template-rows: auto 1fr; align-items: start; }
.tel-card.tel-wide .tel-dside .dg-tools { justify-content: flex-start; }
.tel-card.tel-wide .tel-dprompt .tel-ftitle { font-size: 17px; }
/* The drawing one names or describes: as big as leaves room for the field. */
.tel-card[data-phase="write"] .hg-body > .tel-pic { width: min(100%, calc(42vh * 4 / 3)); align-self: center; }
.tel-tmine { text-align: center; margin-top: -6px; }
.tel-tile .tel-quote { flex: 1; display: flex; align-items: center; }
