/* «На одной волне» (0.46, wave-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; write-games.css the «Играю /
   Смотрю» buttons): the scale, the dial (an SVG semicircle: the target's zones 4 · 3 · 2, the cover, the needles with
   their owners' faces), the psychic's film picker, the clue card, the reveal's results and the podium's extras. */
.wave-entry { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.wave-entry[hidden], .wave-entry-btn[hidden] { display: none; }
.wave-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, .03); color: var(--text); font: inherit; cursor: pointer; }
.hg-others > .wave-entry-btn { margin-top: 0; } /* the dialog's grid spaces its buttons */
.wave-entry-btn:hover { border-color: rgba(229, 160, 13, .6); }
.wave-entry-ico { font-size: 26px; line-height: 1; }
.wave-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wave-entry-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }

/* The start dialog: a small dial, three lines of how to play. */
.wave-how { display: flex; justify-content: center; margin: 2px 0 8px; }
.wave-mini { width: 156px; height: auto; display: block; }
.wave-mini-ndl { stroke: #f4f6fb; stroke-width: 8; stroke-linecap: round; }
.wave-rules { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; line-height: 1.42; color: var(--text); }
.wave-rules li::marker { color: var(--accent); font-weight: 800; }

body.wave-on.lobby-on .video-wrap { overflow: hidden; } /* the lobby does not scroll away under the game */
.wave-card { background: #101218; } /* opaque: the lobby must not show through (game-cards.test.js) */
.wave-card .hg-body { gap: 12px; }
@media (min-width: 761px) { .hg-card.wave-card { width: min(620px, calc(100% - 20px)); } } /* one width through every phase (the hall game widens its reveal) */

/* The scale (the lead's card, above the dial while the psychic thinks). */
.wave-scale { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px 10px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.wave-scale-e { font-size: 26px; line-height: 1; }
.wave-scale-l, .wave-scale-r { font-size: 17px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.wave-scale-l { color: #9cc3ff; text-align: right; }
.wave-scale-r { color: #ffab85; }
.wave-scale-x { color: var(--muted); font-size: 18px; }
.wave-lead { gap: 12px; padding: 20px 6px 16px; }
.wave-lead .wave-scale { width: 100%; max-width: 520px; padding: 14px 16px; animation: wave-in .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.wave-lead .wave-scale-l, .wave-lead .wave-scale-r { font-size: 20px; }
.wave-psy { display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.wave-psy small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.wave-psy b { font-size: 17px; }
.wave-psy em, .wave-r-n small { font-style: normal; font-size: 11px; color: var(--accent); text-transform: uppercase; font-weight: 800; letter-spacing: .05em; }
.wave-gone { color: var(--muted); font-size: 13px; }
.wave-lead-s { font-size: 14px; color: var(--accent); font-weight: 700; }
/* The faces. */
.wave-face-h { 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(--muted); font-weight: 800; }
.wave-face-h img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wave-face-h i { font-style: normal; }
.wave-psy-f { --fs: 44px; box-shadow: 0 0 0 2px var(--accent); }
.wave-r-f { --fs: 30px; }

/* The dial. */
.wave-dial { position: relative; width: 100%; max-width: 460px; margin: 0 auto; }
.wave-svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.wave-live-dial .wave-svg { touch-action: none; cursor: grab; }
.wave-live-dial .wave-svg.dragging { cursor: grabbing; }
.wave-live-dial .wave-svg.locked { cursor: default; }
.wave-svg:focus { outline: none; }
.wave-svg:focus-visible .wave-face { stroke: var(--accent); stroke-width: 3; }
.wave-face { fill: #171b25; stroke: rgba(255, 255, 255, .12); stroke-width: 2; }
.wave-tint { pointer-events: none; } /* the two halves of the scale, flat: the cool end on the left, the warm one on the right */
.wave-tint.l { fill: rgba(156, 195, 255, .075); }
.wave-tint.r { fill: rgba(255, 171, 133, .075); }
.wave-cover, .wave-curtain { fill: url(#wave-hatch); }
.wave-curtain { stroke: rgba(255, 255, 255, .18); stroke-width: 1.5; }
.wave-q { fill: rgba(255, 255, 255, .12); font-size: 70px; font-weight: 900; text-anchor: middle; pointer-events: none; }
.wave-tick { stroke: rgba(255, 255, 255, .22); stroke-width: 2; stroke-linecap: round; }
.wave-tick.long { stroke: rgba(255, 255, 255, .42); stroke-width: 3; }
.wave-band { stroke: #171b25; stroke-width: 1.5; }
.wave-band-n { fill: #14161d; font-size: 15px; font-weight: 900; text-anchor: middle; pointer-events: none; }
.wave-hub { fill: #262b38; stroke: rgba(255, 255, 255, .2); stroke-width: 2; }
.wave-hub-e { font-size: 22px; text-anchor: middle; pointer-events: none; }
.wave-ndl-sh { stroke: rgba(8, 9, 12, .78); stroke-width: 9; stroke-linecap: round; }
.wave-ndl-ln { stroke: #f4f6fb; stroke-width: 4.5; stroke-linecap: round; }
.wave-ndl.me .wave-ndl-ln { stroke: #fff; stroke-width: 6.5; }
.wave-ndl.me .wave-ndl-sh { stroke-width: 12; }
.wave-knob { fill: var(--accent); stroke: #101218; stroke-width: 3; }
.wave-svg.locked .wave-knob { fill: var(--ok, #6fd36f); }
.wave-ndl.ghost .wave-ndl-ln { stroke: #b9b3ff; stroke-width: 3.5; stroke-dasharray: 7 6; }
.wave-ndl.ghost .wave-ndl-sh { stroke-width: 7; opacity: .55; }
.wave-ndl.ghost.me .wave-ndl-ln { stroke-width: 5; }
.wave-knob.ghost { fill: #b9b3ff; }
.wave-ndl.live .wave-ndl-ln { stroke-width: 3.2; opacity: .9; }
.wave-ndl.live.locked .wave-ndl-ln { stroke: var(--ok, #6fd36f); }
.wave-fc-ring { fill: #2a2e38; stroke: #f4f6fb; stroke-width: 2.5; }
.wave-ndl-face.me .wave-fc-ring { stroke: var(--accent); stroke-width: 3.5; }
.wave-ndl-face.live.locked .wave-fc-ring { stroke: var(--ok, #6fd36f); }
.wave-fc-i { fill: #d7dbe6; font-size: 13px; font-weight: 800; text-anchor: middle; pointer-events: none; }
.wave-pts { font-size: 18px; font-weight: 900; text-anchor: middle; fill: #fff; stroke: #0b0d12; stroke-width: 6px; paint-order: stroke; stroke-linejoin: round; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.wave-pts.z0 { fill: #9aa1b3; font-size: 15px; }
.wave-pts.z4 { fill: #7fe0ff; font-size: 21px; }
.wave-open .wave-pts { animation: wave-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.wave-stamp { position: absolute; left: 50%; top: 40%; padding: 5px 14px; border: 3px solid #7fe0ff; border-radius: 10px; color: #7fe0ff; font-size: clamp(17px, 4.6vw, 26px); font-weight: 900; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; background: rgba(16, 18, 24, .86); opacity: 0; transform: translate(-50%, -50%) rotate(-8deg); pointer-events: none; }
.wave-bull .wave-stamp { animation: wave-stamp .5s cubic-bezier(.2, 1.4, .4, 1) .1s both, wave-unstamp .4s ease-in 2.4s forwards; }
@keyframes wave-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes wave-stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1.9); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
@keyframes wave-unstamp { to { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(.92); } }
@keyframes wave-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
/* The ends of the scale under the dial. */
.wave-poles { display: flex; justify-content: space-between; gap: 12px; width: 100%; max-width: 460px; margin: -6px auto 0; }
.wave-pole { max-width: 47%; font-size: 14px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.wave-pole i { font-style: normal; opacity: .7; margin: 0 5px; }
.wave-pole-l { color: #9cc3ff; text-align: left; }
.wave-pole-r { color: #ffab85; text-align: right; }
/* The legend of the zones. */
.wave-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; font-size: 12px; color: var(--muted); }
.wave-legend-k { font-weight: 700; }
.wave-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 3px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--text); font-variant-numeric: tabular-nums; }
.wave-chip b { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--z); color: #14161d; font-size: 11px; }
.wave-legend-p { flex-basis: 100%; text-align: center; }

/* The clue card. */
.wave-clue { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(229, 160, 13, .08); border: 1px solid rgba(229, 160, 13, .38); animation: wave-in .4s ease-out both; }
.wave-clue-img { position: relative; flex: none; width: 52px; height: 78px; border-radius: 7px; overflow: hidden; background: #1d212c; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.wave-clue-img.poster-skel > img { position: absolute; inset: 0; }
.wave-clue.small { padding: 7px 10px; }
.wave-clue.small .wave-clue-img { width: 36px; height: 54px; font-size: 18px; border-radius: 5px; }
.wave-clue-text .wave-clue-img, .wave-clue-text.small .wave-clue-img { width: 44px; height: 44px; border-radius: 50%; font-size: 21px; } /* a written clue: no poster to show */
.wave-clue-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wave-clue-k { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.wave-clue-n { font-size: 21px; line-height: 1.22; overflow-wrap: anywhere; }
.wave-clue.small .wave-clue-n { font-size: 16px; }
.wave-clue-y { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
/* Waiting for the clue. */
.wave-wait { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.wave-wait-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wave-wait b { font-size: 15px; overflow-wrap: anywhere; }
.wave-wait small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.wave-dots { display: inline-flex; gap: 4px; flex: none; }
.wave-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: wave-dot 1.2s ease-in-out infinite; }
.wave-dots span:nth-child(2) { animation-delay: .15s; } .wave-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes wave-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* The psychic's picker. */
.wave-picker { display: flex; flex-direction: column; gap: 8px; }
.wave-pk { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; line-height: 1.35; }
.wave-pk b { color: var(--accent); }
.wave-pk span { color: var(--muted); }
.wave-input { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #0b0d12; color: var(--text); font: inherit; font-size: 16px; } /* 16 px: no zoom on iOS */
.wave-input[hidden] { display: none; }
.wave-input:focus { outline: none; border-color: var(--accent); }
.wave-found { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; }
.wave-found[hidden] { display: none; }
.wave-found:empty { display: none; }
.wave-found-note { padding: 8px 2px; font-size: 13px; color: var(--muted); }
.wave-flist { display: flex; flex-direction: column; gap: 4px; }
.wave-f { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 4px 8px; border-radius: 10px; border: 1px solid transparent; background: rgba(255, 255, 255, .04); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.wave-f:hover { border-color: rgba(255, 255, 255, .2); }
.wave-f:focus-visible, .wave-idea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wave-f.on { border-color: var(--accent); background: rgba(229, 160, 13, .14); }
.wave-f-img { position: relative; flex: none; width: 30px; height: 45px; border-radius: 4px; overflow: hidden; background: #1d212c; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.wave-f-img.poster-skel > img { position: absolute; inset: 0; }
.wave-f-t { display: flex; flex-direction: column; min-width: 0; }
.wave-f-t b { font-size: 14.5px; line-height: 1.25; overflow-wrap: anywhere; }
.wave-f-t small { color: var(--muted); font-size: 12px; }
.wave-ideas-k { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wave-more { min-height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; }
.wave-ideas { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.wave-idea { display: block; min-width: 0; padding: 0; border: 2px solid transparent; border-radius: 9px; background: none; cursor: pointer; }
.wave-idea.on { border-color: var(--accent); }
.wave-idea-img { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 7px; overflow: hidden; background: #1d212c; }
.wave-idea-img > img { position: absolute; inset: 0; }
.wave-idea-img i { position: absolute; inset: auto 0 0 0; z-index: 2; padding: 16px 5px 5px; font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 1.2; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .88)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wave-own-tog { align-self: flex-start; min-height: 40px; padding: 0 2px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wave-pick-note { font-size: 13px; color: var(--bad); }
.wave-pick-note:empty { display: none; }
.wave-go { align-self: center; min-width: min(280px, 100%); max-width: 100%; min-height: 50px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--accent); color: #111; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave-go:disabled { background: rgba(255, 255, 255, .1); color: var(--muted); cursor: default; }
.wave-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wave-card[data-phase="clue"] .wave-psychic { max-width: 360px; }

/* The reveal. */
.wave-card[data-phase="reveal"]:not(.wave-open) .wave-after { opacity: 0; }
.wave-open .wave-after { animation: wave-in .35s ease-out both; }
.wave-after { display: flex; flex-direction: column; gap: 8px; }
.wave-verdict { padding: 8px 12px; border-radius: 10px; font-size: 15.5px; font-weight: 800; text-align: center; }
.wave-verdict span { font-weight: 600; color: var(--text); }
.wave-verdict.bull { background: rgba(63, 184, 232, .14); color: #7fe0ff; }
.wave-verdict.sync { background: rgba(111, 211, 111, .12); color: #8fe28f; }
.wave-verdict.miles, .wave-verdict.none { background: rgba(255, 255, 255, .05); color: var(--muted); }
.wave-mine-l { text-align: center; font-size: 14px; color: var(--muted); }
.wave-mine-l.good { color: var(--text); }
.wave-mine-l .hg-plus { font-size: 18px; }
.wave-res { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wave-r { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 40px; padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.wave-r.me { box-shadow: inset 3px 0 0 var(--accent); }
.wave-r.psy { background: rgba(229, 160, 13, .08); }
.wave-r-n { font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.wave-r-z { font-size: 12.5px; color: var(--muted); text-align: right; }
.wave-r.z4 .wave-r-z { color: #7fe0ff; font-weight: 800; }
.wave-r.z3 .wave-r-z { color: #f5a372; font-weight: 700; }
.wave-r.z2 .wave-r-z { color: #f7d27a; font-weight: 700; }
.wave-r-p { min-width: 3.2em; text-align: right; font-size: 16px; font-variant-numeric: tabular-nums; }

/* The podium's extras. */
.wave-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 8px; }
.wave-x { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); animation: wave-in .4s ease-out both; }
.wave-x:nth-child(2) { animation-delay: .12s; } .wave-x:nth-child(3) { animation-delay: .24s; }
.wave-x.me { border-color: var(--accent); }
.wave-xe { font-size: 24px; line-height: 1; }
.wave-xb { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wave-xb small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wave-xb b { font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.wave-xb em { font-style: normal; font-size: 12.5px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .wave-card .hg-btn, .wave-card .hg-min, .wave-card .ga-tog, .wave-card .gseat-btn, .wave-own-tog, .wave-more { min-height: 44px; } /* phones first: 44-px targets (the hall game's are 40 / 36) */
  .wave-card .hg-min, .wave-card .ga-tog { width: 44px; }
  .wave-dial { max-width: 430px; }
  .wave-card[data-phase="clue"] .wave-psychic { max-width: 300px; }
  .wave-lead .wave-scale-l, .wave-lead .wave-scale-r { font-size: 17px; }
  .wave-scale-l, .wave-scale-r { font-size: 15.5px; }
  .wave-ideas { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* one row a page (wave-game.js: four on a phone) */
  .wave-clue-n { font-size: 18px; }
  .wave-go { width: 100%; }
  .wave-found { max-height: 32vh; }
}
@media (max-width: 480px) { /* a result row: the zone under the name */
  .wave-r { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 0; }
  .wave-r-f { grid-row: 1 / span 2; }
  .wave-r-z { grid-column: 2; grid-row: 2; text-align: left; font-size: 12px; }
  .wave-r-p { grid-column: 3; grid-row: 1 / span 2; }
  .wave-card .hg-step { white-space: nowrap; }
}
@media (max-width: 380px) {
  .wave-pole { font-size: 12.5px; }
  .wave-scale { padding: 9px 10px; gap: 4px 8px; }
  .wave-lead .wave-scale { padding: 12px 10px; }
  .wave-r { gap: 8px; padding: 5px 8px; }
}
/* Reduced motion: everything in place at once. */
@media (prefers-reduced-motion: reduce) {
  .wave-clue, .wave-x, .wave-lead .wave-scale, .wave-open .wave-after, .wave-open .wave-pts, .wave-bull .wave-stamp, .wave-dots span { animation: none !important; }
  .wave-open .wave-pts { opacity: 1; }
}
.wave-still .wave-clue, .wave-still .wave-x, .wave-still .wave-dots span { animation: none; }
.wave-still.wave-open .wave-pts { animation: none; opacity: 1; }
.wave-still.wave-bull .wave-stamp { animation: none; }
