/* 끄적끄적. 모눈 공책 위 네임펜 선. 강조색은 형광펜 노랑 하나.
   진한 색은 그림판 위 그림과 난이도 상세 칸에만 쓴다. */
:root {
  --paper: #f7f4ee;
  --grid: #e7e0d2;
  --card: #fdfbf7;
  --raised: #efe9df;
  --ink: #1f1b16;
  --ink-2: #5e554a;
  --ink-3: #7b7266;
  --line: rgba(31, 27, 22, .14);
  --hl: #ffd84d;            /* 형광펜 */
  --hl-soft: #fff1b8;
  --good: #16a34a;
  --good-soft: #e3f4e8;
  --bad: #dc2626;
  --d-easy: #3ec7a5;
  --d-normal: #4d9de0;
  --d-hard: #ff9f1c;
  --d-impossible: #e84a5f;
  --wob: 255px 16px 225px 16px / 16px 225px 16px 255px;
  --wob2: 16px 225px 16px 255px / 255px 16px 225px 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --display: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --pen: 'Nanum Pen Script', 'Jua', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink); font-family: var(--display); font-size: 16px; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
.screen { display: none; min-height: 100dvh; }
.screen.on { display: flex; }

/* ---------- 공통 부품 */
.btn {
  border: 2px solid var(--ink); border-radius: var(--wob); background: var(--card);
  height: 44px; padding: 0 20px; cursor: pointer; font-size: 17px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s var(--ease), background-color .12s var(--ease);
}
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.big { height: 52px; font-size: 20px; padding: 0 28px; }
.btn.small { height: 32px; font-size: 14px; padding: 0 12px; }
.btn.primary { background: var(--hl); }
.btn.primary:hover { background: #ffcf26; }
.btn.ghost { background: transparent; --bst: dashed; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); transition: background-color .12s var(--ease); }
.icon-btn:hover { background: var(--raised); }
.icon-btn svg, .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
input {
  border: 2px solid var(--ink); border-radius: var(--wob2); background: #fff; height: 44px; padding: 0 16px; font-size: 18px; outline: none; width: 100%; min-width: 0;
}
input:focus { box-shadow: 0 0 0 4px var(--hl-soft); }
input::placeholder { color: var(--ink-3); }
.panel { background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob); padding: 20px; }
.panel-title { font-size: 18px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; }
.panel-title small, .muted { color: var(--ink-3); font-size: 14px; }
.msg { min-height: 20px; color: var(--bad); text-align: center; margin: 0; font-size: 15px; }
.chips { display: flex; gap: 8px; flex-wrap: nowrap; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff; height: 32px; padding: 0 12px; font-size: 15px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center; transition: background-color .12s var(--ease), border-color .12s var(--ease);
}
.chip small { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip.on { background: var(--hl); border-color: var(--ink); }
.chip.on small { color: var(--ink-2); }
.chip:disabled { cursor: default; }
.av {
  width: 36px; height: 36px; flex: none; border: 2px solid var(--ink); border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%;
  display: grid; place-items: center; font-size: 16px; color: var(--ink);
}
.stars { letter-spacing: -1px; }
.num { font-variant-numeric: tabular-nums; }

/* 형광펜 밑줄: 강조할 낱말 하나에만 */
.hl { background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 90%, transparent 90%); padding: 0 4px; }

/* 난이도 표시 (정보라서 색을 쓴다) */
.dtag { display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--ink); border-radius: 999px; height: 28px; padding: 0 10px; font-size: 14px; background: #fff; white-space: nowrap; }
.dtag.easy { background: var(--d-easy); }
.dtag.normal { background: var(--d-normal); color: #fff; }
.dtag.hard { background: var(--d-hard); }
.dtag.impossible { background: var(--d-impossible); color: #fff; }

/* ---------- 첫 화면: 왼쪽 글과 입장, 오른쪽 저절로 그려지는 판 */
#home { align-items: center; justify-content: center; padding: 32px 24px; }
.home-wrap { width: min(1040px, 100%); display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 64px; align-items: center; }
.home-card { display: flex; flex-direction: column; gap: 16px; }
.logo { margin: 0 0 4px; font-size: 64px; line-height: 1; font-weight: 400; letter-spacing: -1px; }
.logo span { display: inline-block; }
.logo span:first-child { transform: rotate(-4deg); }
.logo span:last-child { transform: rotate(3deg) translateY(4px); }
.tagline { margin: 0 0 8px; font-size: 20px; color: var(--ink-2); line-height: 1.4; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 14px; color: var(--ink-3); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1.5px dashed var(--line); }
.join-row { display: flex; gap: 8px; }
.join-row input { text-transform: uppercase; letter-spacing: 4px; text-align: center; font-size: 20px; }
.join-row input::placeholder { letter-spacing: 0; }

.demo { display: flex; flex-direction: column; gap: 12px; }
.demo-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-bar .topic { margin-right: auto; }
.demo-mask { display: flex; gap: 4px; }
.demo-mask i { width: 20px; height: 24px; border-bottom: 3px solid var(--ink); font-style: normal; display: grid; place-items: center; font-size: 18px; }
.demo-board { background: #fff; border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink); aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.demo-board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.demo-board .ink { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.demo-board .paint { stroke: none; opacity: 0; transition: opacity .4s var(--ease); }
.demo-board .paint.on { opacity: 1; }
.demo-chat { display: flex; flex-direction: column; gap: 4px; min-height: 64px; font-size: 15px; }
.demo-chat div { opacity: 0; transform: translateY(4px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.demo-chat div.on { opacity: 1; transform: none; }
.demo-chat b { font-weight: 400; color: var(--ink-3); margin-right: 8px; }
.demo-chat .good { color: var(--good); }

/* ---------- 대기실 */
#lobby { justify-content: center; padding: 32px 16px 48px; }
.lobby-wrap { width: min(640px, 100%); display: flex; flex-direction: column; gap: 16px; }
.code-panel { display: flex; align-items: center; gap: 16px; }
.code-panel .label { font-size: 14px; color: var(--ink-3); }
.room-code { font-size: 44px; letter-spacing: 8px; flex: 1; line-height: 1; }
.lobby-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 12px; }
.lobby-players li { display: flex; align-items: center; gap: 8px; font-size: 17px; min-width: 0; height: 40px; }
.lobby-players li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-players li .tag { font-size: 12px; color: var(--ink-3); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 8px; flex: none; }
.lobby-players li .ic { color: var(--ink-3); }
.settings { display: flex; flex-direction: column; gap: 16px; }
.set-row { display: flex; align-items: center; gap: 16px; }
.set-row > span { width: 64px; flex: none; color: var(--ink-2); }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.col > span { width: auto; }
.diff-legend { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink-3); padding-top: 16px; border-top: 1.5px dashed var(--line); }
.diff-legend .dl { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.lobby-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- 게임 */
#game { flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; gap: 12px; flex: none; }
.brand { font-size: 20px; }
.round { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.top-right { display: flex; align-items: center; gap: 8px; }
.mini-code { font-size: 14px; letter-spacing: 3px; color: var(--ink-3); }
.game-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr) 288px; gap: 16px; padding: 0 16px 16px; }
.plist { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 8px 4px 4px 8px; }
.pl {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob2); height: 56px; padding: 0 12px;
  --bw: 2px; position: relative; min-width: 0; transition: background-color .2s var(--ease); flex: none;
}
.pl .info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pl .nm { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .sc { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pl.drawer { background: var(--hl-soft); }
.pl.solved { background: var(--good-soft); }
.pl.off { opacity: .45; }
.pl .rk { position: absolute; left: -8px; top: -8px; background: var(--ink); color: var(--card); font-size: 11px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.pl .ic { color: var(--ink-2); }
.pl.solved .ic { color: var(--good); }
.pl .gain { position: absolute; right: 8px; top: -10px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px; font-size: 12px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.stage { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.wordbar { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob); height: 72px; padding: 0 16px; flex: none; }
.timer { position: relative; width: 48px; height: 48px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: #fff; stroke: var(--raised); stroke-width: 4; }
.ring { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113.1; transition: stroke .3s; }
.timer.low .ring { stroke: var(--bad); }
.timer.low b { color: var(--bad); }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums; }
.word-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.word-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.topic { font-size: 14px; color: var(--ink-2); }
.word { font-size: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 32px; align-items: center; text-align: center; }
.word .bx { width: 24px; height: 28px; border-bottom: 3px solid var(--ink); display: grid; place-items: center; font-size: 20px; }
.word .bx.hint { background: var(--hl-soft); }
.word .sp { width: 12px; }
.word .plain { display: inline-flex; align-items: center; gap: 8px; }
.word .plain .ic { color: var(--good); width: 20px; height: 20px; }
.board-wrap { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#board {
  width: 100%; height: auto; aspect-ratio: 4 / 3; background: #fff; display: block; flex: none;
  border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink); touch-action: none; user-select: none;
}
#board.can-draw { cursor: crosshair; }
.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; padding: 12px; z-index: 5; }
.overlay.on { display: flex; }
.ov-card {
  pointer-events: auto; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob); --bs: 6px 6px 0 var(--ink);
  padding: 20px 24px; text-align: center; width: min(520px, 96%); animation: enter .25s var(--ease);
}
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.ov-title { font-size: 16px; color: var(--ink-3); }
.ov-answer { font-size: 36px; margin: 4px 0 16px; }
.ov-list { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; font-size: 16px; text-align: left; width: min(240px, 100%); }
.ov-list li { display: flex; justify-content: space-between; gap: 16px; }
.ov-list li b { font-weight: 400; color: var(--good); font-variant-numeric: tabular-nums; }
.ov-none { color: var(--ink-3); font-family: var(--pen); font-size: 26px; }

/* 턴 안내: 마키 → 멈춘 칸이 상세 칸으로 넓어짐 */
.ov-card.intro { background: transparent; transition: background-color .3s var(--ease); }
.ov-card.intro::before { opacity: 0; transition: opacity .3s var(--ease); }
.ov-card.intro.open { background: var(--card); }
.ov-card.intro.open::before { opacity: 1; }
.ov-body { display: flex; flex-direction: column; align-items: center; }
.ov-who { font-size: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.reel { position: relative; width: 100%; border-radius: 16px; background: #fff; clip-path: inset(0 calc(50% - 168px) calc(100% - 62px) calc(50% - 168px) round 16px); transition: clip-path .5s var(--ease), background-color .35s var(--ease); }
.reel.open { clip-path: inset(0 round 16px); }
.reel.easy.open { background: #d9f3ea; }
.reel.normal.open { background: #dceaf8; }
.reel.hard.open { background: #ffe8c9; }
.reel.impossible.open { background: #fad9de; }
.win { position: absolute; left: 50%; top: 0; width: 336px; height: 62px; transform: translateX(-50%); transition: opacity .2s var(--ease); }
.reel.open .win { opacity: 0; }
.win-frame { position: absolute; left: 50%; top: 0; width: 336px; height: 62px; transform: translateX(-50%); border: 2px solid var(--ink); border-radius: 16px; pointer-events: none; z-index: 3; transition: opacity .2s var(--ease); }
.reel.open + .win-frame { opacity: 0; }
.reel-wrap { position: relative; width: 100%; }
.reel-wrap::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 16px; filter: url(#boil); opacity: 0; transition: opacity .25s var(--ease) .35s; pointer-events: none; }
.reel-wrap.open::after { opacity: 1; }
.reel-win { position: absolute; inset: 0; overflow: hidden; border-radius: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.track { position: absolute; left: 0; top: 50%; display: flex; gap: 12px; transform: translate(0, -50%); will-change: transform; }
.track .dtag { font-size: 17px; height: 36px; padding: 0 14px; flex: none; transition: transform .15s var(--ease); }
.track .dtag.land { transform: scale(1.12); }
.pin { position: absolute; left: 50%; width: 0; height: 0; border: 7px solid transparent; transform: translateX(-50%); z-index: 2; }
.pin.t { top: -1px; border-top-color: var(--ink); }
.pin.b { bottom: -1px; border-bottom-color: var(--ink); }
.detail { padding: 16px; opacity: 0; transition: opacity .3s var(--ease) .25s; text-align: left; }
.reel.open .detail { opacity: 1; }
.dt-head { display: flex; align-items: center; gap: 12px; }
.dt-head .dtag { font-size: 18px; height: 36px; padding: 0 14px; }
.dt-head .pts { font-size: 28px; margin-left: auto; font-variant-numeric: tabular-nums; }
.dt-desc { font-family: var(--pen); font-size: 26px; line-height: 1.1; margin: 8px 0 12px; color: var(--ink-2); }
.dt-word { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; text-align: center; }
.dt-word small { display: block; font-size: 13px; color: var(--ink-3); }
.dt-word b { font-size: 30px; font-weight: 400; }
.dt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dt-grid > div { background: rgba(255, 255, 255, .72); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.dt-grid small { display: block; font-size: 12px; color: var(--ink-3); }
.dt-grid b { font-weight: 400; font-size: 16px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.tools { display: none; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; flex: none; }
.tools.on { display: flex; }
.tools .group { display: flex; gap: 4px; align-items: center; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob2); padding: 4px 8px; --bw: 2px; }
.sw { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 50%; cursor: pointer; padding: 0; transition: transform .12s var(--ease); }
.sw.on { transform: scale(1.15); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.colors { display: grid !important; grid-template-columns: repeat(7, 24px); gap: 6px !important; padding: 8px 12px !important; }
.sz, .tl { height: 36px; min-width: 36px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; font-size: 14px; color: var(--ink); transition: background-color .12s var(--ease); }
.sz:hover, .tl:hover { background: var(--raised); }
.sz i { display: block; background: var(--ink); border-radius: 50%; }
.sz.on, .tl.on { background: var(--hl); }
.tl.warn { color: var(--bad); }

.chat { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob2); }
.log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; line-height: 1.35; }
.log .ln { overflow-wrap: anywhere; }
.log .ln b { font-weight: 400; color: var(--ink-3); margin-right: 8px; }
.log .sys { font-size: 13px; color: var(--ink-3); }
.log .good { font-size: 15px; background: var(--good-soft); color: #166534; border-radius: 8px; padding: 2px 8px; align-self: flex-start; }
.log .near { font-size: 15px; background: var(--hl-soft); border-radius: 8px; padding: 2px 8px; align-self: flex-start; }
.log .sol { color: #166534; }
.log .sol b::before { content: '맞힌 사람 '; font-size: 11px; }
.say { display: flex; gap: 8px; padding: 8px; border-top: 1.5px dashed var(--line); }
.say input { font-size: 16px; height: 40px; padding: 0 12px; }
.say input:disabled { background: var(--raised); }
.say .btn { width: 40px; height: 40px; padding: 0; flex: none; }

/* ---------- 결과 */
#end { justify-content: center; padding: 32px 16px 48px; }
.end-wrap { width: min(560px, 100%); display: flex; flex-direction: column; gap: 20px; }
.end-title { text-align: center; font-size: 36px; margin: 8px 0 0; font-weight: 400; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; height: 232px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 120px; }
.pod .av { width: 52px; height: 52px; font-size: 22px; margin-bottom: 4px; }
.pod .nm { font-size: 17px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .blk { width: 100%; border: 2px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; display: grid; place-items: start center; padding-top: 8px; font-size: 24px; margin-top: 4px; background: var(--card); }
.pod.p1 .blk { height: 120px; background: var(--hl); }
.pod.p2 .blk { height: 84px; }
.pod.p3 .blk { height: 56px; }
.pod .pt { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank li { --bs: 0 0 0 transparent; --bw: 2px; display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wob2); height: 52px; padding: 0 16px; font-size: 17px; }
.rank li .n { width: 20px; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rank li .nm { flex: 1; }
.rank li b { font-weight: 400; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); background: var(--ink); color: var(--card); padding: 8px 16px; border-radius: 12px;
  opacity: 0; transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; z-index: 10; font-size: 15px;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.conn { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card); border-radius: 999px; padding: 4px 16px; font-size: 14px; z-index: 11; display: none; }
.conn.on { display: block; }

/* ---------- 보일링 라인: 잉크 테두리만 꿈틀 (글자, 그림은 그대로) */
.btn, .panel, .wordbar, .chat, .pl, .ov-card, .tools .group, .rank li {
  position: relative; isolation: isolate; border-color: transparent !important; box-shadow: none !important; background-clip: padding-box;
}
.btn::before, .panel::before, .wordbar::before, .chat::before, .pl::before, .ov-card::before, .tools .group::before, .rank li::before {
  content: ''; position: absolute; inset: calc(-1 * var(--bw, 2px)); z-index: -1; pointer-events: none;
  border: var(--bw, 2px) var(--bst, solid) var(--ink); border-radius: inherit; box-shadow: var(--bs, none);
  filter: url(#boil);
}
.logo { filter: url(#boil-strong); }

/* ---------- 좁은 화면 (폰) */
@media (max-width: 900px) {
  #home { padding: 32px 16px; align-items: flex-start; }
  .home-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .logo { font-size: 52px; }
  #game { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { height: 48px; padding: 0 12px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); padding: 0 12px 12px; gap: 12px; }
  .stage { order: 1; }
  .plist { order: 2; flex-direction: row; overflow-x: auto; overflow-y: visible; padding: 12px 4px 4px 8px; }
  .pl { min-width: 128px; max-width: 152px; }
  .chat { order: 3; height: 36dvh; min-height: 200px; }
  .board-wrap { flex: none; }
  .wordbar { height: 64px; padding: 0 12px; gap: 8px; }
  .timer { width: 44px; height: 44px; }
  .word { font-size: 20px; }
  .word .bx { width: 20px; height: 24px; font-size: 18px; }
  .ov-card { padding: 12px; }
  .ov-who { margin-bottom: 8px; font-size: 18px; }
  .ov-answer { font-size: 28px; }
  .reel { clip-path: inset(0 calc(50% - 144px) calc(100% - 54px) calc(50% - 144px) round 16px); }
  .reel.open { clip-path: inset(0 round 16px); }
  .win, .win-frame { width: 288px; height: 54px; }
  .track .dtag { font-size: 15px; height: 32px; padding: 0 12px; }
  .detail { padding: 12px; }
  .dt-head .pts { font-size: 22px; }
  .dt-desc { font-size: 22px; margin: 4px 0 8px; }
  .dt-word { padding: 4px 12px; margin-bottom: 8px; }
  .dt-word b { font-size: 24px; }
  .dt-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .dt-grid > div { padding: 4px 8px; }
  .dt-grid b { font-size: 14px; }
  .colors { grid-template-columns: repeat(7, 24px); }
  .tools { gap: 8px; }
}
@media (max-width: 420px) {
  .room-code { font-size: 36px; letter-spacing: 4px; }
  .code-panel { flex-wrap: wrap; }
  .podium { height: 200px; gap: 8px; }
  .pod { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* 여러 개 고르는 주제 칩은 연한 형광펜 (전부 켜져도 화면이 노랗게 덮이지 않게) */
.chips.multi .chip.on { background: var(--hl-soft); }
.chips.multi .chip.all.on { background: var(--hl); }
