/* ใบ้คำ /maligames/charades (2026-11-08, Phase 6). The menu sits on
   minimal.css's tokens like the other inner pages; the play layer (#chPlay) is
   full screen with bold flat colours and its own type. */
.ch-page { max-width: 980px; }
.ch-page [hidden], .ch-sheet[hidden], .ch-sheet-bg[hidden], .ch-play[hidden] { display: none !important; }

/* how to play */
.ch-how .cc-body { display: flex; align-items: center; gap: 14px; }
.ch-mali { flex: none; width: 104px; height: 104px; object-fit: contain; }
.ch-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ch-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.55; }
.ch-steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pill, #111111); color: var(--pill-text, #f8f5ee); font-size: 13px; line-height: 1; margin-top: 1px; }
.ch-line p { margin: 0 0 10px; line-height: 1.55; font-size: 14.5px; }

/* categories */
.ch-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ch-cat { position: relative; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px 8px; border: 1.5px solid var(--edge, rgba(17, 17, 17, .08)); border-radius: 18px; background: var(--surface, #faf8f3); color: var(--text, #111111); font: inherit; cursor: pointer; text-align: center; transition: transform .12s ease, background-color .15s ease, border-color .15s ease; }
.ch-cat img { width: 40px; height: 40px; display: block; margin-bottom: 2px; }
.ch-cat b { font-size: 13.5px; font-weight: 800; line-height: 1.45; }
.ch-cat small { font-size: 11.5px; color: var(--muted, #6b655c); line-height: 1.4; }
.ch-cat:active { transform: scale(.97); }
.ch-cat[aria-pressed="true"] { border-color: var(--pill, #111111); background: color-mix(in srgb, #ff4b2b 12%, var(--surface, #faf8f3)); }
.ch-cat[aria-pressed="true"]::after { content: ""; position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%; background: var(--pill, #111111) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.3l2.6 2.6L13 6.4' fill='none' stroke='%23f8f5ee' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }
html[data-theme="dark"] .ch-cat[aria-pressed="true"]::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.3l2.6 2.6L13 6.4' fill='none' stroke='%231a120d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ch-cat:focus-visible { outline: 2px solid #ff4b2b; outline-offset: 2px; }

/* start bar: stays above the tab bar */
.ch-startbar { position: sticky; z-index: 5; bottom: calc(var(--bn-top, env(safe-area-inset-bottom, 0px)) + 10px); margin: 14px 0 0; padding: 10px; border-radius: 24px; background: var(--card-bg, rgba(255, 255, 255, .74)); border: 1px solid var(--edge, rgba(17, 17, 17, .08)); box-shadow: var(--hard, 0 8px 22px -16px rgba(0, 0, 0, .3)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ch-sum { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin: 0 0 8px; padding: 4px; border: 0; background: transparent; color: var(--muted, #6b655c); font: inherit; font-size: 13px; cursor: pointer; }
.ch-sum span { padding: 4px 10px; border-radius: 999px; background: var(--fill, rgba(17, 17, 17, .045)); line-height: 1.5; font-weight: 700; }
.ch-startrow { display: flex; gap: 10px; align-items: stretch; }
.ch-gear { flex: none; width: 56px; min-height: 56px; display: grid; place-items: center; border-radius: 18px; border: 1px solid var(--edge, rgba(17, 17, 17, .08)); background: var(--surface, #faf8f3); cursor: pointer; padding: 0; }
.ch-gear img { width: 30px; height: 30px; }
.ch-go { flex: 1; min-height: 56px; font-size: 19px; }

/* settings sheet */
.ch-sheet-bg { position: fixed; inset: 0; z-index: 9000; background: rgba(20, 12, 8, .45); }
.ch-sheet { position: fixed; z-index: 9001; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); max-height: 88dvh; overflow: auto; overscroll-behavior: contain; padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--surface, #faf8f3); color: var(--text, #111111); box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .35); animation: chUp .26s ease; }
@keyframes chUp { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
html.ch-sheet-on, html.ch-sheet-on body { overflow: hidden; }
.ch-sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: inherit; padding: 8px 0; }
.ch-sheet-head h2 { margin: 0; font-size: 19px; line-height: 1.4; }
.ch-x { position: relative; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--fill, rgba(17, 17, 17, .045)); cursor: pointer; }
.ch-x::before, .ch-x::after { content: ""; position: absolute; left: 13px; top: 21px; width: 18px; height: 2.5px; border-radius: 2px; background: var(--text, #111111); transform: rotate(45deg); }
.ch-x::after { transform: rotate(-45deg); }
.ch-row { padding: 12px 0; border-top: 1px solid var(--line, rgba(17, 17, 17, .08)); }
.ch-row:first-child { border-top: 0; }
.ch-row.off .ch-seg, .ch-row.off .ch-tog { opacity: .45; }
.ch-lab { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--muted, #6b655c); line-height: 1.5; }
.ch-seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--fill, rgba(17, 17, 17, .045)); }
.ch-seg button { flex: 1; min-height: 44px; padding: 0 6px; border: 0; border-radius: 12px; background: transparent; color: var(--text, #111111); font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.4; cursor: pointer; }
.ch-seg button small { font-size: .8em; margin-left: 2px; font-weight: 600; }
.ch-seg button[aria-pressed="true"] { background: var(--pill, #111111); color: var(--pill-text, #f8f5ee); }
.ch-tog { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--text, #111111); font: inherit; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; }
.ch-row > .ch-tog:first-child { margin-top: 0; }
.ch-sw { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong, rgba(17, 17, 17, .16)); transition: background-color .15s ease; }
.ch-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.ch-tog[aria-pressed="true"] .ch-sw { background: #1f9d57; }
.ch-tog[aria-pressed="true"] .ch-sw::after { transform: translateX(18px); }

/* ---------- the play layer ---------- */
html.ch-play, html.ch-play body { overflow: hidden; overscroll-behavior: none; }
.ch-play { position: fixed; inset: 0; z-index: 2147483000; height: 100vh; height: 100dvh; display: block; overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: #2f4bff; color: #fff; font-family: "Chakra Petch", Inter, "SukhumvitSet", sans-serif; transition: background-color .15s ease; }
.ch-play:focus { outline: none; }
.ch-play[data-scr="rotate"], .ch-play[data-scr="ready"] { background: #111111; color: #f3eee3; }
.ch-play[data-scr="count"] { background: #7a5cff; }
.ch-play[data-res="ok"] { background: #18a957; }
.ch-play[data-res="skip"] { background: #ff8a00; }
.ch-play[data-scr="timeup"] { background: #e5243b; }
.ch-play[data-scr="results"] { background: #f3eee3; color: #111111; touch-action: pan-y; }
.ch-scr { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: max(16px, env(safe-area-inset-top)) max(64px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(64px, env(safe-area-inset-left)); }
.ch-scr.on { display: flex; }
.ch-big { margin: 0; font-size: clamp(26px, 6.5vw, 56px); font-weight: 700; line-height: 1.45; }
.ch-small { margin: 8px 0 0; font-family: Inter, "SukhumvitSet", sans-serif; font-size: clamp(14px, 2.4vw, 19px); line-height: 1.55; opacity: .85; }
.ch-note { margin: 10px auto 0; max-width: 34em; padding: 8px 14px; border-radius: 14px; background: rgba(243, 238, 227, .12); font-family: Inter, "SukhumvitSet", sans-serif; font-size: 14px; line-height: 1.5; }
.ch-huge { margin: 0; font-size: clamp(44px, 12vw, 120px); font-weight: 700; line-height: 1.4; }

/* exit, timer, score */
.ch-exit { color: inherit; position: absolute; z-index: 3; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); cursor: pointer; }
.ch-exit::before, .ch-exit::after { content: ""; position: absolute; left: 14px; top: 22.5px; width: 20px; height: 3px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.ch-exit::after { transform: rotate(-45deg); }
.ch-play[data-scr="results"] .ch-exit { background: rgba(17, 17, 17, .08); }
.ch-top { position: absolute; z-index: 2; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0; display: none; justify-content: center; pointer-events: none; }
.ch-play.timing .ch-top { display: flex; }
.ch-timer { min-width: 64px; padding: 2px 14px; border-radius: 999px; background: rgba(0, 0, 0, .22); font-size: 26px; font-weight: 700; line-height: 1.45; font-variant-numeric: tabular-nums; text-align: center; }
.ch-play.hurry .ch-timer { background: #e5243b; animation: chPulse 1s ease-in-out infinite; }
@keyframes chPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.ch-score { position: absolute; z-index: 2; top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); font-size: 18px; font-weight: 700; line-height: 1.5; display: none; }
.ch-play.timing .ch-score { display: block; }

/* rotate prompt: a phone turning sideways */
.ch-rotate { flex-direction: column; gap: 22px; }
.ch-phone { width: 46px; height: 78px; border: 4px solid #f3eee3; border-radius: 10px; animation: chTurn 1.8s ease-in-out infinite; }
@keyframes chTurn { 0%, 20% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }

/* ready */
.ch-ready { gap: 22px; }
.ch-ready img { flex: none; width: clamp(80px, 32vh, 160px); height: auto; aspect-ratio: 1; }
.ch-ready > div { max-width: 36em; text-align: left; }

/* countdown */
.ch-count span { font-size: clamp(90px, 42vh, 240px); font-weight: 700; line-height: 1; }
.ch-count span.pop { animation: chPop .5s ease; }
@keyframes chPop { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* the word */
.ch-wordbox { position: absolute; top: max(66px, calc(env(safe-area-inset-top) + 56px)); bottom: max(18px, env(safe-area-inset-bottom)); left: max(64px, env(safe-area-inset-left)); right: max(64px, env(safe-area-inset-right)); display: flex; align-items: center; justify-content: center; }
.ch-w { width: 100%; margin: 0; padding: .22em 0; font-size: 80px; font-weight: 700; line-height: 1.5; text-align: center; word-break: normal; overflow-wrap: normal; text-wrap: balance; }
.ch-en { display: block; margin-top: .1em; font-family: Inter, sans-serif; font-size: .42em; font-weight: 700; line-height: 1.4; opacity: .82; }
.ch-side { position: absolute; top: 50%; transform: translateY(-50%); font-family: Inter, "SukhumvitSet", sans-serif; font-size: 13px; font-weight: 800; line-height: 1.4; opacity: 0; letter-spacing: .02em; }
.ch-side.l { left: max(12px, env(safe-area-inset-left)); }
.ch-side.r { right: max(12px, env(safe-area-inset-right)); }
.ch-play[data-mode="tap"] .ch-side { opacity: .55; }
.ch-flash .ch-big { font-size: clamp(54px, 14vw, 130px); }

/* results */
.ch-res { align-items: stretch; justify-content: center; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; font-family: Inter, "SukhumvitSet", sans-serif; }
.ch-res-in { width: min(760px, 100%); margin: auto; padding: 8px 0; }
.ch-res-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; text-align: left; }
.ch-res-head img { width: 84px; height: 84px; flex: none; }
.ch-res-n { margin: 0; font-family: "Chakra Petch", Inter, sans-serif; font-size: 30px; font-weight: 700; line-height: 1.4; }
.ch-res-s { margin: 0; color: #6b655c; font-size: 14.5px; line-height: 1.5; }
.ch-res-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ch-res-list li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; font-size: 15px; font-weight: 700; line-height: 1.5; }
.ch-res-list li small { font-weight: 600; opacity: .8; }
.ch-res-list li.ok { background: #18a957; color: #fff; }
.ch-res-list li.skip { background: #e4dcd3; color: #6d5f55; }
.ch-tag { padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .25); font-size: 11.5px; line-height: 1.6; }
.ch-res-list li.skip .ch-tag { background: rgba(17, 17, 17, .08); }
.ch-res-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ch-res-act .fd-btn { min-height: 52px; min-width: 160px; }

@media (prefers-reduced-motion: reduce) {
  .ch-play.hurry .ch-timer, .ch-phone, .ch-count span.pop, .ch-sheet { animation: none; }
}
@media (max-width: 380px) {
  .ch-cats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .ch-cat { min-height: 96px; padding: 8px 4px; }
  .ch-cat b { font-size: 12.5px; }
  .ch-mali { width: 84px; height: 84px; }
}
