/* lowkey party games: timed engine (charades, heads-up, taboo, five). Only timed- classes. */

/* party.css sets buttons with an invalid font shorthand; give ours the intended size */
.timed-setup .party-btn, .timed-turn .party-btn, .timed-play .party-btn, .timed-summary .party-btn, .timed-five .party-btn, .timed-end .party-btn { font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.timed-setup .party-btn.is-small, .timed-turn .party-btn.is-small, .timed-play .party-btn.is-small, .timed-five .party-btn.is-small, .timed-fh .party-btn.is-small { font-size: 1rem; font-weight: 600; }
.timed-setup .party-btn.is-big, .timed-turn .party-btn.is-big, .timed-summary .party-btn.is-big, .timed-end .party-btn.is-big { font-size: 1.25rem; }

/* setup */
.timed-resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; background: var(--box, #f5f5f7); border: 1px solid var(--box-edge, rgb(0 0 0 / .06)); border-radius: 18px; padding: .8rem 1rem; }
.timed-resume .party-btn { flex: 0 1 auto; }
.timed-team-list { display: grid; gap: .45rem; margin-bottom: .55rem; }
.timed-team-row { display: flex; align-items: center; gap: .35rem; }
.timed-team-row input { flex: 1; min-width: 0; min-height: 56px; font: inherit; font-size: 1.125rem; font-weight: 700; padding: .5rem 1.1rem; border: 0; border-radius: 99px; background: var(--box, #e1e7da); color: var(--ink, #1c2925); box-shadow: inset 0 0 0 1.5px var(--line, #b3bfac); }
.timed-team-row input:focus { outline: none; background: var(--field, #e9eee3); box-shadow: inset 0 0 0 2.5px var(--ink, #1c2925); }
.timed-team-row .party-x { flex: none; width: 44px; height: 44px; }
.timed-check input { width: 22px; height: 22px; accent-color: var(--blue-btn, #0068d6); }

/* head: round, exit, scores */
.timed-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.timed-head .party-progress { text-align: start; }
.timed-scores { justify-content: center; }
.timed-notice { text-align: center; }
.timed-host { flex: 1; display: flex; flex-direction: column; }
.timed-turn, .timed-play, .timed-five, .timed-summary, .timed-end { flex: 1; display: flex; flex-direction: column; gap: .9rem; }

/* 3-2-1 */
.timed-countdown { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 18rem; text-align: center; }
.timed-countdown .party-muted { margin: 0; font-size: 1.1rem; }
.timed-count { margin: 0; font-family: var(--display, inherit); font-size: clamp(6rem, 4rem + 14vw, 10rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* play */
.timed-timerrow { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.timed-timer { min-width: 3ch; }
.timed-card { min-height: 14rem; transition: opacity .15s ease; }
.timed-card .party-card-text { font-size: clamp(2.1rem, 1.4rem + 4vw, 3.4rem); }
.timed-card.is-paused .party-card-text { color: var(--muted, #5e5e63); font-size: 1.8rem; }
.timed-dont { margin: .35rem 0 0; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bad, #b3261e); }
html[lang="ar"] .timed-dont { text-transform: none; letter-spacing: 0; font-size: 1rem; }
.timed-banned { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.timed-play .timed-card:has(.timed-banned) { gap: .45rem; padding-block: 1rem; min-height: 0; }
.timed-banned li { font-size: clamp(1.2rem, 1.05rem + .8vw, 1.5rem); font-weight: 600; padding: .2rem .75rem; border-radius: 12px; background: var(--bad-soft, #fbe9e7); color: var(--ink, #1d1d1f); }
.timed-judge .party-btn { min-height: 76px; font-size: 1.25rem; }
.timed-skip { background: var(--box, #e1e7da); }
.timed-banned-btn { width: 100%; }

/* heads-up: full-viewport overlay, text turned for a sideways phone */
.timed-fh { position: fixed; inset: 0; z-index: 1100; background: var(--bg, #ededf0); color: var(--ink, #1d1d1f); overflow: hidden; }
.timed-fh-in { position: absolute; inset: 0; direction: ltr; }
@media (orientation: portrait) {
  .timed-fh-in { inset: auto; top: 50%; left: 50%; width: 100vh; height: 100vw; width: 100dvh; transform: translate(-50%, -50%) rotate(90deg); }
  .timed-fh.is-flip .timed-fh-in { transform: translate(-50%, -50%) rotate(-90deg); }
}
.timed-fh-halves { position: absolute; inset: 0; display: flex; }
.timed-fh-half { flex: 1; border: 0; margin: 0; padding: 0 0 1.2rem; display: flex; align-items: flex-end; justify-content: center; font-family: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.timed-fh-half.is-pass { background: color-mix(in srgb, var(--bad, #b3261e) 9%, var(--bg, #ededf0)); color: var(--bad, #b3261e); }
.timed-fh-half.is-ok { background: color-mix(in srgb, var(--good, #1a7f4b) 10%, var(--bg, #ededf0)); color: var(--good, #1a7f4b); }
.timed-fh-half:active { filter: brightness(.95); }
.timed-fh-half:disabled { opacity: .5; cursor: default; }
.timed-fh-top { position: absolute; top: .6rem; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: .5rem; pointer-events: none; }
.timed-fh-top > * { pointer-events: auto; }
.timed-fh-timer { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: center; }
.timed-fh-timer.is-low { color: var(--bad, #b3261e); }
.timed-fh-ctl { background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--line, #d2d2d7); }
.timed-fh-center { position: absolute; inset: 3.8rem 1rem 3.4rem; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center; pointer-events: none; }
.timed-fh-kicker { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--muted, #5e5e63); }
.timed-fh-word { margin: 0; font-family: var(--display, inherit); font-size: clamp(3rem, 20vmin, 8rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; text-wrap: balance; }
.timed-fh-word.is-long { font-size: clamp(2.4rem, 13vmin, 5.5rem); }
html[lang="ar"] .timed-fh-word { letter-spacing: 0; line-height: 1.4; }
.timed-fh-word.timed-count { font-size: clamp(6rem, 30vmin, 12rem); }
.timed-fh-hint { margin: 0; max-width: 34rem; font-size: 1rem; color: var(--muted, #5e5e63); }
html[lang="ar"] .timed-fh-center { direction: rtl; }
.timed-fh.is-paused .timed-fh-word { color: var(--muted, #5e5e63); }
.timed-fh-flash { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; font-size: clamp(3rem, 14vmin, 7rem); font-weight: 800; color: #fff; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.timed-fh.is-flash-ok .timed-fh-flash { opacity: 1; background: var(--good, #1a7f4b); }
.timed-fh.is-flash-pass .timed-fh-flash { opacity: 1; background: var(--bad, #b3261e); }

/* turn summary */
.timed-sum-title { margin: 0; font-family: var(--display, inherit); font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }
html[lang="ar"] .timed-sum-title { letter-spacing: 0; }
.timed-sum-pts { color: var(--good, #1a7f4b); font-variant-numeric: tabular-nums; }
.timed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.timed-item { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .6rem .55rem 1rem; border: 0; border-radius: 14px; background: var(--box, #f5f5f7); box-shadow: inset 0 0 0 1px var(--box-edge, rgb(0 0 0 / .06)); color: var(--ink, #1d1d1f); font-family: inherit; font-size: 1.1rem; font-weight: 600; line-height: 1.3; text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[dir="rtl"] .timed-item { padding: .55rem 1rem .55rem .6rem; }
.timed-item-word { overflow-wrap: anywhere; }
.timed-badge { flex: none; min-width: 5.5rem; padding: .4rem .75rem; border-radius: 999px; font-size: .92rem; text-align: center; background: var(--field, #f6f6f8); color: var(--muted, #5e5e63); box-shadow: inset 0 0 0 1px var(--line, #d2d2d7); }
.timed-item.is-got .timed-badge, .timed-item.is-banned .timed-badge { box-shadow: none; }
.timed-item.is-got .timed-badge { background: var(--good-soft, #e3f3ea); color: var(--good, #1a7f4b); }
.timed-item.is-banned .timed-badge { background: var(--bad-soft, #fbe9e7); color: var(--bad, #b3261e); }
.timed-item.is-skip .timed-item-word { color: var(--muted, #5e5e63); }

/* five */
.timed-who { margin: 0; font: 800 clamp(1.3rem, 1.1rem + 1vw, 1.7rem)/1.3 var(--display, inherit); color: var(--brick-ink, #8a2f1b); }
.timed-five-timer { font-size: clamp(4.5rem, 3rem + 8vw, 7rem); line-height: 1; }
.timed-five-actions { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; }
.timed-five-actions .party-actions { margin-top: 0; }
.timed-five-actions .party-btn.is-big { min-height: 76px; font-size: 1.25rem; }
.timed-five-pause { display: flex; justify-content: center; }
.timed-undo { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }

/* end */
.timed-end { text-align: center; align-items: stretch; }
.timed-end .party-card-kicker, .timed-end-label { margin: 0; }
.timed-winner { margin: 0; overflow-wrap: anywhere; }
.timed-board { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .4rem; }
.timed-board li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.1rem; border-radius: 14px; background: var(--box, #f5f5f7); box-shadow: inset 0 0 0 1px var(--box-edge, rgb(0 0 0 / .06)); font-size: 1.1rem; font-weight: 600; }
.timed-board li b { font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.timed-board li.is-win { box-shadow: inset 0 0 0 2px var(--good, #1a7f4b); background: var(--good-soft, #e3f3ea); }

@media (prefers-reduced-motion: reduce) { .timed-card, .timed-fh-flash { transition: none; } }
