/* 심야사주식당 도입부 — 골목 · 노렌 · 카운터 (index 전용)
   밖(골목)은 새벽의 남색, 안(카운터)은 텅스텐 주황. 이미지 없이 CSS/SVG만 사용. */

.scene { position: relative; overflow: hidden; }

/* ══════════ 장면 1 · 골목 ══════════ */
.s-alley {
  min-height: 92vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  background:
    radial-gradient(900px 420px at 50% -60px, #232a4d 0%, rgba(35, 42, 77, 0) 62%),
    linear-gradient(180deg, #0b0e1b 0%, #10132000 40%),
    linear-gradient(180deg, #0c0f1c 0%, #131830 62%, #1a1408 125%);
  color: #ece7db;
}
.s-alley .sky i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #cfd3ea; opacity: .65;
}
.s-alley .moon2 {
  position: absolute; top: 64px; right: 13%; width: 30px; height: 30px; border-radius: 50%;
  box-shadow: 7px 3px 0 0 #e8e3d2; transform: rotate(-18deg); opacity: .85;
}
.alley-copy { position: relative; z-index: 3; text-align: center; padding: 84px 22px 0; }
.alley-copy .eyebrow2 {
  font-size: 12px; letter-spacing: .22em; color: #f2b45c; font-weight: 700; margin: 0 0 14px;
}
.alley-copy h1 {
  font-size: clamp(28px, 6.4vw, 46px); line-height: 1.35; margin: 0 0 16px;
  font-weight: 800; letter-spacing: -0.01em; color: #f2ecdf; text-wrap: balance;
}
.alley-copy .sub2 {
  max-width: 520px; margin: 0 auto 26px; color: #a8a5ba; font-size: 15.5px; line-height: 1.75;
}
.introctas { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn-go {
  appearance: none; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #f2b45c, #e09a37); color: #241708;
  font-size: 16px; font-weight: 800; padding: 14px 26px; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(242, 180, 92, .28); font-family: inherit;
}
.btn-go:active { transform: translateY(1px); }
.btn-skip { color: #8a879e; font-size: 13.5px; text-decoration: none; padding: 10px; }
.btn-skip:hover { color: #cfccdd; }

/* 골목 아트 */
.alleyart { position: relative; height: 300px; margin-top: 26px; z-index: 2; }
.alleyart .bld { position: absolute; bottom: 0; background: #090c16; width: 34%; }
.alleyart .bld.l { left: 0; height: 250px; border-radius: 0 8px 0 0; }
.alleyart .bld.r { right: 0; height: 205px; border-radius: 8px 0 0 0; }
.alleyart .bld .w {
  position: absolute; width: 9px; height: 12px; border-radius: 1.5px;
  background: rgba(242, 180, 92, .26);
}
.shopfront {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 190px; text-align: center;
}
.shopfront .lant {
  position: absolute; bottom: 168px; left: -18px;
  writing-mode: vertical-rl; height: 118px; white-space: nowrap;
  font-weight: 800; font-size: 15px; letter-spacing: .3em;
  color: #ffe3d6; background: linear-gradient(180deg, #e2593c, #c74830);
  border-radius: 10px; padding: 13px 7px 10px;
  box-shadow: 0 0 22px rgba(238, 109, 85, .5), 0 0 70px rgba(238, 109, 85, .16);
  text-shadow: 0 0 9px rgba(255, 227, 214, .65);
}
.noren-mini { display: flex; gap: 6px; justify-content: center; padding-top: 4px; }
.noren-mini::before {
  content: ""; position: absolute; top: 0; left: 8px; right: 8px; height: 5px;
  background: #3a3050; border-radius: 3px;
}
.noren-mini i {
  width: 52px; height: 88px; display: block;
  background: linear-gradient(180deg, #232a52, #1c2240);
  border: 1px solid #343b5c; border-top: 0; border-radius: 0 0 4px 4px;
}
.noren-mini i:nth-child(2) { height: 80px; }
.doorglow {
  height: 84px; margin: -60px auto 0; width: 150px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(242, 180, 92, 0), rgba(242, 180, 92, .2));
}
@media (prefers-reduced-motion: no-preference) {
  .shopfront .lant { animation: lantflick 6s infinite; }
  @keyframes lantflick {
    0%, 100% { opacity: 1; } 91% { opacity: 1; } 92% { opacity: .78; }
    93% { opacity: 1; } 96% { opacity: .88; } 97% { opacity: 1; }
  }
}

/* ══════════ 장면 2 · 노렌 ══════════ */
.s-noren {
  min-height: 86vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 60px 20px;
  background: linear-gradient(180deg, #1a1408 -30%, #12152a 30%, #101320 100%);
}
.notepaper {
  background: #f4ecd9; color: #4a3b28; font-size: 14.5px; font-weight: 600; line-height: 1.7;
  padding: 14px 22px; border-radius: 3px; transform: rotate(-1.6deg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4); margin: 0; text-align: center; position: relative;
}
.notepaper::before {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 12px; background: rgba(238, 109, 85, .55); border-radius: 2px;
}
.noren-big {
  appearance: none; border: 0; background: none; cursor: pointer; position: relative;
  display: flex; gap: 10px; padding: 8px 0 0; font-family: inherit;
}
.noren-big::before {
  content: ""; position: absolute; top: 0; left: -14px; right: -14px; height: 7px;
  background: #3a3050; border-radius: 4px;
}
.noren-big .warm {
  position: absolute; inset: 7px 6px 0; z-index: 0; border-radius: 0 0 8px 8px;
  background: radial-gradient(150px 190px at 50% 82%, rgba(242, 180, 92, .55), rgba(242, 180, 92, .06) 68%);
}
.noren-big .np {
  position: relative; z-index: 1;
  width: min(24vw, 96px); height: min(52vw, 210px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 26px;
  background: linear-gradient(180deg, #232a52, #1b2140);
  border: 1px solid #3a4166; border-top: 0; border-radius: 0 0 6px 6px;
  color: #ece7db; font-size: clamp(18px, 5vw, 24px); font-weight: 800;
  writing-mode: vertical-rl; letter-spacing: .34em;
  transition: transform .7s cubic-bezier(.6, .05, .3, 1), opacity .7s;
  transform-origin: top center;
}
.noren-big:hover .np1, .noren-big:focus-visible .np1 { transform: rotate(-4deg); }
.noren-big:hover .np3, .noren-big:focus-visible .np3 { transform: rotate(4deg); }
.s-noren.open .np1 { transform: rotate(-58deg) translateY(-12px); opacity: .25; }
.s-noren.open .np2 { transform: rotate(6deg) translateY(-6px); opacity: .3; }
.s-noren.open .np3 { transform: rotate(56deg) translateY(-12px); opacity: .25; }
.norenhint { color: #8a879e; font-size: 12.5px; letter-spacing: .14em; margin: 0; }

/* ══════════ 장면 3 · 카운터 ══════════ */
.s-counter {
  background:
    radial-gradient(700px 420px at 50% 34%, rgba(242, 168, 92, .16), rgba(242, 168, 92, 0) 70%),
    linear-gradient(180deg, #17130e 0%, #1b150d 55%, #141117 100%);
  padding: 58px 0 64px; color: #f2ead9;
}
.counterroom { max-width: 720px; margin: 0 auto; padding: 0 18px; }
.roomtitle {
  text-align: center; color: #b9a488; font-size: 12px; letter-spacing: .26em; margin: 0 0 22px;
}
.hostwrap { position: relative; text-align: center; }
.hostwrap .hostsvg { width: min(74vw, 300px); height: auto; display: inline-block; vertical-align: bottom; }
/* 실사 주인장: 세로 9:16, 재생 가능할 때만 SVG를 대체 */
.hostwrap .hostvid {
  width: min(74vw, 300px); aspect-ratio: 9 / 16; height: auto; display: inline-block; vertical-align: bottom;
  object-fit: cover; border-radius: 14px; background: #1b1511;
  box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(242,180,92,.18);
}
#hostSlot.vid .hostsvg { display: none; }
.hostwrap .catsvg {
  width: min(21vw, 86px); height: auto; position: absolute; bottom: 12px; right: 6%;
}
.counterbar {
  height: 40px; margin: -14px -18px 0; position: relative; z-index: 2;
  background: linear-gradient(180deg, #8a6844 0 34%, #6d5136 34%);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .35);
}
/* 선반 술병(고전 라벨) 실루엣 */
.shelfrow {
  display: flex; gap: 14px; justify-content: center; align-items: flex-end;
  margin-bottom: 8px; opacity: .9;
}
.shelfrow .bt {
  width: 26px; border-radius: 8px 8px 3px 3px; position: relative;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .3);
}
.shelfrow .bt::after {
  content: attr(data-l); position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  writing-mode: vertical-rl; font-size: 8.5px; letter-spacing: .1em; color: #f4ecd9;
  background: rgba(20, 14, 8, .55); padding: 5px 2px; border-radius: 2px; white-space: nowrap;
}
.shelfrow small { color: #8f7c62; font-size: 10.5px; align-self: center; letter-spacing: .12em; }

/* 채팅 */
.chat { margin-top: 26px; display: flex; flex-direction: column; gap: 11px; }
.msg { display: flex; gap: 9px; align-items: flex-end; }
.msg .ava2 {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: #3f3428; border: 1px solid #5b4a35; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #f2b45c; font-size: 13px; font-weight: 800;
}
.msg .bb2 {
  background: #f7efe2; color: #2b2118; border-radius: 4px 16px 16px 16px;
  padding: 11px 15px; font-size: 15px; line-height: 1.7; max-width: 86%;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .25);
}
.msg .bb2 b { color: #b0472e; }
.msg.sys { justify-content: center; }
.msg.sys .bb2 {
  background: rgba(242, 180, 92, .12); color: #e8c896; border: 1px dashed rgba(242, 180, 92, .4);
  border-radius: 12px; font-size: 13px; box-shadow: none;
}
.choices2 { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 4px 43px; }
.choices2 .ch2 {
  appearance: none; cursor: pointer; text-align: left; text-decoration: none; font-family: inherit;
  border: 1px solid rgba(242, 180, 92, .45); color: #f2cf9a;
  background: rgba(242, 180, 92, .07); border-radius: 13px; padding: 11px 15px;
  font-size: 14.5px; font-weight: 600; line-height: 1.5; display: block;
  transition: background .18s, transform .18s;
}
.choices2 .ch2:hover { background: rgba(242, 180, 92, .16); transform: translateX(3px); }
.choices2 .ch2 small { display: block; font-weight: 400; font-size: 12px; color: #b7a37f; margin-top: 2px; }
.gobtn {
  display: inline-block; margin: 4px 0 2px 43px; text-decoration: none;
  background: linear-gradient(180deg, #f2b45c, #e09a37); color: #241708;
  font-weight: 800; font-size: 15px; padding: 13px 22px; border-radius: 13px;
  box-shadow: 0 6px 22px rgba(242, 180, 92, .26);
}
.gobtn:active { transform: translateY(1px); }
.menupeek { text-align: center; margin: 26px 0 0; }
.menupeek a { color: #8f7c62; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.menupeek a:hover { color: #d8c5a4; }

/* 잔에서 올라오는 김 */
.steam { animation: steam 2.6s ease-in-out infinite; transform-origin: bottom center; opacity: .7; }
.steam.s2 { animation-delay: 1.2s; }
@keyframes steam {
  0% { transform: translateY(0) scaleX(1); opacity: 0; }
  30% { opacity: .7; }
  100% { transform: translateY(-9px) scaleX(1.25); opacity: 0; }
}

/* ══════════ 진행 연출 (JS 있을 때만 숨겼다 순서대로 공개) ══════════ */
.js-intro .msg, .js-intro .choices2, .js-intro .gobtn, .js-intro .menupeek { opacity: 0; transform: translateY(7px); }
.js-intro .msg.on, .js-intro .choices2.on, .js-intro .gobtn.on, .js-intro .menupeek.on {
  opacity: 1; transform: none; transition: opacity .45s ease, transform .45s ease;
}
.js-intro [data-branch] { display: none; }
.js-intro [data-branch].pick { display: flex; }
.js-intro .gobtn[data-branch].pick { display: inline-block; }
.js-intro .s-noren .postgate { visibility: hidden; }
/* 재방문: 골목·노렌 접기 */
.revisit .s-alley, .revisit .s-noren { display: none; }
.revisit .s-counter { padding-top: 74px; }

@media (prefers-reduced-motion: reduce) {
  .js-intro .msg, .js-intro .choices2, .js-intro .gobtn, .js-intro .menupeek { transition: none; }
  .noren-big .np { transition: none; }
  .steam { animation: none; }
}

@media (min-width: 760px) {
  .alleyart { height: 340px; }
  .alleyart .bld.l { height: 290px; }
  .alleyart .bld.r { height: 240px; }
  .s-counter { padding-top: 70px; }
  .hostwrap .catsvg { right: 14%; }
}

/* ══════════ 장면 0 · 필름 (프로그레시브 인핸스먼트) ══════════
   기본값은 숨김. JS가 재생 가능을 확인했을 때만 body.film-on 이 붙어
   영상이 뜨고 기존 CSS 골목·노렌 장면이 대체된다. 실패·저사양·
   reduced-motion 이면 손대지 않으므로 기존 장면이 그대로 나온다. */
.s-film { display: flex; }
body.film-on .s-film {
  display: flex; align-items: flex-end; justify-content: center;
  position: relative; min-height: 100svh; min-height: 100vh;
  overflow: hidden; background: #0b0e1a;
}
body.film-on .s-alley,
body.film-on .s-noren { display: none; }

.s-film .filmvid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.s-film .filmveil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11,14,26,.55) 0%, rgba(11,14,26,0) 26%),
    linear-gradient(0deg, rgba(11,14,26,.88) 0%, rgba(11,14,26,.45) 26%, rgba(11,14,26,0) 52%);
}
.film-copy {
  position: relative; z-index: 2;
  text-align: center; padding: 0 22px 12vh; max-width: 560px;
}
.film-copy .eyebrow2 {
  font-size: 12px; letter-spacing: .05em; color: #f2b45c; font-weight: 700; margin: 0 0 14px;
}
.film-copy h1 {
  font-size: clamp(26px, 6vw, 40px); line-height: 1.38; margin: 0 0 26px;
  font-weight: 800; color: #f4eee2; text-wrap: balance; word-break: keep-all;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}
/* 영상이 끝나면 CTA를 한 번 더 살짝 끌어올린다 */
.s-film.done .film-copy .btn-go { box-shadow: 0 6px 30px rgba(242, 180, 92, .45); }

@media (min-width: 900px) {
  /* 세로 영상이라 데스크톱에서는 가운데 기둥으로 세우고 양옆은 어둠으로 */
  body.film-on .s-film { background: #07090f; }
  .s-film .filmvid { object-fit: contain; }
  .s-film .filmveil {
    background:
      linear-gradient(180deg, rgba(7,9,15,.5) 0%, rgba(7,9,15,0) 22%),
      linear-gradient(0deg, rgba(7,9,15,.9) 0%, rgba(7,9,15,.4) 24%, rgba(7,9,15,0) 50%),
      linear-gradient(90deg, rgba(7,9,15,.85) 0%, rgba(7,9,15,0) 22%, rgba(7,9,15,0) 78%, rgba(7,9,15,.85) 100%);
  }
}

/* v0.9.3 — 2D 장면 제거 후: 필름 장면은 항상 표시(포스터 폴백), 주인장 자리엔 포스터→클립 */
.s-film { display: flex; }
.hostwrap .hostposter { width: min(74vw, 300px); aspect-ratio: 9/16; object-fit: cover; border-radius: 14px; display: inline-block; vertical-align: bottom; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
#hostSlot.vid .hostposter { display: none; }
.revisit .s-film { min-height: 62svh; }
/* v0.9.3 — 대화록: 내 선택 말풍선 */
.msg.me { flex-direction: row-reverse; }
.msg.me .bb2 { background: color-mix(in srgb, var(--primary) 16%, #2a2530); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.ava2.you { background: #2f2a3a; color: #efe7d8; }
.gobtn.on, .choices2.on { opacity: 1; transform: none; }
/* v0.9.4 — 영상이 끝나야 입장 버튼이 뜬다 */
body.film-on .s-film:not(.done) .introctas { opacity: 0; pointer-events: none; transform: translateY(8px); }
.s-film .introctas { transition: opacity .5s ease, transform .5s ease; }
.s-film.done .film-copy .btn-go { animation: ctaPulse 1.6s ease-in-out infinite; }
@keyframes ctaPulse { 0%,100% { box-shadow: 0 6px 30px rgba(242,180,92,.35); } 50% { box-shadow: 0 6px 44px rgba(242,180,92,.7); } }
.revisit .s-film { min-height: 100svh; }

/* v0.9.7 — 인트로 화면 / 입장 화면 분리 (스크롤 대신 화면 전환) */
body.view-film .s-counter, body.view-film .sec, body.view-film .notify, body.view-film footer, body.view-film > .adslot { display: none !important; }
body.view-film .s-film { min-height: calc(100svh - 56px); }
body.view-counter .s-film { display: none !important; }
body.view-counter .s-counter { min-height: calc(100svh - 56px); animation: counterIn .45s ease-out both; }
@keyframes counterIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* 독이 떠 있으면 카운터의 큰 주인장은 감춘다 — 언니는 한 명이면 된다 */
body:has(#hostSay.dock:not([hidden])) .hostwrap { display: none; }
body:has(#hostSay.dock:not([hidden])) .s-counter { padding-top: 200px; }
