/* ══════════════════════════════════════════════════════════════════
   꾸러기탐험대 게임 화면 옷 v2 (2026-11-28 사장님 "게임회사에서 만든 것처럼")
   - index.html 안의 기본 배치(자리·크기·화면 폭별 규칙)는 그대로 두고, 생김새를 이 파일이 덮어쓴다
   - 본보기: 아이용 3D 모바일 게임의 흔한 화면 짜임
       왼쪽 위 = 내 프로필(얼굴·이름·레벨·경험치 막대) · 오른쪽 위 = 재화(포인트·별)와 메뉴
       아래 = 조작(조이스틱·점프·탈것) · 가운데 = 알림 · 메뉴는 화면 가운데 큰 판(일시 정지 화면처럼)
   - 3D 화면 위 단추는 짙은 반투명 판 + 흰 글씨(낮·밤 모두 잘 보이게), 창(대화창)은 흰 판 + 보라 머리띠
   - 흐림(backdrop-filter)은 쓰지 않는다: 폰에서 3D 위를 매번 흐리게 하면 느려진다
   - 한글은 어절 중간에서 끊기지 않게(keep-all) — html/body 에 이미 걸려 있다
   ══════════════════════════════════════════════════════════════════ */
:root {
  --g-font: 'Jua', 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Malgun Gothic', sans-serif;
  --g-glass: rgba(26, 20, 62, .74);
  --g-glass-hi: rgba(36, 28, 84, .86);
  --g-edge: rgba(255, 255, 255, .24);
  --g-shadow: 0 6px 18px rgba(10, 8, 30, .3);
  --g-pri: #7c3aed; --g-pri-hi: #a78bfa; --g-pri-lo: #4c1d95;
  --g-head: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
  --g-btn: linear-gradient(180deg, #a78bfa 0%, #7c3aed 52%, #6d28d9 100%);
  --g-go: linear-gradient(180deg, #86efac 0%, #22c55e 46%, #16a34a 100%);
  --g-gold: linear-gradient(180deg, #fef08a 0%, #facc15 45%, #f59e0b 100%);
  --g-cream: linear-gradient(180deg, #fffdf6 0%, #ffffff 46%);
}

/* ── 글꼴: 제목·단추·숫자는 둥근 게임 글꼴, 긴 설명 글은 읽기 쉬운 기본 글꼴 ── */
.pill, .prof, .ride button span, .jump, .enterbtn b, .mini-bar button, .toast, .lb-nm b, .lb-door, .lb-float,
.card h2, .card .big-go, .go, .soft, .bigpick, .kidcard b, .kidcard em, .gradegrid button, .ask, .qz-opts button, .gt-opts button,
.qz-tag, .qz-msg, .qz-res, .crash b, .bm-top h2, .bm-top button, .bm-home, .pick b, .gmb b, .bg b, .kidgo b, .km-kid b,
.coupon > b, .rk, .pin-keys button, .stick .knob, .pad span, .emote-panel button span, .guide b, .sighud, .playhud, .namebox label, .homebox label {
  font-family: var(--g-font);
}

/* ── 맨 위 위치 띠: 짙은 띠 + 동 이름은 노랑(이모지 없음 — 2026-11-19 사장님) ── */
.where { background: linear-gradient(180deg, rgba(22, 17, 54, .86), rgba(22, 17, 54, .66)); color: #fff; box-shadow: 0 2px 12px rgba(10, 8, 30, .28); }
.where b { color: #fde047; font: 400 16px/1 var(--g-font); letter-spacing: .01em; }
.where span { color: #fff; }
.where span:not(:empty) { border-left-color: rgba(255, 255, 255, .28); }
.where small { color: rgba(255, 255, 255, .74); }
.where span.warn { color: #fff; }
.where:has(.warn) { background: linear-gradient(180deg, #dc2626, #b91c1c); }

/* ── 위 줄: 왼쪽 프로필 · 오른쪽 재화와 메뉴(한 줄, 가운데는 3D 화면을 누를 수 있게 비움) ── */
.topright { left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); top: calc(10px + var(--safe-t)); max-width: none; flex-wrap: nowrap; align-items: flex-start; gap: 8px; pointer-events: none; }
.topright > * { pointer-events: auto; flex: none; }
.pill { height: 44px; padding: 0 14px 0 6px; gap: 7px; border-radius: 999px; background: var(--g-glass); color: #fff; border: 2px solid var(--g-edge); box-shadow: var(--g-shadow); font-size: 19px; font-weight: 400; line-height: 1; white-space: nowrap; }
.pill b { font-weight: 400; font-variant-numeric: tabular-nums; }
.pill:active { transform: translateY(2px); }
.cur-ic { font-style: normal; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); }
.coin .cur-ic { background: radial-gradient(circle at 35% 30%, #fff7cc 0, #fcd34d 45%, #d97706 100%); }
.star .cur-ic { background: radial-gradient(circle at 35% 30%, #fffbe6 0, #fde68a 45%, #f59e0b 100%); }
.cur-plus { font-style: normal; flex: none; width: 21px; height: 21px; margin: 0 -7px 0 1px; border-radius: 50%; display: grid; place-items: center; background: var(--g-go); border: 2px solid #fff; color: #fff; font: 400 16px/1 var(--g-font); box-shadow: 0 2px 0 #14532d; }
.pill.icon { padding: 0 13px 0 10px; }
.pill.icon i { font-style: normal; font-size: 20px; }
.pill.menu { padding: 0 15px 0 12px; gap: 7px; background: var(--g-btn); border-color: rgba(255, 255, 255, .55); box-shadow: 0 4px 0 #4c1d95, var(--g-shadow); }
.pill.menu svg { width: 20px; height: 20px; fill: #fff; flex: none; }
.pill.menu span { font-size: 16px; }
.pill.menu[aria-expanded="true"] { background: var(--g-gold); color: #422006; } .pill.menu[aria-expanded="true"] svg { fill: #422006; }

/* 내 프로필 카드: 동물 얼굴 + 레벨 배지 + 이름 + 경험치 막대(누르면 내 기록) */
.prof { position: relative; display: flex; align-items: center; gap: 10px; height: 58px; min-width: 0; max-width: 270px; margin-right: auto; padding: 4px 16px 4px 4px; border-radius: 999px; background: var(--g-glass); border: 2px solid var(--g-edge); box-shadow: var(--g-shadow); color: #fff; text-align: left; }
.prof:active { transform: translateY(2px); }
.prof-av { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; line-height: 1; background: radial-gradient(circle at 34% 28%, #fff 0, color-mix(in srgb, var(--av, #a78bfa) 55%, #fff) 52%, var(--av, #a78bfa) 100%); border: 3px solid #fde047; box-shadow: 0 2px 0 #b45309, 0 0 0 2px rgba(26, 20, 62, .6); }
.prof-main { display: grid; gap: 6px; min-width: 0; }
.prof-nm { font-size: 17px; font-weight: 400; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.prof-xp { display: block; width: 128px; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .25); overflow: hidden; }
.prof-xp i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #bef264, #22c55e); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); transition: width .6s ease-out; }
.prof-lv { position: absolute; left: 28px; bottom: -3px; display: flex; align-items: baseline; justify-content: center; gap: 1px; min-width: 30px; height: 23px; padding: 0 6px; border-radius: 999px; background: var(--g-btn); border: 2px solid #fff; color: #fff; font-size: 14px; line-height: 19px; box-shadow: 0 2px 0 #4c1d95; }
.prof-lv small { font-size: 10px; opacity: .9; }
.prof-lv b { font-weight: 400; }
.prof.up .prof-av { animation: profUp .9s ease-out; }
@keyframes profUp { 30% { scale: 1.25; box-shadow: 0 0 0 6px rgba(253, 224, 71, .6), 0 0 22px #fde047; } }

/* 부모님은 점수가 쌓이지 않으니 프로필·포인트·별 대신 부모님 포인트(🪙)와 [내 자녀 함께] */
body.pmode #coinBtn { display: none; }
/* 아이가 친구를 따라갈 때 [따라가기] 단추는 프로필 아래 */
body:not(.pmode) .kidgo { top: calc(80px + var(--safe-t)); }
body:not(.pmode) .kidmenu { top: calc(138px + var(--safe-t)); }

/* ── 작은 지도: 흰 테 + 짙은 바깥 테(게임 지도 틀) ── */
.mini { border-color: #fff; border-radius: 18px; box-shadow: 0 0 0 3px rgba(26, 20, 62, .6), 0 10px 26px rgba(10, 8, 30, .32); }
.kidmini { box-shadow: 0 0 0 3px rgba(26, 20, 62, .6), 0 10px 26px rgba(10, 8, 30, .32); }
.mini-bar button { background: var(--g-glass); color: #fff; border: 2px solid var(--g-edge); border-radius: 999px; padding: 0 14px; font-size: 14.5px; font-weight: 400; box-shadow: var(--g-shadow); }
.mini-bar button:active { transform: translateY(2px); }

/* ── 길 안내·신호·놀이 띠 ── */
.guide { background: var(--g-glass-hi); color: #fff; border: 2px solid var(--g-edge); box-shadow: var(--g-shadow); }
.guide .arrow { color: #fde047; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.guide b { font-weight: 400; font-size: 15px; }
.guide button { background: rgba(255, 255, 255, .16); color: #fff; border: 2px solid rgba(255, 255, 255, .4); }
.sighud { font-weight: 400; border: 2px solid var(--g-edge); }
.playhud { font-weight: 400; background: var(--g-glass-hi); border: 2px solid rgba(253, 224, 71, .7); }

/* ── 알림: 짙은 판 + 금색 테, 톡 튀어나오게(자리는 transform 이 맡으니 scale 만 움직임) ── */
.toast { background: linear-gradient(180deg, rgba(40, 30, 92, .96), rgba(24, 18, 58, .96)); border: 2px solid #fcd34d; border-radius: 18px; padding: 12px 20px; box-shadow: 0 10px 30px rgba(10, 8, 30, .4), inset 0 1px 0 rgba(255, 255, 255, .16); font-size: 18px; font-weight: 400; line-height: 1.35; letter-spacing: .005em; }
.toast.on { animation: toastIn .34s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes toastIn { from { scale: .8; } to { scale: 1; } }

/* ── 아래 조작: 탈것 고르기·인사·놀이·방향 단추·점프 ── */
.ride { background: var(--g-glass); border: 2px solid var(--g-edge); box-shadow: var(--g-shadow); }
/* 탈것 그림(🚲🛴🐾)은 어두운 판에서 잘 안 보여 밝은 칸 위에 둔다. 고른 것은 금색 */
.ride button { color: #3b0764; border-radius: 16px; background: linear-gradient(180deg, #fff, #ede9fe); box-shadow: inset 0 -3px 0 rgba(76, 29, 149, .18); }
.ride button span { font-weight: 400; font-size: 12.5px; }
.ride button[aria-pressed="true"] { background: var(--g-gold); color: #422006; box-shadow: inset 0 -3px 0 rgba(146, 64, 14, .45), 0 0 0 2px #fff; }
.ride button#walkBtn[aria-pressed="true"] { background: var(--g-go); color: #fff; box-shadow: inset 0 -3px 0 rgba(20, 83, 45, .5), 0 0 0 2px #fff; }
.ride button:active { transform: translateY(2px); }
.emote > button { background: var(--g-glass); border: 2px solid var(--g-edge); box-shadow: var(--g-shadow); }
.emote > button:active { transform: translateY(2px); }
#gamesBtn { background: var(--g-btn); border-color: rgba(255, 255, 255, .6); box-shadow: 0 4px 0 #4c1d95, var(--g-shadow); }
.emote-panel { background: var(--g-glass-hi); border: 2px solid var(--g-edge); box-shadow: var(--g-shadow); }
.emote-panel button { background: rgba(255, 255, 255, .08); }
.emote-panel button span { color: #fff; font-weight: 400; font-size: 11.5px; }
.emote-panel button:active { background: rgba(253, 224, 71, .3); }
.pad { background: rgba(26, 20, 62, .3); border: 2px solid rgba(255, 255, 255, .35); }
.pad span { background: var(--g-glass-hi); color: #fff; border: 2px solid rgba(255, 255, 255, .3); box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.pad span.on { background: var(--g-gold); color: #422006; }
.pad .u::after, .pad .d::after, .pad .l::after, .pad .r::after { font-family: var(--g-font); font-weight: 400; }
.jump { display: grid; place-content: center; justify-items: center; gap: 1px; background: radial-gradient(circle at 36% 28%, #fffbeb 0, #fde047 32%, #f59e0b 100%); color: #5b2a00; border: 3px solid #fff; box-shadow: 0 5px 0 #b45309, 0 10px 24px rgba(10, 8, 30, .35); font-size: 18px; font-weight: 400; }
.jump::before { content: ""; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 13px solid currentColor; margin-bottom: 2px; }
.jump:active, .jump.on { box-shadow: 0 2px 0 #b45309, 0 6px 16px rgba(10, 8, 30, .3); }
.stick { background: radial-gradient(circle, rgba(26, 20, 62, .12) 0, rgba(26, 20, 62, .34) 100%); border: 3px solid rgba(255, 255, 255, .8); }
.stick .knob { background: radial-gradient(circle at 36% 30%, #fff 0, #ede9fe 100%); border: 3px solid #fff; color: var(--pri-d); font-weight: 400; box-shadow: 0 4px 0 rgba(76, 29, 149, .4), 0 6px 14px rgba(0, 0, 0, .25); }
.stick.on { background: radial-gradient(circle, rgba(124, 58, 237, .18) 0, rgba(124, 58, 237, .4) 100%); }
.enterbtn { background: var(--g-btn); }
.enterbtn b { font-weight: 400; }
.osm i { background: rgba(26, 20, 62, .6); }

/* ── 3D 위 이름표 ── */
.lb-nm b { font-size: 15px; font-weight: 400; padding: 5px 10px; background: rgba(26, 20, 62, .78); border: 2px solid rgba(255, 255, 255, .55); }
.lb-nm.me b { background: linear-gradient(180deg, #fb7185, #e11d48); border-color: #fff; box-shadow: 0 2px 0 #9f1239; }
.lb-door { font-weight: 400; font-size: 14px; background: var(--g-btn); border: 2px solid #fff; }
.lb-float { font-size: 21px; font-weight: 400; color: #22c55e; text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1.5px 1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px -1.5px 0 #fff, 0 4px 6px rgba(0, 0, 0, .35); }
.lb-float.minus { color: #e11d48; }

/* ══ 창(대화창·문제 창·친구 창) — 흰 판 + 굵은 흰 테 + 보라 머리띠 ══ */
.modal { background: rgba(16, 12, 40, .55); }
#quiz { background: rgba(16, 12, 40, .66); }
.card { --cpt: 20px; --cpx: 20px; position: relative; padding: var(--cpt) var(--cpx) 20px; border-radius: 28px; border: 4px solid #fff; background: var(--g-cream); box-shadow: 0 0 0 3px rgba(91, 33, 182, .38), 0 24px 60px rgba(10, 8, 30, .45); animation: cardIn .26s cubic-bezier(.2, 1.35, .4, 1); }
@keyframes cardIn { from { scale: .9; opacity: 0; } to { scale: 1; opacity: 1; } }
.card > h2:first-child { margin: calc(-1 * var(--cpt)) calc(-1 * var(--cpx)) 14px; padding: 15px 58px 13px; background: var(--g-head); color: #fff; font-size: 23px; font-weight: 400; line-height: 1.25; border-radius: 24px 24px 0 0; text-shadow: 0 2px 0 rgba(46, 16, 101, .5); box-shadow: inset 0 -3px 0 rgba(46, 16, 101, .22); }
#dlg.side .card > h2:first-child { text-align: center; }
.card h2 { font-weight: 400; }
/* 창 오른쪽 위 ✕ (game.js dialog() 가 붙임) */
.dlg-x { position: absolute; top: 8px; right: 10px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #475569; border: 2px solid #e2e8f0; font: 400 19px/1 var(--g-font); }
.card:has(> h2:first-child) > .dlg-x { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .7); }
.dlg-x:active { transform: scale(.92); }
.card .sub { color: #5b5872; }
.info { background: #f5f3ff; border: 2px solid #ede9fe; }
/* 큰 단추(보라) · 보조 단추(흰 판 + 보라 테) */
.big-go, .go:not(.iv-btn) { font-weight: 400; background: var(--g-btn); border: 2px solid #5b21b6; box-shadow: 0 5px 0 #4c1d95, inset 0 2px 0 rgba(255, 255, 255, .35); text-shadow: 0 2px 0 rgba(46, 16, 101, .45); letter-spacing: .01em; }
.big-go:active, .go:not(.iv-btn):not(:disabled):active { transform: translateY(3px); box-shadow: 0 2px 0 #4c1d95, inset 0 2px 0 rgba(255, 255, 255, .35); }
.go:not(.iv-btn):disabled { background: #c4b5fd; border-color: #a78bfa; box-shadow: 0 5px 0 #a78bfa; text-shadow: none; }
.soft:not(.iv-btn) { font-weight: 400; background: #fff; color: var(--pri-d); border: 2px solid #ddd6fe; box-shadow: 0 3px 0 #ddd6fe; }
.soft:not(.iv-btn):active { transform: translateY(2px); box-shadow: 0 1px 0 #ddd6fe; }
.card .bar { height: 16px; background: #ede9fe; border: 2px solid #ddd6fe; }
.card .bar i { background: linear-gradient(90deg, #a3e635, #22c55e); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
.stg { background: #fff; border: 2px solid #f1f5f9; box-shadow: 0 2px 0 #eef2f7; }
.sw button[aria-pressed="true"] { border-color: var(--pri); box-shadow: 0 0 0 3px #ddd6fe; background: #faf5ff; }
/* 🎮 놀이 고르기 · 🎒 가방 · 순위 */
.gmb { background: linear-gradient(180deg, #fff, #f5f3ff); border: 2px solid #ddd6fe; box-shadow: 0 4px 0 #c4b5fd; }
.gmb:not(.off):active { transform: translateY(3px); box-shadow: 0 1px 0 #c4b5fd; }
.gmb b { font-weight: 400; font-size: 17px; }
.gmb i { font-size: 34px; }
.bg { box-shadow: 0 3px 0 #fde68a; }
.coupon > b { font-weight: 400; }

/* 내 기록 창: 위에 내 얼굴 + 레벨, 재화 네 칸 */
.rec-hero { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px 14px; border-radius: 20px; background: linear-gradient(135deg, #f5f3ff, #fdf4ff); border: 2px solid #ede9fe; text-align: left; }
.rec-hero .prof-av { width: 64px; height: 64px; font-size: 38px; border-width: 4px; }
.rec-hero > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.rec-hero b { font: 400 20px/1.2 var(--g-font); color: #3b0764; }
.rec-hero small { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.rec-hero .bar { margin: 2px 0; }
.rec-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.rec-chips span { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 16px; background: #fff; border: 2px solid #f1f5f9; box-shadow: 0 2px 0 #eef2f7; }
.rec-chips i { font-style: normal; font-size: 22px; line-height: 1.1; }
.rec-chips b { font: 400 19px/1.1 var(--g-font); color: #1e1b2e; }
.rec-chips small { font-size: 11.5px; font-weight: 800; color: var(--muted); line-height: 1.25; }
.rec-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 12px; }
.rec-acts .soft { height: auto; min-height: 66px; padding: 8px 4px; display: grid; justify-items: center; align-content: center; gap: 4px; font-size: 14px; line-height: 1.2; border-radius: 16px; }
.rec-acts .soft i { font-style: normal; font-size: 24px; line-height: 1; }
@media (max-width: 460px) { .rec-chips span { padding: 6px 2px; } .rec-chips b { font-size: 17px; } .rec-chips small { font-size: 10.5px; } .rec-acts .soft { font-size: 12.5px; padding: 6px 2px; } }
@media (max-width: 330px) { .rec-chips, .rec-acts { grid-template-columns: repeat(2, 1fr); } }

/* ── 문제 창 ── */
#quizCard .qz-box, .card .qz-box { border-color: #c4b5fd; background: #fff; box-shadow: 0 4px 0 #ede9fe; }
#quizCard .qz-tag, .card .qz-box > .qz-tag { background: var(--g-head); font-weight: 400; font-size: 16px; border: 2px solid #fff; box-shadow: 0 2px 0 #4c1d95; }
#quizCard .qz-pick, .card .qz-pick { font-family: var(--g-font); font-weight: 400; }
.qz-opts button, .gt-opts button { font-weight: 400; background: linear-gradient(180deg, #fff 0%, #f5f3ff 100%); color: #4c1d95; border: 3px solid #c4b5fd; box-shadow: 0 5px 0 #a78bfa; }
.qz-opts button:active, .gt-opts button:active { transform: translateY(3px); box-shadow: 0 2px 0 #a78bfa; }
.qz-opts button.yes, .gt-opts button.yes { background: var(--g-go); color: #fff; border-color: #15803d; box-shadow: 0 5px 0 #166534; text-shadow: 0 2px 0 rgba(20, 83, 45, .5); }
.qz-opts button.no { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; box-shadow: none; }
.gt-opts button.no { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; box-shadow: 0 4px 0 #fca5a5; }
#quizCard .qz-msg { font-weight: 400; }
#quizCard .qz-res { font-weight: 400; font-size: 22px; }
#quizCard .qz-tier { font-family: var(--g-font); font-weight: 400; }

/* ── 꽈당 ── */
.crash b { font-weight: 400; font-size: 72px; color: #fde047; text-shadow: 4px 0 0 #9f1239, -4px 0 0 #9f1239, 0 4px 0 #9f1239, 0 -4px 0 #9f1239, 3px 3px 0 #9f1239, -3px 3px 0 #9f1239, 3px -3px 0 #9f1239, -3px -3px 0 #9f1239, 0 10px 24px rgba(0, 0, 0, .4); }
.crash p { background: var(--g-glass-hi); border: 2px solid var(--g-edge); }

/* ── 큰 지도 ── */
.bm-top { background: linear-gradient(180deg, rgba(36, 28, 84, .97), rgba(22, 17, 54, .93)); color: #fff; box-shadow: 0 3px 14px rgba(10, 8, 30, .3); }
.bm-top h2 { font-weight: 400; font-size: 20px; color: #fff; }
.bm-top h2 small { font-family: var(--font); color: rgba(255, 255, 255, .78); }
.bm-top button { background: rgba(255, 255, 255, .14); color: #fff; border: 2px solid rgba(255, 255, 255, .32); font-weight: 400; }
.bm-top .close { background: var(--g-btn); border-color: #fff; box-shadow: 0 3px 0 #4c1d95; }
.bm-home { background: var(--g-gold); color: #422006; border: 2px solid #fff; font-weight: 400; box-shadow: 0 4px 0 #b45309, 0 6px 16px rgba(0, 0, 0, .2); }
.pick { border: 4px solid #fff; border-radius: 24px; background: var(--g-cream); box-shadow: 0 0 0 3px rgba(91, 33, 182, .35), 0 14px 40px rgba(10, 8, 30, .35); }
.pick b { font-weight: 400; font-size: 20px; }

/* ══ 메뉴판(⚙️ 대신 [☰ 메뉴]) — 화면 가운데 큰 판. 예전 작은 목록의 자리·크기 규칙을 id 로 덮는다 ══ */
#setMenu { position: absolute; inset: 0; top: 0; right: 0; bottom: 0; left: 0; z-index: 19; display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); gap: 0; padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) calc(14px + var(--safe-b)) calc(14px + var(--safe-l)); border-radius: 0; background: rgba(16, 12, 40, .58); box-shadow: none; font-weight: 400; font-size: inherit; }
.menu-card { width: min(660px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 0 18px 16px; border-radius: 28px; border: 4px solid #fff; background: var(--g-cream); box-shadow: 0 0 0 3px rgba(91, 33, 182, .38), 0 24px 60px rgba(10, 8, 30, .45); animation: cardIn .24s cubic-bezier(.2, 1.35, .4, 1); }
.menu-head { position: relative; display: flex; align-items: center; justify-content: center; margin: 0 -18px 14px; padding: 13px 58px 11px; background: var(--g-head); border-radius: 24px 24px 0 0; box-shadow: inset 0 -3px 0 rgba(46, 16, 101, .22); }
.menu-head h2 { margin: 0; font: 400 25px/1.2 var(--g-font); color: #fff; text-shadow: 0 2px 0 rgba(46, 16, 101, .5); }
#setMenu .menu-x { position: absolute; right: 10px; top: 50%; translate: 0 -50%; width: 42px; height: 42px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; border: 2px solid rgba(255, 255, 255, .7); font: 400 19px/1 var(--g-font); }
.menu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#setMenu .mt { width: auto; height: auto; min-height: 96px; padding: 10px 4px 9px; border-radius: 20px; display: grid; justify-items: center; align-content: center; gap: 7px; background: linear-gradient(180deg, #fff 0%, #f7f5ff 100%); border: 2px solid #e4dcff; box-shadow: 0 5px 0 #cbbdfd; color: #3b0764; font-size: inherit; }
#setMenu .mt:active { transform: translateY(3px); box-shadow: 0 2px 0 #cbbdfd; }
#setMenu .mt i { font-style: normal; width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; font-size: 32px; line-height: 1; background: #ede9fe; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06); }
#setMenu .mt span { font: 400 16px/1.15 var(--g-font); color: #3b0764; }
#mRec i { background: #fef3c7 !important; } #mGames i { background: #dcfce7 !important; } #sLook i { background: #fce7f3 !important; } #mShop i { background: #ffedd5 !important; }
#mMap i { background: #dbeafe !important; } #mFriends i { background: #e0f2fe !important; } #mTop i { background: #fef9c3 !important; } #sGrade i { background: #ede9fe !important; }
#sSubj i { background: #f3e8ff !important; } #sHome i { background: #ffe4e6 !important; } #mParent i { background: #ecfccb !important; }
body.pmode #setMenu .mt.kid { display: none; }
.menu-sec { margin: 16px 4px 8px; font: 400 15px/1 var(--g-font); color: #6b6788; }
.menu-tg { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tg { position: relative; display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 6px 10px 6px 6px; border-radius: 16px; background: #fff; border: 2px solid #ebe7f5; box-shadow: 0 3px 0 #ebe7f5; }
.tg:active { transform: translateY(2px); }
.tg span { font: 400 15px/1.2 var(--g-font); color: #1e1b2e; }
#setMenu .tg button { position: static; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 12px; display: grid; place-items: center; background: #f5f3ff; font-size: 21px; line-height: 1; box-shadow: none; }
#setMenu .tg button::after { content: ""; position: absolute; inset: 0; border-radius: 14px; } /* 칸 어디를 눌러도 그 단추 */
#setMenu #timeBtn { font-size: 14px; letter-spacing: -2px; white-space: nowrap; width: 44px; }
.tg:has(#calmBtn[aria-pressed="true"]) { border-color: #bbf7d0; background: #f0fdf4; box-shadow: 0 3px 0 #bbf7d0; }
.touch-only.tg { display: none; }
.touch .tg.touch-only { display: flex; }
.menu-foot { margin: 14px 0 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.menu-foot a { color: var(--pri-d); }

/* ══ 불러오는 화면 ══ */
.loading { background: radial-gradient(ellipse at 50% 30%, #8b5cf6 0%, #5b21b6 52%, #2e1065 100%); color: #fff; gap: 16px; padding: 20px; text-align: center; font-family: var(--g-font); font-weight: 400; }
.loading::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(circle, rgba(255, 255, 255, .55) 1.5px, transparent 2px), radial-gradient(circle, rgba(253, 224, 71, .5) 1.5px, transparent 2px); background-size: 90px 90px, 140px 140px; background-position: 0 0, 40px 60px; }
.loading > * { position: relative; }
.ld-logo { display: grid; justify-items: center; gap: 10px; }
.loading .ld-hero { font-size: 58px; }
.ld-bar { width: min(320px, 72vw); height: 18px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 2px solid rgba(255, 255, 255, .55); overflow: hidden; }
.loading .ld-bar i { display: block; height: 100%; width: 38%; border-radius: 999px; font-size: 0; background: var(--g-gold); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45); animation: ldBar 1.5s ease-in-out infinite; }
@keyframes ldBar { 0% { transform: translateX(-110%); } 100% { transform: translateX(270%); } }
.ld-msg { margin: 0; font-size: 21px; text-shadow: 0 2px 0 rgba(46, 16, 101, .5); }
.ld-tip { margin: 0; min-height: 1.5em; font: 700 14px/1.5 var(--font); color: rgba(255, 255, 255, .86); }

/* ══ 게임 로고(시작 화면·불러오는 화면) — 노랑·흰 글자 + 굵은 보라 테 ══ */
.logo-badge { justify-self: start; padding: 6px 14px; border-radius: 999px; background: linear-gradient(180deg, #f472b6, #db2777); border: 2px solid #fff; color: #fff; font: 400 15px/1 var(--g-font); box-shadow: 0 3px 0 #9d174d, 0 4px 10px rgba(0, 0, 0, .2); rotate: -3deg; white-space: nowrap; }
.ld-logo .logo-badge { justify-self: center; }
.logo-t { --st: #3b0764; display: grid; font: 400 78px/.98 var(--g-font); color: #fde047; letter-spacing: -.005em; white-space: nowrap;
  text-shadow: 5px 0 0 var(--st), -5px 0 0 var(--st), 0 5px 0 var(--st), 0 -5px 0 var(--st), 4px 3px 0 var(--st), -4px 3px 0 var(--st), 4px -3px 0 var(--st), -4px -3px 0 var(--st), 3px 4px 0 var(--st), -3px 4px 0 var(--st), 3px -4px 0 var(--st), -3px -4px 0 var(--st), 0 11px 0 var(--st), 4px 9px 0 var(--st), -4px 9px 0 var(--st), 0 16px 26px rgba(0, 0, 0, .35); }
.logo-t span:last-child { color: #fff; padding-left: .5em; }
.ld-logo .logo-t { font-size: 62px; justify-items: center; }
.ld-logo .logo-t span:last-child { padding-left: 0; }
.logo-sub { font: 400 19px/1.35 var(--g-font); color: #fff; text-shadow: 0 2px 0 rgba(46, 16, 101, .7), 0 2px 8px rgba(0, 0, 0, .5); }

/* ══ 시작 화면: 3D 동네 위에 큰 로고, 오른쪽(폰은 아래)에 떠 있는 판 ══ */
.start::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 80% at 30% 45%, transparent 35%, rgba(20, 14, 52, .42) 100%), linear-gradient(90deg, rgba(20, 14, 52, .32), transparent 55%); }
.st-logo { position: absolute; left: calc(44px + var(--safe-l)); top: calc(36px + var(--safe-t)); display: grid; justify-items: start; gap: 12px; pointer-events: none; }
.start h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* 글은 로고와 같음 → 읽어 주기용으로만 남김 */
.start .panel { position: relative; border: 4px solid #fff; background: var(--g-cream); }
@media (min-width: 761px) and (min-height: 521px) {
  .start { align-items: center; padding: calc(22px + var(--safe-t)) calc(26px + var(--safe-r)) calc(22px + var(--safe-b)) 22px; }
  .start .panel { height: auto; max-height: 100%; width: min(430px, 100%); border-radius: 30px; padding: 22px 22px 18px; box-shadow: 0 0 0 3px rgba(91, 33, 182, .38), 0 24px 60px rgba(10, 8, 30, .42); }
}
.start .panel::before { content: "어서 와요, 탐험대!"; display: block; margin: -2px 0 2px; text-align: center; font: 400 20px/1.2 var(--g-font); color: var(--pri-d); }
.start .panel.tall::before { content: none; }
/* 이어 하기 카드 */
.kidcard { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 60%, #d946ef 100%); border: 3px solid #fff; box-shadow: 0 0 0 3px #c4b5fd, 0 7px 0 #4c1d95, 0 12px 26px rgba(124, 58, 237, .3); padding: 16px 18px 18px; }
.kidcard b { font-size: 30px; font-weight: 400; text-shadow: 0 2px 0 rgba(46, 16, 101, .45); }
.kidcard span { font-weight: 700; }
.kidcard em { font-weight: 400; font-size: 24px; background: var(--g-go); color: #fff; border: 2px solid #fff; box-shadow: 0 5px 0 #166534; text-shadow: 0 2px 0 rgba(20, 83, 45, .5); padding: 12px 14px; border-radius: 16px; }
/* 처음 왔어요(초록 시작 단추) / 전에 와 봤어요(흰 단추) */
.bigpick { font-weight: 400; font-size: 24px; min-height: 74px; border-radius: 22px; }
.bigpick:not(.alt) { background: var(--g-go); border: 3px solid #fff; box-shadow: 0 0 0 3px #86efac, 0 6px 0 #166534, 0 10px 22px rgba(22, 163, 74, .3); text-shadow: 0 2px 0 rgba(20, 83, 45, .5); }
.bigpick:not(.alt):active { transform: translateY(3px); box-shadow: 0 0 0 3px #86efac, 0 3px 0 #166534; }
.bigpick.alt { border: 3px solid #c4b5fd; box-shadow: 0 6px 0 #a78bfa; }
.bigpick.alt:active { transform: translateY(3px); box-shadow: 0 3px 0 #a78bfa; }
/* 처음 왔어요 단계: 다음 ▶ / 시작하기 ▶ 는 초록 */
.start .go { background: var(--g-go); border: 2px solid #15803d; box-shadow: 0 5px 0 #166534, inset 0 2px 0 rgba(255, 255, 255, .45); text-shadow: 0 2px 0 rgba(20, 83, 45, .5); font-size: 23px; }
.start .go:not(:disabled):active { box-shadow: 0 2px 0 #166534; }
.steps i { height: 10px; background: #ece8f7; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.steps i.on { background: var(--g-gold); box-shadow: 0 0 0 2px #fff, 0 0 0 3px #f59e0b; }
.ask { font-weight: 400; font-size: 22px; color: #3b0764; }
.gradegrid button { font-weight: 400; font-size: 22px; background: linear-gradient(180deg, #fff, #f5f3ff); border: 3px solid #c4b5fd; box-shadow: 0 5px 0 #a78bfa; }
.gradegrid button[aria-pressed="true"] { background: var(--g-btn); color: #fff; border-color: #5b21b6; box-shadow: 0 5px 0 #4c1d95; }
.gradegrid button:active { transform: translateY(3px); box-shadow: 0 2px 0 #a78bfa; }
.namebox label { font-weight: 400; font-size: 17px; color: #3b0764; }
.namebox input { border-color: #c4b5fd; background: #fff; box-shadow: inset 0 3px 0 #f5f3ff; }
.pin-keys button { font-weight: 400; background: linear-gradient(180deg, #fff, #f5f3ff); border: 2px solid #ddd6fe; box-shadow: 0 3px 0 #c4b5fd; }
.link { font-family: var(--g-font); font-weight: 400; }
.roomline { background: #f5f3ff; border: 2px solid #ede9fe; }

/* ── 건물 안 놀이·🎮 놀이·지하철 역 창(interior-ui.js 의 .iv-*)과 버스 창(bus.js) — 같은 게임 옷.
   이 모듈들은 스타일을 나중에(head 끝에) 넣으므로 앞에 body 를 붙여 이긴다(자리·크기는 건드리지 않음) ── */
body .iv-card { border: 4px solid #fff; background: var(--g-cream); box-shadow: 0 0 0 3px rgba(91, 33, 182, .38), 0 24px 60px rgba(10, 8, 30, .45); }
body .iv-hd h2 { font-family: var(--g-font); font-weight: 400; font-size: 23px; color: #3b0764; }
body .iv-q { font-family: var(--g-font); font-weight: 400; }
body .iv-ch button { font-family: var(--g-font); font-weight: 400; background: linear-gradient(180deg, #fff, #f5f3ff); border: 3px solid #c4b5fd; box-shadow: 0 5px 0 #a78bfa; }
body .iv-ch button.yes { background: var(--g-go); color: #fff; border-color: #15803d; box-shadow: 0 5px 0 #166534; }
body .iv-ch button.no { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; box-shadow: none; }
body .iv-btn { font-family: var(--g-font); font-weight: 400; border: 2px solid rgba(255, 255, 255, .6); text-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
body .bus-panel { border: 4px solid #fff; background: var(--g-cream); box-shadow: 0 0 0 3px rgba(91, 33, 182, .3), 0 12px 32px rgba(10, 8, 30, .3); }
body .bus-panel h3 { font-family: var(--g-font); font-weight: 400; font-size: 20px; }
body .bus-btn { font-family: var(--g-font); font-weight: 400; background: var(--g-go); border: 2px solid #15803d; box-shadow: 0 5px 0 #166534; text-shadow: 0 2px 0 rgba(20, 83, 45, .5); }
body .bus-btn:disabled { background: #e2e8f0; border-color: #e2e8f0; box-shadow: none; text-shadow: none; }
body .bus-ride { border: 2px solid rgba(255, 255, 255, .45); }

/* ── 화면 폭별 ── */
/* 태블릿 세로: 길 안내·신호를 프로필 아래로 */
@media (min-width: 761px) and (orientation: portrait) {
  .guide { top: calc(80px + var(--safe-t)); }
  .sighud { top: calc(142px + var(--safe-t)); }
}
/* 폰 세로(좁은 화면) */
@media (max-width: 760px) {
  .start .panel { border-width: 4px 0 0; border-radius: 28px 28px 0 0; }
  .st-logo { left: 50%; translate: -50% 0; top: calc(14px + var(--safe-t)); justify-items: center; gap: 6px; }
  .st-logo .logo-badge { justify-self: center; font-size: 12.5px; padding: 5px 11px; }
  .st-logo .logo-t { display: flex; gap: 0; font-size: 42px; --st: #3b0764; text-shadow: 3px 0 0 var(--st), -3px 0 0 var(--st), 0 3px 0 var(--st), 0 -3px 0 var(--st), 2px 2px 0 var(--st), -2px 2px 0 var(--st), 2px -2px 0 var(--st), -2px -2px 0 var(--st), 0 7px 0 var(--st), 0 10px 16px rgba(0, 0, 0, .35); }
  .st-logo .logo-t span:last-child { padding-left: 0; }
  .st-logo .logo-sub { display: none; }
  .start .panel::before { font-size: 18px; }
  .ld-logo .logo-t { font-size: 48px; }
  .card > h2:first-child { font-size: 21px; padding: 13px 54px 11px; }
}
@media (max-width: 760px) and (min-height: 521px) {
  .topright { gap: 5px; }
  .prof { height: 42px; gap: 7px; padding: 2px 10px 2px 2px; flex: 0 1 auto; max-width: none; overflow: hidden; }
  .prof-av { width: 36px; height: 36px; font-size: 21px; border-width: 2px; }
  .prof-main { gap: 4px; }
  .prof-nm { font-size: 14px; max-width: 70px; }
  .prof-xp { width: 64px; height: 7px; }
  .prof-lv { left: 19px; bottom: -4px; min-width: 24px; height: 19px; padding: 0 4px; font-size: 12px; line-height: 15px; }
  .prof-lv small { display: none; }
  .topright .pill { height: 40px; padding: 0 10px 0 4px; gap: 4px; font-size: 16px; }
  .topright .cur-ic { width: 28px; height: 28px; font-size: 16px; }
  .topright .cur-plus { display: none; }
  .topright .pill.icon { padding: 0 9px 0 7px; } .topright .pill.icon i { font-size: 17px; }
  .topright .pill.menu { padding: 0 10px; } .topright .pill.menu span { display: none; }
  .mini { top: calc(58px + var(--safe-t)); }
  .mini-bar { top: calc(64px + var(--mini) + var(--safe-t)); }
  .guide { top: calc(58px + var(--safe-t)); }
  body:not(.pmode) .kidgo { top: calc(58px + var(--safe-t)); }
  body:not(.pmode) .kidmenu { top: calc(116px + var(--safe-t)); }
  .toast { font-size: 16px; }
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #setMenu .mt { min-height: 86px; padding: 8px 3px; gap: 5px; }
  #setMenu .mt i { width: 46px; height: 46px; font-size: 27px; border-radius: 14px; }
  #setMenu .mt span { font-size: 15px; }
  .menu-card { padding: 0 14px 14px; }
  .menu-head { margin: 0 -14px 12px; }
  .menu-tg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 폰 가로(키가 낮은 화면) */
@media (max-height: 520px) {
  .card { --cpt: 12px; --cpx: 14px; padding: var(--cpt) var(--cpx) 12px; }
  .card > h2:first-child { margin-bottom: 8px; padding: 9px 54px 8px; font-size: 19px; }
  .dlg-x { top: 4px; width: 38px; height: 38px; }
  .topright { top: calc(8px + var(--safe-t)); gap: 6px; }
  .prof { height: 44px; padding: 2px 12px 2px 2px; gap: 8px; }
  .prof-av { width: 38px; height: 38px; font-size: 22px; border-width: 2px; }
  .prof-main { gap: 4px; }
  .prof-nm { font-size: 14.5px; max-width: 96px; }
  .prof-xp { width: 92px; height: 7px; }
  .prof-lv { left: 21px; bottom: -4px; height: 19px; font-size: 12px; line-height: 15px; }
  .topright .pill { height: 40px; padding: 0 11px 0 4px; font-size: 16px; }
  .topright .cur-ic { width: 28px; height: 28px; font-size: 16px; }
  .topright .pill.icon { padding: 0 10px 0 8px; }
  .topright .pill.menu { padding: 0 12px 0 10px; }
  .topright .pill.menu span { font-size: 14px; }
  .mini { top: calc(56px + var(--safe-t)); }
  .mini-bar { top: calc(62px + var(--mini) + var(--safe-t)); }
  body:not(.pmode) .kidgo { top: calc(60px + var(--safe-t)); }
  body:not(.pmode) .kidmenu { top: calc(118px + var(--safe-t)); }
  .osm:not(.fold) { top: calc(var(--bar) + 58px + var(--safe-t)); }
  .menu-card { width: min(780px, 100%); padding: 0 14px 10px; }
  .menu-head { margin: 0 -14px 8px; padding: 7px 54px 6px; }
  .menu-head h2 { font-size: 20px; }
  #setMenu .menu-x { width: 36px; height: 36px; }
  .menu-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  #setMenu .mt { min-height: 68px; padding: 5px 2px; gap: 3px; border-radius: 16px; box-shadow: 0 4px 0 #cbbdfd; }
  #setMenu .mt i { width: 36px; height: 36px; font-size: 22px; border-radius: 12px; }
  #setMenu .mt span { font-size: 13.5px; }
  .menu-sec { margin: 10px 4px 6px; font-size: 13.5px; }
  .menu-tg { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .tg { min-height: 46px; padding: 4px 6px 4px 4px; gap: 6px; }
  #setMenu .tg button { width: 34px; height: 34px; font-size: 18px; }
  .tg span { font-size: 13px; }
  .menu-foot { margin-top: 8px; }
  .st-logo { left: calc(18px + var(--safe-l)); translate: none; top: calc(12px + var(--safe-t)); justify-items: start; }
  .st-logo .logo-badge { justify-self: start; }
  .st-logo .logo-t { font-size: 34px; }
  .start .panel::before { content: none; }
  .loading { gap: 10px; } .ld-logo .logo-t { font-size: 44px; } .loading .ld-hero { font-size: 40px; }
  .rec-hero { padding: 8px 10px; margin-bottom: 8px; } .rec-hero .prof-av { width: 48px; height: 48px; font-size: 28px; }
  .rec-chips { margin-bottom: 8px; } .rec-chips span { padding: 5px 4px; } .rec-acts .soft { min-height: 54px; }
}
/* 폰 가로 시작 화면: 판은 오른쪽 60%, 둥근 왼쪽 모서리 */
@media (max-width: 760px) and (max-height: 520px) {
  .start .panel, .start .panel.tall { border-width: 0 0 0 4px; border-radius: 26px 0 0 26px; }
}
.kbp .start .panel, .kbp .start .panel.tall { border-width: 4px 0 0; }
@media (prefers-reduced-motion: reduce) { .card, .menu-card, .toast.on { animation: none; } }
