/* 온성당 웹 체험(2026-11-27) - 따뜻한 미니어처(앱이 고른 화풍). 앱(mobile/onseongdang/src/ui/tokens.ts)과 같은 값이다: 석회빛 바탕 #F5EFE5 · 호두 먹 #2B231D ·
   성모 푸른빛 #31507F · 나무 #8B5A36 · 촛불 호박빛 #E8A24A(그림·강조 점에만 - 글자 색으로 쓰지 않는다). 글은 회중석 그림 위의 반투명 석회빛 패널에 쓴다(블러 없음 -
   앱과 같은 판단). 이 지면만 쓰는 독립 스타일이다(application·tailwind 를 싣지 않는다 - 카카오톡 인앱 브라우저의 첫 그림을 가볍게). 화면 구조는 온고요 웹
   (ongoyo.css)과 같고 앞머리만 os- 다(화면 JS 는 온고요 방 화면 컨트롤러를 물려받아 os-feed-line·--os-wait 를 쓴다).
   대비: 먹은 석회빛 패널 위 12:1 이상, 흐린 글(--os-dim)은 패널 위 5:1 이상, 푸른빛 단추의 흰 글자 7.9:1(앱 tokens 주석).
   움직임은 끝이 있는 것만 둔다 - 끝없는 움직임은 **촛불 불꽃의 아주 느린 깜빡임 하나**뿐이고, 모션 줄이기면 그것도 멈춘다.

   **촛불 자리 12개의 좌표([data-seat])는 임시값이다 - 앱 3D 앵커에서 다시 뽑는다.** 지금 장면 그림(app/assets/images/onseongdang/scene - 앱 정지 그림의
   임시판, 720x1273)에서 회중석 통로 쪽 의자 끝판 옆 바닥을 눈으로 짚었다. 앱 3D 성당(mobile/onseongdang/src/features/space - 함께 기도 촛불 자리 lanterns.ts)의
   정지 그림으로 바꿀 때 그 앵커를 화면 좌표로 옮겨 다시 넣고, 그림 비율이 바뀌면 --os-ratio 도 고친다. */

/* ── 제목 글꼴 - Gowun Batang Regular 줄인 판(온고요 웹과 같은 글꼴 파일) ─────────
   ① ko: KS X 1001 한글 2,350자(문구에 없는 글자가 생겨도 같은 글꼴로 - 그 글자가 화면에 나올 때만 받는다)
   ② ko-ui: 온성당 문구(config/locales/onseongdang*/ko.yml)에 나오는 글자만(약 37KB) - 나중에 적은 쪽이 먼저 쓰여 ①을 받지 않는다
   ③ latin: 영어·스페인어·숫자. 일본어는 시스템 명조(:lang(ja)). 다시 만들기는 app/assets/fonts/gowun_batang/README.md(글자 목록만 onseongdang*). */
@font-face {
  font-family: "Gowun Batang";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/gowun_batang/GowunBatang-Regular-ko-9bf8e52b.woff2") format("woff2");
  unicode-range: U+3000-303F, U+3130-318F, U+AC00-D7A3, U+FF01-FF5E;
}

@font-face {
  font-family: "Gowun Batang";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/gowun_batang/GowunBatang-Regular-onseongdang-ko-ui-3078c5c1.woff2") format("woff2");
  unicode-range: U+AC00, U+AC04, U+AC08, U+AC10, U+AC14-AC15, U+AC19, U+AC1C, U+AC70, U+AC74, U+AC83, U+AC8C, U+ACB0, U+ACBC-ACBD, U+ACC4, U+ACE0, U+ACE7, U+ACF3,
    U+ACF5, U+ACFC, U+AD00, U+AD50, U+AD6C, U+ADDC, U+ADF8, U+ADFC, U+AE00, U+AE08, U+AE30, U+AE38, U+AE4C, U+AE50, U+AEBC, U+AED8, U+B044, U+B04A,
    U+B05D, U+B098, U+B09C, U+B0A0, U+B0A8, U+B0B1, U+B0B4, U+B113, U+B118, U+B123-B124, U+B141, U+B193, U+B294, U+B298, U+B2A5, U+B2C8, U+B2E4, U+B2E8,
    U+B2EB, U+B2F4-B2F5, U+B2F9, U+B300, U+B354-B355, U+B3C4, U+B3CC, U+B3D9, U+B3FC, U+B418, U+B41C, U+B450, U+B454, U+B4A4, U+B4DD, U+B4E4, U+B514,
    U+B530, U+B54C, U+B5A0, U+B73B, U+B77D, U+B78C, U+B798, U+B7B5, U+B7EC, U+B7FC, U+B800, U+B824, U+B838, U+B85C-B85D, U+B8E8, U+B958, U+B978, U+B97C,
    U+B984, U+B9AC-B9AD, U+B9BC, U+B9C1, U+B9C8, U+B9CC, U+B9CE, U+B9D0, U+B9DE, U+BA38, U+BA48, U+BA58, U+BA70, U+BA74, U+BA85, U+BAA8, U+BABB,
    U+BB34-BB36, U+BB38, U+BB3B-BB3C, U+BBF8, U+BC0B, U+BC14, U+BC1B, U+BC29, U+BC84, U+BC88, U+BCBD, U+BCC4, U+BCF4, U+BCFC, U+BD84, U+BD88-BD89,
    U+BE44, U+BE4C, U+BE55, U+BE5B, U+BFD0, U+C05C, U+C0AC, U+C0C1, U+C0C8, U+C0DD, U+C11C-C11D, U+C131, U+C138, U+C14B, U+C18C-C18D, U+C218, U+C228,
    U+C26C, U+C2A4, U+C2B5, U+C2DC-C2DD, U+C2E0, U+C2F6, U+C4F0, U+C4F4, U+C529, U+C544, U+C548-C54A, U+C54C, U+C558, U+C55E, U+C571, U+C57D,
    U+C5B4-C5B5, U+C5B8, U+C5C5-C5C6, U+C5C8, U+C5D0, U+C5EC, U+C5F0, U+C5F4, U+C601, U+C608, U+C624, U+C628, U+C62C, U+C640, U+C694, U+C6A9, U+C6B4,
    U+C6B8, U+C6CC, U+C6D0, U+C6F9, U+C704, U+C720, U+C73C, U+C740, U+C744, U+C74C, U+C758, U+C774, U+C778, U+C77C, U+C785, U+C788, U+C790-C791, U+C798,
    U+C7A0, U+C7A5, U+C800-C801, U+C804, U+C815, U+C81C, U+C838, U+C84C, U+C870-C871, U+C885, U+C88B, U+C8FC, U+C904, U+C911, U+C9C0, U+C9C4, U+C9E7,
    U+CC3C, U+CC3E, U+CC98, U+CCAD, U+CCB4, U+CCE4, U+CD08, U+CD1B, U+CD5C, U+CD98, U+CDC4, U+CE58-CE59, U+CE68, U+CEE4, U+CF00, U+CF1C, U+D06C, U+D070,
    U+D0A4, U+D1A0, U+D1A8, U+D22C, U+D305, U+D3C9, U+D3F0, U+D48D, U+D504, U+D558-D559, U+D55C, U+D560, U+D568-D569, U+D574, U+D588, U+D5A5, U+D5D8,
    U+D63C, U+D654-D655, U+D68C, U+D788, U+D78C;
}

@font-face {
  font-family: "Gowun Batang";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/gowun_batang/GowunBatang-Regular-latin-49b914e1.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215;
}

/* ── 토큰 ─────────────────────────────────────────────────────────────── */
:root {
  --os-bg: #F5EFE5;
  --os-panel: rgba(252, 248, 241, .90);
  --os-panel-line: rgba(43, 35, 29, .10);
  --os-chip: #FCF9F3;
  --os-soft: #EDE3D3;
  --os-line: rgba(43, 35, 29, .14);
  --os-ink: #2B231D;
  --os-ink-2: #463A30;
  --os-dim: #6F6256;
  --os-accent: #31507F;
  --os-accent-press: #284369;
  --os-on-accent: #FFFFFF;
  --os-wood: #8B5A36;
  --os-candle: #E8A24A;
  --os-toast-bg: #2B231D;
  --os-toast-fg: #F5EFE5;
  --os-shadow: 0 1px 0 rgba(43, 35, 29, .04), 0 14px 34px -18px rgba(43, 35, 29, .45);
  --os-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans KR", "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  --os-title: "Gowun Batang", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", serif;
  --os-col: 100vw;
  /* 장면 그림의 세로/가로 비율(720x1273). 그림을 바꾸면 함께 고친다. */
  --os-ratio: 1.768;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --os-bg: #15130F;
    --os-panel: rgba(27, 24, 20, .82);
    --os-panel-line: rgba(241, 234, 223, .10);
    --os-chip: #23201B;
    --os-soft: #2A2620;
    --os-line: rgba(241, 234, 223, .16);
    --os-ink: #F1EADF;
    --os-ink-2: #DDD4C6;
    --os-dim: #A99F92;
    --os-accent: #9DB6E0;
    --os-accent-press: #8EA8D4;
    --os-on-accent: #15130F;
    --os-wood: #CB9C6C;
    --os-candle: #F2B25E;
    --os-toast-bg: #F1EADF;
    --os-toast-fg: #15130F;
    --os-shadow: 0 14px 34px -18px rgba(0, 0, 0, .7);
  }
}

:lang(ja) { --os-title: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif; }
/* 한국어는 낱말 중간에서 줄을 바꾸지 않는다("있 / 어요" 같은 꼬리가 생기지 않게). 일본어는 띄어쓰기가 없어 그대로 둔다. */
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }

/* 그림 - 방문자 현지 시각(레이아웃 머리 스크립트의 html[data-tod]). 낮이 기본. 지금 세 그림은 같은 임시 그림이라 시간대는 덧칠(--os-shade)이 낸다
   (app/assets/images/onseongdang/README.md - 시간대마다 다른 정지 그림이 오면 덧칠을 걷는다). 촛불 빛(--os-glow)은 어두울수록 짙다. */
:root { --os-poster: url("/assets/onseongdang/scene/nave-day-1692ca2c.jpg"); --os-shade: none; --os-glow: .6; }
:root[data-tod="dusk"] { --os-poster: url("/assets/onseongdang/scene/nave-dusk-1692ca2c.jpg"); --os-shade: linear-gradient(rgba(70, 38, 58, .16), rgba(46, 22, 30, .24)); --os-glow: .85; }
:root[data-tod="night"] { --os-poster: url("/assets/onseongdang/scene/nave-night-1692ca2c.jpg"); --os-shade: linear-gradient(rgba(10, 14, 34, .56), rgba(8, 9, 22, .64)); --os-glow: 1; }

[hidden] { display: none !important; }

/* ── 바탕 ─────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

.os-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--os-bg);
  color: var(--os-ink);
  font: 400 16px/1.55 var(--os-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.os-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.os-app {
  position: relative;
  z-index: 0;
  width: var(--os-col);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 넓은 화면 - 가운데 세로 기둥(그림 전체가 보이는 폭) + 뒤에 같은 그림을 흐리게. */
@media (min-width: 600px) {
  :root { --os-col: max(360px, min(480px, 56.5vh)); }

  .os-body::before {
    content: "";
    position: fixed;
    inset: -80px;
    z-index: -1;
    background: var(--os-poster) center / cover no-repeat;
    filter: blur(36px) saturate(.85) brightness(.8);
  }

  .os-scene { box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 40px 120px -30px rgba(0, 0, 0, .65); }
}

/* ── 장면 ─────────────────────────────────────────────────────────────── */
/* 그림 상자는 그림 비율(720:1273) 그대로 기둥을 덮고 아래(회중석)에 붙인다 - 화면이 짧으면 천장 쪽이 잘린다. 촛불 좌표는 이 상자의 % 다. */
.os-scene {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: var(--os-col);
  transform: translateX(-50%);
  overflow: hidden;
  background: #3A281C;
}

.os-scene-box {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(100%, 56.56vh);
  width: max(100%, 56.56lvh);
  height: max(100vh, calc(var(--os-col) * var(--os-ratio)));
  height: max(100lvh, calc(var(--os-col) * var(--os-ratio)));
  transform: translateX(-50%);
  background: var(--os-poster) center / 100% 100% no-repeat;
}

.os-scene-box::after { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--os-shade); pointer-events: none; }

.os-candles { position: absolute; inset: 0; z-index: 1; margin: 0; padding: 0; list-style: none; }

/* 촛불 자리 12개 - 회중석 통로 양쪽, 의자 끝판 곁 바닥에 두 줄씩(임시 좌표 - 머리 주석: 앱 3D 앵커에서 다시 뽑는다). 가운데는 비워 둔다(통로).
   안쪽 셋째 줄까지가 바닥이 보이는 곳이다(그 아래는 맨 앞 의자 등받이). 1~4번이 제대 가까운 첫 줄(안쪽 왼·오른쪽, 바깥 왼·오른쪽), 5~8번 둘째 줄,
   9~12번 셋째 줄 - 기본 정원 8이면 두 줄이 찬다. 앞줄일수록 조금 크다(가까움). */
.os-candle { position: absolute; left: var(--x, 50%); top: var(--y, 70%); width: 3.8%; transform: translate(-50%, -100%) scale(var(--s, 1)); transform-origin: 50% 100%; transition: opacity .6s ease; }
.os-candle[data-seat="1"] { --x: 43%; --y: 66%; --s: .9; }
.os-candle[data-seat="2"] { --x: 63%; --y: 66%; --s: .9; }
.os-candle[data-seat="3"] { --x: 35.5%; --y: 66%; --s: .9; }
.os-candle[data-seat="4"] { --x: 71%; --y: 66%; --s: .9; }
.os-candle[data-seat="5"] { --x: 42%; --y: 71%; --s: 1; }
.os-candle[data-seat="6"] { --x: 64.5%; --y: 71%; --s: 1; }
.os-candle[data-seat="7"] { --x: 34%; --y: 71%; --s: 1; }
.os-candle[data-seat="8"] { --x: 72.5%; --y: 71%; --s: 1; }
.os-candle[data-seat="9"] { --x: 40.5%; --y: 76%; --s: 1.1; }
.os-candle[data-seat="10"] { --x: 66%; --y: 76%; --s: 1.1; }
.os-candle[data-seat="11"] { --x: 31.5%; --y: 76%; --s: 1.1; }
.os-candle[data-seat="12"] { --x: 75%; --y: 76%; --s: 1.1; }

.os-candle.is-leaving { opacity: 0; }

/* 촛불 하나 - 밀랍(아래 54%)·심지·불꽃·빛. 상자 비율 1:2.3. */
.os-candle-inner { position: relative; display: block; isolation: isolate; aspect-ratio: 1 / 2.3; }
.os-candle.is-new .os-candle-inner { animation: os-candle-in 1.2s ease-out both; }

.os-candle-wax {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 54%;
  border-radius: 26% 26% 12% 12% / 9% 9% 5% 5%;
  background: linear-gradient(90deg, #E2D2B6, #FFF8EA 40%, #F6EBD7 68%, #D6C3A4);
  box-shadow: inset 0 4px 4px -3px rgba(255, 206, 130, .95), 0 3px 4px -1px rgba(40, 24, 10, .45);
}

/* 심지 */
.os-candle-wax::before { content: ""; position: absolute; left: 50%; top: -8%; width: 8%; height: 9%; border-radius: 2px; background: #3A2A1C; transform: translateX(-50%); }

.os-candle-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 26%;
  text-align: center;
  font: 400 9px/1 var(--os-title);
  color: #8B5A36;
  pointer-events: none;
}

.os-candle-flame {
  position: absolute;
  left: 50%;
  bottom: 57%;
  width: 40%;
  height: 32%;
  border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 50% 50% at 50% 72%, #FFFFFF 0, #FFF4C6 26%, #FFCB66 52%, rgba(255, 150, 50, .55) 74%, rgba(255, 150, 50, 0) 100%);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: os-flicker 9s ease-in-out infinite;
}

.os-candle:nth-child(2n) .os-candle-flame { animation-delay: -3.1s; }
.os-candle:nth-child(3n) .os-candle-flame { animation-delay: -5.7s; }

.os-candle-glow {
  position: absolute;
  left: 50%;
  bottom: 66%;
  z-index: -1;
  width: 420%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 204, 128, .6), rgba(255, 170, 80, .18) 56%, rgba(255, 170, 80, 0));
  opacity: var(--os-glow);
  transform: translate(-50%, 50%);
  pointer-events: none;
}

/* 내 촛불 - 빛이 조금 더 크고 바닥에 옅은 빛 고리, 위에 "내 촛불". */
.os-candle.is-me .os-candle-glow { width: 520%; opacity: 1; }
.os-candle.is-me .os-candle-inner::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4%;
  z-index: -1;
  width: 230%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 150, .7), rgba(255, 214, 150, 0));
  transform: translateX(-50%);
}

.os-candle-you {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--os-panel);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .45);
  color: var(--os-ink);
  font: 600 11.5px/1.3 var(--os-font);
  white-space: nowrap;
}

.os-candle.is-pulse .os-candle-glow { animation: os-pulse 1.9s ease-out 1; }
.os-candle.is-pulse .os-candle-wax { animation: os-bright 1.9s ease-out 1; }

@keyframes os-candle-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* 불꽃의 아주 느린 깜빡임 - 이 지면의 유일한 끝없는 움직임(9초 한 바퀴, 크기 몇 % 와 밝기만). */
@keyframes os-flicker {
  0%, 100% { transform: translateX(-50%) scale(1, 1); opacity: 1; }
  28% { transform: translateX(-50%) scale(.97, 1.04); }
  52% { transform: translateX(-50%) scale(1.02, .97); opacity: .93; }
  77% { transform: translateX(-50%) scale(.99, 1.02); }
}
@keyframes os-pulse { 0% { transform: translate(-50%, 50%) scale(1); } 28% { transform: translate(-50%, 50%) scale(1.5); opacity: 1; } 100% { transform: translate(-50%, 50%) scale(1); } }
@keyframes os-bright { 28% { filter: brightness(1.12); } }

/* ── 머리 ─────────────────────────────────────────────────────────────── */
/* 머리줄이 화면 밖으로 넘치지 않게(온고요 웹 2026-11-18 검토와 같은 장치).
   ① 이름 표지·인원·소리 단추는 줄지 않는다(flex: none). 알약 단추(나가기·앱에서 열기)만 줄고, 모자라면 글이 두 줄로 접힌다.
   ② 방 화면(is-room)은 머리 폭이 그 언어의 한 줄 폭보다 좁으면 이름 글자를 눈으로만 감춘다(촛불 표지는 남고 화면 읽기는 읽는다).
   ③ 그보다 더 좁으면(320px 대) 간격·안쪽 여백을 줄인다. 컨테이너 쿼리를 모르는 브라우저는 ①만으로 넘치지 않는다. */
.os-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 0;
}

.os-top.is-room { container: os-top / inline-size; }

.os-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--os-panel);
  box-shadow: var(--os-shadow);
  font: 400 17px/1 var(--os-title);
  white-space: nowrap;
  color: var(--os-ink);
}

.os-brand-mark { width: 15px; height: 20px; }

.os-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--os-panel);
  box-shadow: var(--os-shadow);
  font: 600 14px/1 var(--os-font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--os-ink);
}

.os-present-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--os-candle); box-shadow: 0 0 0 4px rgba(232, 162, 74, .24); }

.os-top-gap { flex: 1; }

.os-icon-btn,
.os-pill-btn {
  appearance: none;
  border: 0;
  margin: 0;
  background: var(--os-panel);
  box-shadow: var(--os-shadow);
  color: var(--os-ink);
  cursor: pointer;
}

.os-icon-btn { display: inline-grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.os-icon-btn .is-on { display: none; }
.os-icon-btn.is-on .is-on { display: block; }
.os-icon-btn.is-on .is-off { display: none; }
.os-icon-btn.is-on { color: var(--os-accent); }

.os-pill-btn { flex: 0 1 auto; min-width: 0; min-height: 44px; padding: 4px 15px; border-radius: 999px; font: 600 14px/1.15 var(--os-font); text-align: center; }

/* ② 이름 글자 감추기 - 언어마다 한 줄 폭이 달라 기준이 다르다(온고요 웹의 값 - 이름 길이가 비슷하다). 위치만 빼고 글은 남긴다. */
@container os-top (max-width: 352px) {
  .os-brand:lang(ko) { padding: 0 12px; }
  .os-brand:lang(ko) .os-brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@container os-top (max-width: 378px) {
  .os-brand:lang(ja) { padding: 0 12px; }
  .os-brand:lang(ja) .os-brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@container os-top (max-width: 392px) {
  .os-brand:lang(en) { padding: 0 12px; }
  .os-brand:lang(en) .os-brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@container os-top (max-width: 408px) {
  .os-brand:lang(es) { padding: 0 12px; }
  .os-brand:lang(es) .os-brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ③ 아주 좁은 폭(320px 대) - 인원 칸·알약 단추의 여백과 글 크기를 줄인다. */
@container os-top (max-width: 316px) {
  .os-chip { gap: 6px; padding: 0 10px; }
  .os-pill-btn { padding: 4px 11px; font-size: 13px; }
}

.os-ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── 위쪽(초대 문구·공개 촛불·동작 소식) ──────────────────────────────── */
.os-main { position: relative; z-index: 1; flex: 1 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 54px); min-height: calc(100dvh - 54px); }

.os-sky { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 16px 0; text-align: center; }

.os-phrase-card { max-width: 100%; padding: 10px 18px 11px; border-radius: 18px; background: var(--os-panel); box-shadow: var(--os-shadow); }
.os-phrase { margin: 0; font: 400 18px/1.45 var(--os-title); color: var(--os-ink); }
.os-closes { margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--os-dim); }

/* 지난 24시간 공개 촛불(대략의 수) - 초대 문구 아래 작은 알약. */
.os-candles-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--os-panel);
  box-shadow: var(--os-shadow);
  font-size: 13px;
  line-height: 1.4;
  color: var(--os-ink-2);
}

.os-candles-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--os-candle); box-shadow: 0 0 0 3px rgba(232, 162, 74, .24); }

.os-feed { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }

.os-feed-line {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--os-panel);
  font-size: 13px;
  line-height: 1.4;
  color: var(--os-ink-2);
  transition: opacity .8s ease;
  animation: os-feed-in .45s ease-out both;
}

.os-feed-line:nth-child(2) { opacity: .86; }
.os-feed-line:nth-child(3) { opacity: .7; }
.os-feed-line.is-own { color: var(--os-accent); font-weight: 600; }
/* 다른 사람 숨기기(앉아 있는 동안) - 내 촛불·내 동작 줄만 남긴다. */
.os-app.is-hiding-others .os-candle:not(.is-me),
.os-app.is-hiding-others .os-feed-line:not(.is-own) { display: none; }
.os-feed-line.is-fading { opacity: 0; }

@keyframes os-feed-in { from { transform: translateY(-6px); } to { transform: none; } }

.os-spacer { flex: 1 1 auto; min-height: 24px; }

/* ── 패널 ─────────────────────────────────────────────────────────────── */
.os-panel {
  position: relative;
  margin: 0 10px calc(10px + env(safe-area-inset-bottom));
  padding: 18px 18px 16px;
  border: 1px solid var(--os-panel-line);
  border-radius: 24px;
  background: var(--os-panel);
  box-shadow: var(--os-shadow);
  animation: os-panel-in .22s ease-out both;
}

.os-panel > :last-child { margin-bottom: 0; }

@keyframes os-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 이미 앉아 있던 브라우저(열쇠가 있다)는 상태를 받을 때까지 들어가기를 감춘다. 화면 JS 가 끝내 오지 않으면 4초 뒤 그대로 보인다. */
html[data-returning]:not([data-settled]) .os-panel[data-panel="enter"] { visibility: hidden; animation: os-reveal 0s 4s forwards; }
@keyframes os-reveal { to { visibility: visible; } }

.os-title { margin: 0 0 6px; font: 400 21px/1.38 var(--os-title); letter-spacing: -.005em; color: var(--os-ink); font-synthesis: none; text-wrap: balance; }
.os-title.is-large { font-size: 25px; }
.os-body-text { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--os-ink-2); text-wrap: pretty; }
.os-dim { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--os-dim); text-wrap: pretty; }

.os-row { display: flex; flex-wrap: wrap; gap: 8px; }
.os-row-2 > * { flex: 1 1 140px; }

.os-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: 600 15px/1.25 var(--os-font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}

.os-btn.is-primary { background: var(--os-accent); color: var(--os-on-accent); }
.os-btn.is-primary:active { background: var(--os-accent-press); }
.os-btn.is-soft { background: var(--os-chip); color: var(--os-ink); box-shadow: inset 0 0 0 1px var(--os-line); }
.os-btn.is-ghost { background: transparent; color: var(--os-ink); box-shadow: inset 0 0 0 1px var(--os-line); }
.os-btn.is-text { display: flex; min-height: 44px; margin: 6px auto 0; padding: 0 10px; background: transparent; color: var(--os-accent); }
.os-btn:active { transform: scale(.985); }
.os-btn[disabled],
.os-btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.os-btn[aria-disabled="true"]:active { transform: none; }
.os-btn .os-ico { width: 20px; height: 20px; }

/* "앱에서 열기" 뒤에도 화면이 그대로일 때 "앱 받기" 단추를 두 번 반짝인다(화면 JS showInstallHint - 끝이 있는 움직임). 모션 줄이기면 고리만 남긴다. */
.os-btn.is-attention::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--os-candle);
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  animation: os-attention 1.2s ease-in-out 2;
}

@keyframes os-attention { 50% { opacity: 1; } }

.os-btn:focus-visible,
.os-icon-btn:focus-visible,
.os-pill-btn:focus-visible,
.os-gesture:focus-visible,
.os-foot a:focus-visible { outline: 3px solid var(--os-candle); outline-offset: 2px; }
/* 패널이 바뀔 때 화면 JS 가 새 패널 제목으로 옮기는 포커스(tabindex=-1)는 테두리를 그리지 않는다 - 누를 수 있는 것이 아니다. */
.os-panel [tabindex="-1"]:focus { outline: none; }

/* 앉은 화면 */
.os-status { margin: 0; min-height: 1.5em; font-size: 14.5px; line-height: 1.5; text-align: center; color: var(--os-ink-2); }
.os-app.is-sitting .os-status { font: 400 18px/1.45 var(--os-title); color: var(--os-ink); }
.os-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; text-align: center; color: var(--os-dim); text-wrap: pretty; }

.os-gestures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 6px; }

.os-gesture {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  margin: 0;
  padding: 8px 2px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--os-chip);
  box-shadow: inset 0 0 0 1px var(--os-line);
  color: var(--os-ink);
  font: 600 12.5px/1.2 var(--os-font);
  text-align: center;
  cursor: pointer;
  transition: opacity .2s ease, transform .1s ease;
}

.os-gesture:active { transform: scale(.97); }
.os-gesture .os-ico { width: 24px; height: 24px; color: var(--os-wood); }
/* 쉬는 동작 단추 - disabled 대신 aria-disabled 다(포커스가 단추에 남게 - 화면 JS renderGestures). 눌러도 움직이지 않는다. */
.os-gesture[disabled],
.os-gesture[aria-disabled="true"] { opacity: .45; cursor: default; }
.os-gesture[aria-disabled="true"]:active { transform: none; }
.os-gesture.is-quiet { opacity: .35; }

/* 쿨다운 - 단추 아래 줄이 남은 시간만큼 줄어든다(끝이 있는 움직임). */
.os-gesture.is-waiting::after,
.os-btn.is-waiting::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--os-accent);
  transform-origin: left center;
  animation: os-wait var(--os-wait, 3s) linear forwards;
}

@keyframes os-wait { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.os-switch { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--os-ink-2); cursor: pointer; }
.os-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.os-switch-track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--os-soft); box-shadow: inset 0 0 0 1px var(--os-line); transition: background-color .2s ease; }
.os-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.os-switch input:checked + .os-switch-track { background: var(--os-accent); }
.os-switch input:checked + .os-switch-track::after { transform: translateX(16px); }
.os-switch input:focus-visible + .os-switch-track { outline: 3px solid var(--os-candle); outline-offset: 2px; }

.os-panel[data-panel="solo"] { text-align: center; }
.os-time { margin: 6px 0 12px; font: 400 30px/1.3 var(--os-title); text-align: center; color: var(--os-ink); font-variant-numeric: tabular-nums; }

.os-cta { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--os-line); }
.os-cta .os-dim { margin-bottom: 10px; }
.os-cta .os-row > * { flex: 1 1 140px; }

/* ── 알림 ─────────────────────────────────────────────────────────────── */
/* 알림 칸은 늘 문서에 있다(role=status - 숨겼다 드러내면 화면 읽기가 읽지 않는다). 화면 JS 가 글을 넣고 is-shown 을 붙여 보이고, 사라진 뒤 글을 비운다. */
.os-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 64px);
  left: 50%;
  z-index: 10;
  width: max-content;
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--os-toast-bg);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  color: var(--os-toast-fg);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .3s ease, transform .3s ease;
}

.os-toast:empty { padding: 0; box-shadow: none; }
.os-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── 바닥 ─────────────────────────────────────────────────────────────── */
.os-foot {
  position: relative;
  z-index: 1;
  margin: 0 10px calc(14px + env(safe-area-inset-bottom));
  padding: 18px 16px 16px;
  border-radius: 24px;
  background: var(--os-panel);
  box-shadow: var(--os-shadow);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--os-dim);
}

.os-appcard { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--os-line); }
.os-appcard p { margin: 0; font-size: 14px; color: var(--os-ink-2); text-wrap: pretty; }
.os-appcard .os-row { justify-content: center; width: 100%; }
.os-appcard .os-row > * { flex: 1 1 140px; }
.os-appcard-mark { width: 20px; height: 27px; }

.os-langs,
.os-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.os-langs a,
.os-legal a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 6px; color: var(--os-ink-2); text-decoration: none; }
.os-langs a[aria-current] { color: var(--os-accent); font-weight: 700; }
.os-legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--os-line); }
.os-notice { margin: 8px 0 0; font-size: 12.5px; text-wrap: pretty; }
.os-operated { margin: 8px 0 2px; }

/* ── 소개(/onseongdang) ───────────────────────────────────────────────── */
.os-points { display: grid; gap: 9px; margin: 0 0 16px; padding: 0; list-style: none; }
.os-points li { display: flex; align-items: flex-start; gap: 11px; font-size: 15px; line-height: 1.5; color: var(--os-ink); }
.os-points li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .5em; border-radius: 50%; background: var(--os-candle); box-shadow: 0 0 0 4px rgba(232, 162, 74, .22); }
.os-stores > * { flex: 1 1 140px; }
.os-support { display: flex; flex-direction: column; gap: 10px; }
.os-support .os-body-text { margin: 0; }
.os-notice-text { font-weight: 600; color: var(--os-ink); }

/* ── 모션 줄이기 - 불꽃 깜빡임·들어오는 움직임 없이 ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

  .os-candle-flame { animation: none !important; }
  .os-btn.is-attention::before { opacity: 1; }
}
