@import url("tokens.css");
/* 등불마당 화면 스타일. 색·글꼴·간격 값은 tokens.css(하린 디자인 토큰)를 그대로 쓴다.
   컴포넌트 크기와 상태는 design/시안/02_마당화면.html 기준. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: var(--fs-body); line-height: 1.55; }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.ic { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

/* ---- 버튼 ---- */
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; border-radius: var(--radius-pill);
  background: var(--amber-400); color: var(--night-900); font-weight: 800; font-size: var(--fs-button); box-shadow: 0 6px 24px #F2A93B44;
  transition: background var(--dur) var(--ease); }
.btn-primary:hover { background: var(--amber-300); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { background: var(--night-700); color: var(--muted-dark); box-shadow: inset 0 0 0 2px var(--night-line); cursor: default; }
.btn-primary.loading .ic { animation: spin 3s linear infinite; }
.btn-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 26px;
  box-shadow: inset 0 0 0 2px var(--night-line); color: var(--cream-50); font-weight: 700; font-size: 17px; padding: 0 20px; }
.btn-ghost:hover { background: var(--night-700); }
.btn-ghost.small { width: auto; min-height: 48px; font-size: var(--fs-small); padding: 0 16px; }
.btn-text { display: block; width: 100%; min-height: 48px; margin-top: 6px; color: var(--muted-dark); font-weight: 700; font-size: 17px; }
.linklike { color: var(--muted-dark); font-size: var(--fs-small); text-decoration: underline; min-height: 48px; }
.iconbtn { width: 48px; height: 48px; border-radius: 24px; background: #141B2Eb8; box-shadow: inset 0 0 0 1.5px var(--night-line-soft);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 칩 ---- */
.chip { display: inline-flex; align-items: center; gap: 0; min-height: 40px; padding: 0 14px; border-radius: 20px;
  background: #141B2Eb8; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 16px; font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--night-line-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip b { color: var(--amber-400); font-size: 19px; font-weight: 800; margin: 0 2px 0 5px; }
.chip .ic { color: var(--amber-400); margin-right: 8px; }
.chip-sub { font-size: var(--fs-small); }
.chip-sub b { font-size: 16px; }
.chip-sub > span[aria-hidden] { margin: 0 6px; }
.chip.flash b { animation: flash var(--dur-slow) var(--ease); }
@keyframes flash { 30% { color: var(--amber-200); text-shadow: 0 0 12px var(--amber-300); } }

/* ---- 입장 화면 ---- */
.entry { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px;
  background: rgba(20, 27, 46, 0.55); transition: opacity .5s var(--ease); overflow: auto; }
.entry.gone { opacity: 0; pointer-events: none; }
.entry-inner { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.logo { width: min(340px, 82vw); height: auto; }
.hero { margin: 0; font-family: var(--font-voice); font-size: 24px; font-weight: 700; line-height: 1.4; }
.entry-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 17px; font-weight: 600; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--amber-400); }
.entry-note { margin: 0; color: var(--muted-dark); font-size: var(--fs-small); line-height: 1.6; }
.entry-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; color: var(--muted-dark); font-size: var(--fs-small); }
.entry-foot a { color: var(--muted-dark); min-height: 48px; display: inline-flex; align-items: center; }
.loading { position: absolute; bottom: 32px; left: 0; right: 0; display: flex; gap: 10px; justify-content: center; align-items: center; margin: 0; font-size: 17px; }
.loading-lamp { width: 18px; height: 22px; border-radius: 4px; background: var(--amber-400); box-shadow: 0 0 16px var(--amber-300); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

/* ---- 마당 위쪽 ---- */
.hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; padding: max(12px, env(safe-area-inset-top)) 12px 0; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.chips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.logo-small { height: 34px; width: auto; margin-right: 4px; }

.banners { position: fixed; top: 112px; left: 12px; right: 12px; z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.banner { margin: 0; max-width: 560px; text-align: center; background: #141B2Ee0; box-shadow: inset 0 0 0 1.5px var(--night-line-soft);
  border-radius: var(--radius-m); padding: 10px 16px; font-size: 16px; line-height: 1.5; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.banner .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.banner-voice { font-family: var(--font-voice); font-size: 22px; font-weight: 700; background: #141B2Ecc; color: var(--amber-200); }
.banner-error { color: var(--error-dark); }

.voice { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 30; margin: 0; width: max-content; max-width: calc(100% - 32px);
  font-family: var(--font-voice); font-size: 22px; font-weight: 700; text-align: center; line-height: 1.5; white-space: pre-line;
  color: var(--cream-50); background: #141B2Ed0; border-radius: var(--radius-m); padding: 14px 20px; }

/* ---- 마당 아래쪽 ---- */
.hud-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: linear-gradient(to top, rgba(20,27,46,.85), rgba(20,27,46,0)); }
.actrow { display: flex; gap: 10px; width: 100%; max-width: 520px; }
.act { flex: 1; min-width: 0; height: 78px; border-radius: var(--radius-m); background: #2A3858f2; box-shadow: inset 0 0 0 2px var(--night-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-label); font-weight: 700;
  line-height: 1.15; word-break: keep-all; transition: background var(--dur) var(--ease); }
.act:hover { background: #34456c; }
.act[aria-pressed="true"] { background: var(--amber-400); color: var(--night-900); box-shadow: none; }
.act.cool:not([aria-pressed="true"]) { opacity: .6; }
.light-btn { max-width: 520px; }
.light-error { margin: 0; color: var(--error-dark); font-size: var(--fs-small); }

@media (min-width: 900px) {
  .hud-bottom { flex-direction: row; justify-content: center; align-items: flex-end; }
  .act { width: 112px; height: 80px; flex: none; }
  .actrow { width: auto; max-width: none; }
  .light-btn { width: 260px; min-height: 80px; border-radius: 22px; }
}

/* ---- 메뉴·시트 ---- */
.scrim { position: fixed; inset: 0; z-index: 35; background: #0B1020a6; }
.menu { position: fixed; z-index: 40; top: 68px; right: 12px; width: min(280px, calc(100% - 24px)); display: flex; flex-direction: column; padding: 6px;
  background: var(--night-800); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1.5px var(--night-line-soft), 0 10px 40px #000a; }
.menu > * { text-align: left; padding: 12px 14px; min-height: 48px; font-size: 17px; color: var(--cream-50); text-decoration: none; border-radius: var(--radius-s); }
.menu > *:hover { background: var(--night-700); }
.sheet { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; margin: 0 auto; width: min(520px, 100%); max-height: 88vh; overflow: auto;
  background: var(--night-800); border-radius: var(--radius-l) var(--radius-l) 0 0; padding: 14px 16px max(24px, env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px #000a; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--night-line); margin: 0 auto 14px; }
.sheet h2:focus { outline: none; }
.sheet h2 { font-family: var(--font-voice); font-size: var(--fs-title); font-weight: 700; margin: 0 0 4px; }
.sheet .sub { color: var(--muted-dark); font-size: 16px; margin: 0 0 14px; }
.group-label { margin: 12px 0 6px; font-size: var(--fs-small); font-weight: 700; color: var(--muted-dark); }
.fields { display: grid; gap: 10px; margin-bottom: 16px; }
.field { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 10px 16px; border-radius: var(--radius-m); background: var(--night-700);
  box-shadow: inset 0 0 0 2px var(--night-line); text-align: left; width: 100%; }
.field .ft { font-weight: 800; font-size: 19px; }
.field .fd { font-size: var(--fs-small); color: var(--muted-dark); }
.field[aria-checked="true"] { box-shadow: inset 0 0 0 3px var(--amber-400); background: #33415f; }
.field .rad { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--night-line); display: flex; align-items: center; justify-content: center; }
.field .rad .ic { opacity: 0; }
.field[aria-checked="true"] .rad { background: var(--amber-400); box-shadow: none; color: var(--night-900); }
.field[aria-checked="true"] .rad .ic { opacity: 1; }
.fi { width: 44px; height: 44px; border-radius: 14px; background: var(--night-900); display: flex; align-items: center; justify-content: center; color: var(--moss-300); flex: none; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.choice { flex: 1; min-height: 52px; border-radius: 26px; box-shadow: inset 0 0 0 2px var(--night-line); font-weight: 700; font-size: 17px; padding: 0 12px; }
.choice[aria-checked="true"] { background: var(--amber-400); color: var(--night-900); box-shadow: none; }
.swatch { width: 52px; height: 52px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--night-line); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--night-800), 0 0 0 6px var(--amber-400); }
.sheet .btn-primary, .sheet .btn-ghost { margin-top: 16px; }
.contact { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.contact a { color: var(--amber-300); }

/* 예시 카드: 어두운 시트 위의 밝은 카드 (5-5) */
.card-list { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 8px; }
.ex { flex: 0 0 88%; scroll-snap-align: center; background: var(--cream-100); color: var(--night-800); border-radius: 20px; padding: 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--night-800); color: var(--amber-300); font-weight: 800; font-size: var(--fs-small);
  border-radius: 14px; padding: 4px 12px; box-shadow: inset 0 0 0 2px var(--amber-400); }
.ex dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: 17px; }
.ex dt { color: var(--muted-light); font-weight: 600; }
.ex dd { margin: 0; font-weight: 800; }
.ex .note { margin: 0; font-size: var(--fs-small); color: var(--muted-light); border-top: 2px dashed #8A90A6; padding-top: 10px; }

.noscript { position: fixed; inset: 0; display: grid; place-content: center; }

@media (max-width: 560px) {
  .logo-small { display: none; }
}
@media (max-width: 420px) {
  .chip { font-size: var(--fs-small); }
  .banners { top: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-lamp, .btn-primary.loading .ic, .chip.flash b { animation: none; }
}

/* ---- 글 읽는 페이지(소개, 개인정보처리방침) ---- */
.page { overflow: auto; }
.page main { max-width: 680px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.75; font-size: var(--fs-body); }
.page h1 { font-family: var(--font-voice); font-size: 28px; margin: 0 0 8px; }
.page h2 { font-family: var(--font-voice); font-size: 22px; margin-top: 32px; color: var(--accent-text); }
.page a { color: var(--accent-text); }
.page .logo { display: block; width: 220px; margin: 8px 0 16px; }
.draft { display: inline-block; font-size: var(--fs-small); padding: 2px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--border); }
.back { display: flex; width: max-content; align-items: center; min-height: 48px; margin-bottom: 16px; }
.page table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: var(--fs-small); }
.page th, .page td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.page thead th { font-weight: 700; }
.page .privacy-policy h3 { font-size: 18px; margin-top: 20px; }
.page section { overflow-x: auto; }
