/* 세 실험 공통 바탕(밤 화면). 앱마다 --accent 만 바꿔서 씀. 브랜드 막대·안내 창은 brand.css. */
:root {
  --ink: #f3efe6;
  --dim: rgba(243, 239, 230, 0.66);
  --faint: rgba(243, 239, 230, 0.38);
  --line: rgba(243, 239, 230, 0.18);
  --bg: #08090f;
  --accent: #ffb37a;
  --font: "Pretendard Variable", Pretendard, "Pretendard Fallback", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", Roboto, "Noto Sans KR", "Malgun Gothic", "Noto Sans", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

canvas.stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* 전체 화면 오버레이 (인트로, 결과 등). hidden 이면 페이드아웃.
   내용이 화면보다 길면(작은 폰, 긴 번역) 위가 잘리지 않고 스크롤됨: 위아래 빈 칸(::before/::after)이 가운데 정렬을 대신함 */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 14px; padding: calc(var(--bar-h, 52px) + 20px) 24px 32px; text-align: center;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  transition: opacity 0.6s ease;
}
.screen::before, .screen::after { content: ''; flex: 1 0 0px; margin: -7px 0; }
.screen > * { flex: none; max-width: 100%; }
/* HUD: 화면 위에 얹는 층. 빈 곳은 클릭이 아래 캔버스로 통과 */
.hud-layer { position: fixed; inset: 0; z-index: 5; pointer-events: none; transition: opacity 0.6s ease; }
.hud-layer button, .hud-layer a, .hud-layer [data-hit] { pointer-events: auto; }
.screen.hidden, .hud-layer.hidden { opacity: 0; pointer-events: none !important; }
.screen.hidden * , .hud-layer.hidden * { pointer-events: none !important; }
.gone { display: none !important; }

.title { font-size: clamp(42px, 10vw, 76px); font-weight: 200; letter-spacing: 0.32em; padding-left: 0.32em; }
.lede { font-size: 16px; line-height: 1.75; color: var(--dim); max-width: 26em; word-break: keep-all; }
.note { font-size: 12px; line-height: 1.7; color: var(--faint); max-width: 30em; word-break: keep-all; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.btn {
  appearance: none; cursor: pointer;
  font: inherit; font-size: 15px; color: var(--ink);
  padding: 13px 24px; min-width: min(230px, 100%); min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(243, 239, 230, 0.07);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}
.btn:hover { background: rgba(243, 239, 230, 0.14); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--ink); color: #13141c; border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.small { min-width: 0; padding: 10px 16px; font-size: 13px; min-height: 44px; }

/* 지금 접속 중 표시 */
.live { font-size: 14px; color: var(--accent); min-height: 1.5em; letter-spacing: 0.02em; }
.live::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: 2px;
  animation: live-dot 1.6s ease-in-out infinite;
}
@keyframes live-dot { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 10px); opacity: 0;
  background: rgba(18, 19, 28, 0.88); border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 14px; font-size: 14px; max-width: 88vw; text-align: center; word-break: keep-all;
  transition: opacity 0.35s, transform 0.35s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 다른 글자(태국어·크메르어·버마어·중국어·일본어)는 띄어쓰기가 없거나 적어서 keep-all 을 풂 */
html:is(:lang(zh), :lang(ja), :lang(th), :lang(km), :lang(my)) * { word-break: normal !important; }

/* 글자 사이 간격은 한·중·일·라틴 글자에만. 태국·크메르·버마·싱할라·벵골·네팔(데바나가리) 글자는 자모가 떨어져 보여서 0 */
html:is(:lang(th), :lang(km), :lang(my), :lang(si), :lang(bn), :lang(ne)) * { letter-spacing: 0 !important; }

/* 밤 11시 11분 모임 알림 (shared/gather-ui.js mountPill): 모임 3시간 전부터 막대 바로 아래 떠 있는 작은 링크.
   fixed 라 아무것도 밀지 않음. 보이는 높이는 30px(실험의 위쪽 글자와 겹치지 않게), 누르는 자리는 ::before 로 44px */
.gather-pill {
  position: fixed; z-index: 60; left: max(10px, env(safe-area-inset-left, 0px)); top: calc(var(--bar-h, 52px) + 6px + env(safe-area-inset-top, 0px));
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 132px); height: 30px; padding: 0 13px;
  border-radius: 999px; border: 1px solid rgba(255, 224, 138, 0.45); background: rgba(24, 20, 10, 0.8); color: #ffe08a;
  font-size: 12.5px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gather-pill::before { content: ''; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }
.gather-pill[hidden] { display: none; }
.gather-pill i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ffe08a; box-shadow: 0 0 8px #ffe08a; }
.gather-pill span { overflow: hidden; text-overflow: ellipsis; }
.gather-pill.is-live { background: rgba(255, 224, 138, 0.94); color: #1c1a16; border-color: transparent; }
.gather-pill.is-live i { background: #1c1a16; box-shadow: none; }
@media (min-width: 720px) {
  .gather-pill { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(var(--bar-h, 52px) + 12px + env(safe-area-inset-top, 0px)); max-width: 40vw; }
}
