/* HUFS Voxel Campus - styles (plain CSS, no build step) */
:root {
  --navy: #0b2b52;
  --navy-2: #1d4675;
  --gold: #c79a4b;
  --ink: #1d2430;
  --muted: #5d6675;
  --paper: #fffdf8;
  --line: rgba(11, 43, 82, .14);
  --shadow: 0 10px 30px rgba(15, 30, 55, .18);
  --radius: 14px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 10%, #fbf6ea 0%, #efe6d3 55%, #e2d6bd 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: rgba(255, 253, 248, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--navy);
  padding: 4px 8px; border-radius: 6px; font-size: 13px;
}
.brand-title { font-size: 16px; font-weight: 700; margin: 0; white-space: nowrap; color: var(--navy); }
.campus-tabs { display: flex; gap: 4px; background: rgba(11, 43, 82, .06); padding: 4px; border-radius: 999px; margin-left: auto; }
.tab {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted);
}
.tab[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(11, 43, 82, .3); }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--navy); text-decoration: none;
}
.icon-btn:hover { background: #f4efe3; }
.embed-only { display: none; }
body.embed .embed-only { display: inline-flex; }
body.embed .brand-title { font-size: 14px; }

/* ---------- stage ---------- */
.stage { position: fixed; inset: var(--topbar-h) 0 0 0; }
#scene { width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 95% at 50% 45%, rgba(0,0,0,0) 55%, rgba(70,50,25,.16) 100%);
}
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl {
  position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 12px; font-weight: 700; color: var(--navy);
  background: rgba(255, 255, 255, .93); border: 1px solid rgba(11, 43, 82, .18);
  border-radius: 999px; padding: 3px 9px 3px 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  transform-origin: 50% 100%; transition: opacity .15s;
}
.lbl::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 2px; height: 6px; margin-left: -1px; background: rgba(11, 43, 82, .45);
}
.lbl .num {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 11px;
}
.lbl.place .num { background: #3f8a4a; }
.lbl.nonum { padding-left: 9px; }
.lbl.sel { background: var(--gold); color: #fff; border-color: var(--gold); z-index: 5; }
.lbl.sel .num { background: #fff; color: var(--gold); }
.lbl.hidden { opacity: 0; pointer-events: none; }

/* ---------- panel ---------- */
.panel {
  position: absolute; top: 14px; left: 14px; width: 300px; max-height: calc(100% - 120px);
  display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 10; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 16px; }
.panel-title { margin: 0; font-size: 15px; color: var(--navy); }
.panel-toggle span { display: inline-block; transition: transform .2s; }
.panel.collapsed .panel-toggle span { transform: rotate(-90deg); }
.panel.collapsed .panel-body { display: none; }
.panel-body { display: flex; flex-direction: column; min-height: 0; }
.search { padding: 4px 12px 10px; }
.search input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; font-size: 14px;
}
.poi-list { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; min-height: 0; }
.poi-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 10px;
}
.poi-item:hover, .poi-item[aria-current="true"] { background: rgba(199, 154, 75, .16); }
.poi-item .num {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 700;
}
.poi-item.place .num { background: #3f8a4a; }
.poi-item .nm { display: flex; flex-direction: column; min-width: 0; }
.poi-item .nm b { font-size: 14px; font-weight: 600; }
.poi-item .nm small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poi-empty { padding: 10px 14px; color: var(--muted); font-size: 13px; }

/* ---------- info card ---------- */
.card {
  position: absolute; top: 14px; right: 14px; width: 340px; max-height: calc(100% - 120px); overflow-y: auto;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 11;
}
.card-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255, 255, 255, .9); }
.card-photo { margin: 0; aspect-ratio: 16 / 9; background: #e9e1d0; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 14px 16px 16px; }
.card-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.card-title { margin: 0; font-size: 20px; color: var(--navy); line-height: 1.25; }
.card-sub { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.card-desc { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.card-desc:empty, .card-sub:empty, .card-meta:empty { display: none; }
.card-meta { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--navy);
  padding: 7px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn:hover { filter: brightness(.97); }

/* ---------- map controls ---------- */
.map-ctrls { position: absolute; right: 14px; bottom: 96px; display: flex; flex-direction: column; gap: 6px; z-index: 9; align-items: center; }
.ctrl {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12); display: grid; place-items: center; font-weight: 700; color: var(--navy);
}
.ctrl[aria-pressed="false"] { opacity: .55; }
.compass {
  width: 40px; height: 40px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .12); font-weight: 800; font-size: 12px; color: #b33;
}
.compass span { display: block; transform-origin: 50% 50%; }
.compass span::before { content: "▲"; display: block; font-size: 9px; line-height: 1; text-align: center; }

/* ---------- tour bar ---------- */
.tourbar {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 12;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tour-start {
  border: 0; background: var(--navy); color: #fff; font-weight: 700; padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(11, 43, 82, .35); font-size: 15px;
}
.tour-start:hover { background: var(--navy-2); }
.tour-ctrl {
  display: flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line);
  padding: 6px; border-radius: 16px; box-shadow: var(--shadow);
}
.tour-ctrl[hidden] { display: none; }
.tour-status { font-size: 13px; font-weight: 600; padding: 0 8px; min-width: 150px; text-align: center; color: var(--navy); }
.tour-progress { width: 100%; height: 3px; border-radius: 3px; background: rgba(11, 43, 82, .1); overflow: hidden; visibility: hidden; }
.tourbar.on .tour-progress { visibility: visible; }
.tour-progress span { display: block; height: 100%; width: 0; background: var(--gold); }

/* ---------- misc ---------- */
.loading {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 30;
  background: rgba(244, 236, 220, .7); backdrop-filter: blur(3px); transition: opacity .3s;
}
.loading.done { opacity: 0; pointer-events: none; }
.loading-box { background: var(--paper); padding: 18px 22px; border-radius: var(--radius); box-shadow: var(--shadow); min-width: 240px; }
.loading-title { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.bar { height: 6px; background: rgba(11, 43, 82, .1); border-radius: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .2s; }
.toast {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow);
}
.hint {
  position: absolute; left: 14px; bottom: 30px; margin: 0; font-size: 12px; color: var(--muted); z-index: 5; pointer-events: none;
  background: rgba(255, 253, 248, .82); padding: 3px 8px; border-radius: 8px;
}
.attribution {
  position: fixed; right: 0; bottom: 0; z-index: 25; font-size: 10.5px; color: var(--muted);
  background: rgba(255, 253, 248, .8); padding: 3px 8px; border-top-left-radius: 8px; max-width: 100%;
}
.noscript { position: fixed; inset: 40% 10% auto; background: #fff; padding: 20px; border-radius: 12px; text-align: center; }
.no-webgl #scene { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .brand-title { display: none; }
  .campus-tabs { margin-left: 0; }
  .tab { padding: 6px 10px; font-size: 13px; }
  .panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 46%; border-radius: var(--radius) var(--radius) 0 0; }
  .panel.collapsed { max-height: none; }
  .card { top: 8px; left: 8px; right: 8px; width: auto; max-height: 52%; }
  .card-photo { aspect-ratio: 21 / 9; }
  .map-ctrls { right: 8px; bottom: auto; top: 8px; }
  body.card-open .map-ctrls { display: none; }
  .tourbar { bottom: auto; top: 8px; }
  body.card-open .tourbar:not(.on) { display: none; }
  body.card-open .tourbar.on { top: auto; bottom: calc(46% + 8px); }
  .hint { display: none; }
  .attribution {
    font-size: 9.5px; left: 0; right: 0; border-radius: 0; height: 18px; line-height: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .stage { bottom: 18px; }
  .panel:not(.collapsed) ~ .tourbar.on { top: auto; bottom: calc(46% + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- night mode ---------- */
body.night { background: radial-gradient(120% 90% at 50% 10%, #22304c 0%, #141d31 55%, #0b111e 100%); }
body.night .vignette { background: radial-gradient(120% 95% at 50% 45%, rgba(0,0,0,0) 50%, rgba(0,0,10,.35) 100%); }
body.night .hint { background: rgba(20, 28, 44, .82); color: #c9d2e3; }
body.night .attribution { background: rgba(20, 28, 44, .8); color: #aab4c8; }
#btn-night[aria-pressed="false"] { opacity: 1; }
#btn-night[aria-pressed="true"] { background: #1b2742; color: #ffd27a; border-color: #1b2742; }

/* ---------- card: one-line action bar; on phones it sits right under the photo ---------- */
.card { display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card-photo { order: 0; flex: none; }
.card-body { order: 1; }
.card-actions { order: 2; display: flex; flex-wrap: nowrap; gap: 6px; padding: 0 16px 16px; }
.card-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 8px 4px; font-size: 12.5px; white-space: nowrap; gap: 4px; }
.card-actions .btn .ico { font-size: 14px; line-height: 1; }
@media (max-width: 760px) {
  .card-actions { order: 1; padding: 8px 10px 4px; }
  .card-body { order: 2; padding-top: 8px; }
  .card-photo + .card-body { padding-top: 8px; }
}

/* ---------- seasons ---------- */
#btn-season .season-ico { font-size: 17px; line-height: 1; }
.map-ctrls { position: absolute; }
.season-menu {
  position: absolute; right: calc(100% + 10px); top: 0; z-index: 30; width: 270px;
  background: var(--panel, #fffdf8); color: var(--ink, #1b2433); border-radius: 14px; padding: 8px;
  box-shadow: 0 10px 30px rgba(20, 30, 50, .22); display: flex; flex-direction: column; gap: 2px;
}
.season-menu[hidden] { display: none; }
.season-title { font-size: 12px; font-weight: 700; opacity: .65; padding: 4px 8px 6px; }
.season-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.season-opt:hover, .season-opt:focus-visible { background: rgba(23, 50, 90, .08); outline: none; }
.season-opt[aria-checked="true"] { background: #0f2a4e; color: #fff; }
.season-opt .ico { font-size: 16px; width: 20px; text-align: center; }
.anniv-banner {
  position: absolute; left: 50%; top: 72px; transform: translateX(-50%); z-index: 20;
  background: linear-gradient(90deg, #0f2a4e, #2a5aa0); color: #fff; font-weight: 700; font-size: 14px;
  padding: 9px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(15, 42, 78, .35); white-space: nowrap; pointer-events: none;
}
.anniv-banner[hidden] { display: none; }
@media (max-width: 760px) {
  .season-menu { position: fixed; right: 12px; left: 12px; top: auto; bottom: 90px; width: auto; }
  .anniv-banner { top: 64px; font-size: 12.5px; padding: 7px 14px; }
}

/* campus tabs: short names on narrow screens (three campuses) */
.tab .tab-short { display: none; }
@media (max-width: 560px) {
  .tab .tab-full { display: none; }
  .tab .tab-short { display: inline; }
  .tab { padding: 6px 12px; white-space: nowrap; }
}

/* "tap me" bubbles over the characters */
.sp-hints { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.sp-hint { position: absolute; left: 0; top: 0; will-change: transform; }
.sp-hint.hidden { display: none; }
.sp-hint > span {
  display: block; transform: translate(-50%, -100%); white-space: nowrap;
  background: #ffd84d; color: #13325a; font-weight: 800; font-size: 12.5px; line-height: 1;
  padding: 7px 11px; border-radius: 999px; box-shadow: 0 4px 14px rgba(19, 50, 90, .28);
  animation: spHint 1.5s ease-in-out infinite;
}
.sp-hint > span::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px;
  border: 5px solid transparent; border-bottom: 0; border-top-color: #ffd84d;
}
@keyframes spHint { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, calc(-100% - 7px)); } }
@media (prefers-reduced-motion: reduce) { .sp-hint > span { animation: none; } }
body.night .sp-hint > span { box-shadow: 0 0 16px rgba(255, 216, 77, .55); }
