/* Slop Telephone. Every rule here is scoped under .g-telephone 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 anything extra here. The keyframes used below
   (riseIn, labelIn, lift, flash, popIn, sway, slump) are the shared ones from style.css. */

/* ---------- phone ---------- */
/* The guess screen. These stay on screen while the keyboard is up (a ".lead" would be hidden). */
.g-telephone .t-rule { font-size: 15px; line-height: 1.25; color: var(--muted); }
.g-telephone .t-bans { display: flex; flex-wrap: wrap; gap: 6px; }
.g-telephone .t-bans span { background: var(--pink); color: #fff; font: 800 16px/1 'Rubik', sans-serif; padding: 7px 12px; border-radius: 999px; animation: popIn 0.35s ease backwards; }
.g-telephone .t-bans span:nth-child(2) { animation-delay: 0.08s; }
.g-telephone .t-bans span:nth-child(3) { animation-delay: 0.16s; }
.g-telephone #tCount.over { color: var(--pink); }

/* ---------- TV: the replay of one chain ---------- */
/* Three columns across the screen. Each is the words on top and the picture they made underneath.
   --side is one picture's width: a third of the screen, or as tall as leaves room for the words. */
.g-telephone.t-chain { --side: min(30.4vw, 58vh); width: 100%; display: grid; justify-items: center; gap: 1.2vh; text-align: center; }
.g-telephone .t-strip { display: grid; grid-template-columns: repeat(3, var(--side)); gap: 1.2vw; align-items: start; }
.g-telephone .t-col { position: relative; display: grid; gap: 1vh; min-width: 0; transition: filter 0.4s; }
.g-telephone .t-say { position: relative; height: 16.5vh; padding: 1.2vh 1vw; display: flex; flex-direction: column; justify-content: center; gap: 0.6vh; overflow: hidden; background: var(--panel); border: 0.4vh solid var(--line); border-radius: 1.8vh; }
.g-telephone .t-who { font-size: 2.1vh; line-height: 1.3; color: var(--muted); }
.g-telephone .t-ban { display: inline-block; background: var(--pink); color: #fff; font-weight: 800; padding: 0 0.5em; border-radius: 999px; }
.g-telephone .t-text { font-size: 3vh; font-weight: 800; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.g-telephone .t-text.long { font-size: 2.3vh; }
.g-telephone .t-no { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 0.45em; vertical-align: middle; border-radius: 50%; background: var(--yellow); color: #170b30; font-weight: 800; }
.g-telephone .shot { width: var(--side); border-radius: 1.8vh; box-shadow: 0 1.2vh 0 rgba(0, 0, 0, 0.3); }
.g-telephone .shot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--panel-2); }
.g-telephone .t-voters { font-size: 2.2vh; font-weight: 700; color: var(--lime); line-height: 1.25; min-height: 1.3em; }
.g-telephone .t-foot { font-size: 3vh; font-weight: 600; line-height: 1.25; min-height: 1.3em; max-width: 90vw; }
.g-telephone .t-foot b { color: var(--yellow); }

/* The replay, staged. Each column's words rise in at --say, the quoted line lands at --txt,
   and the cover lifts off the picture at --img (all three set per column by telephone.tv.js). */
.g-telephone.show .t-say { animation: riseIn 0.4s ease var(--say) both; }
.g-telephone.show .t-strip .t-text { animation: labelIn 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) var(--txt) both; }
.g-telephone.show .cover { display: grid; animation: lift 0.5s cubic-bezier(0.6, 0, 0.3, 1) var(--img) forwards; }
.g-telephone.show .t-strip .shot img { animation: flash 0.7s ease-out var(--img) backwards; }
.g-telephone.show .t-no { display: none; } /* the numbers only matter once there is a vote */

/* The end of the replay: the strip gives way to the first and last pictures, side by side and bigger. */
.g-telephone .t-ends { --side: min(37vw, 60vh); display: none; grid-template-columns: var(--side) auto var(--side); gap: 2vw; align-items: start; }
.g-telephone.ends .t-strip { display: none; }
.g-telephone.ends .t-ends { display: grid; }
.g-telephone .t-ends figure { margin: 0; display: grid; gap: 1.2vh; animation: riseIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
.g-telephone .t-ends figure:last-child { animation-delay: 0.25s; }
.g-telephone .t-ends figcaption { font-size: 2.3vh; line-height: 1.3; color: var(--muted); }
.g-telephone .t-ends .t-text { -webkit-line-clamp: 2; }
.g-telephone .t-arrow { align-self: center; font-family: var(--display, 'Bungee'), 'Arial Black', sans-serif; font-size: 12vh; line-height: 1; color: var(--pink); animation: popIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.15s both; }

/* The vote and the result reuse the strip as it stands, so nothing slides in again. */
.tv #stage > .g-telephone.vote, .tv #stage > .g-telephone.result { animation: none; }
.g-telephone.vote .t-col:not(:first-child) .t-say { border-color: var(--yellow); }
.g-telephone.vote .t-foot { animation: riseIn 0.4s ease both; }
.g-telephone.result .t-col.win .t-say { border-color: var(--lime); }
.g-telephone.result .t-col.win .shot { outline: 0.8vh solid var(--lime); }
.g-telephone.result .t-col.lose { animation: slump 0.6s ease-in 0.2s both; }
.g-telephone .stamp { top: 17vh; right: -1vw; z-index: 2; font-size: 3.6vh; }

/* A device that asked for less motion gets no animations at all (style.css), so nothing would ever
   lift the covers: leave them off. */
@media (prefers-reduced-motion: reduce) {
  .g-telephone.show .cover { display: none; }
}
