/* «Joking Hazard»: a step of a round on the big screen, one look on the shared screen (/tv/) and on a PC player's stage
   (owner 2026-10-29: «версии некоторых экранов в ПК и ТВ почти не отличаются» → one code for both, after
   meme-stage.css and the others). The markup and the moving part are shared/client/jh-stage.ts. The page supplies the
   palette (--light-card, --light-ink, --tv-line, --accent, --accent-ink, --gold, --text-primary, --text-secondary,
   --jh-red) and the cuts (--cut-1…4, --cut-shadow).

   The strip: the round's comic as three panels on white cut cards with the ink frame of the printed deck, «?» for an
   ending still to come, a kicker and a title above it, the hint under it. The table: every comic on a cut card with
   a letter stamp, its three panels in a row. A PC player's comics are buttons: hover lifts the card, the pick gets
   the green edge, the others fade, its own comic carries a label. */
@keyframes jhs-cut-in { from { opacity: 0; transform: translateY(-26px) rotate(-5deg) scale(1.06); } }

.jhs-root:not(.tv-view) { display: flex; }
.jhs-root { flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.jhs-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.jhs-kicker {
    margin: 0; padding: 5px 14px; border-radius: 999px; font-family: var(--font-display, inherit); font-size: 15px; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent);
}
.jhs-kicker:empty { display: none; }
.jhs-kicker.is-red { background: var(--jh-red, #e53945); color: #fff; }
.jhs-title { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 34px; font-weight: 800; line-height: 1.2; color: var(--text-primary); text-wrap: balance; }
.jhs-title .player-avatar-chip, .jhs-title .tv-title-chip { font-size: 26px; }
.jhs-hint { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-size: 24px; font-weight: 700; color: var(--text-secondary); text-align: center; text-wrap: balance; }
.jhs-hint:empty { display: none; }

/* A panel: the card's picture on a white cut card in the deck's ink frame; a red card's frame is red; «?» to come. */
.jhs-panel {
    position: relative; display: grid; place-items: center; aspect-ratio: 295 / 420; overflow: hidden;
    background: var(--light-card); border: 3px solid var(--light-ink); border-radius: var(--cut-1); box-shadow: var(--cut-shadow);
}
.jhs-panel:nth-child(3n + 2) { border-radius: var(--cut-2); }
.jhs-panel:nth-child(3n + 3) { border-radius: var(--cut-3); }
.jhs-panel.is-red { border-color: var(--jh-red, #e53945); }
.jhs-panel.is-empty { background: color-mix(in srgb, var(--light-card) 70%, transparent); border-style: dashed; border-color: color-mix(in srgb, var(--light-ink) 40%, transparent); box-shadow: none; }
.jhs-panel-mark { font-family: var(--font-display, inherit); font-weight: 800; font-size: 72px; color: color-mix(in srgb, var(--light-ink) 35%, transparent); }
.jhs-panel-image { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.jhs-panel-image.is-loaded { opacity: 1; }

/* ── The strip ── */
.jhs-strip { display: flex; justify-content: center; gap: 22px; height: 360px; }
.jhs-strip:empty { display: none; }
.jhs-strip .jhs-panel { height: 100%; animation: jhs-cut-in .6s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: calc(140ms + var(--p, 0) * 120ms); }
.jhs-strip .jhs-panel:nth-child(1) { rotate: -1.4deg; }
.jhs-strip .jhs-panel:nth-child(2) { rotate: .8deg; translate: 0 6px; }
.jhs-strip .jhs-panel:nth-child(3) { rotate: -.5deg; }

/* ── The table: the comics share the box (jh-stage.ts jhComicGrid sets --cols and --panel-h) ── */
.jhs-root[data-step="table"] .jhs-head { display: none; }
.jhs-table:empty { display: none; }
.jhs-table {
    display: grid; grid-template-columns: repeat(var(--cols, 2), max-content); justify-content: center; align-content: center;
    gap: 18px; max-width: 1200px; padding: 4px 10px 10px;
}
.jhs-comic {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px;
    background: var(--light-card); color: var(--light-ink); border: 2px solid var(--tv-line);
    border-radius: var(--cut-1); box-shadow: var(--cut-shadow); rotate: -.6deg;
    animation: jhs-cut-in .6s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: calc(180ms + var(--i, 0) * 110ms);
}
.jhs-comic:nth-child(4n + 2) { border-radius: var(--cut-2); rotate: .7deg; translate: 3px 3px; }
.jhs-comic:nth-child(4n + 3) { border-radius: var(--cut-3); rotate: -.3deg; translate: -2px -2px; }
.jhs-comic:nth-child(4n + 4) { border-radius: var(--cut-4); rotate: .5deg; translate: -3px 2px; }
.jhs-comic-row { display: flex; gap: 6px; }
.jhs-comic .jhs-panel { height: var(--panel-h, 160px); border-width: 2px; box-shadow: none; }
.jhs-comic .jhs-panel-mark { font-size: 36px; }
/* The letter: a stamp, cut too and turned the other way (as the answers' letters on /tv/). */
.jhs-comic .tv-option-letter {
    position: absolute; z-index: 1; top: -12px; left: -12px; display: grid; place-items: center; width: 42px; height: 42px;
    font-family: var(--font-display, inherit); font-size: 19px; font-weight: 800; color: var(--accent-ink); background: var(--accent);
    border-radius: 46% 54% 50% 50% / 54% 46% 54% 46%; rotate: -6deg; box-shadow: 2px 3px 0 rgb(0 0 0 / 30%);
}
.jhs-comic:nth-child(even) .tv-option-letter { rotate: 5deg; border-radius: 54% 46% 46% 54% / 46% 54% 50% 50%; }

/* ── A PC player's comics (buttons): hover lifts, the pick gets the green edge and its shadow, the rest fade; its own
   comic carries «Ваш комикс» on an ink strip and takes no vote unless the room allows it. ── */
.jhs-root button.jhs-comic { margin: 0; font-family: inherit; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, opacity .25s ease, scale .15s ease; }
.jhs-root button.jhs-comic:hover:not(:disabled) { border-color: var(--accent); box-shadow: 7px 9px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.jhs-root button.jhs-comic:active:not(:disabled) { scale: .97; }
.jhs-root button.jhs-comic:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.jhs-root button.jhs-comic:disabled { cursor: default; }
.jhs-table.is-votable button.jhs-comic:disabled { opacity: .55; }
.jhs-table.is-locked .jhs-comic:not(.is-selected) { opacity: .45; }
.jhs-comic.is-selected {
    border-color: var(--gold); border-width: 4px; box-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 45%, transparent);
    animation: jhs-stamp .26s cubic-bezier(.3, 1.45, .5, 1);
}
.jhs-comic.is-selected .tv-option-letter { background: var(--gold); color: #fff; }
.jhs-comic-label {
    position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px;
    font-size: 15px; font-weight: 700; color: #fff; background: rgb(23 25 31 / 82%); text-align: center;
}
@keyframes jhs-stamp { 0% { scale: 1; } 45% { scale: 1.04; } 100% { scale: 1; } }

/* ── Round end (reveal-results.js with `dashboard`): the line on the left, the comics on the right, each with its
   author and voters under its panels. On /tv/ (#r-box) and on a PC player's stage (#reveal-container), both with
   .qs-reveal; jh-stage.ts jhRevealLayout adds .jhs-reveal and sets the sizes. ── */
.jhs-reveal .rr-screen1 { grid-template-columns: 280px minmax(0, 1fr); column-gap: 32px; }
.jhs-reveal .rr-context { padding: 24px 26px; background: var(--light-card); border: 2px solid var(--tv-line); border-radius: var(--cut-2); rotate: -1deg; box-shadow: var(--cut-shadow); }
.jhs-reveal .rr-context-text { color: var(--light-ink); font-size: 27px; font-weight: 800; }
.jhs-reveal .rr-context-subtext { color: var(--text-secondary); }
.jhs-reveal .rr-option-image-row { grid-column: 2; align-self: center; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 18px; max-height: 580px; }
.jhs-reveal .rr-container.rr-dashboard .rr-option-image-card.rr-option-comic {
    width: var(--jh-comic-w, 420px); max-width: none; min-width: 0; border: 2px solid var(--tv-line); border-radius: var(--cut-1);
    background: var(--light-card); box-shadow: var(--cut-shadow); rotate: -.6deg;
}
.jhs-reveal .rr-option-image-card.rr-option-comic:nth-child(even) { border-radius: var(--cut-2); rotate: .7deg; }
.jhs-reveal .rr-option-comic-strip { display: flex; gap: 6px; padding: 8px 8px 0; overflow: visible; }
.jhs-reveal .rr-option-comic-strip img { flex: 1 1 0; min-width: 0; height: var(--jh-panel-h, 150px); width: auto; aspect-ratio: 295 / 420; object-fit: cover; border: 2px solid var(--light-ink); border-radius: 8px; }
.jhs-reveal .rr-option-image-info { padding: 8px 10px 10px; }
.jhs-reveal .rr-option-image-owner { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; color: var(--light-ink); }
.jhs-reveal .rr-option-image-card .rr-owner-avatar { width: 26px; height: 26px; font-size: 13px; }
.jhs-reveal .rr-option-image-voters { margin-top: 4px; font-size: 15px; color: var(--text-secondary); }
.jhs-reveal .rr-container.rr-dashboard .rr-option-image-card.rr-option-comic.rr-type-correct { border-color: var(--rp-correct); box-shadow: 6px 7px 0 color-mix(in srgb, var(--rp-correct) 45%, transparent); }
