/* ── 입장 화면 ─────────────────────────────────────────── */

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(32px, 6vw, 80px) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.entry-copy { display: grid; gap: 28px; max-width: 520px; }
.entry h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.entry .lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.6; max-width: 34ch; }
.entry .lead strong { color: var(--ink); font-weight: 500; }
.join { display: grid; gap: 18px; margin-top: 8px; }
.join .btn { justify-self: start; min-width: 180px; }
.entry-note { font-size: var(--step--1); color: var(--ink-2); }

.entry { overflow: hidden; }
.entry-picture {
  position: relative;
  aspect-ratio: 1 / 1.05;
  display: grid;
  place-items: center end;
  justify-self: stretch;
}
.entry-picture::before {
  content: '';
  position: absolute;
  inset: 8% 4% 14% 10%;
  border-radius: 50%;
  background: #f1d7a1;
  opacity: 0.09;
  filter: blur(70px);
}
.folders { position: relative; width: min(88%, 400px); aspect-ratio: 0.82; }
.folder {
  position: absolute;
  inset: 0;
  background: #b29a72;
  color: #2a2117;
}
.folder::before {
  content: '';
  position: absolute;
  top: -22px; left: 0;
  width: 42%; height: 24px;
  background: inherit;
  clip-path: polygon(0 100%, 6% 0, 94% 0, 100% 100%);
}
.folder-back { transform: translate(5%, -5%) rotate(4deg); background: #9c8662; }
.folder-front { transform: translate(-4%, 4%) rotate(-3.5deg); }
.folder-face { position: absolute; inset: 9% 9% auto; display: grid; gap: 10px; }
.folder-kind { font-weight: 600; font-size: 15px; color: #4b3d2b; font-variant-numeric: tabular-nums; }
.folder-tab-label {
  position: absolute;
  top: -17px; left: 5%;
  font-size: 13px;
  font-weight: 600;
  color: #3f3324;
  white-space: nowrap;
}
.folder-photo {
  /* 클립으로 끼운 현장 사진 */
  position: absolute;
  right: 9%; top: 26%;
  width: 40%;
  aspect-ratio: 4 / 5;
  padding: 7px 7px 26px;
  background: #ece6da;
  transform: rotate(4deg);
}
.folder-photo svg { width: 100%; height: 100%; }
.folder-photo .blood-path { stroke-dashoffset: 0; }
.folder-photo .blood-drip { transform: none; }
.folder-photo::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -14px; left: 22%;
  width: 14px; height: 42px;
  border: 3px solid #9aa0a3;
  border-radius: 8px;
}
.folder-title {
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.folder-stamp {
  position: absolute;
  right: 10%; bottom: 14%;
  padding: 6px 12px;
  border: 3px solid #a3201d;
  color: #a3201d;
  font-weight: 600;
  font-size: 18px;
  transform: rotate(-8deg);
  opacity: 0.85;
  mix-blend-mode: multiply;
}
.folder-back .folder-face { opacity: 0.7; }
.folder-label {
  position: absolute;
  left: 9%; bottom: 9%;
  width: 48%;
  padding: 10px 12px;
  background: #efe8d8;
  font-size: 13px;
  color: #5d5243;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .entry { grid-template-columns: 1fr; padding-top: 40px; }
  .entry-copy { max-width: none; }
  .entry-picture { aspect-ratio: auto; height: 300px; place-items: center; }
  .folders { width: 230px; }
  .folder-title { font-size: 24px; }
  .folder-label { display: none; }
}

/* ── 대기실 공통 ─────────────────────────────────────────── */

.lobby {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
  min-height: 100vh; min-height: 100svh;
}
.lobby-scene { position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh; }
.lobby-panel {
  display: grid;
  align-content: center;
  gap: 26px;
  padding: clamp(32px, 5vw, 72px) var(--gutter);
  background: var(--surface);
}
.lobby-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 5.2vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.lobby-meta { color: var(--ink-2); margin-top: 14px; }
.lobby-team { display: flex; align-items: baseline; gap: 14px; color: var(--ink-2); }
.lobby-team b {
  color: var(--ink);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.roster { display: grid; gap: 2px; max-width: 420px; }
.roster li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  font-size: var(--step-1);
  transition: background-color 300ms ease;
}
.roster li::before {
  content: '';
  width: 10px; height: 10px;
  flex: none;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}
.roster li.is-in { background: color-mix(in srgb, var(--bg) 25%, var(--surface)); }
.roster li.is-in::before { background: var(--accent); }
.roster li.is-empty { color: color-mix(in srgb, var(--ink-2) 65%, transparent); font-size: var(--step-0); }
.roster li .me { margin-left: auto; color: var(--ink-2); font-size: var(--step--1); }
.roster li.is-new { animation: roster-in 420ms var(--ease-out); }
@keyframes roster-in { from { opacity: 0; transform: translateX(-10px); } }
.lobby-status { color: var(--ink); max-width: 30ch; }
.countdown { display: flex; align-items: baseline; gap: 18px; }
.countdown-num {
  font-family: var(--font-display);
  font-size: clamp(80px, 10vw, 140px);
  line-height: 0.9;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.lobby .btn-quiet { justify-self: start; }

@media (max-width: 860px) {
  .lobby { grid-template-columns: 1fr; }
  .lobby-scene { min-height: 56vh; }
}

/* ── 잠긴 404호: 복도와 문 ──────────────────────────────── */

.corridor {
  position: absolute;
  inset: 0;
  background: #1c1311;
  display: grid;
  place-items: end center;
}
.corridor::before {
  /* 벽지 */
  content: '';
  position: absolute;
  inset: 0 0 18% 0;
  background: #261a16 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46'%3E%3Crect width='2' height='46' fill='%23ffdcaa' fill-opacity='.035'/%3E%3Ccircle cx='23' cy='23' r='1.4' fill='%23ffdcaa' fill-opacity='.04'/%3E%3C/svg%3E");
}
.corridor::after {
  /* 복도 등이 가끔 깜빡인다. 시점은 스크립트가 무작위로 정한다. */
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.corridor.is-flicker::after { animation: flicker 700ms linear; }
@keyframes flicker {
  0% { opacity: 0; }
  12% { opacity: 0.55; }
  22% { opacity: 0.1; }
  48% { opacity: 0.62; }
  60%, 100% { opacity: 0; }
}
.carpet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18%;
  background: #4a141b;
}
.wall-lamp {
  position: absolute;
  top: 18%;
  width: 26px; height: 46px;
  background: #d9b27a;
  border-radius: 13px 13px 4px 4px;
  box-shadow: 0 0 0 4px #6b5333;
}
.wall-lamp::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: #f4c98a;
  opacity: 0.14;
  filter: blur(50px);
  transform: translate(-50%, -50%);
}
.wall-lamp.l { left: calc(50% - 230px); }
.wall-lamp.r { left: calc(50% + 204px); }

.door-frame {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 18%;
  height: min(66%, 620px);
  aspect-ratio: 0.46;
  transform: translateX(-50%);
  padding: 14px 14px 0;
  background: #120b09;
  box-shadow: inset 0 0 0 3px #2c1c15;
  perspective: 1400px;
}
.door-dark { position: absolute; inset: 14px 14px 0; background: #050303; }
.door {
  position: relative;
  height: 100%;
  background: #3b2318;
  transform-origin: left center;
  transition: transform 1.4s var(--ease-in-out);
  box-shadow: inset 0 0 0 2px #2a170f, inset 6px 0 18px rgba(0, 0, 0, 0.35);
}
.lobby.is-opening .door { transform: rotateY(-78deg); }
.door-panel {
  position: absolute;
  left: 14%; right: 14%;
  background: #34200f;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.45), inset -2px -2px 0 rgba(255, 210, 160, 0.08);
}
.door-panel.top { top: 8%; height: 34%; }
.door-panel.bottom { top: 54%; height: 38%; }
.door-plate {
  position: absolute;
  top: 18%; left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px 6px;
  background: #1a100b;
  color: var(--brass);
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 800;
  font-size: clamp(22px, 3.2vh, 30px);
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 2px #6d5432;
}
.peephole {
  position: absolute;
  top: 31%; left: 50%;
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #0b0705;
  box-shadow: 0 0 0 3px #8a6c40;
}
.lock {
  position: absolute;
  right: 9%; top: 44%;
  width: 26px; height: 48px;
  background: #1b1b1b;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #4a4a4a;
}
.lock .led {
  position: absolute;
  top: 8px; left: 50%;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #ff2d2d;
  transition: background-color 300ms ease;
}
.lobby.is-full .lock .led { background: #42d26b; }
.handle {
  position: absolute;
  right: 7%; top: 55%;
  width: 46px; height: 9px;
  border-radius: 5px;
  background: #b48f55;
  transform-origin: right center;
  box-shadow: 0 2px 0 #6d5432;
}
.dnd {
  position: absolute;
  right: 3%; top: 58%;
  width: 74px;
  padding: 26px 6px 10px;
  background: #e9dfcb;
  color: #8f1b1e;
  text-align: center;
  transform-origin: 50% 0;
  transform: rotate(4deg);
  clip-path: polygon(0 0, 34% 0, 34% 14%, 66% 14%, 66% 0, 100% 0, 100% 100%, 0 100%);
}
.dnd span { display: block; font-weight: 600; font-size: 12px; line-height: 1.3; }
.dnd small { display: block; margin-top: 4px; font-size: 8px; color: #6c5b48; letter-spacing: 0.04em; }

.door-gap {
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 5px;
  background: #f4c37c;
  overflow: hidden;
}
.feet {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: translateX(-70px);
}
.feet.is-passing { animation: feet 3.6s linear; }
.feet::before, .feet::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 24px;
  background: #1a0f0b;
}
.feet::before { left: 0; }
.feet::after { left: 38px; }
/* 문 너머에서 누군가 지나가다 멈칫하고 다시 걸어간다. */
@keyframes feet {
  0% { transform: translateX(-70px); }
  30% { transform: translateX(32%); }
  62% { transform: translateX(36%); }
  100% { transform: translateX(100%); }
}
.spill {
  position: absolute;
  z-index: 0;
  left: 50%; bottom: 13%;
  width: min(34vh, 300px);
  height: 40px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #f4c37c;
  opacity: 0.22;
  filter: blur(18px);
}

/* ── 사라진 시장: 폐창고 셔터 ───────────────────────────── */

.yard {
  position: absolute;
  inset: 0;
  background: #0d0f10;
}
.yard::before {
  /* 골함석 벽 */
  content: '';
  position: absolute;
  inset: 0 0 20% 0;
  background: #24292a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='10'%3E%3Crect width='3' height='10' fill='%23000' fill-opacity='.35'/%3E%3Crect x='3' width='4' height='10' fill='%23fff' fill-opacity='.03'/%3E%3C/svg%3E");
}
.yard::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 20%;
  background: #1a1b1a;
}
.sodium {
  position: absolute;
  z-index: 1;
  top: 9%; left: 50%;
  width: 70px; height: 16px;
  margin-left: -35px;
  background: #2b2b2b;
  border-radius: 2px;
}
.sodium::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: -6px;
  height: 7px;
  background: #ffb347;
  border-radius: 0 0 6px 6px;
}
.sodium::after {
  content: '';
  position: absolute;
  left: 50%; top: 10px;
  width: 360px; height: 460px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #ffae45;
  opacity: 0.12;
  filter: blur(64px);
}
.bay {
  position: absolute;
  z-index: 1;
  left: 50%; bottom: 20%;
  width: min(70%, 480px);
  height: 54%;
  transform: translateX(-50%);
  background: #181a1a;
  padding: 16px 16px 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 4px #3a3f3f;
}
.bay::before {
  /* 셔터가 말려 들어가는 상자 */
  content: '';
  position: absolute;
  z-index: 2;
  left: 0; right: 0; top: 0;
  height: 16px;
  background: #3a3f3f;
}
.bay-inside {
  position: absolute;
  inset: 16px 16px 0;
  background: #030303;
  overflow: hidden;
}
.bay-inside::after {
  /* 셔터 틈으로 새어 나오는 백열등 빛 */
  content: '';
  position: absolute;
  left: 30%; right: 30%; bottom: -20px;
  height: 90px;
  border-radius: 50%;
  background: #ffbf5e;
  opacity: 0.28;
  filter: blur(26px);
}
.tie {
  position: absolute;
  left: 46%; bottom: 3px;
  width: 64px; height: 12px;
  background: #1c2a4a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12'%3E%3Cpath d='M2 12 L8 0' stroke='%237b2a2a' stroke-width='2'/%3E%3C/svg%3E");
  clip-path: polygon(0 40%, 82% 0, 100% 50%, 82% 100%, 0 60%);
  transform: rotate(-6deg);
  opacity: 0.9;
}
.shutter {
  position: absolute;
  inset: 16px 16px 0;
  background: #4a4f4e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='18'%3E%3Crect width='8' height='2' fill='%235d6362'/%3E%3Crect y='15' width='8' height='3' fill='%23343837'/%3E%3C/svg%3E");
  transform: translateY(-17%);
  transition: transform 2s var(--ease-in-out);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -10px 0 #2a2e2e;
}
.lobby.is-opening .shutter { transform: translateY(-102%); }
.shutter-sign {
  padding: 10px 26px;
  border: 4px solid rgba(184, 38, 30, 0.85);
  color: rgba(196, 44, 34, 0.9);
  font-family: 'Black Han Sans', sans-serif;
  font-size: clamp(28px, 4vw, 52px);
  letter-spacing: 0.08em;
  transform: rotate(-2deg) translateY(10%);
  opacity: 0.86;
}
.ground-spill {
  /* 셔터 틈으로 새어 나온 빛이 바닥에 번진다 */
  position: absolute;
  z-index: 1;
  left: 50%; bottom: calc(20% - 34px);
  width: min(50%, 340px); height: 60px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #ffb04f;
  opacity: 0.16;
  filter: blur(22px);
}
.hasp {
  position: absolute;
  z-index: 2;
  right: calc(50% - min(35%, 240px) + 34px);
  bottom: calc(20% + 10px);
  width: 30px; height: 28px;
  background: #8b7a4b;
  border-radius: 3px;
  transform-origin: 50% -16px;
  transform: rotate(-4deg);
}
.hasp::before {
  /* 열린 고리 */
  content: '';
  position: absolute;
  left: 4px; top: -24px;
  width: 16px; height: 26px;
  border: 5px solid #a8a8a0;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  transform: translateX(8px) rotate(24deg);
  transform-origin: 0 100%;
}
.hasp::after {
  content: '';
  position: absolute;
  left: 50%; top: 9px;
  width: 6px; height: 10px;
  margin-left: -3px;
  background: #2a2618;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .corridor::after, .feet { animation: none !important; }
  .lobby.is-opening .door, .lobby.is-opening .shutter { transform: none; }
}

/* 셔터 틈 안쪽 전구가 가끔 흔들린다 */
.bay-inside.is-flicker::after { animation: bulb-flicker 900ms linear; }
@keyframes bulb-flicker {
  0% { opacity: 0.28; }
  15% { opacity: 0.06; }
  30% { opacity: 0.3; }
  45% { opacity: 0.02; }
  70%, 100% { opacity: 0.28; }
}

/* 입장 화면이 열릴 때 한 번: 제목과 입력칸이 차례로 올라오고 폴더가 책상에 놓인다 */
.entry.is-entering .entry-copy > * { animation: rise 640ms var(--ease-out) both; }
.entry.is-entering .entry-copy > :nth-child(2) { animation-delay: 80ms; }
.entry.is-entering .entry-copy > :nth-child(3) { animation-delay: 160ms; }
.entry.is-entering .folder-back { animation: settle-back 900ms var(--ease-out) 120ms both; }
.entry.is-entering .folder-front { animation: settle-front 900ms var(--ease-out) 220ms both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes settle-back { from { opacity: 0; transform: translate(16%, -12%) rotate(11deg); } }
@keyframes settle-front { from { opacity: 0; transform: translate(4%, 10%) rotate(-9deg); } }
