/* Leapinity 끝말잇기 (/wordchain/) — 흰 배경 Leapinity 모양 (위쪽 줄은 /lpx-bar.css). 휴대폰 먼저 */
:root {
  --bg: #ffffff; --soft: #f5f6fb; --card: #ffffff; --line: #e4e7f1; --ink: #111827; --sub: #5b6475; --mute: #6b7386;
  --brand: #6d4cff; --ok: #0f9f74; --bad: #e0445a; --warn: #c27a00;
  --me: #f1edff; --ai: #e9f7fb; --p2: #e8f8f1;
  --grad: linear-gradient(100deg, #7c5cff 0%, #38bdf8 55%, #2dd4a7 100%);
  --shadow: 0 6px 24px rgba(22, 28, 61, .07);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b1030; --soft: #161d45; --card: #121941; --line: #2b3468; --ink: #eef1fb; --sub: #b3bad6; --mute: #a3abc9;
  --brand: #a996ff; --ok: #3fd3a3; --bad: #ff7a8c; --warn: #f2b84b; --me: #241d57; --ai: #12304a; --p2: #11372c; --shadow: none; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0b1030; --soft: #161d45; --card: #121941; --line: #2b3468; --ink: #eef1fb; --sub: #b3bad6; --mute: #a3abc9;
  --brand: #a996ff; --ok: #3fd3a3; --bad: #ff7a8c; --warn: #f2b84b; --me: #241d57; --ai: #12304a; --p2: #11372c; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.wc { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--brand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.wc-wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; }
.ic { display: inline-grid; place-items: center; flex: none; }
.lead { color: var(--sub); margin: 6px 0 0; }

/* 위쪽 줄의 화면 색 단추 (theme.js 가 그림) */
.lpx-bar .theme-btn { display: inline-flex; align-items: center; border: 1px solid var(--x-line); border-radius: 999px; cursor: pointer; font: inherit; }

/* 첫 화면 */
.wc-hero { padding: 14px 0 6px; }
.wc-eyebrow { margin: 0; font-size: 13px; font-weight: 700; color: var(--brand); letter-spacing: .02em; }
.wc-hero h1, .wc-h1 { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; font-size: clamp(26px, 6.4vw, 38px); line-height: 1.2; letter-spacing: -.03em; font-weight: 800; }
.wc-h1 { font-size: clamp(22px, 5.6vw, 30px); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wc-count { color: var(--mute); font-size: 14px; margin: 4px 0 0; }
.wc-daily { display: flex; align-items: center; gap: 14px; margin: 16px 0; padding: 18px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; box-shadow: var(--shadow); }
.wc-daily .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wc-daily small { font-weight: 700; color: var(--brand); font-size: 13px; }
.wc-daily b { font-size: 22px; letter-spacing: -.02em; }
.wc-daily .t > span { color: var(--sub); font-size: 14px; }
.wc-daily .go { font-size: 22px; color: var(--brand); }
.wc-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.wc-mode { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); min-height: 132px; }
.wc-mode:hover, .wc-daily:hover { border-color: var(--brand); }
.wc-mode b { font-size: 17px; }
.wc-mode > span:last-child { color: var(--sub); font-size: 13.5px; line-height: 1.45; }
.wc-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.wc-card h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; margin: 0 0 10px; letter-spacing: -.02em; }
.wc-text ol, .wc-text ul { padding-left: 20px; margin: 0; }
.wc-text li { margin: 4px 0; }
.wc-text details { border-top: 1px solid var(--line); padding: 10px 0; }
.wc-text summary { font-weight: 700; cursor: pointer; }
.wc-text details p { margin: 6px 0 0; color: var(--sub); }
.wc-credits { color: var(--sub); font-size: 14.5px; }
.wc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.wc-stat { background: var(--soft); border-radius: 14px; padding: 10px 12px; text-align: center; }
.wc-stat b { display: block; font-size: 21px; letter-spacing: -.02em; }
.wc-stat span { font-size: 12.5px; color: var(--sub); }
.wc-note { font-size: 13.5px; color: var(--mute); margin: 10px 0 0; }
.wc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.wc-chips li { background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 14px; }
.wc-link { background: none; border: 0; padding: 4px 2px; color: var(--brand); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* 버튼 */
.wc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--ink); color: var(--bg);
  font: 700 16px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.wc-btn:disabled { opacity: .5; cursor: default; }
.wc-ghost { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.wc-big { width: 100%; min-height: 56px; font-size: 18px; border-radius: 16px; background: var(--grad); color: #fff; margin-top: 14px; }
.wc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wc-row .wc-btn { flex: 1 1 140px; }

/* 시작 전 고르기 */
.wc-setup fieldset { border: 0; padding: 0; margin: 16px 0 0; }
.wc-setup legend, .wc-timer > span { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.wc-seg { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
.wc-seg legend { grid-column: 1 / -1; }
.wc-seg label, .wc-timer label { position: relative; }
.wc-seg input, .wc-timer input, .wc-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wc-seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 700; cursor: pointer; }
.wc-seg input:checked + span { border-color: var(--brand); background: var(--me); }
.wc-seg input:focus-visible + span, .wc-timer input:focus-visible + span, .wc-sw input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.wc-hint { color: var(--sub); font-size: 14px; margin: 8px 0 0; }
.wc-rules { display: grid; gap: 8px; }
.wc-sw span { display: flex; flex-direction: column; padding: 10px 64px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; position: relative; min-height: 56px; justify-content: center; }
.wc-sw small { color: var(--sub); font-size: 13px; line-height: 1.35; }
.wc-sw span::after { content: ""; position: absolute; right: 14px; top: 50%; width: 40px; height: 24px; margin-top: -12px; border-radius: 99px; background: var(--line); transition: background .15s; }
.wc-sw span::before { content: ""; position: absolute; right: 32px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #fff; z-index: 1; transition: right .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.wc-sw input:checked + span::after { background: var(--brand); }
.wc-sw input:checked + span::before { right: 17px; }
.wc-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.wc-timer > span { width: 100%; margin: 6px 0 0; }
.wc-timer label span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); cursor: pointer; font-weight: 600; }
.wc-timer input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* 오늘의 끝말잇기 */
.wc-dcard { margin: 14px 0 0; padding: 18px; border-radius: 18px; text-align: center; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; display: flex; flex-direction: column; gap: 2px; }
.wc-dcard small { color: var(--sub); font-weight: 700; }
.wc-dword { font-size: 40px; letter-spacing: -.03em; }
.wc-week { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wc-week li { text-align: center; border-radius: 12px; background: var(--soft); padding: 6px 0; font-size: 12px; color: var(--sub); }
.wc-week li b { display: block; font-size: 17px; color: var(--ink); }
.wc-week li.ok { background: var(--me); }
.wc-week li.today { outline: 2px solid var(--brand); }
.wc-streak { text-align: center; font-weight: 700; margin: 10px 0 0; }

/* 판 */
.wc-game { display: flex; flex-direction: column; min-height: calc(100dvh - 140px); }
.wc-game.done { min-height: 0; }
.wc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.wc-turn { font-size: 16px; }
.wc-score { font-size: 14px; color: var(--sub); white-space: nowrap; }
.wc-clock { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 8px 0 0; }
.wc-clock i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: left; }
.wc-clock.low i { background: var(--bad); }
.wc-chain { list-style: none; padding: 0; margin: 12px 0 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.wc-chain li { max-width: 88%; padding: 10px 14px; border-radius: 16px; background: var(--soft); animation: wcIn .2s ease-out; }
.wc-chain li.by-me { align-self: flex-end; background: var(--me); border-bottom-right-radius: 4px; }
.wc-chain li.by-ai, .wc-chain li.by-p2 { align-self: flex-start; background: var(--ai); border-bottom-left-radius: 4px; }
.wc-chain li.by-p2 { background: var(--p2); }
.wc-chain li.by-p1 { align-self: flex-end; background: var(--me); border-bottom-right-radius: 4px; }
.wc-chain li.by-start { align-self: center; text-align: center; background: var(--card); border: 1px dashed var(--line); }
.wc-chain .who { font-size: 12px; font-weight: 700; color: var(--sub); }
.wc-chain .w { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.wc-chain .w em { font-style: normal; color: var(--brand); }
.wc-chain .def { display: block; font-size: 13.5px; color: var(--sub); line-height: 1.45; }
.wc-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 3px; background: var(--ink); color: var(--bg); }
.wc-tag.hb { background: var(--bad); color: #fff; }
.wc-tag.old { background: var(--warn); color: #fff; }
.wc-chain li.think { color: var(--sub); font-size: 14px; }
@keyframes wcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wc-chain li { animation: none; } }
.wc-dock { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(8px + env(safe-area-inset-bottom)); margin-top: 10px; border-top: 1px solid var(--line); }
.wc-need { margin: 0 0 8px; font-size: 15px; color: var(--sub); }
.wc-need b { font-size: 22px; color: var(--ink); background: var(--me); padding: 0 8px; border-radius: 8px; }
.wc-input { display: flex; gap: 8px; }
.wc-input input { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--line); border-radius: 14px; padding: 0 14px; font: 600 18px/1 var(--font); background: var(--card); color: var(--ink); outline: none; }
.wc-input input:focus { border-color: var(--brand); }
.wc-input .wc-btn { min-height: 52px; }
.wc-msg { min-height: 1.6em; margin: 6px 0 0; font-size: 14.5px; font-weight: 600; }
.wc-msg.bad { color: var(--bad); }
.wc-msg.ok { color: var(--ok); }
.wc-tools { display: flex; justify-content: space-between; }
.shake { animation: wcShake .3s; }
@keyframes wcShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* 결과 */
.wc-result { text-align: center; padding: 18px 0; }
.wc-result h2 { font-size: 28px; margin: 4px 0; letter-spacing: -.02em; }
.wc-result > p { color: var(--sub); margin: 0 0 14px; }
.wc-big-emo { font-size: 52px; margin: 0; line-height: 1.1; }
.wc-could { text-align: left; margin: 16px 0 0; background: var(--soft); border-radius: 16px; padding: 12px 16px; }
.wc-could h3 { margin: 0 0 6px; font-size: 15px; }
.wc-could ul { margin: 0; padding-left: 18px; }
.wc-could li { margin: 3px 0; font-size: 14.5px; }
.wc-could small { color: var(--sub); }

.wc-foot { border-top: 1px solid var(--line); padding: 20px 16px 36px; text-align: center; color: var(--mute); font-size: 13.5px; }
.wc-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-bottom: 8px; }
.wc-foot a { color: var(--sub); text-decoration: none; }
.wc-foot p { margin: 2px 0; }
@media (min-width: 720px) {
  .wc-wrap { padding-top: 28px; }
  .wc-mode { min-height: 150px; padding: 20px; }
  .wc-chain li { max-width: 70%; }
}
@media (max-width: 360px) { .wc-modes { grid-template-columns: 1fr; } }
