/* 초성 칠판 — 교실 칠판 + 게임쇼 자석 타일 */
:root {
  --board: #22433a;
  --board-2: #1a362e;
  --board-3: #13281f;
  --chalk: #eef0e7;
  --chalk-2: rgba(238, 240, 231, .66);
  --chalk-3: rgba(238, 240, 231, .32);
  --yellow: #f6d66b;
  --pink: #f6a6a0;
  --sky: #a9d6ea;
  --tile: #f1e4c2;
  --tile-hi: #fbf3dc;
  --tile-edge: #b4935a;
  --gold: #f5c746;
  --gold-edge: #b6861b;
  --ink: #1a2a24;
  --wood: #7d5131;
  --wood-2: #5b381f;
  --wood-hi: #9a6a43;
  --t1: #e04a3c;
  --t2: #2f72d6;
  --t3: #e6b520;
  --t4: #f07f2c;
  --pen: 'Nanum Pen Script', 'Pretendard Variable', cursive;
  --blk: 'Black Han Sans', 'Pretendard Variable', sans-serif;
  --ui: 'Pretendard Variable', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --frame: clamp(8px, 1.3vmin, 16px);
}

* { box-sizing: border-box; }
html { scrollbar-width: none; -webkit-text-size-adjust: 100%; background: var(--wood-2); }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0; min-height: 100%; height: auto; overflow-x: hidden; overflow-y: visible;
  background: var(--board-3); color: var(--chalk); font-family: var(--ui);
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all; overflow-wrap: anywhere;
}
body.playing { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ── 칠판 + 나무 틀 ── */
.app {
  position: relative; min-height: 100svh; display: flex; flex-direction: column;
  border: var(--frame) solid var(--wood);
  border-image: linear-gradient(135deg, var(--wood-hi), var(--wood) 30%, var(--wood-2) 70%, var(--wood)) 1;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(0, 0, 0, .35)),
    radial-gradient(40% 18% at 22% 30%, rgba(255, 255, 255, .055), transparent 70%),
    radial-gradient(35% 14% at 74% 64%, rgba(255, 255, 255, .045), transparent 70%),
    radial-gradient(28% 10% at 60% 18%, rgba(255, 255, 255, .035), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, var(--board) 0%, var(--board-2) 100%);
  overflow: hidden;
}
body.playing .app { position: fixed; inset: 0; min-height: 0; height: 100dvh; z-index: 40; }

/* ── 위 막대 ── */
.top {
  display: flex; align-items: center; gap: 10px; padding: 10px clamp(12px, 2vw, 22px) 0;
  position: relative; z-index: 5;
}
.home {
  font-family: var(--blk); font-size: 15px; color: var(--ink); text-decoration: none;
  background: var(--tile); padding: 5px 9px 4px; border-radius: 4px;
  box-shadow: 0 3px 0 var(--tile-edge); transform: rotate(-3deg);
}
.crumb { flex: 1; min-width: 0; margin: 0; display: flex; justify-content: center; gap: .3em; font-family: var(--pen); font-size: clamp(22px, 2.6vw, 34px); line-height: 1; color: var(--chalk-2); white-space: nowrap; }
.crumb .cl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb .cp { flex: none; }
.top-act { display: flex; gap: 6px; }
.chip {
  border: 1.5px solid var(--chalk-3); background: rgba(0, 0, 0, .14); color: var(--chalk);
  border-radius: 18px 6px 16px 7px / 7px 16px 6px 18px; padding: 6px 11px; font-size: 13px; font-weight: 600; white-space: nowrap; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
}
.chip:hover { border-color: var(--chalk-2); }
.chip[aria-pressed="false"] { color: var(--chalk-2); text-decoration: line-through; }

.board { flex: 1; position: relative; display: flex; flex-direction: column; min-height: 0; }
.view { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 16px 18px; min-height: 0; }

.chalk { font-family: var(--pen); color: var(--chalk); letter-spacing: .01em; filter: url(#chalk); }

/* ── 타일 ── */
.tiles { display: flex; justify-content: center; gap: calc(var(--s, 60px) * .12); flex-wrap: wrap; }
.tile {
  --s: inherit;
  width: var(--w, var(--s)); height: var(--s); perspective: calc(var(--s) * 6);
  position: relative; flex: none;
  animation: drop .62s cubic-bezier(.28, 1.32, .5, 1) both; animation-delay: calc(var(--i, 0) * 75ms + var(--d0, 0ms));
}
.tile-in {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transition: transform .56s cubic-bezier(.35, 1.45, .45, 1);
}
.tile.open .tile-in { transform: rotateX(-180deg); }
.f {
  position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-family: var(--blk); font-weight: 400; font-size: calc(var(--s) * .62); line-height: 1; color: var(--ink);
  border-radius: calc(var(--s) * .08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 38%),
    linear-gradient(0deg, rgba(120, 90, 40, .14), transparent 30%),
    var(--tile);
  box-shadow: 0 calc(var(--s) * .055) 0 var(--tile-edge), 0 calc(var(--s) * .1) calc(var(--s) * .14) rgba(0, 0, 0, .42), inset 0 0 0 1px rgba(120, 90, 40, .18);
}
.f.back {
  transform: rotateX(180deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 40%), var(--gold);
  box-shadow: 0 calc(var(--s) * .055) 0 var(--gold-edge), 0 calc(var(--s) * .1) calc(var(--s) * .14) rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(120, 80, 10, .25);
  font-size: calc(var(--s) * .58);
}
.tile.hinted .f.back { background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 40%), var(--sky); box-shadow: 0 calc(var(--s) * .055) 0 #5d93ad, 0 calc(var(--s) * .1) calc(var(--s) * .14) rgba(0, 0, 0, .4); }
.tile.fixed .f { background: rgba(0, 0, 0, .18); color: var(--chalk); box-shadow: inset 0 0 0 2px var(--chalk-3); font-family: var(--blk); }
.tile.fixed .f.back { color: var(--ink); }
.tile.mark { width: calc(var(--s) * .32); }
.tile.mark .f { background: none; box-shadow: none; color: var(--chalk); font-family: var(--pen); font-size: calc(var(--s) * .7); align-items: end; }
.tile.mark .f.back { color: var(--ink); color: var(--chalk); }
.tile.land { animation: none; }
.word { display: flex; gap: calc(var(--s) * .1); }
.line { display: flex; justify-content: center; gap: calc(var(--s) * .5); }

@keyframes drop {
  0% { transform: translateY(calc(-60vh - 100%)) rotate(var(--r, 8deg)); opacity: 1; }
  62% { transform: translateY(0) rotate(0); }
  76% { transform: translateY(calc(var(--s) * -.1)) rotate(calc(var(--r, 8deg) * -.15)); }
  100% { transform: none; }
}
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-1deg); } 40% { transform: translateX(6px) rotate(.8deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes pop { 0% { transform: translateX(-50%) scale(.4) rotate(-10deg); opacity: 0; } 60% { transform: translateX(-50%) scale(1.12) rotate(-6deg); opacity: 1; } 100% { transform: translateX(-50%) scale(1) rotate(-6deg); opacity: 1; } }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.dust { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: rgba(240, 240, 232, .55); filter: blur(1.5px); pointer-events: none; animation: dust .7s ease-out forwards; }
@keyframes dust { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }

/* ── 첫 화면 ── */
.v-home { justify-content: center; gap: clamp(10px, 2.2vh, 22px); }
.title { margin: 0; --s: clamp(58px, 11vmin, 132px); }
.hero-tiles { --s: inherit; }
.lede { margin: 0; font-size: clamp(24px, 3.2vmin, 38px); color: var(--chalk-2); text-align: center; }
.topics { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 1.6vmin, 18px); max-width: 940px; }
.topic {
  background: none; border: 0; padding: 8px 8px 6px; display: grid; justify-items: center; gap: 2px; min-width: 104px;
  border-radius: 10px; color: var(--chalk);
}
.topic:hover, .topic:focus-visible { background: rgba(255, 255, 255, .05); }
.mini { display: flex; gap: 4px; }
.mini i {
  font-style: normal; width: 34px; height: 34px; display: grid; place-items: center; font-family: var(--blk); font-size: 21px; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 40%), var(--tile); border-radius: 4px; box-shadow: 0 3px 0 var(--tile-edge), 0 5px 8px rgba(0,0,0,.35);
  transition: transform .4s cubic-bezier(.35, 1.45, .45, 1), background .2s;
}
.topic:hover .mini i, .topic:focus-visible .mini i { transform: translateY(-3px) rotate(-3deg); }
.topic:hover .mini i:nth-child(even) { transform: translateY(-3px) rotate(3deg); }
.t-nm { font-family: var(--pen); font-size: 34px; line-height: 1.05; margin-top: 6px; filter: url(#chalk); }
.t-n { font-size: 13px; color: var(--chalk-2); font-weight: 600; }

.opts { display: grid; gap: 2px; justify-items: center; }
.go-note { margin: 0 0 -6px; font-size: clamp(20px, 2.6vmin, 28px); color: var(--chalk-2); }
.opt { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.opt-l { font-family: var(--pen); font-size: 26px; color: var(--yellow); margin-right: 6px; min-width: 48px; text-align: right; filter: url(#chalk); }
.opt button {
  background: none; border: 0; color: var(--chalk-2); font-family: var(--pen); font-size: 27px; line-height: 1;
  padding: 2px 9px 4px; min-height: 44px; min-width: 44px; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
}
.opt button::after { content: ''; position: absolute; inset: 6px 0 5px; border: 2px solid transparent; border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; pointer-events: none; }
.opt button:hover { color: var(--chalk); }
.opt button[aria-checked="true"] { color: var(--chalk); }
.opt button[aria-checked="true"]::after { border-color: var(--chalk); }

/* ── 타일 모양 버튼 ── */
.tbtn {
  border: 0; font-family: var(--blk); font-size: clamp(17px, 2.1vmin, 24px); color: var(--ink); line-height: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), var(--tile);
  padding: .72em 1.05em .62em; border-radius: 6px; box-shadow: 0 4px 0 var(--tile-edge), 0 7px 12px rgba(0, 0, 0, .35);
  display: inline-flex; align-items: center; gap: .5em; white-space: nowrap; transition: transform .08s, box-shadow .08s;
}
.tbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tile-edge), 0 3px 6px rgba(0, 0, 0, .35); }
.tbtn.gold { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 45%), var(--gold); box-shadow: 0 4px 0 var(--gold-edge), 0 7px 12px rgba(0, 0, 0, .35); }
.tbtn:disabled { opacity: .45; cursor: default; }
.tbtn em { margin-left: .35em; font-style: normal; font-family: var(--ui); font-weight: 800; font-size: .6em; min-width: 1.6em; padding: 2px 4px; border-radius: 9px; background: var(--ink); color: var(--tile); }
.tbtn kbd { font-family: var(--ui); font-size: .55em; font-weight: 700; padding: 3px 5px; border-radius: 3px; background: rgba(26, 42, 36, .12); }
.make-go { margin-top: 4px; }

/* ── 진행 화면 ── */
.v-play { justify-content: center; padding-top: 0; position: relative; }
.stage { width: 100%; flex: 1; padding-top: clamp(58px, 11vmin, 130px); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: calc(var(--s, 60px) * .28); min-height: 0; position: relative; }
.stage.shake { animation: shake .45s; }
.hint-line {
  min-height: 1.3em; margin: 0 0 6px; max-width: 92%; text-align: center;
  font-family: var(--pen); font-size: clamp(28px, 4.4vmin, 58px); line-height: 1.15; color: var(--yellow); filter: url(#chalk);
}
.hint-line.go { animation: write .9s steps(18) both; }
.hint-line small { font-size: .62em; color: var(--chalk-2); margin-right: .35em; }
.stamp {
  position: absolute; left: 50%; top: clamp(4px, 1vmin, 12px); margin: 0; white-space: nowrap; z-index: 4; font-family: var(--pen); font-size: clamp(40px, 7.4vmin, 100px); line-height: 1;
  color: var(--pink); border: 4px solid currentColor; padding: .05em .3em .12em; border-radius: 255px 25px 225px 25px / 25px 225px 25px 255px;
  transform: translateX(-50%) rotate(-6deg); opacity: 0; pointer-events: none; filter: url(#chalk);
}
.stamp.on { animation: pop .45s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.stamp.ok { color: var(--yellow); }

.timer { position: absolute; top: 4px; right: clamp(10px, 2vw, 26px); width: clamp(64px, 10vmin, 120px); aspect-ratio: 1; z-index: 3; cursor: pointer; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: url(#chalk); }
.timer circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.t-bg { stroke: var(--chalk-3); stroke-dasharray: 2 6; }
.t-arc { stroke: var(--chalk); stroke-dasharray: 264; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--blk); font-weight: 400; font-size: clamp(22px, 3.6vmin, 42px); color: var(--chalk); }
.timer.low .t-arc { stroke: var(--pink); }
.timer.low b { color: var(--pink); animation: tick 1s infinite; }
.timer.paused b { color: var(--chalk-2); }
.timer.gone { opacity: 0; transform: scale(.7); transition: opacity .3s, transform .3s; pointer-events: none; }
@keyframes tick { 0%, 100% { transform: scale(1); } 10% { transform: scale(1.18); } }

.teams { display: flex; gap: clamp(10px, 3vw, 44px); justify-content: center; flex-wrap: wrap; padding: 4px 0 0; }
.team {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 8px; color: var(--chalk); border-radius: 10px;
}
.team:hover { background: rgba(255, 255, 255, .05); }
.mag {
  width: clamp(40px, 6vmin, 70px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 40%), var(--c);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3), 0 8px 12px rgba(0, 0, 0, .35), inset 0 -4px 6px rgba(0, 0, 0, .2);
  font-family: var(--blk); color: #fff; font-size: clamp(14px, 2.2vmin, 24px); text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.team.bump .mag { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 30% { transform: scale(1.25) rotate(-8deg); } }
.score { display: grid; justify-items: start; }
.score b { font-family: var(--blk); font-weight: 400; font-size: clamp(26px, 4.6vmin, 56px); line-height: 1; }
.tally { display: flex; gap: 2px; height: clamp(14px, 2.2vmin, 24px); }
.tally svg { height: 100%; width: auto; filter: url(#chalk); }
.tally path { fill: none; stroke: var(--chalk); stroke-width: 2.4; stroke-linecap: round; }
.tally path.new { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.kbdn { font-family: var(--ui); font-size: 11px; color: var(--chalk-3); font-weight: 700; }

/* ── 받침대(아래 막대) ── */
.tray {
  position: relative; z-index: 4; padding: 12px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--wood-hi), var(--wood) 30%, var(--wood-2));
  box-shadow: 0 -6px 14px rgba(0, 0, 0, .3);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: center;
}
.tray::before { /* 분필 몇 개 */
  content: ''; position: absolute; left: 18px; top: -8px; width: 46px; height: 9px; border-radius: 4px; background: var(--chalk);
  box-shadow: 58px 1px 0 -1px var(--yellow), 0 0 0 0 transparent; opacity: .9;
}
.tray::after {
  content: ''; position: absolute; right: 22px; top: -14px; width: 74px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #d9d2c2 0 45%, #3b3a3a 45%); box-shadow: 0 3px 4px rgba(0,0,0,.35);
}
.tray-team, .tray-solo { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; width: 100%; }
.tray-solo input {
  flex: 1 1 220px; max-width: 520px; min-width: 0; font-family: var(--ui); font-weight: 700; font-size: 20px; color: var(--ink);
  background: var(--tile-hi); border: 0; border-radius: 6px; padding: 12px 14px; box-shadow: inset 0 2px 4px rgba(0,0,0,.25);
}
.tray-solo input.bad { animation: shake .4s; box-shadow: inset 0 0 0 3px var(--t1); }
.keys { margin: 0; font-size: 12px; color: rgba(255, 240, 220, .7); font-weight: 600; text-align: center; }
.app[data-mode="solo"] .tray-team, .app[data-mode="team"] .tray-solo { display: none; }
.app[data-mode="solo"] .keys { display: none; }
@media (pointer: coarse) { .keys { display: none; } }

/* ── 결과 ── */
.v-end { justify-content: center; gap: 12px; overflow-y: auto; }
.end-head { margin: 0; font-size: clamp(34px, 5vmin, 64px); color: var(--yellow); text-align: center; }
.end-tiles { --s: clamp(56px, 10vmin, 120px); }
.end-sub { margin: 0; font-size: clamp(24px, 3.4vmin, 40px); text-align: center; color: var(--chalk-2); }
.end-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; max-width: 900px; }
.end-list li { font-family: var(--pen); font-size: 26px; color: var(--chalk-2); white-space: nowrap; }
.end-list li.ok { color: var(--chalk); }
.end-list li.ok::before { content: '○ '; color: var(--yellow); }
.end-list li.no::before { content: '× '; color: var(--pink); }
.end-act, .sh-act, .mk-act { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.linkbox { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; max-width: 760px; width: 100%; }
.linkbox .lrow { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.linkbox input { flex: 1; min-width: 0; background: rgba(0,0,0,.25); border: 1.5px solid var(--chalk-3); border-radius: 6px; color: var(--chalk); padding: 10px 12px; font-size: 14px; }
.linkbox canvas { background: #fff; padding: 8px; border-radius: 4px; width: 148px; height: 148px; image-rendering: pixelated; }
.linkbox p { margin: 0; font-size: 14px; color: var(--chalk-2); max-width: 300px; }
.qrbig { position: fixed; inset: 0; z-index: 90; background: rgba(12, 26, 21, .96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vmin; padding: 16px; cursor: zoom-out; }
.qrbig canvas { width: min(76vmin, 92vw); height: auto; aspect-ratio: 1; background: #fff; padding: 2.4vmin; border-radius: 6px; image-rendering: pixelated; box-sizing: content-box; }
.qb-t { margin: 0; font-size: clamp(30px, 5vmin, 64px); color: var(--yellow); text-align: center; }
.qb-sub { margin: 0; font-size: clamp(14px, 2vmin, 22px); color: var(--chalk-2); text-align: center; }

/* ── 받은 링크 ── */
.v-shared { justify-content: center; gap: 12px; text-align: center; }
.sh-from { margin: 0; font-size: 26px; color: var(--chalk-2); }
.sh-title { margin: 0; font-size: clamp(42px, 7vmin, 84px); line-height: 1.05; color: var(--chalk); }
.sh-tiles { --s: clamp(44px, 8vmin, 96px); }
.sh-meta { margin: 0; font-size: 28px; color: var(--chalk-2); }
.sh-chal { margin: 0; font-size: 30px; line-height: 1.2; color: var(--yellow); max-width: 18em; text-wrap: balance; }

/* ── 만들기 ── */
.v-make { gap: 12px; align-items: stretch; max-width: 1080px; width: 100%; margin: 0 auto; overflow-y: auto; }
.mk-head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: end; justify-content: space-between; }
.mk-h { margin: 0; font-size: clamp(36px, 5vmin, 56px); font-weight: 400; color: var(--yellow); }
.mk-title { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 440px; }
.mk-title input { width: 0; }
.mk-title span { font-family: var(--pen); font-size: 28px; color: var(--chalk-2); }
.mk-title input, .v-make textarea {
  flex: 1; min-width: 0; background: rgba(0, 0, 0, .2); border: 1.5px solid var(--chalk-3); border-radius: 6px; color: var(--chalk); padding: 10px 12px; font-size: 16px;
}
.mk-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 0; }
.mk-in { display: grid; gap: 8px; align-content: start; }
.mk-lab { margin: 0; font-size: 13px; color: var(--chalk-2); font-weight: 600; }
.mk-lab b { color: var(--yellow); }
.v-make textarea { min-height: 260px; resize: vertical; line-height: 1.7; font-size: 16px; }
.mk-fill { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--chalk-2); }
.mk-prev { display: grid; gap: 8px; align-content: start; min-height: 0; }
.mk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; max-height: 340px; overflow-y: auto; }
.mk-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.mk-list .mt { display: flex; flex-wrap: wrap; gap: 3px; }
.mk-list .mt i { font-style: normal; font-family: var(--blk); font-size: 15px; color: var(--ink); background: var(--tile); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; box-shadow: 0 2px 0 var(--tile-edge); }
.mk-list .mt i.sp { background: none; box-shadow: none; width: 8px; }
.mk-list .mt i.fx { background: rgba(0,0,0,.2); color: var(--chalk); box-shadow: inset 0 0 0 1.5px var(--chalk-3); }
.mk-list .mh { font-size: 13px; color: var(--chalk-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-list li.err .mh { color: var(--pink); }
.mk-list li.more { color: var(--chalk-2); font-size: 13px; }

/* ── 알림 ── */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 80;
  background: var(--tile-hi); color: var(--ink); font-weight: 700; padding: 10px 16px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.4);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

/* ── 아래 설명 ── */
.guide {
  position: relative; z-index: 1; background: var(--board-3); color: rgba(238, 240, 231, .86);
  content-visibility: auto; contain-intrinsic-size: auto 1900px; border-top: 10px solid var(--wood-2);
}
.guide-in { max-width: 700px; margin: 0 auto; padding: 44px 18px 30px; font-size: 16px; line-height: 1.75; }
.guide h2 { font-family: var(--pen); font-weight: 400; font-size: 38px; line-height: 1.15; color: var(--yellow); margin: 38px 0 10px; }
.guide h2:first-of-type { margin-top: 12px; }
.guide p { margin: 0 0 12px; }
.guide b { color: var(--chalk); }
.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin-bottom: 10px; }
.steps b { display: block; }
.keys-list, .faq { margin: 0; }
.keys-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.keys-list dt { font-weight: 700; color: var(--chalk); }
.keys-list dd { margin: 0; }
.faq dt { font-weight: 700; color: var(--chalk); margin-top: 16px; }
.faq dd { margin: 4px 0 0; }
.uses, .others { padding-left: 1.2em; margin: 0; }
.uses li, .others li { margin-bottom: 6px; }
.others a { color: var(--yellow); font-weight: 700; }
.credit { font-size: 13px; color: var(--chalk-2); margin-top: 26px; }
.site-foot { margin-top: 26px; font-size: 13px; color: var(--chalk-2); text-align: center; }
.site-foot a { color: var(--chalk-2); }
.site-foot .sep { margin: 0 8px; }
.fallback { text-align: center; color: var(--chalk); }

/* ── 좁은 화면 ── */
@media (max-width: 720px) {
  .top { gap: 6px; padding-top: 8px; }
  .crumb { font-size: 22px; padding: 0 4px; }
  .crumb .cl { max-width: 34vw; }
  .chip { padding: 5px 9px; font-size: 12px; }
  #fsBtn { display: none; }
  .topic { min-width: 0; width: calc(33.3% - 8px); padding: 6px 2px 4px; }
  .mini i { width: 27px; height: 27px; font-size: 17px; }
  .t-nm { font-size: 29px; }
  .opt-l { font-size: 22px; min-width: 0; margin-right: 2px; }
  .opt button { font-size: 23px; padding: 1px 7px 3px; }
  .mk-body { grid-template-columns: 1fr; }
  .mk-title { flex: none; width: 100%; max-width: none; }
  .mk-head { flex-direction: column; align-items: stretch; }
  .v-make textarea { min-height: 170px; }
  .mk-list { max-height: 220px; }
  .keys-list { grid-template-columns: 1fr; gap: 0; }
  .keys-list dd { margin-bottom: 8px; }
  .tray-solo .tbtn { padding: .7em .8em .6em; }
  .tray-solo input { flex-basis: 100%; max-width: none; }
  .timer { top: 0; }
}
@media (max-height: 560px) and (min-width: 721px) {
  .lede { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: fade .3s both; animation-delay: calc(var(--i, 0) * 30ms); }
  .tile-in { transition-duration: .01s; }
  .dust { display: none; }
  .hint-line.go { animation: none; }
  @keyframes fade { from { opacity: 0; } }
}
