/* 파란 UI 공통 틀 (6단계 U1, 파란UI-계획.md, S1 시안 승인 2026-10-21).
   맨 마지막에 불러와 옛 위쪽 띠(qplay·quiz-hud·world-explorer)를 덮는다. 옛 규칙은 화면을 옮긴 뒤 지운다.
   테두리 글씨 글꼴: 메이플스토리 Bold(assets/fonts/Maplestory-사용조건.txt). */
@font-face { font-family: "QuizOutline"; src: url("./assets/fonts/MaplestoryBold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bu-rim: #c4ecff; --bu-rim2: #6fb9f2; --bu-cobalt: #4a80e4; --bu-cobalt2: #3567cf;
  /* 칸 속(우물)은 큐플레이처럼 회청빛 중간 밝기(밝기 약 30~35%). 가장 짙은 남색은 숫자 줄·이름표 같은 작은 홈(--bu-groove·--bu-navy)에만.
     (2026-10-23 큐플레이 비교: 우물이 거의 검은 남색이라 UI 화면이 '꺼진 구멍'처럼 허전해 보였음, 검증/큐플레이비교/분석.md C1) */
  --bu-well: #3d5aa6; --bu-well2: #314c94; --bu-groove: #213c86; --bu-navy: #0c2160; --bu-ink: #081a4f; --bu-sky: #7fd6ff;
  --bu-gold: #ffe36b; --bu-text: #eaf4ff;
  --bu-outline: "QuizOutline", "NanumSquareRound", sans-serif;
  --qp-bottom-height: 40px;
  /* 두꺼운 창 틀(C2): 바깥 남색 홈 → 위가 밝은 은청 베벨(1366×768에서 9px) → 안쪽 남색 선 → 위가 하늘빛인 코발트 몸통.
     쓰는 법: border: var(--bu-frame-w) solid transparent; background: var(--bu-body) padding-box, var(--bu-frame) border-box; box-shadow: var(--bu-frame-shadow); */
  --bu-frame-w: 9px;
  --bu-frame: linear-gradient(#f2faff 0, #c8e2f8 26px, #a9c7ec 90px, #8fb3e3 100%);
  --bu-frame-shadow: 0 0 0 2px var(--bu-ink), 0 4px 0 2px #061a52, 0 10px 18px #04103a59, inset 0 0 0 2px var(--bu-ink);
  --bu-body: linear-gradient(#76aef3 0%, var(--bu-cobalt) 24%, var(--bu-cobalt2) 100%);
  /* 창 제목 띠(C11): 짙은 남색 알약 대신 하늘 광택 캡(위 흰 반사선 → 아래 코발트), 글자는 흰 글자 + 남색 테두리 */
  --bu-cap: linear-gradient(#e2f7ff 0%, #96d6ff 28%, #4aa3ee 60%, #2b79d9 100%);
  --bu-cap-shadow: inset 0 2px 0 #ffffffd9, inset 0 -2px 0 #1d5cc4, 0 2px 0 #061a5280;
  /* 우물 안쪽 그늘(예전 #04103a는 너무 짙어 칸이 파여 보였음) */
  --bu-well-shadow: inset 0 2px 4px #0b1f5e8c;
}
html body, html body.qp-campus { --qp-top-height: 58px; }

/* 흰 글자 + 남색 테두리(제목·탭·버튼·숫자) */
.bu-o { font-family: var(--bu-outline); color: #fff; text-shadow:
  0 2px 0 var(--bu-ink), 2px 0 0 var(--bu-ink), -2px 0 0 var(--bu-ink), 0 -2px 0 var(--bu-ink),
  2px 2px 0 var(--bu-ink), -2px 2px 0 var(--bu-ink), 2px -2px 0 var(--bu-ink), -2px -2px 0 var(--bu-ink), 0 3px 0 var(--bu-ink); }

/* ── 위쪽 띠 ── 큐플레이처럼 밝은 하늘 → 코발트 광택 띠, 맨 위 흰 반사선, 아래는 남색 홈 + 밝은 베벨로 몸통과 잇는다(C9) */
html body .top.qp-topbar, html body.qp-campus .top.qp-topbar {
  height: var(--qp-top-height); padding: 0 14px 0 10px; gap: 10px; display: flex; align-items: center;
  background: linear-gradient(#86cbfa 0%, #4f9cee 22%, #2c72da 62%, #2259c2 100%); border: 0; border-bottom: 3px solid #0b2a77;
  box-shadow: inset 0 2px 0 #eaf8ffd9, inset 0 -2px 0 #1a4fb0, 0 2px 0 #8fd0ff, 0 4px 0 #061a52; color: var(--bu-text);
}
html body .top.qp-topbar > .nm.qp-brand { display: flex; align-items: flex-end; gap: 6px; flex: none; min-width: 0; text-shadow: none; }
.qp-logo { display: block; height: 50px; width: auto; overflow: visible; }
.qp-logo text { font-family: var(--bu-outline); font-size: 40px; stroke-linejoin: round; }
.qp-logo-shadow { fill: #061a52; stroke: #061a52; stroke-width: 11px; transform: translateY(2px); }
.qp-logo-rim { fill: #0b2a77; stroke: #0b2a77; stroke-width: 8px; }
.qp-logo-face { stroke: #fff; stroke-width: 2.2px; paint-order: stroke; }
.qp-logo-quiz { fill: #6fd3ff; }
.qp-logo-rest { fill: #ffffff; }
.qp-crumb { font: 800 12px "NanumSquareRound", sans-serif; color: #fff; margin-bottom: 7px; white-space: nowrap; display: flex; align-items: center; gap: 5px;
  text-shadow: 0 1px 0 var(--bu-ink), 1px 0 0 var(--bu-ink), -1px 0 0 var(--bu-ink), 0 -1px 0 var(--bu-ink); }
.qp-crumb::before { content: ""; border: 5px solid transparent; border-left: 6px solid #ffe36b; border-right: 0; filter: drop-shadow(0 1px 0 var(--bu-ink)); }

/* 둥근 크롬 아이콘(글자 없음, 2026-10-21 사용자 선택): 짙은 파랑 유리구슬 + 위쪽 흰 반사, 그림이 가장 밝게(C9, 예전 흰 원판은 그림을 묻었음) */
html body .top.qp-topbar .icb.qp-chrome, html body.qp-campus .top.qp-topbar .icb.qp-chrome {
  width: 48px !important; height: 48px !important; padding: 0; flex: none; display: grid; place-items: center; border-radius: 50%;
  color: #0a2a77; background: radial-gradient(58% 34% at 50% 20%, #ffffffd0 0%, #ffffff00 100%), radial-gradient(110% 90% at 50% 100%, #4aa6f4 0%, #1f62d2 46%, #0f3a98 100%) !important;
  border: 2px solid #061a52; box-shadow: inset 0 0 0 2px #7fc4ff, inset 0 -4px 0 #0b3a96, 0 2px 0 #051a50; transform: none; filter: none;
}
html body .top.qp-topbar .icb.qp-chrome::before, html body .top.qp-topbar .icb.qp-chrome::after { display: none; content: none; }
html body .top.qp-topbar .icb.qp-chrome :is(.candy-icon, .rich-icon) { width: 30px !important; height: 30px !important; filter: drop-shadow(0 1px 0 #061a52); }
html body .top.qp-topbar .icb.qp-chrome .qp-tool-label { display: none; }
html body .top.qp-topbar .icb.qp-chrome:is(:hover, :focus-visible) { filter: brightness(1.08); }
html body .top.qp-topbar .icb.qp-chrome:focus-visible { outline: 3px solid #fff3a0; outline-offset: 2px; }
html body .top.qp-topbar .icb.qp-chrome:is(:active, .qp-pressed) { box-shadow: inset 0 -1px 0 #1450b8, 0 1px 0 #051a50; translate: 0 1px; }

/* 금화 알약 */
html body .top.qp-topbar .gold.qp-gold, html body.qp-campus .top.qp-topbar .gold.qp-gold {
  height: 38px; min-width: 0; padding: 0 14px 0 4px; gap: 6px; display: flex; align-items: center; border-radius: 19px; flex: none;
  background: linear-gradient(#0f2a72, #091d58); border: 2px solid #0b2a77; box-shadow: inset 0 2px 3px #00000066, 0 1px 0 #bfe6ff; font-size: 0;
}
html body .top.qp-topbar .gold.qp-gold .coin { width: 30px; height: 30px; flex: 0 0 30px; margin: 0; background: none; border: 0; box-shadow: none; display: block; }
html body .top.qp-topbar .gold.qp-gold b { font: 22px var(--bu-outline); color: var(--bu-gold); text-shadow: 0 2px 0 #4a2600; letter-spacing: .5px; }
.qp-coin { display: block; }

/* 운영자 탭: 작은 주황 알약 */
html body .top.qp-topbar .qp-admin-tab { height: 32px; border-radius: 16px; font: 15px var(--bu-outline); }

/* ── 아래 바 ── 위쪽 띠와 같은 광택 띠(위 흰 반사선, 남색 홈). 가운데에는 화면마다 도움말이 흐르는 홈, 오른쪽에 전체 화면·나가기(C8:
   예전에는 '뒤로'와 '나가기' 사이 약 1000px가 빈 남색이었음) */
.qp-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--qp-bottom-height);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: linear-gradient(#6fb6f6 0%, #3f88e6 24%, #2a68d2 64%, #2256bd 100%); border-top: 3px solid #0b2a77;
  box-shadow: inset 0 2px 0 #e2f6ffcc, 0 -2px 0 #8fd0ff;
}
.qp-bar-slot { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
/* 도움말 홈(상점은 자기 안내 줄 .qs-hint로 바꿔 끼운다) */
.qp-bar-tip { flex: 0 1 auto; max-width: 760px; min-width: 0; height: 26px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 13px; overflow: hidden; white-space: nowrap;
  background: #0a1f5c; border: 1.5px solid #0b2a77; box-shadow: inset 0 2px 3px #00000066, 0 1px 0 #bfe6ff; font: 800 12px "NanumSquareRound", sans-serif; color: #cfe6ff; }
.qp-bar-tip::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #4a2600;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #ffc928 60%, #d89a10); }
.qp-bar-tip span { overflow: hidden; text-overflow: ellipsis; }
.qp-bar-tip b { color: #ffe36b; font-weight: 800; }
html body .qp-bottom .qp-bar-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 14px; cursor: pointer;
  font: 800 13px "NanumSquareRound", sans-serif !important; color: #e6f3ff !important; white-space: nowrap; min-height: 0 !important;
  background: linear-gradient(#2a5bc8, #173c94) !important; border: 1.5px solid #061a52 !important; box-shadow: inset 0 1px 0 #7fb6ff !important; transform: none;
}
html body .qp-bottom .qp-bar-btn:is(:hover, :focus-visible) { filter: brightness(1.12); }
html body .qp-bottom .qp-bar-btn:focus-visible { outline: 3px solid #fff3a0; outline-offset: 2px; }
html body .qp-bottom .qp-bar-btn.qp-bar-exit { background: linear-gradient(#f26d5c, #c4301f) !important; box-shadow: inset 0 1px 0 #ffb0a3 !important; }
.qp-bar-icon { width: 15px; height: 15px; }
html body.qp-campus .qp-bottom #tbOut.qp-bar-btn { height: 28px; min-width: 0; border-radius: 14px; font-size: 13px; }
html body.qp-campus .top.qp-topbar #tbShop.qp-chrome { width: 48px !important; height: 48px !important; padding: 0 !important; border: 2px solid #061a52 !important; border-radius: 50% !important; }
html body .qp-bottom .qp-bar-btn[aria-pressed="true"] { background: linear-gradient(#ffd27a, #e88a10) !important; box-shadow: inset 0 1px 0 #fff0c4 !important; color: #fff !important; }

/* 아래 바가 있는 화면은 내용이 바 위에서 끝난다. 퀴즈 모드 화면은 U5에서 옮길 때까지 바를 숨긴다. */
body:has(#qpBottom) :is(.qq-root, #campusRoot.school-room-host, .tsplit) { bottom: var(--qp-bottom-height) !important; height: auto; }
body:has(.rq-root, .fq-root, .ox-room) #qpBottom { display: none; }
/* 서바이벌 OX는 자기 채팅 바에 뒤로·나가기가 있어 공용 아래 띠를 숨기고 맨 아래까지(예전에는 빈 띠가 두 겹이었음, C8) */
body:has(#qpBottom):has(.ox-room) :is(.qq-root, #campusRoot.school-room-host, .tsplit) { bottom: 0 !important; }
/* 자유·순서·라운드·팀 화면(index.html fqScreen): 위쪽 띠 아래 칸(free-quiz.js의 .fq-host는 방장 상자라 다른 이름). 퀴즈 맵에서는 아래 바가 없으므로 맨 아래까지.
   바닥은 로비와 같은 빛 도는 파랑(방 만들기 창 둘레가 단색 남색이라 섬처럼 떠 보였음, C7) */
.qq-fq-frame { position: absolute; left: 0; right: 0; top: var(--qp-top-height); bottom: var(--qp-bottom-height); overflow: hidden;
  background: radial-gradient(ellipse at 50% -20%, #7ab2f2 0%, #4a7ad8 45%, #3358b4 85%); }
body:has(.fq-root) .qq-fq-frame { bottom: 0; }
.qq-fq-frame > .qq-fq-mount { height: 100%; }
/* 체험 모드 상자는 아래 바 안(나가기 왼쪽)에 한 줄로 */
body:has(#qpBottom):not(:has(.rq-root, .fq-root, .ox-room)) .qp-demo-toolbar { bottom: 3px; right: 214px; z-index: 41; flex-wrap: nowrap; max-width: none;
  padding: 2px 6px; gap: 4px; border: 0; border-radius: 16px; background: #0a2066 !important; box-shadow: none; color: #bfe3ff; }
body:has(#qpBottom):not(:has(.rq-root, .fq-root, .ox-room)) .qp-demo-toolbar small { display: none; }
body:has(#qpBottom):not(:has(.rq-root, .fq-root, .ox-room)) .qp-demo-toolbar button { height: 28px; min-height: 0; padding: 0 10px; font-size: 12px; }
/* 서바이벌 OX(아래 띠 없음): 체험 모드 상자는 라운드전처럼 위 가운데로(채팅 바의 뒤로·나가기를 가리지 않게) */
html body:has(.ox-room) .qp-demo-toolbar { top: 9px; bottom: auto; right: auto; left: 50%; translate: -50% 0; z-index: 60; flex-wrap: nowrap; }
html body:has(.ox-room) .qp-demo-toolbar small { display: none; }

/* ── 알림 창(모달) ── */
html body #modal .mbox.pnl { border-radius: 18px; padding: 4px; border: 8px solid transparent;
  background: var(--bu-body) padding-box, var(--bu-frame) border-box; box-shadow: var(--bu-frame-shadow); }
html body #modal .mbox > .pnl-h { height: 32px; margin: 0 0 8px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: var(--bu-cap); border: 2px solid #0b2a77; box-shadow: var(--bu-cap-shadow); font: 17px var(--bu-outline); color: #fff;
  text-shadow: 0 2px 0 var(--bu-ink), 2px 0 0 var(--bu-ink), -2px 0 0 var(--bu-ink), 0 -2px 0 var(--bu-ink); }
html body #modal .mbox > .pnl-h::before { display: none; }
html body #modal .mbox > .mbody { border-radius: 9px; background: #f4f9ff; color: #10296f; }

@media (prefers-reduced-motion: reduce) { html body .top.qp-topbar .icb.qp-chrome:is(:active, .qp-pressed) { translate: none; } }

/* ── U4 맵 위 UI(마을·교실·놀이터와 자유·순서·팀 퀴즈 맵 공통, 맵 그림은 그대로) ── */
html body:is(.qp-campus, :has(.fq-root)) .sr-room-title { min-width: 180px; padding: 6px 14px 7px; border-radius: 12px; border: 2px solid var(--bu-ink); border-image: none;
  background: linear-gradient(var(--bu-cobalt), var(--bu-cobalt2)); box-shadow: inset 0 0 0 2px var(--bu-rim2), inset 0 3px 0 2px var(--bu-rim), 0 3px 0 #061a52; }
html body:is(.qp-campus, :has(.fq-root)) .sr-room-title strong { font: 21px var(--bu-outline); color: #fff; line-height: 1.3; letter-spacing: .3px;
  text-shadow: 0 2px 0 var(--bu-ink), 2px 0 0 var(--bu-ink), -2px 0 0 var(--bu-ink), 0 -2px 0 var(--bu-ink), 0 3px 0 var(--bu-ink); }
html body:is(.qp-campus, :has(.fq-root)) .sr-network { margin-top: 3px; font-weight: 800; color: #cfe7ff; }
html body:is(.qp-campus, :has(.fq-root)) .sr-friend-count { padding: 8px 14px; border-radius: 18px; font-weight: 800; color: #eaf4ff;
  background: linear-gradient(#18348a, #0b1f5e); border: 2px solid var(--bu-ink); box-shadow: inset 0 2px 0 #3a64c8, 0 3px 0 #061a52; }
html body:is(.qp-campus, :has(.fq-root)) .sr-friend-count b { font: 18px var(--bu-outline); color: var(--bu-gold); text-shadow: 0 2px 0 #4a2600; }
html body:is(.qp-campus, :has(.fq-root)) .sr-tools { padding: 6px; border-radius: 14px; border: 2px solid var(--bu-ink);
  background: linear-gradient(var(--bu-cobalt), var(--bu-cobalt2)); box-shadow: inset 0 0 0 2px var(--bu-rim2), 0 3px 0 #061a52; }
html body .sr-help { color: #10296f; background: #f4f9ff; border: 2px solid var(--bu-ink); border-radius: 12px; box-shadow: inset 0 0 0 3px var(--bu-rim2), 0 4px 0 #061a52; }

/* 작은 지도: 코발트 창 + 남색 제목 띠 + 우물 */
html body .wm-mini { padding: 7px; border-radius: 12px; border: 2px solid var(--bu-ink); border-image: none; color: var(--bu-text);
  background: linear-gradient(var(--bu-cobalt), var(--bu-cobalt2)); box-shadow: inset 0 0 0 2px var(--bu-rim2), inset 0 3px 0 2px var(--bu-rim), 0 3px 0 #061a52; }
html body .wm-mini-head { margin: 0 0 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 14px;
  background: var(--bu-cap); border: 2px solid #0b2a77; box-shadow: var(--bu-cap-shadow); }
html body .school-room-host .wm-mini-head button { min-height: 22px; font: 14px var(--bu-outline); color: #fff;
  text-shadow: 0 2px 0 var(--bu-ink), 1px 0 0 var(--bu-ink), -1px 0 0 var(--bu-ink), 0 -1px 0 var(--bu-ink) !important; }
html body .school-room-host .wm-mini-head .wm-fold { width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 17px; line-height: 18px; background: #2a5bc8; border: 1.5px solid #061a52; }
html body .wm-mini .wm-board { border-radius: 8px; border: 2px solid #061a52; box-shadow: 0 0 0 1px var(--bu-rim2); }
html body .wm-mini .wm-legend { padding-top: 6px; color: #eaf4ff; }
html body .wm-mini .wm-legend i { box-shadow: 0 0 0 1.5px #061a52; }

/* M 지도 창: 코발트 테두리, 남색 제목, 왼쪽 장소 우물, 오른쪽 밝은 내용 */
html body .school-room-host .wm-dialog { padding: 8px; border-radius: 14px; border: 2px solid var(--bu-ink); color: #10296f;
  background: linear-gradient(var(--bu-cobalt), var(--bu-cobalt2)); box-shadow: inset 0 0 0 2px var(--bu-rim2), inset 0 3px 0 2px var(--bu-rim), 0 6px 0 #061a52, 0 20px 60px #0b1440aa; }
html body .wm-header { height: 64px; padding: 0 10px 0 22px; border-radius: 12px; border: 2px solid #0b2a77;
  background: var(--bu-cap); box-shadow: var(--bu-cap-shadow); }
html body .wm-header small { margin-bottom: 2px; color: #0b2a77; font-size: 12px; letter-spacing: .5px; text-shadow: 0 1px 0 #ffffffb0; }
html body .wm-header h2 { font: 25px var(--bu-outline); color: #fff;
  text-shadow: 0 2px 0 var(--bu-ink), 2px 0 0 var(--bu-ink), -2px 0 0 var(--bu-ink), 0 -2px 0 var(--bu-ink), 0 3px 0 var(--bu-ink); }
html body .wm-body { margin-top: 8px; height: calc(100% - 64px - 8px - 44px - 8px); gap: 8px; }
html body .wm-places { padding: 8px; gap: 6px; border: 2px solid #061a52; border-radius: 10px;
  background: linear-gradient(var(--bu-well), var(--bu-well2)); box-shadow: var(--bu-well-shadow); }
html body .school-room-host .wm-place { min-height: 58px; border-radius: 10px; border: 1.5px solid #0b2a7a; background: linear-gradient(#3c6fd8, #2a54b8); box-shadow: inset 0 1px 0 #8fc1ff; }
html body .school-room-host .wm-place:is(:hover, :focus-visible) { filter: brightness(1.1); }
html body .school-room-host .wm-place[aria-pressed="true"] { background: linear-gradient(#ffb340, #f08a12); border-color: #7a3c00; box-shadow: inset 0 1px 0 #ffe1a3, 0 0 0 2px #fff; }
html body .wm-place img { border: 1.5px solid #061a52; }
html body .wm-place b { color: #fff; font: 15px var(--bu-outline); text-shadow: 0 1px 0 var(--bu-ink), 1px 0 0 var(--bu-ink), -1px 0 0 var(--bu-ink), 0 -1px 0 var(--bu-ink); }
html body .wm-place small { color: #dbeaff; font-weight: 700; }
html body .school-room-host .wm-place[aria-pressed="true"] small { color: #4a2600; }
html body .wm-detail { border-radius: 10px; background: #f4f9ff; border: 2px solid #061a52; }
html body .wm-detail-head h3 { font: 22px var(--bu-outline); color: #10296f; }
html body .wm-detail-head p { color: #3a5490; font-weight: 700; }
html body .wm-map-area { background: #dcecfb; border: 2px solid #9fcaf0; }
html body .school-room-host .wm-connections button { border-radius: 14px; font-weight: 800; color: #fff; background: linear-gradient(#4f86ea, #2c5fcc); border: 1.5px solid #0b2a7a; box-shadow: inset 0 1px 0 #a9d4ff; }
html body .wm-route { background: #e3f1fd; border: 1.5px solid #b8d8f6; color: #10296f; }
html body .wm-footer { height: 44px; margin-top: 8px; padding: 0 16px; border: 0; border-radius: 12px; color: #dbeaff; font-weight: 700;
  background: linear-gradient(#18348a, #0b1f5e); box-shadow: inset 0 2px 0 #3a64c8; }
html body .wm-footer .wm-legend { padding: 0; gap: 14px; font-size: 12px; }
