/* =====================================================================
   《메이드학 개론》 스타일 — 시안 C(고딕 게임 UI) + B(쯔꾸르 도트)
   색과 글꼴은 :root 변수만 바꾸면 전체에 반영됩니다.
   ===================================================================== */
@font-face { font-family: "Galmuri11"; src: url("../assets/fonts/Galmuri11.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Galmuri11"; src: url("../assets/fonts/Galmuri11-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #17141C; --panel: #1E1924; --plum: #322638; --plum-2: #4A3A55;
  --wine: #622B3B; --wine-2: #7D3A4E; --silver: #C6C3CD; --gold: #C8A978;
  --ivory: #F5EDE1; --seal: #0F0D12; --muted: #9C93A8; --pink: #E8798B; --mint: #7BC4A8;
  --paper: #F7EED8;
  --f-title: "Gowun Batang", "Nanum Myeongjo", serif;
  --f-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-latin: "Cinzel", "Times New Roman", serif;
  --f-pixel: "Galmuri11", "Noto Sans KR", monospace;
  --nav-h: 60px; --r: 4px; --max: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--silver);
  font-family: var(--f-body); font-size: 16px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
a { color: var(--gold); }
img { max-width: 100%; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--f-title); color: var(--ivory); font-weight: 700; line-height: 1.3; margin: 0 0 .4em; }
.latin { font-family: var(--f-latin); letter-spacing: .12em; }
.pixel { font-family: var(--f-pixel); }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.wrap { width: min(var(--max), 100% - 32px); margin: 0 auto; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border: 1px solid var(--gold); background: transparent;
  color: var(--gold); border-radius: var(--r); font-weight: 500; text-decoration: none;
  transition: background .2s, color .2s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--gold); color: var(--ink); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn--solid { background: var(--wine); border-color: var(--wine); color: var(--ivory); }
.btn--solid:hover:not(:disabled) { background: var(--wine-2); color: var(--ivory); border-color: var(--wine-2); }
.btn--ghost { border-color: var(--plum-2); color: var(--silver); }
.btn--ghost:hover:not(:disabled) { background: var(--plum); color: var(--ivory); }
.btn:disabled { border-color: #3a3342; color: #6d6577; background: transparent; }
.btn--sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.chip {
  min-height: 38px; padding: 4px 14px; border: 1px solid var(--plum-2); border-radius: 999px; background: transparent;
  color: var(--silver); font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--wine); border-color: var(--gold); color: var(--ivory); }

/* ---------- 쯔꾸르 창 (B 요소) ---------- */
.pxwin {
  background: var(--paper); color: #2A2233; font-family: var(--f-pixel); border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--gold), 4px 4px 0 var(--seal); border-radius: 0; padding: 14px 16px;
}
.pxwin--dark { background: #241D2C; color: var(--ivory); box-shadow: inset 0 0 0 2px var(--plum-2), 4px 4px 0 var(--seal); }
.pxwin b { color: var(--wine); }
.pxwin--dark b { color: var(--gold); }
.cursor::before { content: "▶"; display: inline-block; margin-right: 6px; color: var(--pink); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 헤더 / 네비 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: rgba(23, 20, 28, .94);
  border-bottom: 1px solid var(--plum); backdrop-filter: blur(4px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ivory); min-width: 0; }
.brand b { font-family: var(--f-title); font-size: 18px; white-space: nowrap; }
.brand small { display: block; font-family: var(--f-latin); font-size: 10px; letter-spacing: .14em; color: var(--gold); white-space: nowrap; }
.nav { display: flex; gap: 2px; }
.nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--silver); text-decoration: none;
  font-size: 14px; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ivory); }
.nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--plum-2); background: transparent; border-radius: var(--r); }
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 4px auto; background: var(--silver); }
.hdr-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--plum-2); background: transparent; border-radius: var(--r); display: grid; place-items: center; }
.icon-btn[aria-pressed="true"] { border-color: var(--gold); }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; background: var(--ink);
    border-bottom: 1px solid var(--plum); padding: 8px 16px 16px; transform: translateY(-120%); transition: transform .25s; z-index: 49;
  }
  .nav.open { transform: none; }
  .nav a { border-bottom: 1px solid var(--plum); }
  .brand small { display: none; }
}

/* ---------- 공통 섹션 ---------- */
main { min-height: calc(100vh - var(--nav-h) - 120px); }
.view { padding: 40px 0 64px; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.page-head { margin-bottom: 28px; }
.page-head .eyebrow { font-family: var(--f-latin); color: var(--gold); letter-spacing: .2em; font-size: 12px; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); }
.page-head p { margin: 0; color: var(--muted); }
.section { margin-top: 48px; }
.section > h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section > h2::after { content: ""; flex: 1; height: 1px; background: var(--plum); }
.grid { display: grid; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--plum); border-radius: var(--r); padding: 18px; }
.lace-line { height: 12px; background-repeat: repeat-x; background-size: auto 12px; image-rendering: pixelated; opacity: .55; margin: 18px 0; }

/* ---------- 성인 확인 ---------- */
.gate {
  position: fixed; inset: 0; z-index: 200; background: var(--seal); display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.gate__box { width: min(460px, 100%); text-align: center; }
.gate__box h2 { font-size: 22px; margin-top: 12px; }
.gate__box p { font-size: 15px; }
.gate__age { display: inline-block; font-family: var(--f-pixel); font-weight: 700; font-size: 28px; color: var(--ivory); background: var(--wine); border: 3px solid var(--gold); padding: 6px 14px; }
.gate__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 메인 (타이틀 화면) ---------- */
.home { position: relative; min-height: calc(100vh - var(--nav-h)); display: grid; overflow: hidden; }
.home__stage { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; gap: 24px; padding: 48px 0 96px; }
.home__title .eyebrow { font-family: var(--f-latin); color: var(--gold); letter-spacing: .26em; font-size: 13px; }
.home__title h1 { font-size: clamp(42px, 7vw, 84px); margin: 6px 0 8px; letter-spacing: .02em; }
.home__title .sub { font-family: var(--f-title); font-size: clamp(16px, 2vw, 20px); color: var(--ivory); }
.home__intro { max-width: 520px; margin-top: 18px; color: var(--silver); font-size: 15px; }
.home__crest { display: flex; align-items: center; gap: 14px; }
.gatebox {
  position: relative; width: min(340px, 100%); aspect-ratio: 3 / 4; margin-left: auto; border: 2px solid var(--gold);
  border-radius: 170px 170px 0 0; background: var(--plum); overflow: hidden;
}
.gatebox::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(200,169,120,.5); border-radius: 160px 160px 0 0; }
.gatebox__light { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: radial-gradient(circle at 50% 60%, rgba(200,169,120,.35), transparent 65%); }
.gatebox__light .pixel { color: var(--gold); font-size: 13px; }
.menu { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 4px; max-width: 360px; }
.menu button, .menu a {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; background: transparent;
  border: 0; border-left: 2px solid transparent; color: var(--silver); font-family: var(--f-title); font-size: 19px; text-align: left; text-decoration: none;
}
.menu button::before, .menu a::before { content: "◆"; font-size: 11px; color: transparent; transition: color .15s; }
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { color: var(--ivory); border-left-color: var(--gold); background: rgba(50,38,56,.6); }
.menu button:hover::before, .menu a:hover::before, .menu button:focus-visible::before, .menu a:focus-visible::before { color: var(--gold); }
.menu .primary { color: var(--gold); }
.home__walk { position: absolute; left: 0; right: 0; bottom: 18px; height: 64px; pointer-events: none; }
.walker { position: absolute; bottom: 0; left: -80px; animation: walk 26s linear infinite; }
.walker--2 { animation-delay: -13s; animation-duration: 32s; }
@keyframes walk { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 160px)); } }
.credit { font-family: var(--f-latin); font-size: 12px; letter-spacing: .16em; color: var(--muted); margin-top: 24px; }
.credit a, .credit span { color: var(--gold); text-decoration: none; }

/* 입장 연출 */
.intro { position: fixed; inset: 0; z-index: 150; background: var(--seal); overflow: hidden; }
.intro__door { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--plum); border: 2px solid var(--gold); transition: transform 1.6s cubic-bezier(.7,0,.3,1); }
.intro__door--l { left: 0; border-right-width: 1px; }
.intro__door--r { right: 0; border-left-width: 1px; }
.intro__door::after { content: ""; position: absolute; top: 50%; width: 14px; height: 60px; margin-top: -30px; background: var(--gold); }
.intro__door--l::after { right: 18px; } .intro__door--r::after { left: 18px; }
.intro.open .intro__door--l { transform: translateX(-102%); }
.intro.open .intro__door--r { transform: translateX(102%); }
.intro__hall { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.intro__skip { position: absolute; right: 16px; bottom: 16px; z-index: 3; }
.intro__crest { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; transition: opacity .5s; }
.intro.open .intro__crest { opacity: 0; }
.spark { position: absolute; pointer-events: none; animation: rise 1.8s ease-out forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.6); } 30% { opacity: 1; } to { opacity: 0; transform: translateY(-120px) scale(1.1); } }

/* ---------- 로비 (쯔꾸르 홀) ---------- */
.hall {
  position: relative; border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--plum-2); min-height: 460px; overflow: hidden;
  background-color: #2A2233;
  background-image: linear-gradient(45deg, #2F2638 25%, transparent 25%, transparent 75%, #2F2638 75%), linear-gradient(45deg, #2F2638 25%, transparent 25%, transparent 75%, #2F2638 75%);
  background-size: 48px 48px; background-position: 0 0, 24px 24px; image-rendering: pixelated;
}
.hall__wall { height: 120px; background: var(--plum); border-bottom: 6px solid var(--wine); display: flex; justify-content: space-around; align-items: flex-end; padding: 0 4%; }
.door {
  width: 92px; height: 104px; background: #3B2F4A; border: 3px solid var(--ink); border-bottom: 0; box-shadow: inset 0 0 0 3px var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; color: var(--ivory); text-decoration: none;
  font-family: var(--f-pixel); font-size: 12px; line-height: 1.3; text-align: center;
}
.door:hover, .door:focus-visible { background: var(--wine); }
.hall__floor { position: relative; height: 300px; }
.hall__obj { position: absolute; background: none; border: 0; padding: 4px; }
.hall__obj:hover img, .hall__obj:focus-visible img { transform: translateY(-3px); }
.hall__obj img { transition: transform .15s; }
.hall__npc { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); background: none; border: 0; }
.hall__dialog { position: absolute; left: 12px; right: 12px; bottom: 12px; min-height: 112px; }
.hall__dialog .opts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.hall__dialog .opts a, .hall__dialog .opts button { background: none; border: 0; padding: 4px 0; color: var(--wine); font-family: var(--f-pixel); font-size: 15px; text-decoration: none; min-height: 32px; }
.hall__dialog .opts a:hover, .hall__dialog .opts button:hover, .hall__dialog .opts a:focus-visible { text-decoration: underline; }
.runner { position: absolute; bottom: 130px; left: -60px; z-index: 4; transition: none; }
.runner.go { animation: dash 2.2s steps(22) forwards; }
@keyframes dash { to { transform: translateX(calc(50vw + 40px)); } }
.bubble { position: absolute; z-index: 5; font-family: var(--f-pixel); font-size: 13px; background: var(--paper); color: #2A2233; border: 2px solid var(--ink); padding: 4px 8px; white-space: nowrap; }

/* ---------- 아카데미 소개 ---------- */
.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--f-pixel); font-size: 28px; color: var(--ivory); }
.stat span { font-size: 13px; color: var(--muted); }
.map {
  position: relative; aspect-ratio: 16 / 9; border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--plum-2);
  background: #2B3A35; overflow: hidden;
}
.map__path { position: absolute; background: #8C7A5C; }
.map__node {
  position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.map__node .label { font-family: var(--f-pixel); font-size: 12px; color: var(--ivory); background: rgba(15,13,18,.85); padding: 1px 6px; white-space: nowrap; }
.map__node:hover .label, .map__node:focus-visible .label, .map__node.on .label { background: var(--wine); }
.map__node img { width: clamp(44px, 7vw, 80px); height: auto; }
.map__tip { position: absolute; z-index: 6; max-width: 240px; pointer-events: none; font-size: 13px; padding: 8px 10px; }
.map__walker { position: absolute; z-index: 3; transition: left 4s linear, top 4s linear; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--plum); margin-bottom: 18px; }
.tabs button { min-height: 44px; padding: 6px 16px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-family: var(--f-title); font-size: 16px; }
.tabs button[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.tabs button:hover { color: var(--ivory); }
.subjects { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.subjects li { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--plum); border-left: 3px solid var(--gold); }
.books { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.book {
  position: relative; text-align: left; padding: 20px 18px 18px 26px; background: var(--wine); color: var(--ivory); border: 0; border-radius: 2px 8px 8px 2px;
  box-shadow: inset 8px 0 0 rgba(0,0,0,.25), 4px 4px 0 var(--seal); min-height: 170px; display: flex; flex-direction: column; text-decoration: none;
}
.book:nth-child(2) { background: #3E3554; } .book:nth-child(3) { background: #4B2A2A; } .book:nth-child(4) { background: #2E3B44; }
.book small { font-family: var(--f-latin); color: var(--gold); letter-spacing: .14em; font-size: 11px; }
.book h3 { font-size: 21px; margin: 4px 0 6px; }
.book p { font-size: 14px; margin: 0 0 10px; color: #E7DCCF; }
.book .count { margin-top: auto; font-family: var(--f-pixel); font-size: 13px; color: var(--gold); }
.notice { background: var(--ivory); color: var(--ink); padding: 28px clamp(18px, 4vw, 44px); border-top: 6px solid var(--wine); position: relative; }
.notice h3 { color: var(--wine); text-align: center; font-size: 22px; }
.notice .no { text-align: center; font-family: var(--f-latin); font-size: 12px; letter-spacing: .2em; color: #6E5E58; }
.notice ol { margin: 18px 0 0; padding-left: 1.4em; }
.notice li { margin-bottom: 8px; }
.notice .stamp { position: absolute; right: 18px; bottom: 14px; opacity: .85; }
.posters { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.board { background: #3B2A22; padding: 18px; border: 6px solid #2A1E18; }
.poster {
  border: 0; text-align: left; background: var(--paper); color: #2A2233; padding: 16px; min-height: 220px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4); transform: rotate(-1deg); transition: transform .2s;
}
.poster:nth-child(even) { transform: rotate(1.2deg); background: #EFE3F0; }
.poster:hover, .poster:focus-visible { transform: rotate(0) translateY(-4px); }
.poster h3 { color: var(--wine); font-size: 20px; margin: 4px 0; }
.poster p { font-size: 14px; margin: 0; }
.poster .pin { width: 12px; height: 12px; background: var(--pink); border: 2px solid var(--ink); margin: -8px auto 4px; }
.poster .more { margin-top: auto; font-family: var(--f-pixel); font-size: 13px; color: var(--wine); }

/* ---------- 배정 데스크 ---------- */
.desk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--plum); background: var(--panel); }
.desk__art { position: relative; background: var(--plum); min-height: 460px; display: grid; place-items: center; overflow: hidden; }
.desk__info { padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; gap: 10px; }
.desk__info .no { font-family: var(--f-pixel); color: var(--gold); font-size: 14px; }
.desk__info h2 { font-size: clamp(26px, 3.2vw, 36px); margin: 0; }
.desk__info .en { font-family: var(--f-latin); letter-spacing: .14em; color: var(--muted); font-size: 13px; }
.hook { font-family: var(--f-title); font-size: 18px; color: var(--ivory); border-left: 3px solid var(--wine); padding: 4px 0 4px 14px; margin: 6px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ivory); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 22px 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.search { position: relative; }
.search input {
  min-height: 42px; width: min(260px, 100%); padding: 6px 12px; background: var(--seal); border: 1px solid var(--plum-2); border-radius: var(--r);
  color: var(--ivory); font: inherit; font-size: 15px;
}
.search input::placeholder { color: #6d6577; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot {
  position: relative; display: flex; flex-direction: column; text-align: left; border: 1px solid var(--plum); background: var(--panel); padding: 0; border-radius: var(--r); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.slot:hover { border-color: var(--gold); transform: translateY(-2px); }
.slot[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.slot[aria-pressed="true"]::before { content: "▶"; position: absolute; top: 6px; left: 8px; z-index: 2; color: var(--gold); font-size: 12px; animation: blink 1s steps(2) infinite; }
.slot__img { aspect-ratio: 3 / 4; background: var(--plum); display: grid; place-items: center; overflow: hidden; }
.slot__body { padding: 8px 10px 10px; }
.slot__body b { display: block; color: var(--ivory); font-size: 15px; }
.slot__body span { font-size: 12px; color: var(--muted); font-family: var(--f-pixel); }
.slot--locked { background: var(--seal); border-color: #2a2330; }
.slot--locked .slot__img { background: repeating-linear-gradient(45deg, #141118 0 8px, #19151e 8px 16px); }
.slot--locked .q { transition: transform .2s; }
.slot--locked:hover .q, .slot--locked:focus-visible .q { animation: wiggle .5s ease-in-out infinite; }
.slot--locked:hover .sealmark, .slot--locked:focus-visible .sealmark { animation: glint .9s ease-in-out infinite; }
.slot--locked .slot__body b { color: #8a8094; }
.sealmark { position: absolute; right: 8px; bottom: 54px; opacity: .7; }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes glint { 50% { filter: brightness(1.8); opacity: 1; } }
.empty { padding: 28px; text-align: center; border: 1px dashed var(--plum-2); color: var(--muted); }
.ribbon-tag { display: inline-block; font-family: var(--f-pixel); font-size: 12px; padding: 1px 8px; background: var(--wine); color: var(--ivory); }

/* 플레이스홀더 이미지 */
.ph { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 10px; }
.ph span { font-family: var(--f-pixel); font-size: 12px; color: var(--muted); }
.art-img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
.art-img--cover { object-fit: cover; object-position: center top; }

/* ---------- 상세 추천서 ---------- */
.dossier { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
.dossier__side { position: sticky; top: calc(var(--nav-h) + 16px); }
.portrait { aspect-ratio: 3 / 4; background: var(--plum); border: 1px solid var(--gold); position: relative; overflow: hidden; }
.portrait::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(200,169,120,.35); pointer-events: none; }
.dossier__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--plum); padding-bottom: 12px; margin-bottom: 4px; }
.doc-label { font-family: var(--f-pixel); font-size: 13px; color: var(--gold); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--plum); border: 1px solid var(--plum); }
.doc-grid div { background: var(--panel); padding: 10px 14px; }
.doc-grid dt { font-size: 12px; color: var(--muted); }
.doc-grid dd { margin: 0; color: var(--ivory); font-size: 16px; }
.doc-block { margin-top: 18px; }
.doc-block h3 { font-size: 16px; color: var(--gold); margin-bottom: 6px; font-family: var(--f-pixel); }
.doc-block p { margin: 0; }
.unset { color: #786f84; font-style: italic; }
.grades { display: flex; flex-wrap: wrap; gap: 10px; }
.grade { min-width: 120px; padding: 8px 12px; background: var(--plum); border-left: 3px solid var(--gold); }
.grade b { display: block; font-family: var(--f-pixel); font-size: 22px; color: var(--ivory); }
.grade span { font-size: 13px; color: var(--muted); }
.secret-locked { text-align: center; padding: 32px 18px; }
.secret-locked .bars { display: grid; gap: 8px; margin: 18px auto; max-width: 420px; }
.secret-locked .bars i { display: block; height: 14px; background: repeating-linear-gradient(90deg, #322638 0 10px, #241d2c 10px 20px); }
.secret-open { border: 1px solid var(--wine); background: linear-gradient(#1E1924, #1E1924) padding-box; padding: 18px; position: relative; }
.secret-open .stampmark { position: absolute; right: 14px; top: 10px; font-family: var(--f-pixel); color: var(--wine-2); border: 2px solid var(--wine-2); padding: 0 6px; transform: rotate(8deg); font-size: 13px; }
.media-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vol { display: flex; align-items: center; gap: 8px; }
.vol input { width: 120px; accent-color: var(--gold); }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }
.whif-note { font-size: 13px; color: var(--muted); }

/* ---------- 실습 체험실 / 게임 ---------- */
.games { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.game-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.game-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.game-card h3 { margin: 6px 0 0; font-size: 20px; }
.game-card p { margin: 0; font-size: 14px; }
.game-card .go { margin-top: auto; font-family: var(--f-pixel); color: var(--gold); font-size: 14px; }
.game { max-width: 760px; margin: 0 auto; }
.progress { height: 10px; background: var(--seal); border: 2px solid var(--ink); box-shadow: 0 0 0 1px var(--plum-2); margin-bottom: 16px; }
.progress i { display: block; height: 100%; background: var(--pink); transition: width .3s; }
.q-title { font-size: 18px; margin: 0 0 12px; color: #2A2233; font-family: var(--f-pixel); font-weight: 700; line-height: 1.5; }
.choices { display: grid; gap: 8px; margin-top: 14px; }
.choice {
  text-align: left; min-height: 48px; padding: 10px 14px; background: var(--ivory); border: 2px solid var(--ink); color: #2A2233;
  font-family: var(--f-pixel); font-size: 15px; line-height: 1.5;
}
.choice:hover:not(:disabled), .choice:focus-visible { background: #FFF7E6; border-color: var(--wine); }
.choice:hover:not(:disabled)::before, .choice:focus-visible::before { content: "▶ "; color: var(--pink); }
.choice.right { background: #DDF1E8; border-color: #2F7A5C; }
.choice.wrong { background: #F6DADF; border-color: var(--wine); }
.feedback { margin-top: 14px; padding: 10px 12px; border: 2px dashed #6E5E58; font-family: var(--f-pixel); font-size: 14px; color: #2A2233; }
.report { background: var(--ivory); color: var(--ink); padding: clamp(20px, 4vw, 40px); border: 1px solid var(--gold); position: relative; }
.report h2 { color: var(--wine); text-align: center; font-size: 24px; }
.report .sub { text-align: center; font-family: var(--f-latin); letter-spacing: .2em; font-size: 12px; color: #6E5E58; }
.report table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.report th, .report td { border-bottom: 1px solid #D8CAB4; padding: 10px 6px; text-align: left; }
.report td.g { font-family: var(--f-pixel); font-size: 24px; color: var(--wine); text-align: right; font-weight: 700; }
.report .verdict { text-align: center; font-family: var(--f-title); font-size: 18px; }
.report .note { font-size: 12px; color: #6E5E58; text-align: center; margin-top: 10px; }
.report .stamp-anim { position: absolute; right: 20px; top: 20px; }
.cert-canvas { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; border: 1px solid var(--gold); }
.suspects { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.suspect { text-align: left; background: #241D2C; color: var(--ivory); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--plum-2); padding: 12px; font-size: 14px; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
.suspect:hover:not(:disabled), .suspect:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.suspect b { font-family: var(--f-pixel); color: var(--gold); font-size: 15px; }
.suspect .lbl { color: var(--pink); font-family: var(--f-pixel); font-size: 12px; }
.suspect.right { box-shadow: inset 0 0 0 3px var(--mint); }
.suspect.wrong { box-shadow: inset 0 0 0 3px var(--pink); opacity: .75; }

/* ---------- 기록실 ---------- */
.petition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 18px; align-items: start; }
.petition textarea {
  width: 100%; min-height: 160px; padding: 12px; background: #FFFCF4; color: #2A2233; border: 2px solid var(--ink); font-family: var(--f-pixel); font-size: 15px; line-height: 1.6; resize: vertical;
}
.err { color: var(--wine); font-size: 13px; min-height: 1.4em; margin: 4px 0 0; font-family: var(--f-pixel); }
.receipt { position: relative; text-align: center; padding: 18px; }
.receipt .stamp-big { display: inline-block; font-family: var(--f-pixel); font-weight: 700; color: var(--wine); border: 4px double var(--wine); padding: 6px 14px; transform: rotate(-8deg); animation: stamp .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stamp { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
.sponsors { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.vault { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.vault-item { position: relative; text-align: center; background: var(--seal); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--plum); padding: 14px 10px; color: var(--silver); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vault-item:hover, .vault-item:focus-visible { box-shadow: inset 0 0 0 2px var(--wine-2); }
.vault-item .box { position: relative; width: 96px; height: 96px; }
.vault-item .box img { width: 96px; height: 96px; image-rendering: pixelated; }
.vault-item .censor { position: absolute; left: -8px; right: -8px; top: 38px; background: var(--ink); color: var(--pink); font-family: var(--f-pixel); font-size: 12px; padding: 2px 0; transform: rotate(-6deg); border: 1px solid var(--pink); }
.vault-item b { font-family: var(--f-pixel); font-size: 13px; }
.eggs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.eggs li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--plum-2); font-size: 14px; }
.eggs li.found { border-color: var(--gold); color: var(--ivory); }

/* ---------- 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 120; background: rgba(10, 8, 12, .82); display: grid; place-items: center; padding: 16px; }
.modal__box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; position: relative; }
.modal__box--wide { width: min(900px, 100%); }
.modal__close { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border: 2px solid var(--ink); background: var(--ivory); color: var(--ink); font-family: var(--f-pixel); font-size: 16px; z-index: 2; }
.modal h2 { color: inherit; font-size: 20px; padding-right: 44px; }
.pxwin h2 { font-family: var(--f-pixel); color: var(--wine); }
.pxwin--dark h2 { color: var(--gold); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame video, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 130; max-width: calc(100% - 32px); }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--plum); padding: 28px 0 36px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.linkish { background: none; border: 0; color: var(--gold); text-decoration: underline; padding: 4px; font-size: 13px; min-height: 32px; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .home__stage { grid-template-columns: 1fr; padding-top: 28px; }
  .gatebox { margin: 0 auto; width: min(260px, 70%); order: -1; }
  .desk { grid-template-columns: 1fr; }
  .desk__art { min-height: 340px; }
  .dossier { grid-template-columns: 1fr; }
  .dossier__side { position: static; max-width: 360px; margin: 0 auto; width: 100%; }
  .petition { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .view { padding: 28px 0 48px; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search input { width: 100%; }
  .hall__wall { height: 100px; padding: 0 2%; }
  .door { width: 64px; height: 84px; font-size: 11px; }
  .hall__floor { height: 330px; }
  .map { aspect-ratio: 3 / 4; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 6px; }
  .menu button, .menu a { font-size: 17px; }
}

/* 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .walker, .map__walker { display: none; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
body.reduce-motion .walker, body.reduce-motion .map__walker { display: none; }
