/* 외국어동아리 발표회 메타버스 — 겉모양 */
:root {
  --bg: #f6f3ec;
  --paper: #fffdf7;
  --card: #ffffff;
  --ink: #1d2b33;
  --muted: #5b6b73;
  --line: rgba(29, 43, 51, 0.12);
  --a: #13808a;
  --a-soft: #dff0ef;
  --b: #d0573a;
  --b-soft: #fbe5dc;
  --gold: #b98a2e;
  --play: #6a5acd;
  --good: #2f9e44;
  --warn: #e8590c;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(29, 43, 51, 0.16);
  --font: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: #c92a2a; font-weight: 700; margin: 8px 0 0; }
.warn { color: var(--warn); font-weight: 700; }

/* ── 버튼 · 입력 ── */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 700; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:hover { background: #f4f1ea; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--a); color: #fff; border-color: var(--a); }
.btn.primary:hover { background: #0f6b74; }
.btn.ghost { background: transparent; }
.btn.danger { color: #c92a2a; }
.btn.mini { padding: 5px 9px; font-size: 13px; border-radius: 8px; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; margin-bottom: 10px; }
input[type=text], input[type=url], input[type=search], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--a); box-shadow: 0 0 0 3px rgba(19, 128, 138, 0.15); }
input[type=range] { width: 100%; accent-color: var(--a); }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--a); width: 18px; height: 18px; flex: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.row.center { justify-content: center; }
.row > input, .row > select { flex: 1 1 160px; width: auto; }
.grow { flex: 1 1 auto; min-width: 0; }
kbd { display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 6px; background: #1d2b33; color: #fff; font-size: 12px; font-weight: 800; text-align: center; font-family: var(--font); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(19,128,138,0.2); border-top-color: var(--a); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 시작 화면 ── */
#landing { min-height: 100%; position: relative; overflow-x: hidden; padding: 0 16px 40px; }
.land-bg { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(800px 500px at 10% 0%, rgba(19,128,138,0.16), transparent 60%),
  radial-gradient(700px 500px at 100% 10%, rgba(208,87,58,0.14), transparent 60%),
  linear-gradient(transparent 31px, rgba(120,110,80,0.06) 32px) 0 0 / 32px 32px,
  linear-gradient(90deg, transparent 31px, rgba(120,110,80,0.06) 32px) 0 0 / 32px 32px,
  var(--bg); }
.land-head { max-width: 1180px; margin: 0 auto; padding: 34px 4px 18px; }
.land-head h1 { margin: 8px 0 6px; line-height: 1.15; font-size: clamp(28px, 4.6vw, 48px); font-weight: 900; letter-spacing: -0.02em; }
.land-head h1 small { display: block; font-size: 0.42em; color: var(--muted); font-weight: 800; letter-spacing: 0; }
.land-sub { margin: 0; font-weight: 700; color: var(--gold); font-size: 17px; }
.land-hello { margin: 6px 0 0; color: var(--muted); }
.land-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.lb { padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.lb.a { background: var(--a-soft); color: var(--a); }
.lb.b { background: var(--b-soft); color: var(--b); }
.land-main { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.land-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 4px 18px rgba(29,43,51,0.06); }
.land-card h2 { margin: 0 0 14px; font-size: 19px; }
.land-card h3 { margin: 16px 0 8px; font-size: 15px; color: var(--muted); }
.land-card.info { grid-column: 1 / -1; }
.me-grid { display: grid; grid-template-columns: 250px 1fr; gap: 18px; }
.me-pv { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pv-box { width: 240px; height: 240px; border-radius: 16px; background: linear-gradient(#f3f8f8, #fbf6ee); overflow: hidden; cursor: grab; }
.pv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.pv-opts select { padding: 7px 8px; font-size: 13px; }
.me-form { display: flex; flex-direction: column; gap: 12px; }
.me-form label > span { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
.me-form .agree span { font-weight: 500; font-size: 13.5px; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.sw.on { box-shadow: 0 0 0 3px var(--ink); }
.room-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.room-item { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 10px; border: 1px solid var(--line); background: #fbfaf6; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.room-item small { grid-column: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .cnt { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 800; color: var(--a); }
.room-item:hover { border-color: var(--a); }
.room-item.full { opacity: 0.5; cursor: not-allowed; }
details.mk { margin-top: 12px; }
details.mk summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.schedule { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.schedule li { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 10px; background: #fbfaf6; border-radius: 10px; }
.schedule b { color: var(--a); }
.map-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: block; }
.land-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ── 3D 화면 ── */
#game { position: fixed; inset: 0; overflow: hidden; background: #dfeef5; touch-action: none; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; inset: 0; }
.css3d-layer { position: absolute !important; inset: 0; z-index: 0; pointer-events: none; }
.css3d-layer iframe { pointer-events: none; border: 0; }
.yt-wrap { background: #000; }
.gl-canvas { position: absolute; inset: 0; z-index: 1; display: block; outline: none; }
#hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud > .touch-layer, #hud > .fade, #hud > .banners, #hud > .toasts, #hud > .topbar { pointer-events: none; }
#modal-root { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
/* 닫혀 있는 막·판은 클릭을 가로채지 않게 (이게 없으면 화면 전체 클릭이 막힘) */
#modal-root > .scrim, #modal-root > .sheet { pointer-events: none; }
#modal-root > .scrim.open, #modal-root > .sheet.open, #modal-root > .pic-overlay, #modal-root > .stopped { pointer-events: auto; }

/* 위쪽 막대 */
.topbar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none !important; }
.topbar > * { pointer-events: auto; }
.tb-left { display: flex; flex-direction: column; gap: 6px; }
.brand { background: rgba(255,255,255,0.92); border-radius: 12px; padding: 7px 12px; box-shadow: var(--shadow); line-height: 1.15; }
.brand b { display: block; font-size: 14px; white-space: nowrap; }
.brand small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.area-name { --theme: #555; white-space: nowrap; align-self: flex-start; background: var(--theme); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; box-shadow: var(--shadow); }
.chips { display: flex; gap: 6px; align-items: center; }
.room-chip, .count-chip { background: rgba(255,255,255,0.92); border: 0; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.net-dot { width: 10px; height: 10px; border-radius: 50%; background: #adb5bd; box-shadow: 0 0 0 2px #fff; }
.net-dot[data-state=open] { background: #2f9e44; }
.net-dot[data-state=reconnecting] { background: #f08c00; }
.tb-right { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 70vw; }
.hbtn { position: relative; display: flex; align-items: center; gap: 5px; border: 0; background: rgba(255,255,255,0.94); border-radius: 12px; padding: 8px 11px; cursor: pointer; box-shadow: var(--shadow); font-weight: 800; font-size: 13px; }
.hbtn:hover { background: #fff; transform: translateY(-1px); }
.hbtn.on { background: #13808a; color: #fff; }
.hico { font-size: 16px; }
.badge-count { position: absolute; top: -6px; right: -6px; background: var(--b); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; font-weight: 900; }
.minimap { position: absolute; top: 64px; right: 10px; width: 170px; height: 170px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 3px solid #fff; cursor: pointer; background: #fff; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.notice { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); max-width: min(720px, 60vw); background: #fff3bf; border: 2px solid #f2c94c; border-radius: 14px; padding: 9px 40px 9px 14px; font-weight: 800; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center; }
.notice .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 20px; cursor: pointer; }
.banners { position: absolute; top: 112px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none !important; width: min(760px, 62vw); }
.banner { pointer-events: auto; width: 100%; }
.bn { display: flex; gap: 10px; align-items: center; background: rgba(16,35,44,0.9); color: #fff; border-radius: 14px; padding: 9px 14px; box-shadow: var(--shadow); font-weight: 700; }
.bn > span:not(.timer):not(.pill) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn b { white-space: nowrap; }
.bn.pic { background: rgba(80,66,180,0.92); }
.bn.tag { background: rgba(201,42,42,0.9); }
.bn .timer { background: rgba(255,255,255,0.2); border-radius: 999px; padding: 2px 10px; font-weight: 900; }
.bn .pill, .pill { background: rgba(255,255,255,0.2); border-radius: 999px; padding: 2px 10px; font-size: 13px; white-space: nowrap; }
.bn .pill.o { background: #2f6fe4; }
.bn .pill.x { background: #e4483b; }
.prompt { position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.95); border-radius: 999px; padding: 8px 16px; font-weight: 800; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.toasts { position: absolute; bottom: 196px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none !important; width: min(560px, 90vw); }
.toast { pointer-events: auto; background: rgba(29,43,51,0.92); color: #fff; padding: 9px 15px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); animation: toastIn .25s ease; text-align: center; }
.toast.good { background: rgba(47,158,68,0.95); }
.toast.warn { background: rgba(232,89,12,0.95); }
.toast.hint { background: rgba(106,90,205,0.95); }
.toast.action { display: flex; gap: 10px; align-items: center; background: #fff; color: var(--ink); border: 2px solid var(--a); }
.toast.action button { border: 0; background: var(--a); color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 800; cursor: pointer; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* 채팅 */
.chat { position: absolute; left: 10px; bottom: 10px; width: min(400px, 42vw); display: flex; flex-direction: column; gap: 6px; }
.chat-toggle { align-self: flex-start; border: 0; background: rgba(255,255,255,0.92); border-radius: 10px; padding: 4px 8px; cursor: pointer; box-shadow: var(--shadow); }
.chat-log { max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; background: rgba(16,35,44,0.66); color: #fff; font-size: 14.5px; line-height: 1.4; scrollbar-width: thin; box-shadow: var(--shadow); text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.chat-line { animation: toastIn .2s ease; }
.chat-line b { margin-right: 6px; color: #ffe08a; }
.chat-line.mine b { color: #9ff0e6; }
.chat-line.sys { color: #d6f5ff; font-style: normal; opacity: 0.9; }
.chat-line span { word-break: break-word; }
.chat.collapsed .chat-log, .chat-log:empty { display: none; }
.chat-input { background: rgba(255,255,255,0.95) !important; box-shadow: var(--shadow); }
.emotebar { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; background: rgba(255,255,255,0.9); padding: 5px; border-radius: 14px; box-shadow: var(--shadow); }
.emo { position: relative; border: 0; background: transparent; border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 19px; }
.emo:hover { background: #f1ede4; }
.emo small { position: absolute; right: 2px; bottom: 0; font-size: 9px; color: var(--muted); font-weight: 800; }
.sound-btn { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); border: 0; background: var(--gold); color: #fff; font-weight: 900; border-radius: 999px; padding: 10px 18px; box-shadow: var(--shadow); cursor: pointer; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.05); } }
.fade { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none !important; transition: opacity .22s; }
.fade.on { opacity: 1; }
.conn-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(246,243,236,0.6); backdrop-filter: blur(2px); }
.conn-box { background: #fff; border-radius: 16px; padding: 22px 30px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.fps { position: absolute; left: 10px; top: 150px; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.stopped { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(246,243,236,0.85); z-index: 60; }
.stopped-box { background: #fff; padding: 26px; border-radius: 18px; box-shadow: var(--shadow); max-width: 420px; text-align: center; }

/* 손가락 조작 */
.touch-layer { position: absolute; inset: 0; pointer-events: none !important; }
.touch-layer > * { pointer-events: auto; }
.joy-zone { position: absolute; left: 0; bottom: 0; width: 42vw; height: 46vh; }
body:not(.touch-ui) .joy-zone, body:not(.touch-ui) .tpad { display: none; }
/* 방향 조작판: 손대기 전에도 왼쪽 아래에 보임 (누르면 그 자리로 옮겨 감) */
.joy-zone { touch-action: none; }
.joy-base { position: absolute; left: 92px; top: calc(100% - 128px); width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255,255,255,0.32); border: 2px solid rgba(255,255,255,0.85); box-shadow: 0 4px 14px rgba(0,0,0,0.18); pointer-events: none; }
.joy-base.on { background: rgba(255,255,255,0.42); }
.joy-arrow { position: absolute; color: rgba(29,43,51,0.55); font-size: 15px; line-height: 1; }
.joy-arrow.up { top: 6px; left: 50%; transform: translateX(-50%); }
.joy-arrow.down { bottom: 6px; left: 50%; transform: translateX(-50%); }
.joy-arrow.left { left: 7px; top: 50%; transform: translateY(-50%); }
.joy-arrow.right { right: 7px; top: 50%; transform: translateY(-50%); }
.tbtn { touch-action: none; user-select: none; -webkit-user-select: none; }
.joy-knob { position: absolute; left: 33px; top: 33px; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,0.9); box-shadow: var(--shadow); }
.tpad { position: absolute; right: 14px; bottom: 70px; display: grid; grid-template-columns: repeat(2, 64px); gap: 10px; }
.tbtn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.88); font-weight: 900; font-size: 13px; box-shadow: var(--shadow); }
.tbtn.on { background: var(--a); color: #fff; }
.tbtn.t-jump { grid-column: 2; grid-row: 2; width: 72px; height: 72px; background: rgba(19,128,138,0.92); color: #fff; }
.tbtn.t-act { grid-column: 2; grid-row: 1; font-size: 12px; letter-spacing: -0.5px; }
.tbtn.t-down { grid-column: 1; grid-row: 2; }

/* ── 옆 판 ── */
.scrim { position: absolute; inset: 0; background: rgba(16,35,44,0.25); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--paper); box-shadow: -10px 0 40px rgba(16,35,44,0.2); transform: translateX(105%); transition: transform .24s ease; display: flex; flex-direction: column; pointer-events: auto; }
.sheet.open { transform: none; }
.sheet.wide { width: min(760px, 100vw); }
.sheet.center { top: 50%; left: 50%; right: auto; bottom: auto; width: min(980px, 94vw); height: min(88vh, 860px); border-radius: 20px; transform: translate(-50%, -46%) scale(0.98); opacity: 0; transition: all .2s; pointer-events: none; }
.sheet.center.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-head .x, .pic-top .x { border: 0; background: #efebe2; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 16px 30px; user-select: text; -webkit-user-select: text; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 15.5px; }
.card p { margin: 6px 0; }
.now-title { font-weight: 900; font-size: 16px; }
.progress { height: 8px; border-radius: 99px; background: #ece7dc; overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; background: var(--a); width: 0; transition: width .4s; }
.progress.seekable { cursor: pointer; height: 12px; }
.progress.big { height: 14px; }
.queue { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.queue li > div { display: inline-flex; }
.queue li { display: list-item; }
.queue li { padding: 2px 0; }
.chips-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { background: #f1ede4; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.chip.on { background: var(--play); color: #fff; }
.chip.red { background: #e03131; color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two ol { margin: 6px 0; padding-left: 20px; }
.area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.area-btn { --theme: #555; text-align: left; border: 2px solid var(--theme); background: #fff; border-radius: 14px; padding: 12px; cursor: pointer; display: grid; gap: 2px; position: relative; }
.area-btn b { color: var(--theme); font-size: 16px; }
.area-btn small { color: var(--muted); }
.area-btn .cnt { position: absolute; right: 10px; top: 10px; font-size: 12px; font-weight: 800; color: var(--muted); }
.area-btn.here { background: var(--theme); }
.area-btn.here b, .area-btn.here small, .area-btn.here .cnt { color: #fff; }
.booth-list h4 { margin: 12px 0 6px; }
.booth-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.booth-row .no { color: #fff; border-radius: 8px; padding: 3px 7px; font-weight: 900; font-size: 13px; }
.booth-row small { color: var(--muted); }
.stamp-head { display: flex; gap: 12px; align-items: center; }
.stamp-head b { font-size: 28px; color: var(--b); white-space: nowrap; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.stamp-cell { --theme: #555; border: 2px solid var(--theme); background: #fff; border-radius: 12px; padding: 8px 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.stamp-cell .sno { font-weight: 900; color: var(--theme); }
.stamp-cell .sic { font-size: 22px; line-height: 1.1; }
.stamp-cell small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stamp-cell.got { background: var(--theme); }
.stamp-cell.got .sno, .stamp-cell.got small { color: #fff; }
.avatar-holder { display: grid; place-items: center; margin-bottom: 10px; }
.av-editor { display: flex; flex-direction: column; gap: 10px; }
.av-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: start; }
.av-label { font-weight: 800; font-size: 13.5px; color: var(--muted); padding-top: 6px; }
.type-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.type-btn { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 6px 2px 4px; cursor: pointer; display: grid; justify-items: center; gap: 1px; }
.type-btn .ti { font-size: 24px; line-height: 1.1; }
.type-btn small { font-size: 11px; font-weight: 700; color: var(--muted); }
.type-btn.on { border-color: var(--a); background: var(--a-soft); }
.type-btn.on small { color: var(--a); }
.swatches.left { justify-content: flex-start; }
.av-editor.compact .opt { padding: 4px 10px; font-size: 12.5px; }
@media (max-width: 560px) { .type-grid { grid-template-columns: repeat(4, 1fr); } .av-row { grid-template-columns: 1fr; } .av-label { padding-top: 0; } }
.avatar-preview-canvas { border-radius: 16px; background: linear-gradient(#f3f8f8, #fbf6ee); cursor: grab; }
.opt-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 700; font-size: 13.5px; }
.opt.on { background: var(--ink); color: #fff; }
.person { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tag-admin, .tag-host { margin-left: 6px; font-size: 11px; font-weight: 900; border-radius: 6px; padding: 1px 6px; }
.tag-admin { background: #e85d04; color: #fff; }
.tag-host { background: var(--gold); color: #fff; }
.setting { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.setting.check { display: flex; }
.keys { width: 100%; border-collapse: collapse; }
.keys td { padding: 5px 4px; border-bottom: 1px dashed var(--line); font-size: 14px; }

/* 부스 판 */
.booth-head { --theme: #555; display: flex; gap: 14px; align-items: center; padding: 4px 0 12px; border-bottom: 3px solid var(--theme); margin-bottom: 10px; }
.booth-head .no { background: var(--theme); color: #fff; font-size: 28px; font-weight: 900; border-radius: 14px; padding: 8px 14px; }
.booth-head h3 { margin: 0; font-size: 21px; }
.booth-head p { margin: 2px 0; font-weight: 700; color: var(--theme); }
.booth-head small { color: var(--muted); }
/* 좁은 화면: 스탬프 표시를 아래 줄로 내려 학교 · 동아리 설명이 세로로 길게 밀리지 않게 */
@media (max-width: 640px) {
  .booth-head { flex-wrap: wrap; gap: 10px; }
  .booth-head > div:not(.no) { flex: 1 1 calc(100% - 90px); min-width: 0; }
  .booth-head > :last-child:not(:nth-child(2)) { flex-basis: 100%; }
  .booth-head h3 { font-size: 18px; }
}
.booth-stamp { background: #f1ede4; border-radius: 999px; padding: 6px 12px; font-weight: 800; white-space: nowrap; }
.booth-stamp.got { background: #fff3bf; color: #a5770a; }
.booth-stamp.pop { animation: pop .6s; }
@keyframes pop { 40% { transform: scale(1.25) rotate(-6deg); } }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.tab.on { background: var(--ink); color: #fff; }
.media-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.media-box video, .media-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.tab-body img.zoomable { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 10px; background: #fff; cursor: zoom-in; }
.tab-body img.zoomable.zoom { max-height: none; cursor: zoom-out; }
.topic { font-weight: 700; color: var(--muted); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty img { max-width: 100%; max-height: 50vh; border-radius: 12px; }
.book { display: grid; place-items: center; background: #f1ede4; border-radius: 14px; padding: 10px; }
.book .page, .tab-body > img.page { max-width: 100%; max-height: 62vh; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); cursor: pointer; background: #fff; }
.quiz-card { border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: #fff; transition: border-color .2s; }
.quiz-card.solved { border-color: var(--good); background: #f4fbf5; }
.quiz-card.wrong { animation: shake .4s; border-color: #e03131; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.qnum { font-weight: 900; color: var(--muted); font-size: 13px; }
.qtext { font-weight: 800; font-size: 16px; white-space: pre-wrap; }
.opts { display: grid; gap: 6px; }
.opts.ox { grid-template-columns: 1fr 1fr; }
.opt-btn { border: 1px solid var(--line); background: #fbfaf6; border-radius: 10px; padding: 10px 12px; text-align: left; cursor: pointer; font-weight: 700; }
.opts.ox .opt-btn { text-align: center; font-size: 24px; font-weight: 900; }
.opt-btn:hover { border-color: var(--a); background: #fff; }
.feedback { margin-top: 8px; }
.feedback .ok { color: var(--good); font-weight: 900; }
.feedback .no { color: #e03131; font-weight: 900; }
.feedback .reveal { color: #a5770a; font-weight: 900; }
.feedback .ex { margin: 6px 0 0; color: var(--muted); }
/* 퀴즈 힌트 */
.quiz-card .hint-btn { white-space: nowrap; }
.quiz-card .hint-btn:disabled { opacity: .5; cursor: default; }
.quiz-hints { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.quiz-hints:empty { display: none; }
.quiz-hints .hint { background: #fff8e1; border: 1px solid #f1d58a; border-radius: 10px; padding: 7px 10px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.quiz-hints .hint b { display: block; font-size: 12px; color: #8a6400; margin-bottom: 2px; }
.quiz-hints .hint.page { background: #eef6ff; border-color: #b7d3f5; }
.quiz-hints .hint.page b { color: #2b5c9a; }
.quiz-hints .hint.mask span, .quiz-hints .hint.shape span { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .5px; }
.feedback .no.fb-near, .feedback .no.fb-part, .feedback .no.fb-spell, .feedback .no.fb-updown, .feedback .no.fb-lang { color: #c25e00; }
.quiz-left { display: block; margin-top: 6px; }
.quiz-left:empty { display: none; }
.opt-btn.elim { opacity: .38; text-decoration: line-through; cursor: default; }
.video-holder { position: fixed; left: -4px; top: -4px; width: 2px; height: 2px; overflow: hidden; opacity: 0.01; pointer-events: none; z-index: -1; }
.video-holder video { width: 2px; height: 2px; }
.photo-result { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.word-card { text-align: center; background: linear-gradient(#fff8e6, #ffffff); border: 3px solid #e63946; border-radius: 20px; padding: 18px; animation: pop .6s; }
.wc-ko { font-size: 40px; font-weight: 900; }
.word-card .words { margin: 10px auto 0; }

/* 그림 맞히기 */
.pic-overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(16,35,44,0.35); z-index: 25; }
.pic-card { width: min(1100px, 96vw); max-height: 96vh; max-height: min(96vh, 96dvh); background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pic-top { display: flex; gap: 10px; align-items: center; }
.pic-head { flex: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.pic-head .pill { background: var(--play); color: #fff; }
.pic-head .pill.soft { background: #ece9fb; color: var(--play); }
.pic-head .timer { margin-left: auto; font-weight: 900; background: #ece9fb; color: var(--play); border-radius: 999px; padding: 3px 12px; }
.pic-head .timer.hurry { background: #e03131; color: #fff; }
.pic-main { display: grid; grid-template-columns: 1fr 190px; gap: 10px; min-height: 0; }
.pic-stage { position: relative; }
.pic-canvas { width: auto; height: auto; max-width: 100%; max-height: 70vh; margin: 0 auto; background: #fff; border-radius: 14px; border: 2px solid #e3dff5; display: block; } /* 비율을 지켜야 그린 선이 손 위치와 맞음 */
.pic-canvas.can-draw { cursor: crosshair; border-color: var(--play); }
.pic-modal { position: absolute; inset: 12% 10%; background: rgba(255,255,255,0.97); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; overflow: auto; text-align: center; }
.pic-modal h3 { margin: 4px 0 10px; font-size: 22px; }
.pic-modal .ko { font-weight: 800; color: var(--play); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { border: 2px solid #e3dff5; background: #fff; border-radius: 16px; padding: 16px 8px; cursor: pointer; display: grid; gap: 4px; }
.choice b { font-size: 22px; }
.choice:hover { border-color: var(--play); background: #f6f4ff; }
.words { margin: 8px auto; border-collapse: collapse; font-size: 17px; }
.words td { padding: 4px 12px; border-bottom: 1px dashed var(--line); text-align: left; }
.words td:first-child { color: var(--muted); font-weight: 700; }
.rank { text-align: left; display: inline-block; font-size: 18px; }
.pic-side { background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 8px; overflow: auto; }
.pic-side h4 { margin: 2px 0 6px; }
.pp { display: flex; gap: 6px; align-items: center; padding: 4px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.pp b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp.drawer { color: var(--play); }
.pp.got { color: var(--good); }
.pp.me b { text-decoration: underline; }
.pic-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.palette { display: flex; flex-wrap: wrap; gap: 4px; }
.pc { width: 26px; height: 26px; border-radius: 6px; border: 2px solid #ddd; cursor: pointer; }
.pc.on { outline: 3px solid var(--ink); }
.sizes { display: flex; gap: 4px; }
.sz { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; }
.sz i { display: block; border-radius: 50%; background: var(--ink); }
.sz.on { background: #ece9fb; border-color: var(--play); }
.pic-guess { font-size: 17px !important; padding: 12px !important; }

/* 컴퓨터 중간 너비: 위쪽 단추 10개가 되도록 한 줄에 들어가게 조금 좁힘 */
@media (min-width: 901px) and (max-width: 1400px) {
  .tb-right { gap: 4px; max-width: 74vw; }
  .hbtn { padding: 7px 8px; gap: 4px; font-size: 12.5px; }
  .emotebar { left: auto; right: 10px; transform: none; } /* 채팅칸과 겹치지 않게 오른쪽 아래로 */
}
@media (min-width: 901px) and (max-width: 1180px) {
  .brand b { font-size: 12.5px; }
  .hbtn .hlbl { font-size: 12px; }
}

/* ── 좁은 화면 · 휴대폰 ── */
@media (max-width: 900px) {
  .land-main { grid-template-columns: 1fr; }
  .me-grid { grid-template-columns: 1fr; }
  .me-pv { order: -1; }
  .hlbl { display: none; }
  .hbtn { padding: 8px 9px; }
  .brand { display: none; }
  .minimap { width: 120px; height: 120px; top: 92px; }
  .banners { top: 150px; width: 92vw; }
  .notice { top: 92px; max-width: 92vw; }
  .chat { width: 62vw; bottom: 150px; }
  body:not(.touch-ui) .chat { left: 60px; width: min(440px, calc(100vw - 80px)); } /* 세로 감정 막대와 겹치지 않게 */
  .chat-log { max-height: 120px; font-size: 12.5px; }
  .emotebar { bottom: auto; top: 128px; left: 10px; transform: none; flex-direction: column; padding: 3px; }
  .emo { width: 32px; height: 32px; font-size: 16px; }
  .emo small { display: none; }
  .prompt { bottom: 200px; }
  .toasts { bottom: 240px; }
  .sheet { width: 100vw; top: auto; height: 82vh; height: min(82vh, 82dvh); border-radius: 20px 20px 0 0; transform: translateY(105%); }
  .sheet.open { transform: none; }
  .sheet.center { width: 100vw; height: 92vh; height: min(92vh, 92dvh); top: auto; left: 0; bottom: 0; border-radius: 20px 20px 0 0; transform: translateY(105%); opacity: 1; }
  .sheet.center.open { transform: none; }
  .pic-main { grid-template-columns: 1fr; }
  .pic-side { max-height: 90px; }
  .choices { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; }
  .schedule li { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  .chat.collapsed .chat-log { display: none; }
}

/* ── 휴대폰 · 손가락 조작 화면 ── */
.emo-toggle { display: none; }
body.touch-ui .emo-toggle, .emo-toggle.show { display: grid; place-items: center; position: absolute; right: 14px; bottom: 236px; width: 50px; height: 50px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.92); font-size: 24px; box-shadow: var(--shadow); }
body.touch-ui .emotebar { display: none; top: auto; left: 50%; right: auto; bottom: 160px; transform: translateX(-50%); flex-direction: row; flex-wrap: wrap; width: min(300px, 86vw); justify-content: center; padding: 6px; }
body.touch-ui .emotebar.open { display: flex; }
body.touch-ui .emo { width: 46px; height: 46px; font-size: 22px; }
body.touch-ui .emo small { display: none; }
body.touch-ui .chat { top: 92px; bottom: auto; left: 8px; width: min(64vw, 340px); }
body.touch-ui .chat-row { order: -1; }
body.touch-ui .chat-toggle { position: absolute; right: -40px; top: 0; }
/* 휴대폰: 채팅은 💬 단추만 보이고, 누르면 펼쳐짐 (화면 위쪽 입구 간판 · 부스 간판을 가리지 않게) */
body.touch-ui .chat.collapsed .chat-row { display: none; }
body.touch-ui .chat.collapsed { width: auto; } /* 접혔을 때는 💬 단추 크기만 (작은 지도 가장자리를 막지 않게) */
body.touch-ui .chat.collapsed .chat-toggle { position: static; font-size: 20px; padding: 6px 10px; }
body.touch-ui .chat-log { max-height: 20vh; font-size: 12.5px; padding: 6px 8px; background: rgba(16,35,44,0.55); }
body.touch-ui .chat-input { padding: 8px 10px; font-size: 14px; }
body.touch-ui .prompt { bottom: 300px; font-size: 13px; padding: 6px 12px; max-width: 92vw; white-space: normal; text-align: center; }
body.touch-ui .toasts { bottom: auto; top: 40%; }
body.touch-ui .minimap { width: 104px; height: 104px; top: 96px; right: 8px; }
body.touch-ui .banners { top: 210px; width: 94vw; }
body.touch-ui .tpad { right: 12px; bottom: 26px; }
body.touch-ui .joy-zone { width: 50vw; height: 42vh; }
body.touch-ui .sound-btn { bottom: auto; top: 160px; }
body.touch-ui .fps { top: auto; bottom: 4px; left: 4px; }
@media (max-width: 900px) {
  .topbar { left: 6px; right: 6px; top: 6px; }
  .tb-right { gap: 4px; max-width: 78vw; }
  .hbtn { padding: 7px 8px; border-radius: 10px; }
  .hico { font-size: 15px; }
  .room-chip { display: none; }
  .area-name { font-size: 12.5px; padding: 5px 11px; }
  .notice { font-size: 13px; }
}
@media (max-height: 500px) and (pointer: coarse) {
  /* 휴대폰 가로 화면 */
  body.touch-ui .chat { top: 72px; width: 42vw; } /* 사람 수 표시 아래로 */
  body.touch-ui .chat-log { max-height: 26vh; }
  body.touch-ui .minimap { top: 56px; width: 84px; height: 84px; }
  body.touch-ui .prompt { bottom: 150px; }
  body.touch-ui .emo-toggle { bottom: 16px; right: 146px; }
  body.touch-ui .emotebar { bottom: 90px; }
  body.touch-ui .tpad { bottom: 12px; grid-template-columns: repeat(2, 56px); gap: 8px; }
  body.touch-ui .tbtn { width: 56px; height: 56px; font-size: 12px; }
  body.touch-ui .tbtn.t-act, body.touch-ui .tbtn.t-down { font-size: 10.5px; letter-spacing: -0.8px; }
}

/* ── 역할 (학생 · 선생님 · 운영자) ── */
.role-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-row > span { font-weight: 800; }
.role-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.role-btn { border: 2px solid #d9d2c3; background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 800; cursor: pointer; font-size: 14px; }
.role-btn.on { border-color: #13808a; background: #13808a; color: #fff; }
.tag-teacher { margin-left: 6px; font-size: 11px; font-weight: 900; border-radius: 6px; padding: 1px 6px; background: #2a9d8f; color: #fff; }
.chat-role { font-size: 10px; font-weight: 900; border-radius: 5px; padding: 1px 5px; margin-right: 4px; color: #fff; background: #2a9d8f; vertical-align: 1px; }
.chat-line.role-a .chat-role { background: #e85d04; }
.chat-line.role-t b, .chat-line.role-a b { color: #ffe08a; }
.person select { font-size: 12px; padding: 3px 4px; border-radius: 8px; max-width: 108px; }

/* ── 부스 느낌 투표 ── */
.react-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 10px; padding: 8px 10px; background: #fbf7ee; border-radius: 12px; }
.react-title { font-weight: 800; font-size: 13px; margin-right: 4px; color: #5b4a2a; }
.react-btn { display: inline-flex; align-items: center; gap: 4px; border: 2px solid #eadfc8; background: #fff; border-radius: 999px; padding: 4px 10px 4px 7px; cursor: pointer; font-size: 13px; font-weight: 700; transition: transform .12s; }
.react-btn:hover { transform: translateY(-1px); }
.react-btn:active { transform: scale(0.95); }
.react-btn .ri { font-size: 17px; }
.react-btn b { min-width: 14px; text-align: right; color: #8a7350; }
.react-btn.on { border-color: #e85d75; background: #fff0f3; }
.react-btn.on b { color: #e85d75; }
body.touch-ui .react-btn .rn { display: none; }

/* ── 처음 안내 ── */
.ob-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 8px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e0d8c8; }
.ob-dots i.on { background: #13808a; width: 22px; border-radius: 6px; }
.ob-title { margin: 4px 0 6px; font-size: 20px; }
.ob-lead { margin: 0 0 8px; color: #5b6b73; }
.ob-keys td { padding: 4px 6px; vertical-align: top; }
.ob-keys kbd { white-space: nowrap; }
.ob-tip { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #eef7f6; line-height: 1.5; font-size: 14px; }
.ob-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ob-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #fbf8f1; }
.ob-item b { display: block; }
.ob-item small { color: #5b6b73; line-height: 1.4; }
.ob-ico { font-size: 22px; line-height: 1; flex: none; }
.ob-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ob-rules li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; background: #fff6ee; line-height: 1.45; }
.ob-nav { justify-content: space-between; margin-top: 14px; }

/* ── 완주 보상 꾸미기 ── */
.av-editor .opt.locked, .av-editor .sw.locked { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.av-editor .sw.reward { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d4a017; }
.av-editor .opt.reward:not(.locked) { border-color: #d4a017; }
.av-reward { margin: 6px 0 0; font-size: 12px; color: #8a7350; background: #fbf5e6; border-radius: 10px; padding: 6px 10px; }
.av-reward.on { color: #7a5a00; background: #fff3c4; font-weight: 700; }
.emo.reward { background: linear-gradient(135deg, #fff3c4, #ffe08a); }

/* 1:1 채팅 */
.badge-count.dm { background: #e03131; }
.dm-log { display: flex; flex-direction: column; gap: 6px; max-height: min(52vh, 420px); min-height: 160px; overflow-y: auto; padding: 10px; background: #f6f3ea; border-radius: 12px; margin: 8px 0; }
.dm-msg { display: flex; flex-direction: column; align-items: flex-start; }
.dm-msg.mine { align-items: flex-end; }
.dm-bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); word-break: break-word; line-height: 1.4; }
.dm-msg.mine .dm-bubble { background: #13808a; color: #fff; border-radius: 14px 14px 4px 14px; }
.dm-time { color: var(--muted); font-size: 11px; margin: 2px 4px 0; }
.dm-row input { flex: 1; min-width: 0; }
.dm-inbox { display: grid; gap: 6px; }
.dm-item { display: flex; align-items: center; gap: 6px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; overflow: hidden; white-space: nowrap; }
.dm-item .muted { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.dm-unread { background: #e03131; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 800; }

/* 그림 게시판 */
.draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.draw-item { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.draw-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-radius: 8px; cursor: zoom-in; }
.draw-item figcaption { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.paint-wrap { display: flex; justify-content: center; }
.paint-canvas { width: min(100%, 560px); aspect-ratio: 4 / 3; background: #fff; border: 2px solid var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.paint-colors { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); cursor: pointer; }
.swatch.on { outline: 3px solid #13808a; outline-offset: 2px; }
.paint-tools { flex-wrap: wrap; justify-content: center; }
.paint-sizes { display: flex; gap: 4px; }
.paint-sizes .on, .paint-tools .on { background: #13808a; color: #fff; }

.paint-preview { display: grid; gap: 10px; justify-items: center; text-align: center; }
.paint-preview-img, .draw-zoom { width: min(100%, 560px); aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border: 2px solid var(--line); border-radius: 12px; }

/* 첫 접속 화면 안내 (각 단추 · 조작판 옆에 설명 · 상자들은 빈자리를 찾아 겹치지 않게) */
.coach { position: fixed; inset: 0; z-index: 9000; background: rgba(8, 22, 28, 0.62); animation: coachIn .25s ease; font-family: inherit; }
.coach.out { opacity: 0; transition: opacity .25s; }
@keyframes coachIn { from { opacity: 0; } to { opacity: 1; } }
.coach-layer { position: absolute; inset: 0; }
.coach-ring { position: absolute; border: 3px solid #ffd166; border-radius: 14px; box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.25), 0 0 18px rgba(255, 209, 102, 0.55); -webkit-backdrop-filter: brightness(1.9) saturate(1.2); backdrop-filter: brightness(1.9) saturate(1.2); pointer-events: none; }
.coach-tip { position: absolute; max-width: 230px; background: #fffdf6; color: #1d2b33; border-radius: 12px; padding: 7px 11px; font-size: 14px; font-weight: 700; line-height: 1.35; box-shadow: 0 6px 20px rgba(0,0,0,.3); word-break: keep-all; }
.coach-tip.mini { max-width: 150px; font-size: 12.5px; padding: 6px 9px; text-align: center; }
body.touch-ui .coach-tip { font-size: 12.5px; padding: 5px 9px; max-width: 170px; }
.coach-card { position: absolute; width: min(420px, 90vw); background: #fffdf6; border-radius: 18px; padding: 16px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.coach-card h3 { margin: 0 0 10px; font-size: 18px; color: #13808a; }
.coach-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.coach-card li { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.coach-card kbd { background: #1d2b33; color: #fff; border-radius: 8px; padding: 4px 8px; font-family: inherit; font-weight: 800; font-size: 13px; text-align: center; }
.coach-card.compact { width: min(560px, 94vw); padding: 12px 16px; }
.coach-card.compact h3 { font-size: 16px; margin-bottom: 8px; }
.coach-card.compact ul { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.coach-card.compact li { grid-template-columns: 86px 1fr; gap: 8px; font-size: 13px; }
.coach-card.compact kbd { font-size: 12px; padding: 3px 6px; }
.coach-go { position: absolute; display: grid; justify-items: center; gap: 8px; text-align: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); width: max-content; max-width: min(460px, 92vw); }
.coach-go p { margin: 0; font-weight: 800; font-size: 16px; }
.coach-go small { opacity: .85; }
.draw-zoom { display: block; margin: 0 auto; }
/* 휴대폰: 위쪽 단추 뜻 · 조작 설명 · 시작 단추를 한 상자에 */
.coach-panel { position: absolute; display: grid; gap: 7px; background: #fffdf6; color: #1d2b33; border-radius: 14px; padding: 10px 12px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); box-sizing: border-box; }
.coach-panel > b { color: #13808a; font-size: 13px; }
.coach-legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 3px 6px; font-size: 12px; font-weight: 700; }
.coach-legend-grid i { font-style: normal; }
.coach-line { font-size: 12.5px; font-weight: 600; line-height: 1.35; word-break: keep-all; }
.coach-line b { color: #13808a; }
.coach-panel .row { justify-content: center; gap: 8px; margin: 2px 0 0; }
.coach-panel .btn.primary.big { width: auto; min-width: 62%; margin: 0; padding: 10px 26px; font-size: 16px; }
.coach-panel.tight { gap: 5px; padding: 8px 10px 10px; }
.coach-panel.tight .btn.primary.big { padding: 8px 22px; font-size: 15px; }
.coach-panel.tight .coach-legend-grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 2px 4px; font-size: 11.5px; white-space: nowrap; }
.coach-panel.tight .coach-line { font-size: 12px; }
.coach-panel small { color: #5d6b72; text-align: center; font-size: 11.5px; }
