/* 끝말잇기 — lib/mini.css 위에 이 게임에만 필요한 것. 글자판이 무대 아래쪽을 가리니까 적는 칸을 맨 위에 둬요 */
.app[data-game="kkeut"] .mini-body { inset: 50px 14px calc(14px + var(--kb, 0px)); gap: 10px; justify-content: flex-start; align-items: stretch; text-align: left; }
.app[data-game="kkeut"] .live { top: 18px; font: 700 17px/1 var(--font-sans); letter-spacing: 0; color: var(--p1); }
.app[data-game="kkeut"] .stage--mini .num { font-size: 15px; color: rgb(var(--stage-ink)); }
.app[data-game="kkeut"] { --ke-me: #3FB65A; --ke-end: #F08A1C; --ke-low: #E8457A; }
/* 적는 칸 */
.ke-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; flex: none; }
.ke-in { min-width: 0; height: 52px; padding: 0 16px; border: 0; border-radius: 16px; background: rgba(var(--stage-ink), 0.07); color: rgb(var(--stage-ink)); font: 600 20px/1 var(--font-sans); outline: none; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 120ms; -webkit-appearance: none; appearance: none; }
.ke-in::placeholder { color: rgba(var(--stage-ink), 0.34); font-weight: 500; }
.ke-in:focus { box-shadow: inset 0 0 0 2px rgb(var(--stage-ink)); }
.ke-go { height: 52px; padding: 0 20px; border: 0; border-radius: 16px; background: rgb(var(--stage-ink)); color: var(--stage); font: 700 16px/1 var(--font-sans); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ke-go:active { transform: translateY(1px); }
.ke-go:focus-visible, .ke-in:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ke-form.is-shake { animation: ke-shake 300ms ease-out; }
/* 지금 이어야 할 낱말 */
.ke-now { flex: none; display: grid; justify-items: center; gap: 6px; padding: 16px 12px 14px; border-radius: 20px; background: rgba(var(--stage-ink), 0.05); text-align: center; }
.ke-now__who { font: 600 12px/1 var(--font-sans); color: var(--on-stage-muted); }
.ke-now__w { display: block; min-height: 46px; font: 800 40px/46px var(--font-sans); letter-spacing: -0.01em; color: rgb(var(--stage-ink)); word-break: keep-all; }
.ke-now__w em { font-style: normal; color: var(--ke-end); }
.ke-now__need { font: 500 14px/20px var(--font-sans); color: var(--on-stage-muted); word-break: keep-all; }
.ke-now__need b { margin-right: 1px; font-weight: 800; font-size: 16px; color: var(--ke-end); }
.ke-now.is-new .ke-now__w { animation: ke-pop 380ms var(--ease-pop, ease-out) both; }
.ke-dots { display: inline-flex; align-items: center; gap: 7px; height: 46px; }
.ke-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(var(--stage-ink), 0.4); animation: ke-dot 900ms ease-in-out infinite; }
.ke-dots i:nth-child(2) { animation-delay: 150ms; } .ke-dots i:nth-child(3) { animation-delay: 300ms; }
/* 남은 시간 */
.ke-bar { flex: none; height: 8px; border-radius: 4px; background: rgba(var(--stage-ink), 0.08); overflow: hidden; }
.ke-bar i { display: block; height: 100%; border-radius: 4px; background: var(--ke-me); transform-origin: left center; will-change: transform; }
.ke-bar i.is-low { background: var(--ke-low); }
/* 방금 한 말 */
.ke-last { flex: none; min-height: 22px; margin: 0; font: 500 14px/22px var(--font-sans); color: var(--on-stage-muted); word-break: keep-all; }
.ke-last b { font-weight: 700; color: rgb(var(--stage-ink)); }
.ke-last.is-ok b { color: var(--ke-me); }
.ke-last.is-win { color: rgb(var(--stage-ink)); }
.ke-last.is-win b { color: var(--ke-end); }
.ke-last.is-pop { animation: ke-in 260ms ease-out both; }
/* 나온 낱말: 새것부터 */
.ke-chain { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; scrollbar-width: none; }
.ke-chain::-webkit-scrollbar { display: none; }
.ke-chip { flex: none; height: 32px; padding: 0 12px; border-radius: 10px; background: rgba(var(--stage-ink), 0.06); font: 600 14px/32px var(--font-sans); color: var(--on-stage-muted); }
.ke-chip.is-me { background: color-mix(in srgb, var(--ke-me) 18%, transparent); color: rgb(var(--stage-ink)); }
.ke-chip.is-new { animation: ke-in 280ms ease-out both; }
.ke-fail { margin: auto 0 12px; text-align: center; font: 500 15px/23px var(--font-sans); color: var(--on-stage-muted); }
.app[data-game="kkeut"] #keRetry { align-self: center; margin-bottom: auto; }
@keyframes ke-in { 0% { opacity: 0; transform: translateY(6px) scale(0.97); } 100% { opacity: 1; transform: none; } }
@keyframes ke-pop { 0% { opacity: 0; transform: scale(0.86); } 60% { transform: scale(1.05); } 100% { opacity: 1; transform: none; } }
@keyframes ke-shake { 20% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }
@keyframes ke-dot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }
/* 소개 그림 */
.ke-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 6px; max-width: 200px; }
.ke-demo__w { height: 34px; padding: 0 12px; border-radius: 11px; background: rgba(var(--stage-ink), 0.07); font: 700 16px/34px var(--font-sans); color: rgb(var(--stage-ink)); }
.ke-demo__w.is-me { background: rgba(63, 182, 90, 0.22); }
.ke-demo__w em { font-style: normal; color: #F08A1C; }
.ke-demo i { font: 500 13px/1 var(--font-mono); font-style: normal; color: var(--on-stage-muted); }
/* 끝 화면 */
.app[data-game="kkeut"] .stat__v.is-word { font-size: 17px; line-height: 28px; word-break: keep-all; }
.ke-miss { display: grid; gap: 4px; margin-top: 10px; padding: 12px 16px; border-radius: var(--radius-md, 14px); background: var(--paper-raised); box-shadow: inset 0 0 0 1.5px var(--line); }
.ke-miss span { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.ke-miss b { font: 700 16px/22px var(--font-sans); color: var(--ink); word-break: keep-all; }
.ke-label { display: block; margin: 16px 0 8px; }
.ke-chain--total { --stage-ink: 18, 22, 19; overflow: visible; }
.ke-chain--total .ke-chip { background: var(--paper-raised); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-muted); }
.ke-chain--total .ke-chip.is-me { background: rgba(63, 182, 90, 0.2); box-shadow: none; color: var(--ink); }
:root[data-theme="dark"] .ke-chain--total { --stage-ink: 255, 255, 255; }
.ke-credit { margin: 16px 0 0; font-size: 11px; line-height: 16px; color: var(--ink-muted); word-break: keep-all; }
@media (max-height: 640px) { .ke-now { padding: 10px 12px; } .ke-now__w { min-height: 38px; font-size: 32px; line-height: 38px; } .ke-dots { height: 38px; } }
@media (min-width: 960px) and (min-height: 620px) {
  .app[data-game="kkeut"] .mini-body { inset: 64px max(32px, calc(50% - 300px)) 28px; gap: 12px; }
  .ke-in, .ke-go { height: 56px; } .ke-in { font-size: 22px; }
  .ke-now { padding: 22px 16px 20px; } .ke-now__w { min-height: 60px; font-size: 52px; line-height: 60px; } .ke-dots { height: 60px; }
}
@media (prefers-reduced-motion: reduce) { .ke-now.is-new .ke-now__w, .ke-last.is-pop, .ke-chip.is-new, .ke-form.is-shake, .ke-dots i { animation: none; } }
