/* PLAYORA 말랑 방울 터트리기 */
:root {
  --paper: #f4f0e8; --paper-2: #ebe5d8; --ink: #232a44; --ink-2: #5d6380; --ink-3: #8a8fa6; --line: #d9d2c3;
  --jar: #23294a; --acc: #e8684a; --acc-ink: #fffaf3; --acc-soft: #f8ddd3; --ok: #2f8f5b;
  --f-body: "IBM Plex Sans KR", "Pretendard", system-ui, -apple-system, "Malgun Gothic", sans-serif;
  --f-disp: "Bagel Fat One", "Jua", "Black Han Sans", "Malgun Gothic", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r1: 8px; --r2: 12px; --r3: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@supports (color: oklch(0 0 0)) {
  :root { --paper: oklch(0.954 0.012 85); --paper-2: oklch(0.922 0.017 85); --ink: oklch(0.29 0.05 272); --ink-2: oklch(0.5 0.045 275); --ink-3: oklch(0.65 0.03 275); --line: oklch(0.87 0.022 85); --jar: oklch(0.29 0.06 272); --acc: oklch(0.67 0.16 36); --acc-soft: oklch(0.9 0.05 40); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.7 var(--f-body); word-break: keep-all; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 페이지 머리: 왼쪽에 붙인 얇은 띠 */
.mast { display: flex; align-items: baseline; gap: var(--s4); padding: var(--s3) clamp(var(--s4), 3vw, var(--s6)); }
.mast-brand { text-decoration: none; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.mast-brand b { font-weight: 700; letter-spacing: 0.08em; color: var(--ink); margin-right: 6px; }
.mast-more { margin-left: auto; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.head { max-width: 1240px; margin: 0 auto; padding: var(--s2) clamp(var(--s3), 3vw, var(--s6)) var(--s3); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.head h1 { margin: 0; font: 400 clamp(32px, 4.2vw, 46px)/1.1 var(--f-disp); letter-spacing: 0.01em; font-style: normal; }
.head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(0px, 2vw, var(--s5)); }

/* ---------------------------------------------------------------- 게임 무대 */
.jd { position: relative; display: flex; flex-direction: column; width: 100%; height: clamp(520px, calc(100svh - 120px), 860px); background: var(--paper-2); color: var(--ink); overflow: hidden; border-radius: var(--r2);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; font-family: var(--f-body); font-size: 14px; line-height: 1.45; }
.jd::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, rgba(35, 42, 68, 0.07) 1px, transparent 1.5px); background-size: 22px 22px; pointer-events: none; }
@media (max-width: 640px) { .jd { border-radius: 0; height: min(88svh, 820px); min-height: 560px; } .head p { display: none; } }
html.embed, html.embed body { height: 100%; overflow: hidden; background: var(--paper-2); }
html.embed .mast, html.embed .head, html.embed .about, html.embed .foot { display: none !important; }
html.embed .wrap { padding: 0; max-width: none; }
html.embed .jd, .jd.fs { position: fixed; inset: 0; width: auto; height: auto; min-height: 0; border-radius: 0; z-index: 50; }
.jd:fullscreen { width: 100%; height: 100%; border-radius: 0; }
.jd button:focus-visible, .jd canvas:focus-visible, .jd input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.jd canvas:focus, .ov:focus { outline: none; }

/* 위 막대 */
.bar { position: relative; z-index: 6; flex: none; height: 46px; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2) 0 var(--s4); background: var(--paper); border-bottom: 1px solid var(--line); }
.jd.short .bar { height: 40px; }
.bar-l { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; flex: 1; overflow: hidden; }
.bar-t { font: 400 19px/1 var(--f-disp); white-space: nowrap; }
.bar-m { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-r { display: flex; align-items: center; gap: 4px; flex: none; }
.tb { height: 32px; padding: 0 var(--s3); border-radius: var(--r1); border: 1px solid var(--line); background: transparent; font: 600 13px/1 var(--f-body); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tb:hover { border-color: var(--ink-3); background: var(--paper-2); }
.tb svg { width: 18px; height: 18px; flex: none; }
.tb.icon { width: 34px; padding: 0; }
.tb .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb .off { display: none; }
.tb.off .off { display: inline; }
.tb.off .on { display: none; }
.tb.off { color: var(--ink-3); }
.jd.narrow .bar { padding-left: var(--s3); gap: 4px; }
.jd.narrow .bar-m { display: none; }
.jd.narrow .tb { padding: 0 var(--s2); }
.jd.narrow .tb.icon { width: 32px; padding: 0; }

.stage { position: relative; flex: 1; min-height: 0; }
.stage canvas { position: absolute; inset: 0; display: block; touch-action: none; }

/* 휴대폰 단추 */
.pad { position: relative; z-index: 4; flex: none; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 6px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); touch-action: none; }
.pad button { height: 50px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--paper-2); color: var(--ink); display: flex; align-items: center; justify-content: center; touch-action: none; }
.pad button svg { width: 24px; height: 24px; }
.pad button.on { background: var(--ink); color: var(--acc-ink); border-color: var(--ink); }
.pad .pad-h { background: var(--acc-soft); }
.jd.short .pad button { height: 42px; }

/* 덮개 화면 */
.ov { position: absolute; z-index: 5; left: 0; right: 0; top: 46px; bottom: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--paper-2); padding: clamp(var(--s3), 3vw, var(--s6)); }
.jd.short .ov { top: 40px; }
.jd.on-play .ov { background: rgba(28, 33, 58, 0.5); display: flex; align-items: center; justify-content: center; }
.jd.on-play .ov[hidden] { display: none; }
.sheet { max-width: 720px; margin: 0 auto; }
.sheet.wide { max-width: 980px; }
.jd.on-play .sheet { background: var(--paper); border-radius: var(--r3); padding: var(--s5) var(--s5) var(--s4); box-shadow: 0 18px 50px rgba(20, 24, 46, 0.3); max-width: 420px; width: 100%; margin: auto; max-height: 100%; overflow-y: auto; }
.jd.on-play .sheet.wide { max-width: 760px; }
.sheet h2 { margin: 0 0 var(--s2); font: 700 22px/1.3 var(--f-body); letter-spacing: -0.01em; }
.sheet h2 small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: var(--s2); }
.sheet p { margin: 0 0 var(--s3); color: var(--ink-2); }
.sheet .fine { font-size: 13px; color: var(--ink-3); }
.sheet .warn { color: #a3402b; font-weight: 600; }
.row-btn { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.col-btn { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.btn { min-height: 42px; padding: 0 var(--s5); border-radius: var(--r1); border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 15px; transition: background 0.2s var(--ease), border-color 0.2s var(--ease); }
.btn:hover { border-color: var(--ink-3); }
.btn.pri { background: var(--ink); border-color: var(--ink); color: var(--acc-ink); }
.btn.pri:hover { background: #343c62; }
.lnk { border: 0; background: none; padding: 0; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.lnk:hover { color: var(--ink); }

/* 처음 화면: 왼쪽 큰 제목, 오른쪽 모드 목록 */
.home { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr); gap: var(--s5) clamp(var(--s5), 4vw, var(--s7)); max-width: 980px; margin: 0 auto; min-height: 100%; align-items: center; }
.home-l { align-self: center; }
.logo { margin: 0; font: 400 clamp(40px, 6.2vw, 68px)/1 var(--f-disp); letter-spacing: 0.01em; color: var(--ink); }
.lede { margin: var(--s3) 0 var(--s4); color: var(--ink-2); font-size: 15px; max-width: 30ch; }
.home-art { width: 240px; height: 180px; display: block; }
.home-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s4) 0 0; }
.home-r { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mode { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n r" "d r"; align-items: center; gap: 0 var(--s4); text-align: left; padding: var(--s3) var(--s3) var(--s3) var(--s4); border: 0; border-bottom: 1px solid var(--line); background: transparent; white-space: normal; position: relative; transition: background 0.2s var(--ease), padding 0.25s var(--ease); }
.mode::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--acc); transform: scaleY(0); transition: transform 0.25s var(--ease); }
.mode:hover, .mode:focus-visible { background: var(--paper); padding-left: var(--s5); }
.mode:hover::before, .mode:focus-visible::before { transform: scaleY(1); }
.mode b { grid-area: n; font-size: 18px; font-weight: 700; }
.mode span { grid-area: d; color: var(--ink-2); font-size: 13.5px; }
.mode em { grid-area: r; font-style: normal; font-size: 13px; font-weight: 600; color: var(--acc); white-space: nowrap; }
@media (max-width: 700px) {
  .home { grid-template-columns: 1fr; gap: var(--s4); align-content: start; }
  .home-art { display: none; }
  .logo { font-size: 44px; }
  .lede { margin: var(--s2) 0 0; }
  .home-links { margin-top: var(--s2); }
  .home-l { display: grid; }
  .home-links { order: 3; }
}
.jd.short .home-art { display: none; }

/* 고르기 */
.pick { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0; }
.opt { flex: 1 1 140px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--paper); text-align: left; white-space: normal; }
.opt b { font-size: 16px; }
.opt span { font-size: 13px; color: var(--ink-2); }
.opt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.lv-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: var(--s3); }
.lv { display: grid; grid-template-columns: 40px 1fr auto; grid-template-areas: "i n r" "i d r"; gap: 0 var(--s3); align-items: center; text-align: left; padding: var(--s3) var(--s2); border: 0; border-bottom: 1px solid var(--line); background: transparent; white-space: normal; }
.lv:hover, .lv:focus-visible { background: var(--paper); }
.lv i { grid-area: i; font: 400 22px/40px var(--f-disp); font-style: normal; width: 40px; height: 40px; text-align: center; border-radius: 50%; background: var(--jar); color: #fff4d6; }
.lv b { grid-area: n; font-size: 16px; }
.lv span { grid-area: d; font-size: 13px; color: var(--ink-2); }
.lv em { grid-area: r; font-style: normal; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pz-ch h3 { margin: var(--s4) 0 var(--s2); font-size: 15px; font-weight: 700; }
.pz-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.pz { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; height: 58px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--paper); }
.pz b { font-size: 17px; line-height: 1.1; }
.pz span { font-size: 11.5px; color: var(--ink-2); }
.pz.done { background: var(--jar); border-color: var(--jar); color: #fff4d6; }
.pz.done span { color: #c5cae0; }
.steps { margin: 0 0 var(--s4); padding-left: 1.3em; color: var(--ink); }
.steps li { margin-bottom: var(--s1); }
.duo-keys, .rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s4); margin: var(--s3) 0; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys caption { text-align: left; font-weight: 700; padding-bottom: var(--s1); }
.keys th, .keys td { text-align: left; padding: 6px var(--s2) 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.keys th { font-weight: 500; color: var(--ink-2); }
.keys td:last-child { text-align: right; }
.bind td:nth-child(2) { text-align: left; }
kbd { display: inline-block; min-width: 26px; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--paper); font: 600 12.5px/1.6 var(--f-body); text-align: center; }
.ach-h { margin: var(--s4) 0 var(--s2); font-size: 15px; }
.ach { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.ach li { padding: var(--s2) var(--s3); border: 1px dashed var(--line); border-radius: var(--r1); color: var(--ink-3); }
.ach li b { display: block; font-size: 14px; }
.ach li span { font-size: 12.5px; }
.ach li.got { border: 1px solid var(--ink); color: var(--ink); background: var(--paper); }
.ach li.got span { color: var(--ink-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: var(--s3) 0 var(--s3); }
.tab { border: 0; background: none; padding: var(--s2) var(--s3); font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--acc); }
.set-body { display: flex; flex-direction: column; gap: 2px; }
.tg, .rg { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tg span, .rg span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tg b, .rg b { font-size: 14.5px; font-weight: 600; }
.tg small, .rg small { font-size: 12.5px; color: var(--ink-2); }
.tg input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; order: 2; }
.rg input { width: min(200px, 40%); accent-color: var(--ink); }
.rg output { width: 30px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.res { text-align: left; }
.res .big { font: 400 46px/1.1 var(--f-disp); color: var(--ink); margin: var(--s2) 0; }
.res .big small { font: 600 16px var(--f-body); margin-left: 6px; color: var(--ink-2); }
.res .badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--acc); color: var(--acc-ink); font-size: 13px; font-weight: 700; }
.res .tally { font: 400 34px/1.1 var(--f-disp); margin: var(--s2) 0 var(--s3); color: var(--ink); }
.stat { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s4); margin: var(--s3) 0 0; font-size: 14px; }
.stat dt { color: var(--ink-2); }
.stat dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.vs-t td, .vs-t th { text-align: right; }
.vs-t th:first-child { text-align: left; }

/* 따라 하기 안내 */
.coach { position: absolute; z-index: 4; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: flex; align-items: flex-end; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: var(--r2); box-shadow: 0 10px 30px rgba(20, 24, 46, 0.18); }
.coach p { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.ghost-btn { flex: none; border: 1px solid var(--line); background: var(--paper-2); border-radius: var(--r1); padding: 6px var(--s3); font-size: 13px; font-weight: 600; }
.jd:not(.on-play) .coach { display: none; }
.pad:not([hidden]) ~ .coach { bottom: 76px; }
.toast { position: absolute; z-index: 9; left: 50%; top: 56px; transform: translate(-50%, -8px); padding: 6px var(--s4); border-radius: 999px; background: var(--ink); color: var(--acc-ink); font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.nojs { padding: var(--s6); }

/* ---------------------------------------------------------------- 소개 글 */
.about { max-width: 1240px; margin: var(--s7) auto 0; padding: 0 clamp(var(--s4), 3vw, var(--s6)); display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s7); }
.about h2 { margin: var(--s7) 0 var(--s3); font: 700 23px/1.35 var(--f-body); letter-spacing: -0.01em; font-style: normal; }
.about h2:first-child { margin-top: 0; }
.about h3 { margin: var(--s5) 0 var(--s2); font: 700 16px/1.4 var(--f-body); }
.about p, .about li, .about dd { color: #3b4160; }
.about-main { max-width: 760px; }
.about .note { font-size: 14px; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: var(--s3); }
.about ol, .about ul { padding-left: 1.3em; }
.about li { margin-bottom: var(--s2); }
.about dt { font-weight: 700; margin-top: var(--s4); color: var(--ink); }
.about dd { margin: var(--s1) 0 0; }
.about .more { font-size: 14px; color: var(--ink-2); margin-top: var(--s6); line-height: 1.9; }
.about .more a { color: var(--ink); }
.about-side h3:first-child { margin-top: 0; }
.about-side { font-size: 14.5px; }
.about .keytab { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: var(--s3); }
.about .keytab th, .about .keytab td { text-align: left; padding: 7px var(--s2) 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.about .keytab th { font-weight: 600; white-space: nowrap; color: var(--ink); }
.about .keytab td { color: #3b4160; }
.tab-wrap { overflow-x: auto; margin: var(--s3) 0; }
.wide-tab { min-width: 520px; }
.rule-fig { margin: var(--s4) 0 var(--s5); }
.rf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--s3); }
.rf { display: flex; flex-direction: column; gap: 6px; }
.rf svg { width: 100%; height: auto; display: block; }
.rf span { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.rule-fig figcaption { font-size: 13px; color: var(--ink-3); margin-top: var(--s2); }
@media (max-width: 900px) { .about { grid-template-columns: minmax(0, 1fr); gap: var(--s5); } }
.foot { max-width: 1240px; margin: var(--s8) auto 0; padding: var(--s5) clamp(var(--s4), 3vw, var(--s6)) var(--s6); border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.foot a { margin-right: var(--s4); white-space: nowrap; display: inline-block; margin-bottom: var(--s1); }
.foot p { margin: var(--s3) 0 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
