@import url('https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

:root { font-family: 'Noto Sans KR', sans-serif; color: #eee8d9; color-scheme: dark; font-synthesis: none; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #10130f; }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 2px solid #e6c98e; outline-offset: 3px; }
canvas { display: block; }
#sanctuary-ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; color: #efe9da; font-size: 14px; text-shadow: 0 1px 6px #000a; }
#sanctuary-ui button, #sanctuary-ui textarea, #sanctuary-ui input, #sanctuary-ui .modal-backdrop { pointer-events: auto; }
.sanctuary-header { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 27px 38px; background: linear-gradient(180deg, #0d120fdc 0%, #0c100c64 65%, transparent 100%); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal { display: grid; place-items: center; width: 39px; height: 39px; color: #d3bc86; border: 1px solid #d3bc86a3; border-radius: 50%; font-family: 'Gowun Batang', serif; font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: 'Gowun Batang', serif; font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: .16em; white-space: nowrap; }
.brand small { margin-top: 6px; color: #d3cbb9c9; font-size: 10px; letter-spacing: .14em; }
.header-right { display: flex; align-items: center; gap: 10px; }
.world-status, .icon-button, .login-button { height: 38px; border: 1px solid #c4b49142; background: #121711bd; backdrop-filter: blur(16px); border-radius: 7px; }
.world-status { display: flex; align-items: center; gap: 10px; padding: 0 14px; color: #e4dfd1; font-size: 12px; }
.world-status i { width: 1px; height: 12px; background: #c0ad7f66; }
.status-dot { display: inline-block; flex: none; width: 6px; height: 6px; background: #b9bd8d; border-radius: 50%; box-shadow: 0 0 9px #c5c595; }
.icon-button { display: grid; place-items: center; width: 38px; color: #d7c9aa; }
.icon-button svg { width: 18px; height: 18px; }
.login-button { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #eee5d4; font-size: 12px; }
.google-g { color: #f0e7d2; font-weight: 700; font-size: 16px; }
.icon-button:hover, .login-button:hover { background: #32362bbf; border-color: #d7c69b8a; }
.ambient-caption { position: absolute; left: 39px; bottom: 147px; display: flex; align-items: center; gap: 12px; color: #e2d8c4c4; font-family: 'Gowun Batang', serif; font-size: 14px; letter-spacing: .14em; }
.caption-line { width: 27px; height: 1px; background: #d2ba84; }
.scene-guide { position: absolute; top: 98px; left: 50%; transform: translateX(-50%); padding: 9px 15px; border: 1px solid #d6c39324; border-radius: 100px; background: #151a14ad; backdrop-filter: blur(12px); color: #ded4c2d6; font-size: 11px; white-space: nowrap; }
.guide-dot { display: inline-block; width: 5px; height: 5px; margin-right: 7px; vertical-align: 2px; border-radius: 50%; background: #d6bb7a; }
.guide-divider { margin: 0 7px; color: #d6bb7a; }
.connection-chip { position: absolute; right: 39px; bottom: 148px; color: #e4dbc7af; font-size: 11px; }
.chat-wrap { position: absolute; left: 38px; bottom: 95px; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 9px; }
.chat-toggle { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #c4ad8052; border-radius: 8px; background: #171f18e8; color: #e8dfcb; font-size: 11px; backdrop-filter: blur(14px); }
.chat-toggle:hover { background: #323b2eec; }
.chat-toggle svg { width: 17px; height: 17px; color: #d6bd87; }
.chat-panel[hidden] { display: none; }
.chat-panel { position: fixed; left: 50vw; bottom: 176px; transform: translateX(-50%); z-index: 5; width: min(440px, calc(100vw - 32px)); padding: 10px; border: 1px solid #c4ad8052; border-radius: 9px; background: #171e17ed; box-shadow: 0 10px 32px #0008; backdrop-filter: blur(16px); }
.chat-form { display: flex; gap: 7px; }
.chat-form input { min-width: 0; flex: 1; padding: 9px; border: 1px solid #b8a57950; border-radius: 5px; background: #0e1510a8; color: #f2eadb; font: inherit; font-size: 12px; }
.chat-form input::placeholder { color: #c3b9a675; }
.chat-form button { padding: 8px 12px; border: 1px solid #c7ae79; border-radius: 5px; background: #c4a36b; color: #161a12; font-size: 12px; font-weight: 600; text-shadow: none; }
.chat-footnote { margin: 8px 2px 0; color: #c4bda9ae; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gesture-bar, .bottom-nav { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; border: 1px solid #c4ad8052; background: linear-gradient(145deg, #1e251fef, #111812f2); box-shadow: 0 12px 40px #0008, inset 0 1px #ffffff12; backdrop-filter: blur(18px); }
.gesture-bar { bottom: 109px; gap: 3px; padding: 5px 12px; border-radius: 10px; }
.gesture-bar button, .bottom-nav button { border: 0; background: transparent; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: #d8d2c4bf; }
.gesture-bar button { min-width: 58px; padding: 4px 7px; font-size: 10px; }
.gesture-bar svg { width: 18px; height: 18px; color: #d6c7a4; }
.bottom-nav { bottom: 23px; gap: 2px; padding: 9px 14px; border-radius: 14px; }
.bottom-nav button { min-width: 92px; min-height: 53px; padding: 4px 12px; font-size: 11px; border-radius: 8px; }
.bottom-nav svg { width: 22px; height: 22px; color: #d6bd87; }
.gesture-bar button:hover, .bottom-nav button:hover { color: #fff6e0; background: #c3b2871b; }
.ritual-toast { position: absolute; left: 50%; bottom: 197px; transform: translate(-50%, 8px); max-width: min(90vw, 500px); opacity: 0; padding: 12px 20px; color: #f6e9cf; background: #1b241de8; border: 1px solid #d1b47580; border-radius: 6px; transition: opacity .2s, transform .2s; text-align: center; font-family: 'Gowun Batang', serif; }
.ritual-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: #070b08ab; backdrop-filter: blur(8px); }
.sanctuary-modal { position: relative; width: min(100%, 470px); max-height: min(90vh, 760px); overflow: auto; padding: 39px 42px 36px; border: 1px solid #a5956e6e; border-radius: 12px; background: radial-gradient(ellipse at 50% 0%, #383b2df2, #1c231cf7 45%, #121a14fa 100%); box-shadow: 0 28px 100px #000b, inset 0 1px #ffffff19; text-align: center; }
.sanctuary-modal::before { position: absolute; content: ''; inset: 7px; border: 1px solid #c7b7891a; border-radius: 7px; pointer-events: none; }
.modal-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 50%; background: #ffffff0b; color: #e8dec4ba; }
.modal-close:hover { background: #ffffff19; }
.modal-close svg { width: 18px; height: 18px; }
.modal-eyebrow { color: #d6bb85; font-size: 9px; letter-spacing: .22em; }
.sanctuary-modal h2 { margin: 13px 0 12px; color: #f5eedc; font-family: 'Gowun Batang', serif; font-size: 26px; font-weight: 400; letter-spacing: .03em; }
.modal-intro { margin: 0 0 23px; color: #d3cbb9b8; line-height: 1.8; font-size: 13px; }
.mood-list, .place-list { display: grid; gap: 8px; text-align: left; }
.mood-option, .place-list button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px; border: 1px solid #cabb8a33; border-radius: 8px; background: #ffffff08; text-align: left; }
.mood-option:hover, .place-list button:hover { border-color: #d3bb80a8; background: #c4ac7515; }
.mood-mark, .place-icon, .ritual-mark { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 1px solid #c5ae7970; border-radius: 50%; color: #e6c78d; font: 18px 'Gowun Batang', serif; }
.mood-option strong, .place-list strong, .channel-card strong { display: block; font-size: 13px; font-weight: 500; }
.mood-option small, .place-list small, .channel-card small { display: block; margin-top: 5px; color: #c5bdaa9c; font-size: 11px; }
.option-chevron, .place-list b { margin-left: auto; color: #b6a57f; font-size: 23px; font-weight: 400; }
.privacy-note { margin: 19px 0 0; color: #c4bda994; font-size: 11px; line-height: 1.7; }
.privacy-note.left { margin: 7px 0 17px; text-align: left; }
.ritual-mark { width: 54px; height: 54px; margin: 21px auto 13px; font-size: 25px; box-shadow: 0 0 32px #d3ad5940; }
.ritual-label { display: block; margin: 22px 0 9px; color: #d9cfbd; text-align: left; font-size: 12px; }
.sanctuary-modal textarea { display: block; width: 100%; min-height: 90px; resize: vertical; padding: 13px; border: 1px solid #b8a57950; border-radius: 7px; background: #0e1510a8; color: #f2eadb; font-size: 13px; line-height: 1.6; }
.sanctuary-modal textarea::placeholder { color: #c3b9a675; }
.primary-button { width: 100%; padding: 13px 18px; border: 1px solid #e1c48d; border-radius: 6px; background: #c4a36b; color: #161a12; font-weight: 600; font-size: 13px; text-shadow: none; }
.primary-button:hover { background: #dfc18a; }
.text-button { margin-top: 14px; border: 0; background: transparent; color: #d5c8aa; text-decoration: underline; text-underline-offset: 4px; font-size: 11px; }
.verse-ornament { margin: 28px auto 13px; color: #d2b57f; font-size: 20px; }
blockquote { margin: 31px 0 22px; color: #f0e6d2; font: 17px/2.1 'Gowun Batang', serif; }
.verse-rule { width: 32px; height: 1px; margin: 0 auto; background: #cdb78280; }
.verse-caption { margin: 15px 0 0; color: #d5c3a0; font-family: 'Gowun Batang', serif; font-size: 12px; }
.channel-card { display: flex; align-items: center; gap: 13px; padding: 18px 16px; margin: 10px 0 20px; border: 1px solid #bba77a44; border-radius: 8px; background: #fff1; text-align: left; }
.qr-placeholder { display: grid; place-content: center; width: 174px; height: 174px; margin: 26px auto 0; border: 1px dashed #d4bc8f75; border-radius: 8px; color: #d8c8a6; background: #0d1510a6; }
.qr-placeholder span { font: 26px 'Gowun Batang', serif; color: #d9c394; }
.qr-placeholder small { display: block; margin-top: 10px; font-size: 10px; }
.qr-image { width: 186px; height: 186px; padding: 9px; margin: 26px auto 0; background: #fff; border-radius: 8px; }
.qr-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ritual-moment { display: grid; place-items: center; width: 126px; height: 126px; margin: 26px auto 10px; border: 1px solid #ceb58866; border-radius: 50%; background: radial-gradient(circle, #d3ab6c42, #1b241b44 70%); box-shadow: 0 0 45px #d9a4652b; color: #efd7a6; font: 38px 'Gowun Batang', serif; animation: ritual-breathe 4s ease-in-out infinite; }
.ritual-moment--forgive { background: radial-gradient(circle, #88ada444, #1b272644 70%); box-shadow: 0 0 45px #7aa9a32b; }
.ritual-moment--calm { background: radial-gradient(circle, #aab5a344, #1b241b44 70%); box-shadow: 0 0 45px #96b69c2b; }
@keyframes ritual-breathe { 0%,100% { transform: scale(.96); opacity: .78; } 50% { transform: scale(1.04); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ritual-moment { animation: none; } }
@media (max-width: 700px) {
  .sanctuary-header { padding: 18px 16px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-seal { width: 32px; height: 32px; font-size: 16px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 9px; }
  .header-right { gap: 6px; }
  .world-status { padding: 0 8px; font-size: 10px; }
  .world-status i, .world-status [data-time] { display: none; }
  .login-button { padding: 0 9px; font-size: 10px; }
  .icon-button, .world-status, .login-button { height: 34px; }
  .icon-button { width: 34px; }
  .ambient-caption { display: none; }
  .scene-guide { top: 76px; font-size: 10px; }
  .connection-chip { right: 16px; bottom: 130px; font-size: 10px; }
  .chat-wrap { left: 12px; bottom: 83px; }
  .chat-panel { bottom: 160px; }
  .gesture-bar { bottom: 93px; }
  .bottom-nav { bottom: 12px; width: calc(100% - 24px); padding: 7px 4px; justify-content: space-around; }
  .bottom-nav button { min-width: 0; flex: 1; padding: 4px 2px; font-size: 10px; }
  .sanctuary-modal { padding: 36px 24px 30px; }
}
