/* Charades, Pictionary and Heads up (assets/tools/charades-pictionary-words-for-couples.js). Tokens only. */
.tool.cha .cha-idle, .tool.cha .cha-live, .tool.cha .cha-end { display: flex; flex-direction: column; gap: 12px; }
.tool.cha .cha-card { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; text-align: left; padding: 22px; outline: none; }
.tool.cha .cha-idle-card { min-height: 150px; }
.tool.cha .cha-role { font-size: 28px; line-height: 34px; font-weight: 950; letter-spacing: -.02em; color: rgb(var(--ink)); text-wrap: balance; }
.tool.cha .cha-hint { font-size: 15px; line-height: 22px; }
.tool.cha .cha-bar { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.tool.cha .cha-bar-t { flex: 1; min-width: 0; }
.tool.cha .cha-now { font-size: 17px; line-height: 22px; font-weight: 900; color: rgb(var(--ink)); }
.tool.cha .cha-pts { font-size: 14px; line-height: 20px; font-weight: 800; color: var(--link); font-variant-numeric: tabular-nums; }
.tool.cha .cha-word-card { position: relative; min-height: 220px; overflow: hidden; cursor: default; }
.tool.cha .cha-word { font-size: 44px; line-height: 50px; font-weight: 950; letter-spacing: -.02em; color: rgb(var(--ink)); text-wrap: balance; overflow-wrap: anywhere; }
.tool.cha .cha-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--surface) 14px 28px);
}
.tool.cha .cha-cover p { font-size: 20px; font-weight: 900; color: rgb(var(--ink)); }
.tool.cha .cha-btns .btn-primary { flex: 1; }
.tool.cha .cha-btns .btn-secondary { flex: 0 0 34%; }
.tool.cha .cha-pad { display: none; }
.tool.cha .cha-live.is-drawing .cha-pad { display: flex; flex-direction: column; gap: 4px; }
.tool.cha .cha-live.is-drawing .cha-word-card { min-height: 52px; padding: 0; border-radius: 26px; }
.tool.cha .cha-live.is-drawing .cha-cover { flex-direction: row; gap: 8px; }
.tool.cha .cha-live.is-drawing .cha-cover { padding: 0 16px; }
.tool.cha .cha-live.is-drawing .cha-cover p { font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tool.cha .cha-live.is-drawing .cha-word-card .cha-word { font-size: 22px; line-height: 28px; padding: 12px 20px; }
.tool.cha .cha-live.is-drawing .cha-word-card .cha-deck { display: none; }
.tool.cha .cha-canvas { width: 100%; height: max(220px, calc(100svh - 540px)); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); touch-action: none; cursor: crosshair; }
.tool.cha .cha-end-card { min-height: 160px; }
.tool.cha .cha-big { font-size: 34px; line-height: 40px; font-weight: 950; letter-spacing: -.02em; color: rgb(var(--ink)); }
.tool.cha .cha-lead { font-size: 16px; line-height: 22px; font-weight: 750; color: rgb(var(--ink) / .7); }
.tool.cha .cha-log li { padding: 10px 14px; }
.tool.cha .cha-mark { flex: none; min-width: 64px; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.tool.cha .cha-log li.is-ok .cha-mark { color: var(--link); }
.tool.cha .cha-log li.is-skip { opacity: .6; }

/* Heads up overlay: covers the screen, big word, two tap halves */
.tool.cha .cha-hu { position: fixed; inset: 0; z-index: 2147483000; background: rgb(var(--party-t)); color: #fff; display: grid; grid-template-columns: 1fr 1fr; }
.tool.cha .cha-hu[hidden] { display: none !important; }
.tool.cha .cha-hu-zone { position: relative; height: 100%; background: transparent; color: #fff; font-size: 22px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: flex-end; justify-content: center; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.tool.cha .cha-hu-pass { background: rgb(0 0 0 / .12); }
.tool.cha .cha-hu-zone:active { background: rgb(255 255 255 / .12); }
.tool.cha .cha-hu-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 48px; pointer-events: none; text-align: center; }
.tool.cha .cha-hu-word { font-size: clamp(44px, 13vw, 160px); line-height: 1.05; font-weight: 950; letter-spacing: -.02em; color: #fff; text-wrap: balance; overflow-wrap: anywhere; }
.tool.cha .cha-hu-time { font-size: clamp(28px, 6vw, 56px); font-weight: 900; color: rgb(255 255 255 / .9); font-variant-numeric: tabular-nums; min-height: 28px; }
.tool.cha .cha-hu-exit { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 48px; height: 48px; border-radius: 24px; display: grid; place-items: center; background: rgb(0 0 0 / .2); color: #fff; }
.tool.cha .cha-hu-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.tool.cha .cha-hu-flash.is-ok { background: rgb(40 200 120); }
.tool.cha .cha-hu-flash.is-skip { background: rgb(var(--party-d)); }
.tool.cha .cha-hu-flash.is-on { animation: cha-flash .45s ease-out; }
@keyframes cha-flash { 0% { opacity: .85; } 100% { opacity: 0; } }
@media (max-width: 599px) {
    .tool.cha .cha-role { font-size: 24px; line-height: 30px; }
  .tool.cha .cha-word { font-size: 38px; line-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .tool.cha .cha-hu-flash.is-on { animation: none; } }

.tool.cha .cha-word-card.is-peek .cha-cover { opacity: 0; }
.tool.cha .cha-cover { transition: opacity .12s ease; touch-action: none; user-select: none; -webkit-user-select: none; }
.tool.cha .cha-win { min-height: 0; box-shadow: var(--shadow), inset 0 0 0 2px rgb(var(--accent) / .4); }
.tool.cha .cha-hu-rot { display: none; font-size: 15px; font-weight: 800; color: rgb(255 255 255 / .7); }
@media (orientation: portrait) { .tool.cha .cha-hu-rot { display: block; } }
.tool.cha .cha-hu.is-count .cha-hu-word { font-size: clamp(80px, 30vw, 240px); }
.tool.cha .cha-hu.is-count .cha-hu-zone { pointer-events: none; opacity: .4; }
.tool.cha .cha-hu.is-count .cha-hu-rot { display: block; }
.tool.cha .cha-card p { text-wrap: pretty; }

.tool.cha .cha-game button { min-height: 42px; font-size: 14px; }
.tool.cha .cha-pens { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tool.cha .cha-pen { width: 36px; height: 36px; border-radius: 18px; background: var(--pen); box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1px rgb(var(--ink) / .15); }
.tool.cha .cha-pen[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 3px rgb(var(--accent)); }
.tool.cha .cha-pen[data-c="erase"], .tool.cha .cha-thick { width: auto; padding: 0 12px; background: var(--surface); font-size: 13px; font-weight: 850; color: rgb(var(--ink)); }
.tool.cha .cha-hu-zone span { padding: 8px 18px; border-radius: 20px; background: rgb(0 0 0 / .18); }
.tool.cha .cha-live { scroll-margin-top: calc(var(--nav-h, 80px) + 12px); }
.tool.cha .cha-hu-rot, .tool.cha .cha-hu:not(.is-count) .cha-hu-rot { display: none; }
@media (orientation: portrait) { .tool.cha .cha-hu.is-count .cha-hu-rot { display: block; } }
/* iPhone Safari cannot lock landscape: in portrait, turn the whole Heads up screen sideways so it reads on a forehead. */
@media (orientation: portrait) {
  .tool.cha .cha-hu { inset: auto; top: 0; left: 100vw; width: 100dvh; height: 100vw; transform-origin: top left; transform: rotate(90deg); }
  .tool.cha .cha-hu-word { font-size: min(16vw, 12dvh); overflow-wrap: normal; }
  .tool.cha .cha-hu.is-count .cha-hu-word { font-size: clamp(80px, 30dvh, 240px); }
  .tool.cha .cha-hu.is-count .cha-hu-rot { display: block; }
}

/* Topics sit on the first screen as one row that scrolls sideways. */
.tool.cha .cha-topics { margin: 0 -2px; }
.tool.cha .cha-topics .tool-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; gap: 6px; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tool.cha .cha-topics .tool-chips::-webkit-scrollbar { display: none; }
.tool.cha .cha-topics .tool-chips button { flex: none; min-height: 38px; padding: 0 14px; font-size: 14px; white-space: nowrap; scroll-snap-align: start; }
.tool.cha .cha-topics .tool-chips button:last-child { margin-right: 32px; }
@media (min-width: 600px) {
  .tool.cha .cha-topics .tool-chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .tool.cha .cha-topics .tool-chips button:last-child { margin-right: 0; }
}
/* Heads up: no answer pills during 3, 2, 1; a one-line tilt hint. */
.tool.cha .cha-hu.is-count .cha-hu-zone span { visibility: hidden; }
.tool.cha .cha-hu-tilt { font-size: 15px; font-weight: 800; color: rgb(255 255 255 / .75); }
.tool.cha .cha-hu-tilt[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  .tool.cha .cha-word-card { box-shadow: var(--shadow), inset 0 0 0 1.5px rgb(var(--ink) / .14); }
}
