@font-face { font-family: Galmuri; src: url(fonts/Galmuri11.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Galmuri; src: url(fonts/Galmuri11-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #2b2140; --soft: #6b6388; --line: #dcd6ea; --paper: #f7f5fc; --card: #fff;
  --accent: #e2467f; --route: #e2467f; --sun: #ffd84f;
  --g1: #ffec7f; --g2: #9cc0f2; --g3: #f1aeae;
  --office: #e3ddf5; --special: #d2e7bb; --care: #fde2cc; --sports: #ddd4bd; --mid: #ffffff; --util: #ececf0;
  --entrance: #fff3c2;
  --pixel: Galmuri, 'Pretendard Variable', sans-serif;
  --text: 'Pretendard Variable', Pretendard, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; font-family: var(--text); color: var(--ink); background: var(--paper); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── 위: 도트 그림 학교 ── */
.hero { position: relative; height: clamp(360px, 62vh, 560px); background: #8bbeed; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: default; }
#scene.point { cursor: pointer; }
.sign { position: absolute; left: 50%; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; display: flex; align-items: center; --fs: clamp(11px, calc(var(--tw, 260px) / 10.5), 20px); }
.sign::before { content: ''; flex: none; width: 1.1em; height: 1.1em; margin-right: .25em; border-radius: 50%; background: radial-gradient(circle, #6a9fd8 0 28%, #fff 30% 46%, #6a9fd8 48% 60%, #fff 62%); font-size: var(--fs); }
.sign h1 { margin: 0; padding: 0; font: 700 var(--fs)/1.15 var(--pixel); letter-spacing: 0; color: #fff; text-shadow: 1px 1px 0 #2a5aa0, -1px 0 0 #2a5aa0, 0 -1px 0 #2a5aa0; }
.clock { position: absolute; transform: translate(-50%, -50%); pointer-events: none; white-space: pre; font: 700 clamp(10px, calc(var(--tw, 200px) / 5.2), 17px)/1 var(--pixel); letter-spacing: 1px; color: #ff6a3d; text-shadow: 0 0 4px rgba(255,106,61,.8); background: #15161c; padding: 2px 4px 1px; border: 2px solid #2b2140; border-radius: 2px; box-shadow: inset 0 0 0 1px #3a3d4a; font-variant-numeric: tabular-nums; }
.clock:empty { display: none; }
/* 왼쪽 위 날짜·날씨 (2026-11-29) */
.today { position: absolute; left: 14px; top: 12px; z-index: 2; pointer-events: none; color: #fff; font-family: var(--pixel); text-shadow: 1px 1px 0 #2a5aa0, -1px 0 0 #2a5aa0, 0 -1px 0 #2a5aa0, 0 1px 0 #2a5aa0; line-height: 1.3; }
.today-date { font-size: 15px; font-weight: 700; }
.today-wx { font-size: 13px; margin-top: 2px; }
.today-wx small { font-size: 11px; opacity: .85; }
.today { display: flex; align-items: flex-start; gap: 18px; right: 14px; }
.today-main { flex: none; }
.today-meal { max-width: 380px; padding-left: 16px; border-left: 2px solid rgba(255,255,255,.75); font-size: 13px; line-height: 1.45; }
.today-meal b { display: block; font-size: 13px; margin-bottom: 1px; }
.today-meal span { display: block; }
.today-meal i { font-style: normal; white-space: nowrap; }
@media (max-width: 760px) { .today { flex-direction: column; gap: 4px; } .today-meal { padding-left: 0; border-left: 0; max-width: 92%; font-size: 11px; } .today-meal b { display: inline; font-size: 11px; margin-right: .4em; } .today-meal span { display: inline; } }
@media (max-width: 560px) { .today { left: 10px; top: 8px; } .today-date { font-size: 12px; } .today-wx { font-size: 11px; } .today-wx small { font-size: 10px; } }
@keyframes bulbs { 50% { border-color: #ff8a5c; } }
.hero-tip { position: absolute; z-index: 3; pointer-events: none; transform: translate(-50%, -100%); background: var(--ink); color: #fff; font: 400 12px/1.4 var(--pixel); padding: 6px 9px; border-radius: 4px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.hero-tip b { color: var(--sun); font-weight: 700; }

.search { position: absolute; z-index: 5; left: 50%; bottom: -26px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 0 14px; height: 52px; box-shadow: 0 5px 0 var(--ink); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 400 11px var(--pixel); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; color: var(--soft); }
.results { position: absolute; left: -2px; right: -2px; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 5px 0 var(--ink); max-height: 360px; overflow: auto; }
.results li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.results li[aria-selected="true"], .results li:hover { background: #f2eefb; }
.results .fl { flex: none; font: 700 12px var(--pixel); width: 34px; text-align: center; padding: 3px 0; border-radius: 6px; background: var(--ink); color: #fff; }
.results .nm { font-weight: 650; }
.results .ds { font-size: 12.5px; color: var(--soft); margin-left: auto; text-align: right; }
.results .empty { color: var(--soft); cursor: default; }

/* ── 아래: 평면도 ── */
.plan-wrap { max-width: 1240px; margin: 0 auto; padding: 58px 16px 24px; }
.plan-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.floors, .modes { display: flex; gap: 6px; }
.floors button, .modes button { border: 2px solid var(--ink); background: var(--card); border-radius: 10px; padding: 7px 14px; font-weight: 700; box-shadow: 0 3px 0 var(--ink); transition: transform .08s; }
.floors button { font-family: var(--pixel); min-width: 56px; }
.floors button[aria-current="true"] { background: var(--ink); color: var(--sun); }
.modes button { font-size: 14px; padding: 6px 12px; box-shadow: 0 2px 0 var(--ink); }
.modes button[aria-pressed="true"] { background: var(--sun); }
.floors button:active, .modes button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.floor-head { display: flex; align-items: baseline; gap: 12px; margin: 22px 2px 10px; flex-wrap: wrap; }
.floor-head h2 { margin: 0; font: 700 26px var(--pixel); }
.floor-head p { margin: 0; color: var(--soft); font-size: 14px; }
.compass { display: flex; justify-content: space-between; font: 400 11px var(--pixel); color: var(--soft); margin: 0 4px 4px; }
.plan { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); padding: 10px; overflow: hidden; }
.plan svg { display: block; width: 100%; height: auto; font-family: var(--text); }
.plan .room { cursor: pointer; }
.plan .room rect { stroke: var(--ink); stroke-width: 1.2; transition: filter .15s, opacity .2s; }
.plan .room:hover rect { filter: brightness(.95) saturate(1.2); }
.plan .room.dim rect { opacity: .28; }
.plan .room.dim text { opacity: .4; }
.plan .room.sel rect { stroke: var(--accent); stroke-width: 4; }
.plan .room.sel { animation: pop .5s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.plan .ping { fill: none; stroke: var(--accent); stroke-width: 3; animation: ping 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ping { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.25); } }
.plan text { fill: var(--ink); pointer-events: none; }
.plan .t-sub { fill: var(--soft); }
.plan .route { fill: none; stroke: var(--route); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 11; animation: march .7s linear infinite; }
@keyframes march { to { stroke-dashoffset: -13; } }
.plan .route-end { fill: var(--route); stroke: #fff; stroke-width: 2.5; }
.plan .route-start { fill: #fff; stroke: var(--route); stroke-width: 4; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 14px 2px 0; list-style: none; font-size: 13px; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 12px; border: 1.5px solid var(--ink); border-radius: 3px; display: inline-block; }

/* ── 방 정보 ── */
.info { position: relative; margin-top: 18px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.4fr); gap: 0 28px; align-items: start; background: var(--card); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink); padding: 20px 20px 18px; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
.info-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--soft); border-radius: 8px; }
.info-close:hover { background: #f2eefb; }
.info .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.info .badge { font: 700 11.5px var(--pixel); padding: 3px 8px; border-radius: 6px; border: 1.5px solid var(--ink); }
.info h3 { margin: 0 34px 4px 0; font-size: 22px; line-height: 1.3; }
.info .desc { margin: 0; color: var(--soft); font-size: 14px; }
.info .note { margin: 12px 0 0; padding: 9px 12px; background: #fff7d6; border-radius: 10px; font-size: 14px; }
.info .go { margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed var(--line); }
.info[hidden] { display: none; }
#infoBody { display: contents; }
.info .head, .info .staff { grid-column: 1; }
.info .staff { margin-top: 14px; }
.info .staff h4 { margin: 12px 0 6px; font-size: 13px; color: var(--soft); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.info .staff h4:first-child { margin-top: 0; }
.info .staff ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.info .person { display: inline-flex; align-items: center; gap: 0; padding: 5px 10px; border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; background: #fff; }
.info .person span { color: var(--soft); font-weight: 500; font-variant-numeric: tabular-nums; }
.info .person em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #8a5a00; background: #ffe98a; border-radius: 4px; padding: 1px 4px; margin-right: 5px; }
.info .person:hover { border-color: var(--ink); }
.info .person.hit { border-color: var(--accent); background: #fde7ef; box-shadow: 0 0 0 3px #fde7ef; }
.info .kids { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 5px; }
.info .kids li { font-size: 13.5px; padding: 5px 8px; background: #f4f1fb; border-radius: 8px; white-space: nowrap; }
.info .kids b { font-variant-numeric: tabular-nums; font-weight: 700; }
.info .staff .ext-help { margin: 8px 0 0; font-size: 12px; color: var(--soft); }
.info .go { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; padding-top: 0; border-top: 0; padding-left: 26px; border-left: 1.5px dashed var(--line); }
.info .share { grid-column: 1; margin-top: 16px; }
.info .go { grid-row: auto; }
.info .side { grid-column: 2; grid-row: 1 / span 3; padding-left: 26px; border-left: 1.5px dashed var(--line); min-width: 0; }
.info .side .go { padding-left: 0; border-left: 0; }
.info .links h4 { margin: 14px 0 8px; font-size: 13px; color: var(--soft); font-weight: 650; }
.info .links h4:first-child { margin-top: 0; }
.info .links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.info .link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); transition: transform .08s; }
.info .link:hover { background: #fff7d6; }
.info .link:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.info .link.hit { background: #fde7ef; border-color: var(--accent); box-shadow: 0 3px 0 var(--accent); }
.info .link .em { font-size: 22px; flex: none; }
.info .link .tx { display: flex; flex-direction: column; min-width: 0; }
.info .link b { font-size: 14.5px; line-height: 1.3; }
.info .link small { font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .link .ar { margin-left: auto; color: var(--soft); font-size: 13px; }
.info .go-fold { margin-top: 16px; }
.info .go-fold summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--soft); list-style: none; }
.info .go-fold summary::before { content: '▸ '; }
.info .go-fold[open] summary::before { content: '▾ '; }
.info .go-fold[open] summary { margin-bottom: 10px; }
.info .go-fold .go-head { justify-content: flex-start; }
.results .who { flex: none; width: 34px; text-align: center; font-size: 15px; }
.plan .tel { fill: #8a5a00; font-size: 10px; }
.plan .room { scroll-margin-top: 90px; }
.info .go-head { margin-right: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.info .go-head b { font-size: 15px; }
.info .starts { display: flex; gap: 4px; }
.info .starts button { border: 1.5px solid var(--ink); background: var(--card); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; }
.info .starts button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.info .go ol { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.info .go ol li { counter-increment: s; position: relative; padding: 2px 0 10px 34px; font-size: 14.5px; line-height: 1.5; }
.info .go ol li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--route); color: #fff; font: 700 12px/24px var(--pixel); text-align: center; }
.info .go ol li:not(:last-child)::after { content: ''; position: absolute; left: 11px; top: 28px; bottom: 2px; border-left: 2px dotted var(--route); }
.info .go ol li button { border: 0; background: #fde7ef; color: var(--accent); border-radius: 6px; font-size: 12px; font-weight: 700; padding: 1px 7px; margin-left: 4px; }
.info .share { margin-top: 6px; display: flex; gap: 8px; }
.info .share button { flex: 1; border: 2px solid var(--ink); background: var(--sun); border-radius: 10px; padding: 9px; font-weight: 700; box-shadow: 0 3px 0 var(--ink); }
.info .share button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.foot { max-width: 1240px; margin: 14px auto 0; padding: 10px 16px 120px; display: grid; gap: 10px; }
.dept-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); padding: 10px 14px; }
.dept-name { flex: none; width: 104px; text-align: left; font: 700 15px var(--pixel); color: var(--ink); background: none; border: 0; padding: 4px 0; }
button.dept-name { cursor: pointer; }
button.dept-name:hover { color: var(--accent); }
button.dept-name::after { content: ' ›'; color: var(--soft); }
.dept-links { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.dept-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 650; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; transition: transform .08s; }
.dept-btn:hover { background: var(--sun); }
.dept-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

@media (max-width: 760px) {
  .hero { height: clamp(320px, 54vh, 440px); }
  .plan-wrap { padding-top: 52px; }
  .plan-bar { flex-direction: column; align-items: stretch; }
  .floors button { flex: 1; min-width: 0; padding: 8px 0; }
  .modes { justify-content: flex-end; }
  .search kbd { display: none; }
  .floor-head h2 { font-size: 22px; }
  .plan { padding: 6px; }
  .info { position: fixed; z-index: 20; display: block; margin: 0; overflow: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72dvh; border-radius: 18px 18px 0 0; border-bottom: 0; box-shadow: 0 -4px 0 var(--ink); padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
  .info h3 { font-size: 20px; }
  .info .go { margin-top: 14px; padding: 12px 0 0; border-left: 0; border-top: 1.5px dashed var(--line); }
  .info .side { padding-left: 0; border-left: 0; margin-top: 14px; }
  .info .links ul { grid-template-columns: 1fr; }
  .foot { padding-bottom: 60dvh; }
  .dept-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px 12px; }
  .dept-name { width: auto; }
  .dept-btn { font-size: 13.5px; padding: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 인사하는 사람 */
.greeter { position: absolute; z-index: 40; pointer-events: none; transform: translateY(-100%); display: flex; align-items: flex-end; gap: 4px; }
.greeter[hidden] { display: none; }
.greeter.pop { animation: greet .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes greet { from { transform: translateY(-88%) scale(.6); opacity: 0; } }
.greeter.flip { flex-direction: row-reverse; }
.greeter.flip .g-bubble::before { left: auto; right: -9px; border-right: 0; border-left: 8px solid var(--ink); }
.greeter.flip .g-bubble::after { left: auto; right: -5px; border-right: 0; border-left: 7px solid #fff; }

.g-who { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.g-who canvas { width: 54px; height: 84px; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(43, 33, 64, .25)); }
.g-name { font: 700 11px var(--pixel); background: var(--ink); color: var(--sun); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.g-bubble { position: relative; margin-bottom: 60px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font: 700 13.5px/1.5 var(--pixel); color: var(--ink); white-space: pre-line; word-break: keep-all; width: max-content; max-width: min(340px, calc(100vw - 110px)); box-shadow: 0 3px 0 var(--ink); }
.g-bubble::before { content: ''; position: absolute; left: -9px; bottom: 10px; border: 8px solid transparent; border-right-color: var(--ink); border-left: 0; }
.g-bubble::after { content: ''; position: absolute; left: -5px; bottom: 11px; border: 7px solid transparent; border-right-color: #fff; border-left: 0; }
