/* 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); }

/* ---------- "입장하기": my character, name tag, presence counter ---------- */
.tour-row { display: flex; align-items: center; gap: 8px; }
.enter-btn {
  border: 0; background: #ffd84d; color: #13325a; font-weight: 800; padding: 11px 18px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(19, 50, 90, .28); font-size: 15px; cursor: pointer;
}
.enter-btn:hover { background: #ffcf26; }
.me-chip {
  display: flex; align-items: center; gap: 6px; background: var(--paper, #fffdf8); color: var(--navy, #0b2b52);
  border-radius: 999px; padding: 5px 6px 5px 12px; box-shadow: 0 8px 20px rgba(19, 50, 90, .25); font-weight: 800; font-size: 14px;
}
.me-chip[hidden] { display: none; }
.me-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #ffd84d; }
.me-name { margin-right: 4px; white-space: nowrap; }
.me-btn { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(11, 43, 82, .07); cursor: pointer; font-size: 14px; display: grid; place-items: center; }
.me-btn:hover { background: rgba(11, 43, 82, .15); }
.me-tag { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.me-tag.hidden { display: none; }
.me-tag > span {
  display: flex; align-items: center; gap: 6px; transform: translate(-50%, -100%); white-space: nowrap;
  background: rgba(11, 43, 82, .92); color: #fff; font-weight: 800; font-size: 12.5px; padding: 5px 10px 5px 7px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25); border: 2px solid #ffd84d;
}
.me-tag i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1.5px #fff; }
.presence {
  display: flex; align-items: center; gap: 7px; background: rgba(255, 253, 248, .94); color: var(--navy, #0b2b52);
  font-weight: 700; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; box-shadow: 0 4px 14px rgba(19, 50, 90, .18);
}
.presence[hidden] { display: none; }
.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 0 rgba(46, 204, 113, .6); animation: presencePulse 2s infinite; }
@keyframes presencePulse { 0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, .6); } 70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); } }
.tourbar.on .tour-row .enter-btn, .tourbar.on .tour-row .me-chip { display: none; }
@media (max-width: 760px) {
  .enter-btn, .tour-start { padding: 9px 14px; font-size: 14px; }
  .me-chip { font-size: 13px; }
  .me-btn { width: 30px; height: 30px; }
  .presence { font-size: 11.5px; padding: 5px 10px; }
}
.presence-sep { opacity: .45; }
#presence-total[hidden] + *, .presence:has(#presence-total[hidden]) .presence-sep { display: none; }
#presence-total { color: #4a5a70; }
.tour-start, .enter-btn { white-space: nowrap; }
@media (max-width: 560px) {
  .tour-row { flex-wrap: wrap; justify-content: center; max-width: 280px; row-gap: 6px; }
  .me-chip { padding: 4px 4px 4px 10px; gap: 4px; }
}
.shot-flash { position: fixed; inset: 0; background: #fff; z-index: 99; pointer-events: none; animation: shotFlash .45s ease-out forwards; }
@keyframes shotFlash { from { opacity: .75; } to { opacity: 0; } }

/* movement guide + help card */
.me-guide {
  background: rgba(11, 43, 82, .93); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); border: 2px solid #ffd84d; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.me-guide[hidden] { display: none; }
.me-help {
  background: var(--paper, #fffdf8); color: var(--navy, #0b2b52); border-radius: 16px; padding: 14px 16px 12px; width: min(420px, 92vw);
  box-shadow: 0 12px 30px rgba(11, 43, 82, .3); border: 2px solid #ffd84d; font-size: 13.5px; line-height: 1.45;
}
.me-help[hidden] { display: none; }
.me-help .h-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.me-help ul { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 5px; }
.me-help button { border: 0; background: #0b2b52; color: #fff; font-weight: 800; padding: 7px 16px; border-radius: 999px; cursor: pointer; float: right; }
.me-help::after { content: ''; display: block; clear: both; }
@media (max-width: 560px) { .me-guide { font-size: 11.5px; white-space: normal; border-radius: 14px; } .me-help { font-size: 12.5px; } }
.me-help ul { gap: 7px; font-size: 14px; }
.me-help li b { color: #0b2b52; background: #fff1b8; padding: 0 4px; border-radius: 4px; }
.me-help li small { color: #5a6a80; font-size: 12px; }
.me-help .h-v { font-size: 12.5px; color: #4a5a70; border-top: 1px dashed rgba(11, 43, 82, .2); padding-top: 7px; }

/* ---------- likes (Instagram-style heart) ---------- */
.like-row { display: flex; align-items: center; gap: 6px; margin: -4px 0 8px -6px; }
.like-row[hidden] { display: none; }
.like-btn { border: 0; background: none; padding: 4px; cursor: pointer; color: #1b2433; display: grid; place-items: center; border-radius: 50%; line-height: 0; }
.like-btn:hover { color: #6b7280; }
.like-btn .heart-f { display: none; color: #ff3040; }
.like-btn[aria-pressed="true"] .heart-o { display: none; }
.like-btn[aria-pressed="true"] .heart-f { display: block; }
.like-btn.pop svg { animation: likePop .45s cubic-bezier(.17, .89, .32, 1.49); }
@keyframes likePop { 0% { transform: scale(1); } 25% { transform: scale(.75); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.like-count { font-weight: 800; font-size: 14px; color: #1b2433; }
.card-photo { position: relative; }
.like-burst { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .35)); }
.like-burst.on { animation: likeBurst .9s ease-out; }
@keyframes likeBurst { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15); opacity: .95; } 30% { transform: translate(-50%, -50%) scale(.95); } 70% { transform: translate(-50%, -50%) scale(1); opacity: .95; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .like-btn.pop svg, .like-burst.on { animation: none; } }

/* ---------- treasure hunt ---------- */
:root { --serif: "Noto Serif KR", "Nanum Myeongjo", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; --paper-2: #f6f2e8; }
.hunt {
  position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 14; width: min(440px, calc(100vw - 24px));
  background: rgba(255, 253, 248, .97); color: var(--ink); border: 1px solid rgba(29, 36, 48, .18); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15, 30, 55, .14); padding: 8px 12px 10px;
}
.hunt[hidden] { display: none; }
.hunt-head { display: flex; align-items: center; gap: 8px; }
.hunt-head b { font-size: 13.5px; white-space: nowrap; }
.hunt-slots { display: flex; gap: 5px; margin-left: auto; }
.hunt-slot { width: 30px; height: 30px; border-radius: 6px; border: 1px dashed rgba(29, 36, 48, .35); background: transparent; font-weight: 700; color: #8a8478; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.hunt-slot.sel { border: 1px solid var(--ink); color: var(--ink); }
.hunt-slot.got { border: 1px solid rgba(29, 36, 48, .25); background: var(--paper-2); }
.hunt-slot img { width: 26px; height: 26px; }
.hunt-fold { border: 0; background: none; font-size: 15px; cursor: pointer; color: #6a6458; width: 24px; transition: transform .2s; }
.hunt.fold .hunt-body { display: none; }
.hunt.fold .hunt-fold { transform: rotate(-90deg); }
.hunt-riddle { margin: 8px 0 3px; font-family: var(--serif); font-size: 14px; font-weight: 600; line-height: 1.55; }
.hunt-foreign { margin: 0 0 6px; font-size: 12px; color: #6a6458; }
.hunt-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.hunt-warm { margin-right: auto; display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12px; color: #4a4f5a; }
.hunt-warm .wd { display: inline-flex; gap: 3px; }
.hunt-warm .wd i { width: 7px; height: 12px; border-radius: 1px; background: rgba(29, 36, 48, .14); }
.hunt-warm.w0 .wd i:nth-child(-n+1), .hunt-warm.w1 .wd i:nth-child(-n+2) { background: #4f7cae; }
.hunt-warm.w2 .wd i:nth-child(-n+3), .hunt-warm.w3 .wd i:nth-child(-n+4) { background: #c0502f; }
.hunt-warm.w3 { color: #a8402a; }
.hunt-hint { border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; font-size: 12px; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.hunt-hint:disabled { background: transparent; color: #8a8478; border-color: rgba(29, 36, 48, .2); cursor: default; }
.hunt-hint[hidden] { display: none; }

/* found: a museum-label style card */
.hunt-pop {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60; width: min(440px, calc(100vw - 24px));
  display: flex; gap: 14px; align-items: flex-start; text-align: left; cursor: pointer;
  background: var(--paper-2); color: var(--ink); border: 1px solid rgba(29, 36, 48, .24); border-radius: 4px;
  padding: 14px 16px 14px 14px; box-shadow: 0 16px 32px -16px rgba(15, 25, 40, .5);
}
.hunt-pop[hidden] { display: none; }
.hunt-pop.on { animation: hpIn .22s ease-out; }
@keyframes hpIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.hp-fig { flex: 0 0 86px; height: 86px; margin: 0; background: #ece6d8; border: 1px solid rgba(29, 36, 48, .1); display: grid; place-items: center; }
.hp-fig img { width: 80px; height: 80px; }
.hp-txt { min-width: 0; }
.hp-meta { margin: 1px 0 3px; font-size: 11.5px; letter-spacing: .04em; color: #6a6458; font-variant-numeric: tabular-nums; }
.hp-title { margin: 0 0 6px; font: 700 19px/1.3 var(--serif); }
.hp-fact { margin: 0; font-size: 13px; line-height: 1.6; color: #3a404c; }
.hp-word { margin: 9px 0 0; padding-top: 8px; border-top: 1px solid rgba(29, 36, 48, .14); font-size: 12px; color: #6a6458; }
.hp-word i { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 14px; color: var(--ink); margin-right: 8px; }

/* certificate viewer */
.hunt-badge { position: fixed; inset: 0; z-index: 70; background: rgba(18, 20, 24, .62); display: grid; place-items: center; padding: 16px; }
.hunt-badge[hidden] { display: none; }
.hb-card { display: grid; gap: 12px; justify-items: center; animation: hbIn .2s ease-out; }
@keyframes hbIn { from { opacity: 0; } to { opacity: 1; } }
#hb-img { display: block; width: auto; height: auto; max-width: min(460px, 92vw); max-height: calc(100vh - 110px); background: var(--paper-2); box-shadow: 0 20px 44px rgba(0, 0, 0, .45); }
.hb-btns { display: flex; gap: 8px; }
.hb-btns button { border: 1px solid rgba(255, 255, 255, .5); border-radius: 6px; padding: 9px 18px; font-weight: 700; font-size: 14px; cursor: pointer; }
#hb-save { background: var(--paper-2); color: var(--ink); border-color: var(--paper-2); }
#hb-close { background: transparent; color: #fff; }
@media (max-width: 760px) { .hunt { top: 160px; left: 10px; transform: none; width: calc(100vw - 72px); padding: 6px 10px 8px; } .hunt-riddle { font-size: 13px; } .hunt-slot { width: 28px; height: 28px; } .hunt-pop { bottom: 86px; } .hp-fig { flex-basis: 70px; height: 70px; } .hp-fig img { width: 64px; height: 64px; } }
@media (prefers-reduced-motion: reduce) { .hunt-pop.on, .hb-card { animation: none; } }
