:root {
  --panel: linear-gradient(180deg, rgba(44, 34, 25, 0.86), rgba(24, 18, 14, 0.88));
  --panel-solid: #221a14;
  --line: rgba(222, 186, 118, 0.38);
  --line-strong: rgba(232, 200, 134, 0.72);
  --gold: #e6c682;
  --gold-soft: #cdb07a;
  --text: #f3eada;
  --muted: #bfb29a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", "AppleMyungjo", serif;
  --sans: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --gap: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1412; color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* phones must not enlarge the text when turned sideways */
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#sanctuary-ui .menu-button, .panel-close { display: none; }
.panel-close { place-items: center; margin-left: auto; padding: 0 12px; color: var(--muted); }
.panel-close svg { width: 16px; height: 16px; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
#game canvas.is-looking { cursor: grabbing; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

#sanctuary-ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: 14px; }
#sanctuary-ui > * { pointer-events: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }

/* ---- top left: profile and map ---------------------------------------- */
.hud-profile { position: absolute; left: var(--gap); top: var(--gap); display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 40px; min-width: 216px; }
.profile-seal { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font: 600 24px var(--serif); color: #2b2016;
  background: radial-gradient(circle at 35% 30%, #fbeccb, #d9b674 70%, #a98445); border: 2px solid rgba(255, 240, 205, 0.75); box-shadow: 0 0 0 3px rgba(30, 22, 16, 0.7); }
.profile-text { display: grid; gap: 2px; min-width: 0; }
.profile-text strong { font: 600 17px var(--serif); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.profile-text small { color: var(--muted); font-size: 12px; }
.profile-text small b { color: var(--gold); font-weight: 600; margin-left: 2px; }
.profile-bar { height: 4px; width: 128px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin-top: 3px; }
.profile-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #7fd0c4, #b6ead0); transition: width 0.6s ease; }

.hud-map { position: absolute; left: var(--gap); top: 92px; display: flex; align-items: flex-start; gap: 10px; }
.minimap { position: relative; width: 148px; height: 148px; border-radius: 50%; border: 2px solid var(--line-strong); box-shadow: var(--shadow), 0 0 0 4px rgba(26, 20, 15, 0.72); overflow: hidden; background: #31452f; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.minimap-north { position: absolute; left: 50%; top: 3px; transform: translateX(-50%); font: 700 11px var(--serif); color: #fff3d0; text-shadow: 0 1px 3px #000; }
.map-side { display: grid; gap: 8px; }
.location-chip { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; text-align: left; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.location-chip svg { color: var(--gold); }
.location-chip strong { display: block; font: 600 15px var(--serif); }
.location-chip small { display: block; color: #a9d6a0; font-size: 11.5px; margin-top: 1px; }
.map-zoom { display: grid; gap: 4px; width: 30px; }
.map-zoom button { width: 30px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--gold-soft); }
.map-zoom svg { width: 15px; height: 15px; }

/* ---- top right ----------------------------------------------------------- */
.hud-top { position: absolute; right: var(--gap); top: var(--gap); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 280px); }
.header-right { display: flex; align-items: center; gap: 8px; }
.world-status { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.world-status i { width: 1px; height: 12px; background: var(--line); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2c06e; box-shadow: 0 0 8px #e2c06e; flex: none; }
.icon-button, .language-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--gold); box-shadow: var(--shadow); transition: transform 0.15s, border-color 0.15s; }
.language-button { font: 600 12px var(--sans); width: auto; min-width: 40px; padding: 0 12px; border-radius: 22px; }
.icon-button:hover, .language-button:hover, .login-button:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.login-button { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.google-g { font-weight: 700; color: #fff; }

/* ---- tabs shared by practice and chat ----------------------------------- */
.tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { flex: 1; padding: 10px 8px 9px; font: 600 13.5px var(--serif); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); background: linear-gradient(180deg, rgba(230, 198, 130, 0.14), transparent); }

/* ---- right: daily practice --------------------------------------------------- */
.hud-practice { position: absolute; right: var(--gap); top: 76px; width: 292px; overflow: hidden; }
.practice-body { padding: 12px 14px 12px; }
.practice-body h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 600 14.5px var(--serif); }
.practice-body h3 svg { color: var(--gold); }
.practice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.practice-list li { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; padding: 7px 2px; font-size: 13.2px; border-bottom: 1px dashed rgba(222, 186, 118, 0.14); }
.practice-list .check { width: 17px; height: 17px; border: 1.5px solid var(--gold-soft); border-radius: 3px; display: grid; place-items: center; color: #1e1711; }
.practice-list .check svg { width: 13px; height: 13px; stroke-width: 2.6; }
.practice-list li.done .check { background: var(--gold); border-color: var(--gold); }
.practice-list li.done .task-label { color: var(--muted); }
.task-value { color: var(--gold-soft); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.practice-reward { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(230, 198, 130, 0.1); font-size: 12.8px; }
.practice-reward svg { color: var(--gold); }
.practice-reward em { font-style: normal; color: var(--muted); margin-left: auto; }
.hud-practice.all-done .practice-reward { background: rgba(140, 214, 180, 0.18); }
.record-list { margin: 0; display: grid; gap: 2px; }
.record-list div { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed rgba(222, 186, 118, 0.14); font-size: 13.2px; }
.record-list dt { color: var(--muted); }
.record-list dd { margin: 0; color: var(--gold); font-variant-numeric: tabular-nums; }
.practice-toggle { position: absolute; right: var(--gap); top: 76px; display: none; }

/* ---- bottom left: chat --------------------------------------------------------- */
.hud-chat { position: absolute; left: var(--gap); bottom: var(--gap); width: 336px; display: flex; flex-direction: column; overflow: hidden; }
.hud-chat .tabs [role="tab"] { flex: 0 0 auto; padding: 9px 14px 8px; }
.chat-collapse { margin-left: auto; padding: 0 10px; color: var(--muted); }
.chat-collapse svg { width: 15px; height: 15px; }
.chat-log { list-style: none; margin: 0; padding: 8px 12px; height: 112px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: 13px; line-height: 1.45; scrollbar-width: thin; scrollbar-color: rgba(222, 186, 118, 0.4) transparent; }
.chat-log:empty::before { content: "아직 조용해요. 따뜻한 말을 건네보세요."; color: var(--muted); font-size: 12.5px; }
.chat-log li { overflow-wrap: anywhere; }
.chat-log b { color: var(--gold); font-weight: 600; margin-right: 6px; }
.chat-log b::after { content: " :"; color: var(--muted); }
.chat-tag { display: inline-block; font-size: 11px; color: var(--muted); margin-right: 6px; }
.chat-tag::before { content: "["; } .chat-tag::after { content: "]"; }
.chat-log li[data-kind="system"] { color: #b7d8c0; }
.chat-log li.self b { color: #f5dfae; }
.chat-form { display: flex; align-items: center; gap: 8px; margin: 0 10px 10px; padding: 0 6px 0 11px; height: 38px; border-radius: 9px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(222, 186, 118, 0.24); }
.chat-form svg { color: var(--muted); width: 17px; height: 17px; }
.chat-form input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 13.5px; outline: none; }
.chat-form input::placeholder { color: rgba(191, 178, 154, 0.75); }
.chat-form button { width: 30px; height: 30px; display: grid; place-items: center; color: var(--gold); border-radius: 7px; }
.chat-form button:hover { background: rgba(230, 198, 130, 0.16); }
.chat-open { position: absolute; left: var(--gap); bottom: var(--gap); display: none; }
.chat-closed .hud-chat { display: none; }
.chat-closed .chat-open { display: grid; }

/* ---- bottom centre: actions ------------------------------------------------------ */
.action-bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 14px; }
.action-bar button { display: grid; justify-items: center; gap: 3px; width: 76px; padding: 0; }
.action-disc { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: var(--gold);
  background: radial-gradient(circle at 50% 30%, rgba(82, 62, 42, 0.95), rgba(26, 19, 14, 0.94) 72%); border: 1.5px solid var(--line-strong);
  box-shadow: 0 0 0 3px rgba(22, 16, 12, 0.6), 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 235, 190, 0.22); transition: transform 0.15s, box-shadow 0.2s; }
.action-disc svg { width: 30px; height: 30px; stroke-width: 1.35; }
.action-bar button:hover .action-disc, .action-bar button.active .action-disc { transform: translateY(-3px); box-shadow: 0 0 0 3px rgba(22, 16, 12, 0.6), 0 0 22px rgba(240, 200, 120, 0.55), inset 0 1px 0 rgba(255, 235, 190, 0.3); }
.action-bar button.active .action-disc { color: #fff1cc; border-color: #f6dca0; }
.action-label { font: 600 13px var(--serif); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.7); white-space: nowrap; }
.action-bar kbd { font: 11px var(--sans); color: var(--muted); text-shadow: 0 1px 3px #000; }
.action-bar kbd::before { content: "("; } .action-bar kbd::after { content: ")"; }

/* ---- bottom right: quick menu ------------------------------------------------------ */
.quick-bar { position: absolute; right: var(--gap); bottom: var(--gap); display: flex; gap: 8px; }
.quick-bar button { width: 72px; height: 62px; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 11.5px; white-space: nowrap; color: var(--text); transition: transform 0.15s, border-color 0.15s; }
.quick-bar button svg { color: var(--gold); width: 22px; height: 22px; }
.quick-bar button:hover { transform: translateY(-2px); border-color: var(--line-strong); }

/* ---- floating notes -------------------------------------------------------------------- */
.scene-guide { position: absolute; left: 50%; bottom: 158px; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 20px; background: rgba(24, 18, 14, 0.72); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); white-space: nowrap; transition: opacity 1.2s; pointer-events: none !important; }
.scene-guide.faded { opacity: 0; }
.guide-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.guide-divider { opacity: 0.5; }
.connection-chip { position: absolute; left: 50%; bottom: 126px; transform: translateX(-50%); font-size: 12px; color: rgba(243, 234, 218, 0.82); text-shadow: 0 1px 4px #000; pointer-events: none !important; white-space: nowrap; }
.ritual-toast { position: absolute; left: 50%; top: 86px; transform: translate(-50%, -8px); max-width: min(520px, 86vw); padding: 11px 22px; border-radius: 24px; background: rgba(26, 20, 15, 0.9); border: 1px solid var(--line-strong); font: 500 14px var(--serif); text-align: center; opacity: 0; transition: opacity 0.35s, transform 0.35s; pointer-events: none !important; }
.ritual-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.render-stats { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); color: #cfe9c8; font: 11.5px/1.5 ui-monospace, Consolas, monospace; pointer-events: none !important; white-space: pre; }
.fade-curtain { position: absolute; inset: 0; background: #0b0f0e; opacity: 0; transition: opacity 0.3s; pointer-events: none !important; }
.fade-curtain.closed { opacity: 1; }
.joystick { position: absolute; left: 26px; bottom: 96px; width: 116px; height: 116px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: rgba(24, 18, 14, 0.42); display: none; touch-action: none; }
.joystick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f3deaa, #b9965a); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
@media (pointer: coarse) { .joystick { display: block; } .scene-guide { display: none; } .action-bar kbd { display: none; } }

/* ---- dialogs ------------------------------------------------------------------------------ */
.modal-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 10, 9, 0.56); opacity: 0; transition: opacity 0.25s; backdrop-filter: blur(3px); }
.modal-backdrop.open { opacity: 1; }
.sanctuary-modal { position: relative; width: min(440px, 100%); max-height: min(86vh, 760px); overflow-y: auto; padding: 34px 30px 28px; text-align: center; border-radius: 16px; background: linear-gradient(180deg, #2c2219, #1b1510); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.sanctuary-modal.wide { width: min(820px, 100%); }
.modal-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.modal-eyebrow { font-size: 10.5px; letter-spacing: 0.24em; color: var(--gold-soft); }
.sanctuary-modal h2 { margin: 10px 0 8px; font: 600 24px var(--serif); letter-spacing: 0.03em; }
.modal-intro { margin: 0 0 20px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.privacy-note { margin: 14px 0 0; font-size: 12px; color: rgba(191, 178, 154, 0.85); line-height: 1.6; }
.privacy-note.left { text-align: left; }
.mood-list, .place-list { display: grid; gap: 8px; }
.mood-option, .place-list button { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 11px 14px; text-align: left; border-radius: 11px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.2); transition: background 0.15s, border-color 0.15s; }
.mood-option:hover, .place-list button:hover { background: rgba(230, 198, 130, 0.13); border-color: var(--line-strong); }
.mood-mark, .place-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font: 600 18px var(--serif); color: var(--gold); border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.mood-option strong, .place-list strong { display: block; font: 600 15px var(--serif); }
.mood-option small, .place-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.3px; }
.option-chevron, .place-list b { color: var(--gold-soft); font-size: 20px; font-weight: 400; }
.ritual-mark, .verse-ornament { font: 600 30px var(--serif); color: var(--gold); margin-top: 8px; }
.ritual-label { display: block; margin: 0 0 8px; text-align: left; font-size: 13px; color: var(--muted); }
.sanctuary-modal textarea { width: 100%; min-height: 96px; padding: 12px; resize: vertical; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(222, 186, 118, 0.28); color: var(--text); font: 14px/1.6 var(--sans); }
.primary-button { width: 100%; margin-top: 16px; padding: 13px; border-radius: 26px; font: 600 15px var(--serif); color: #241a10; background: linear-gradient(180deg, #f0d79c, #cfa95f); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.primary-button:hover { filter: brightness(1.06); }
.text-button { margin-top: 10px; padding: 8px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.ritual-moment { width: 120px; height: 120px; margin: 14px auto 6px; border-radius: 50%; display: grid; place-items: center; font: 600 40px var(--serif); color: #fff1cf; animation: breathe 5s ease-in-out infinite; }
.ritual-moment--wish { background: radial-gradient(circle, rgba(255, 196, 110, 0.9), rgba(255, 160, 60, 0.18) 60%, transparent 72%); }
.ritual-moment--forgive { background: radial-gradient(circle, rgba(140, 205, 210, 0.85), rgba(80, 150, 170, 0.18) 60%, transparent 72%); }
.ritual-moment--calm { background: radial-gradient(circle, rgba(226, 214, 190, 0.8), rgba(170, 150, 120, 0.16) 60%, transparent 72%); }
@keyframes breathe { 0%, 100% { transform: scale(0.92); opacity: 0.8; } 50% { transform: scale(1.06); opacity: 1; } }
.sanctuary-modal blockquote { margin: 10px 0 12px; font: 500 18px/1.8 var(--serif); }
.verse-caption { margin: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.verse-rule { width: 40px; height: 1px; margin: 14px auto; background: var(--line-strong); }
.channel-card { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 6px; text-align: left; border-radius: 11px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(222, 186, 118, 0.2); }
.channel-card strong { display: block; font: 600 15px var(--serif); }
.channel-card small { display: block; color: var(--muted); font-size: 12.3px; margin-top: 2px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); gap: 18px; align-items: start; text-align: left; }
.map-image { width: 100%; border-radius: 12px; border: 1px solid var(--line-strong); display: block; }
.map-layout .place-list { max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.setting-group { text-align: left; margin-bottom: 14px; }
.setting-group h3 { margin: 0 0 8px; font: 600 14.5px var(--serif); }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(222, 186, 118, 0.22); font-size: 14px; }
.choice.selected { background: rgba(230, 198, 130, 0.2); border-color: var(--gold); color: #fff1cf; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 2px; border-top: 1px solid rgba(222, 186, 118, 0.16); text-align: left; cursor: pointer; }
.toggle-row strong { display: block; font: 600 14.5px var(--serif); }
.toggle-row small { display: block; color: var(--muted); font-size: 12.2px; margin-top: 2px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; flex: none; width: 44px; height: 24px; border-radius: 12px; background: rgba(255, 255, 255, 0.14); transition: background 0.2s; }
.toggle-row i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #efe4cf; transition: transform 0.2s; }
.toggle-row input:checked + i { background: #b99653; }
.toggle-row input:checked + i::after { transform: translateX(20px); }
.toggle-row input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- smaller screens ------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .hud-practice { width: 252px; }
  .hud-chat { width: 292px; }
  .world-status { display: none; }
  .quick-bar button { width: 64px; height: 56px; font-size: 10.5px; }
}
@media (max-width: 900px) {
  :root { --gap: 10px; }
  .hud-profile { min-width: 0; padding: 5px 12px 5px 5px; }
  .profile-seal { width: 40px; height: 40px; font-size: 19px; }
  .profile-bar { width: 86px; }
  .profile-text strong { font-size: 14.5px; max-width: 96px; }
  .hud-map { top: 66px; }
  .minimap { width: 104px; height: 104px; }
  .map-zoom { display: none; }
  .location-chip small { display: none; }
  .hud-top { max-width: calc(100vw - 190px); gap: 6px; }
  .header-right { gap: 5px; }
  .icon-button, .language-button, .login-button { height: 36px; }
  .icon-button { width: 36px; }
  .login-button span:last-child { display: none; }
  .login-button { padding: 0 12px; }
  .hud-top [data-action="fullscreen"] { display: none; }
  .hud-practice { top: 58px; width: min(300px, calc(100vw - 20px)); }
  .practice-closed .hud-practice { display: none; }
  .practice-toggle { display: grid; top: 58px; }
  #sanctuary-ui:not(.practice-closed) .practice-toggle { display: none; }
  .panel-close { display: grid; }
  .hud-chat { width: min(336px, calc(100vw - 20px)); bottom: 100px; }
  .chat-open { bottom: 232px; }
  .action-bar { gap: 4px; bottom: 8px; }
  .action-bar button { width: 62px; }
  .action-disc { width: 50px; height: 50px; }
  .action-disc svg { width: 24px; height: 24px; }
  .action-label { font-size: 11.5px; }
  .quick-bar { flex-direction: column; bottom: 96px; gap: 6px; }
  .quick-bar button { width: 46px; height: 46px; }
  .quick-bar button span { display: none; }
  .connection-chip { bottom: 86px; font-size: 11px; }
  .map-layout { grid-template-columns: 1fr; }
  .sanctuary-modal { padding: 30px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- time of day, guidance and place prompts ---- */
.time-chip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; white-space: nowrap; color: var(--text); transition: transform 0.15s, border-color 0.15s; }
.time-chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.time-chip .time-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--gold); background: rgba(230, 198, 130, 0.12); }
.time-chip .time-icon svg { width: 18px; height: 18px; }
.time-chip strong { font: 600 14px var(--serif); }
.time-chip i { width: 1px; height: 12px; background: var(--line); }
.time-chip span[data-time-clock] { color: var(--muted); font-variant-numeric: tabular-nums; }
.time-chip.preview span[data-time-clock] { color: var(--gold); }
.time-row { grid-template-columns: repeat(5, 1fr); }
.time-choice { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; font-size: 13px; }
.time-choice svg { width: 24px; height: 24px; color: var(--gold); }
.profile-seal { cursor: pointer; }

.hud-stack { position: absolute; left: 50%; bottom: 122px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.hud-stack > * { pointer-events: auto; }
/* What F does here: a little above the keys guide (.scene-guide, bottom 236px), clear of the route chip and the buttons below. */
.place-prompt { position: absolute; left: 50%; bottom: 284px; translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 9px 20px 9px 10px; border-radius: 24px; background: linear-gradient(180deg, rgba(64, 46, 26, 0.94), rgba(30, 22, 15, 0.94)); border: 1px solid var(--line-strong); box-shadow: 0 0 22px rgba(240, 200, 120, 0.28), var(--shadow); font: 600 14.5px var(--serif); color: #fff1cf; white-space: nowrap; animation: prompt-in 0.25s ease-out; }
.place-prompt kbd { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--gold); color: #241a10; font: 700 13px var(--sans); }
.place-prompt:hover { filter: brightness(1.12); }
@keyframes prompt-in { from { opacity: 0; transform: translateY(6px); } }
.nav-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 22px; background: rgba(24, 18, 14, 0.9); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.nav-chip > svg { width: 18px; height: 18px; color: var(--gold); }
.nav-chip button { height: 28px; padding: 0 12px; border-radius: 14px; background: rgba(230, 198, 130, 0.14); border: 1px solid var(--line); font-size: 12.5px; color: var(--text); }
.nav-chip button.active { background: rgba(230, 198, 130, 0.36); border-color: var(--gold); }
.nav-chip button:last-child { width: 28px; padding: 0; display: grid; place-items: center; }
.nav-chip button:last-child svg { width: 14px; height: 14px; }
.progress-chip { display: grid; gap: 6px; min-width: 240px; padding: 9px 16px 11px; border-radius: 14px; background: rgba(24, 18, 14, 0.9); border: 1px solid var(--line); font: 600 13.5px var(--serif); text-align: center; }
.progress-chip i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress-chip b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #cfa95f, #f6e2ad); transition: width 0.4s; }
.connection-chip { top: 62px; bottom: auto; }
.scene-guide { bottom: 236px; }

.dharma-caption { position: absolute; left: 50%; top: 134px; transform: translateX(-50%); width: min(680px, 90vw); padding: 14px 24px 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(40, 28, 18, 0.92), rgba(20, 15, 11, 0.92)); border: 1px solid var(--line-strong); box-shadow: var(--shadow); text-align: center; pointer-events: none !important; }
.dharma-caption b { display: block; margin-bottom: 5px; font: 600 12.5px var(--sans); letter-spacing: 0.08em; color: var(--gold); }
.dharma-caption p { margin: 0; font: 500 17px/1.7 var(--serif); color: #fbf3e2; word-break: keep-all; }

.action-bar { gap: 10px; }
.action-disc { position: relative; }
.action-disc .cooldown { position: absolute; inset: -1px; border-radius: 50%; background: conic-gradient(rgba(12, 9, 7, 0.72) var(--cooldown, 0deg), transparent 0); pointer-events: none; }
.action-bar button.unavailable .action-disc { opacity: 0.5; filter: saturate(0.4); }
.action-bar button.unavailable .action-label { opacity: 0.7; }
.action-bar button.cooling .action-disc { color: var(--muted); }

.quest-box { margin-top: 10px; padding: 9px 10px 8px; border-radius: 8px; border: 1px solid rgba(222, 186, 118, 0.3); background: rgba(230, 198, 130, 0.07); }
.quest-box h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 600 13px var(--serif); }
.quest-box h4 svg { width: 16px; height: 16px; color: var(--gold); }
.quest-box h4 em { margin-left: auto; font-style: normal; color: var(--gold); }
.quest-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.quest-box li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.6px; color: var(--text); }
.quest-box li.done { color: var(--muted); text-decoration: line-through; }
.quest-box li b { font-weight: 500; color: var(--gold); font-variant-numeric: tabular-nums; }
.quest-box p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hwadu-line { margin: 8px 0 0; font: 500 12.6px/1.5 var(--serif); color: var(--gold-soft); }
.journal-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px; border-radius: 9px; background: rgba(230, 198, 130, 0.12); border: 1px solid var(--line); font: 600 13px var(--serif); color: var(--text); }
.journal-button svg { width: 17px; height: 17px; color: var(--gold); }
.journal-button:hover { border-color: var(--line-strong); }

.channel-list { display: grid; gap: 6px; margin-top: 8px; max-height: 34vh; overflow-y: auto; }
.channel-row { display: grid; grid-template-columns: 76px 1fr 54px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.2); text-align: left; }
.channel-row:hover:not(:disabled) { background: rgba(230, 198, 130, 0.13); border-color: var(--line-strong); }
.channel-row.current { border-color: var(--gold); }
.channel-row:disabled { opacity: 0.45; }
.channel-row strong { font: 600 14.5px var(--serif); }
.channel-row em { font-style: normal; text-align: right; color: var(--gold); font-variant-numeric: tabular-nums; font-size: 13px; }
.channel-meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.channel-meter i { display: block; height: 100%; background: linear-gradient(90deg, #8fc7a4, #e6c682); }

/* ---- dialogs for wishes, records, rewards and hall practices ---- */
.dialog-field { width: 100%; min-height: 86px; margin-top: 4px; padding: 12px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); color: var(--text); font: 15px/1.6 var(--serif); resize: none; }
.dialog-field:focus { outline: none; border-color: var(--line-strong); }
.option-list { display: grid; gap: 8px; text-align: left; }
.option-list button { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.2); text-align: left; }
.option-list button:hover:not(:disabled) { background: rgba(230, 198, 130, 0.13); border-color: var(--line-strong); }
.option-list button:disabled { opacity: 0.5; }
.option-list .option-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(230, 198, 130, 0.14); color: var(--gold); font: 600 18px var(--serif); }
.option-list strong { display: block; font: 600 15px var(--serif); }
.option-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.3px; line-height: 1.5; }
.journal-filter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; }
.journal-filter button { padding: 6px 13px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(222, 186, 118, 0.22); font-size: 12.6px; color: var(--muted); }
.journal-filter button.selected { background: rgba(230, 198, 130, 0.2); border-color: var(--gold); color: #fff1cf; }
.journal-list { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; text-align: left; }
.journal-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.16); }
.journal-list time { font-size: 11.8px; color: var(--muted); }
.journal-list .journal-kind { font-size: 11.8px; color: var(--gold); margin-right: 8px; }
.journal-list p { grid-column: 1 / -1; margin: 0; font: 15px/1.6 var(--serif); word-break: keep-all; }
/* 기와 불사: the stand's dialog, the transfer notice and the operator's list. */
.dialog-field.tile-name { min-height: 0; margin-top: 8px; padding: 10px 14px; }
.tile-list { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 8px; max-height: 34vh; overflow-y: auto; text-align: left; }
.tile-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-radius: 10px; background: rgba(70, 74, 79, 0.42); border: 1px solid rgba(222, 186, 118, 0.16); }
.tile-list li > span:first-child { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tile-list b { font-size: 12.4px; color: var(--gold); font-weight: 600; }
.tile-list li.pending b { color: #f2d38a; }
.tile-list li.rejected b, .tile-list li.removed b { color: var(--muted); }
.tile-list time { font-size: 11.8px; color: var(--muted); }
.tile-list p { grid-column: 1 / -1; margin: 0; font: 15px/1.6 var(--serif); word-break: keep-all; overflow-wrap: anywhere; }
.tile-list p small { color: var(--muted); font-size: 12.4px; }
.tile-list.others li { grid-template-columns: 1fr; }
.tile-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tile-actions button { padding: 5px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(222, 186, 118, 0.28); font-size: 12.4px; }
.tile-actions button:hover { background: rgba(230, 198, 130, 0.16); }
.tile-amount { margin: 4px 0 10px; color: var(--gold-soft); font: 600 15px var(--serif); }
.pay-soon { margin: 14px auto; padding: 12px 16px; border-radius: 10px; border: 1px dashed var(--line-strong); color: var(--gold-soft); font-size: 14px; }
.pay-custom { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; border-radius: 18px; border: 1px solid rgba(222, 186, 118, 0.3); background: rgba(255, 255, 255, 0.04); }
.pay-custom input { width: 96px; padding: 8px 0; border: 0; background: transparent; color: inherit; font: 600 14px var(--serif); text-align: right; outline: none; }
.pay-custom.wide { display: flex; box-sizing: border-box; width: min(260px, 100%); margin: 12px auto 4px; padding: 0 16px; }
.pay-custom.wide input { flex: 1; min-width: 0; width: auto; font-size: 20px; padding: 10px 0; }
.pay-custom:focus-within { border-color: var(--gold); }
.pay-test-note { margin: 6px auto; padding: 6px 12px; width: fit-content; border-radius: 8px; background: rgba(120, 170, 220, 0.14); border: 1px solid rgba(140, 185, 230, 0.35); color: #cfe2f5; font-size: 12.5px; }
/* Toss's widget draws itself on white; it sits on a light card so its own colours read as they should. */
.toss-box { margin: 8px 0; border-radius: 12px; overflow: hidden; background: #fff; color: #333; }
.toss-box:empty { display: none; }
.toss-box > .privacy-note { margin: 0; padding: 18px; color: #555; }
.privacy-note a { color: var(--gold-soft); text-underline-offset: 2px; }
.journal-list button { font-size: 11.8px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.stamp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 4px 0 6px; }
.stamp-grid span { display: grid; place-items: center; gap: 3px; padding: 9px 2px 7px; border-radius: 10px; border: 1px dashed rgba(222, 186, 118, 0.3); font-size: 11.5px; color: var(--muted); }
.stamp-grid span b { font: 600 19px var(--serif); color: rgba(222, 186, 118, 0.35); }
.stamp-grid span.got { border-style: solid; border-color: var(--gold); color: var(--text); background: rgba(230, 198, 130, 0.12); }
.stamp-grid span.got b { color: #f0d79c; }
.reward-section { margin-top: 16px; text-align: left; }
.reward-section h3 { margin: 0 0 8px; font: 600 14px var(--serif); color: var(--gold); }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-row button, .chip-row span { padding: 7px 13px; border-radius: 16px; border: 1px solid rgba(222, 186, 118, 0.25); background: rgba(255, 255, 255, 0.05); font-size: 12.8px; color: var(--text); }
.chip-row button.selected { background: rgba(230, 198, 130, 0.22); border-color: var(--gold); color: #fff1cf; }
.chip-row .locked { opacity: 0.45; }
.chip-row .robe-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, 0.3); }
.schedule-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; text-align: left; }
.schedule-list li { display: flex; justify-content: space-between; padding: 9px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.16); font-size: 13.6px; }
.schedule-list li.next { border-color: var(--gold); background: rgba(230, 198, 130, 0.12); }
.schedule-list li em { font-style: normal; color: var(--gold); }
.nahan-card { margin: 4px auto 0; padding: 18px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: radial-gradient(circle at 50% 0, rgba(230, 198, 130, 0.2), transparent 70%); }
.nahan-card .nahan-mark { font: 600 44px var(--serif); color: var(--gold); }
.nahan-card strong { display: block; margin: 4px 0 8px; font: 600 18px var(--serif); }
.nahan-card p { margin: 0; font: 15.5px/1.7 var(--serif); word-break: keep-all; }

@media (max-width: 900px) {
  .time-chip { height: 34px; padding: 0 10px 0 6px; font-size: 12px; }
  .time-chip span[data-time-clock], .time-chip i { display: none; }
  .hud-stack { bottom: 104px; }
  .action-bar { gap: 4px; }
  .action-bar button { width: 58px; }
  .dharma-caption { top: 104px; padding: 10px 14px 12px; }
  .dharma-caption p { font-size: 14.5px; }
  .time-row { grid-template-columns: repeat(3, 1fr); }
  .stamp-grid { grid-template-columns: repeat(4, 1fr); }
  .progress-chip { min-width: 190px; }
}

/* ---- the assembly card and its links ---- */
.assembly-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; text-align: left; background: linear-gradient(180deg, rgba(230, 198, 130, 0.2), rgba(230, 198, 130, 0.08)); border: 1px solid var(--line-strong); color: var(--text); transition: filter 0.15s; }
.assembly-card:hover { filter: brightness(1.12); }
.assembly-card .assembly-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(230, 198, 130, 0.22); color: #f6e2ad; font: 600 19px var(--serif); }
.assembly-card strong { display: block; font: 600 14px var(--serif); }
.assembly-card small { display: block; margin-top: 2px; font-size: 12px; color: var(--gold); }
.assembly-card b { color: var(--gold); font-size: 18px; }
.assembly-card.live { border-color: #f6dca0; box-shadow: 0 0 18px rgba(240, 200, 120, 0.35); animation: assembly-pulse 2.4s ease-in-out infinite; }
@keyframes assembly-pulse { 50% { box-shadow: 0 0 6px rgba(240, 200, 120, 0.15); } }
.status-link { padding: 0; color: var(--gold); font: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(230, 198, 130, 0.4); }
.status-link:hover { color: #fff1cf; }

/* Wide screens: a label may take two lines (English, Vietnamese and Thai run long), never more, and never wider than its button. */
@media (min-width: 1700px) {
  .quick-bar button { width: 74px; height: auto; min-height: 62px; padding: 7px 4px 6px; font-size: 11px; }
  .quick-bar button span { max-width: 100%; line-height: 1.15; white-space: normal; text-align: center; overflow-wrap: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---- the channel chip: which channel this is, and the way to choose another ---- */
.channel-chip { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 11px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 13px; white-space: nowrap; color: var(--gold); transition: transform 0.15s, border-color 0.15s; }
.channel-chip:hover { transform: translateY(-1px); border-color: var(--gold); }
.channel-chip svg { width: 18px; height: 18px; flex: none; }
.channel-chip strong { font-weight: 600; color: var(--text); }
.channel-chip .short { display: none; }
@media (max-width: 900px) {
  .channel-chip { height: 36px; padding: 0 10px 0 8px; font-size: 12px; gap: 5px; }
  .channel-chip .long { display: none; }
  .channel-chip .short { display: inline; }
}

/* ---- speech bubbles: laid over the view, sized to their words, kept on screen (bubbles.mjs) ---- */
.bubble-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.speech-bubble { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: max-content; max-width: min(22em, 70vw); min-width: 2.6em; padding: 0.5em 0.9em 0.56em; border-radius: 0.9em; font-size: clamp(17px, 1.25vw, 24px); background: rgba(249, 244, 231, 0.97); color: #30372f; font-family: var(--serif); font-weight: 500; line-height: 1.45; text-align: center; word-break: keep-all; overflow-wrap: anywhere; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32); will-change: transform; }
.speech-bubble::after { content: ''; position: absolute; left: var(--tail, 50%); top: 100%; margin-left: -8px; border: 8px solid transparent; border-top-color: rgba(249, 244, 231, 0.97); border-bottom: 0; }

/* ---- the count before an assembly ---- */
.countdown { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 30; display: grid; justify-items: center; gap: 6px; pointer-events: none; text-align: center; }
.countdown strong { font: 600 88px/1 var(--serif); color: #fff3d6; text-shadow: 0 0 24px rgba(255, 200, 110, 0.75), 0 2px 6px rgba(0, 0, 0, 0.55); }
.countdown strong.tick { animation: countdown-tick 0.9s ease-out; }
.countdown small { max-width: min(420px, 86vw); padding: 6px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 13px; }
@keyframes countdown-tick { from { transform: scale(1.35); opacity: 0.4; } 30% { opacity: 1; } to { transform: scale(1); } }
@media (max-width: 900px) { .countdown strong { font-size: 64px; } }

/* ---- laptop widths: the six practices, the chat and the quick menu used to run into each other ----
   The quick menu keeps its labels only where the six practices in the middle leave room for seven labelled buttons
   (about 1700px); narrower, it shows its icons, and each button's name comes up on hover (title). */
@media (min-width: 901px) and (max-width: 1699px) {
  .quick-bar button { width: 46px; height: 46px; }
  .quick-bar button span { display: none; }
}
@media (min-width: 901px) and (max-width: 1366px) {
  .hud-chat { width: 300px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .quick-bar { flex-direction: column; gap: 6px; }
  .hud-chat { width: 280px; }
  .action-bar { gap: 4px; }
  .action-bar button { width: 62px; }
  .action-disc { width: 50px; height: 50px; }
  .action-disc svg { width: 24px; height: 24px; }
  .hud-practice { max-height: calc(100vh - 76px - 384px); overflow-y: auto; }   /* clear of the quick menu's column below it */
}

/* ---- how the level rises (temple office) ---- */
button.practice-reward { width: 100%; text-align: left; color: var(--text); border: 1px solid transparent; }
button.practice-reward:hover { border-color: var(--line); }
.practice-reward em { white-space: nowrap; color: var(--gold-soft); }
.level-guide .level-now { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; }
.level-guide .level-now b { color: var(--gold); }
.level-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-bottom: 10px; }
.level-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #7fd0c4, #b6ead0); }
.level-guide h4 { margin: 10px 0 4px; font: 600 12.5px var(--sans); color: var(--muted); }
.level-guide ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.level-guide li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px dashed rgba(222, 186, 118, 0.14); font-size: 13.2px; }
.level-guide li small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.level-guide li b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---- the phone menu ---- */
.menu-status { margin: 0 0 14px; font-size: 12.5px; line-height: 1.6; color: var(--muted); word-break: keep-all; }
.menu-status .status-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid button { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 72px; padding: 10px 4px 9px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(222, 186, 118, 0.22); font-size: 12.5px; color: var(--text); }
.menu-grid button:active { background: rgba(230, 198, 130, 0.18); }
.menu-grid svg { width: 24px; height: 24px; color: var(--gold); }
.primary-button .google-g { color: #241a10; }

/* ---- phones: a layout of their own, upright (.portrait) and sideways (.landscape); ui.js decides ----
   Along the top: who you are on the left; the channel and the menu on the right (everything else is in the menu).
   Below them: the map on the left, the practice list (folded) on the right.
   Along the bottom: the stick on the left, the six practices on the right; what is happening between them. */
#sanctuary-ui.phone {
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --gap: 8px; font-size: 13px;
}
#sanctuary-ui.phone .hud-profile { left: calc(var(--sl) + 8px); top: calc(var(--st) + 8px); min-width: 0; gap: 8px; padding: 4px 12px 4px 4px; }
#sanctuary-ui.phone .profile-seal { width: 34px; height: 34px; font-size: 16px; border-width: 1.5px; box-shadow: 0 0 0 2px rgba(30, 22, 16, 0.7); }
#sanctuary-ui.phone .profile-text { gap: 1px; }
#sanctuary-ui.phone .profile-text strong { font-size: 13.5px; line-height: 1.25; max-width: 88px; }
#sanctuary-ui.phone .profile-text small { font-size: 11px; line-height: 1.3; }
#sanctuary-ui.phone .profile-bar { width: 64px; height: 3px; margin-top: 1px; }

#sanctuary-ui.phone .hud-top { right: calc(var(--sr) + 8px); top: calc(var(--st) + 8px); max-width: none; gap: 6px; flex-wrap: nowrap; }
#sanctuary-ui.phone .header-right { gap: 6px; }
#sanctuary-ui.phone .world-status, #sanctuary-ui.phone .time-chip, #sanctuary-ui.phone .hud-top [data-panel="settings"],
#sanctuary-ui.phone .hud-top [data-action="fullscreen"], #sanctuary-ui.phone .login-button, #sanctuary-ui.phone .language-button { display: none; }
#sanctuary-ui.phone .menu-button { display: grid; }
#sanctuary-ui.phone .icon-button { width: 42px; height: 42px; }
#sanctuary-ui.phone .channel-chip { height: 42px; padding: 0 12px 0 10px; font-size: 12.5px; gap: 5px; }
#sanctuary-ui.phone .channel-chip .long { display: none; }
#sanctuary-ui.phone .channel-chip .short { display: inline; }

#sanctuary-ui.phone .hud-map { left: calc(var(--sl) + 8px); top: calc(var(--st) + 62px); gap: 6px; align-items: center; }
#sanctuary-ui.phone .minimap { width: 84px; height: 84px; box-shadow: var(--shadow), 0 0 0 3px rgba(26, 20, 15, 0.72); }
#sanctuary-ui.phone .map-zoom, #sanctuary-ui.phone .location-chip small { display: none; }
#sanctuary-ui.phone .location-chip { padding: 6px 11px 6px 8px; gap: 5px; }
#sanctuary-ui.phone .location-chip strong { font-size: 13px; }
#sanctuary-ui.phone .location-chip svg { width: 16px; height: 16px; }

#sanctuary-ui.phone .practice-toggle { display: grid; top: calc(var(--st) + 60px); right: calc(var(--sr) + 8px); bottom: auto; }
#sanctuary-ui.phone:not(.practice-closed) .practice-toggle, #sanctuary-ui.phone.practice-closed .hud-practice { display: none; }
#sanctuary-ui.phone .panel-close { display: grid; }
#sanctuary-ui.phone .hud-practice { top: calc(var(--st) + 60px); right: calc(var(--sr) + 8px); width: min(320px, calc(100vw - 16px - var(--sl) - var(--sr)));
  max-height: calc(100% - var(--st) - var(--sb) - 220px); overflow-y: auto; overscroll-behavior: contain; z-index: 5; }
#sanctuary-ui.phone .practice-list li { padding: 6px 2px; font-size: 12.8px; }

#sanctuary-ui.phone .joystick { left: calc(var(--sl) + 18px); bottom: calc(var(--sb) + 18px); width: 116px; height: 116px; }
#sanctuary-ui.phone .action-bar { left: auto; right: calc(var(--sr) + 8px); bottom: calc(var(--sb) + 8px); transform: none; display: grid; grid-template-columns: repeat(3, 58px); gap: 4px; }
#sanctuary-ui.phone .action-bar button { width: 58px; gap: 2px; }
#sanctuary-ui.phone .action-disc { width: 46px; height: 46px; }
#sanctuary-ui.phone .action-disc svg { width: 22px; height: 22px; }
#sanctuary-ui.phone .action-label { font-size: 10.5px; }
#sanctuary-ui.phone .action-bar kbd, #sanctuary-ui.phone .place-prompt kbd { display: none; }
#sanctuary-ui.phone .place-prompt { bottom: calc(var(--sb) + 244px); max-width: calc(100vw - 32px); padding: 10px 18px; font-size: 14px; }

#sanctuary-ui.phone .chat-open { left: calc(var(--sl) + 14px); bottom: calc(var(--sb) + 148px); width: 42px; height: 42px; }
#sanctuary-ui.phone .hud-chat { left: calc(var(--sl) + 8px); right: calc(var(--sr) + 8px); bottom: calc(var(--sb) + var(--kb, 0px) + 8px); width: auto; z-index: 6; }
#sanctuary-ui.phone .chat-log { height: clamp(80px, 24vh, 210px); }
#sanctuary-ui.phone .chat-form input { font-size: 16px; }   /* 16px or more: iPhones do not zoom in on the field */

#sanctuary-ui.phone .hud-stack { bottom: calc(var(--sb) + 148px); max-width: calc(100vw - 136px); }
#sanctuary-ui.phone .progress-chip { min-width: 0; width: min(250px, calc(100vw - 136px)); font-size: 12.5px; }
#sanctuary-ui.phone .nav-chip { font-size: 12.5px; padding: 5px 6px 5px 12px; }
#sanctuary-ui.phone .connection-chip, #sanctuary-ui.phone .quick-bar, #sanctuary-ui.phone .scene-guide { display: none; }

#sanctuary-ui.phone .dharma-caption { top: calc(var(--st) + 156px); width: calc(100vw - 16px - var(--sl) - var(--sr)); padding: 9px 12px 10px; }
#sanctuary-ui.phone .dharma-caption b { font-size: 11px; margin-bottom: 3px; }
#sanctuary-ui.phone .dharma-caption p { font-size: 13.5px; line-height: 1.6; }
#sanctuary-ui.phone .ritual-toast { top: 36%; font-size: 13px; padding: 9px 16px; max-width: calc(100vw - 32px); }
#sanctuary-ui.phone .countdown { top: 27%; }
#sanctuary-ui.phone .countdown strong { font-size: 60px; }
#sanctuary-ui.phone .countdown small { font-size: 12px; }

#sanctuary-ui.phone .modal-backdrop { padding: calc(var(--st) + 8px) calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px); }
#sanctuary-ui.phone .sanctuary-modal { max-height: calc(100vh - var(--st) - var(--sb) - 16px); max-height: calc(100dvh - var(--st) - var(--sb) - 16px); padding: 26px 16px 18px; border-radius: 14px; overscroll-behavior: contain; }
#sanctuary-ui.phone .sanctuary-modal h2 { font-size: 20px; margin: 6px 0; }
#sanctuary-ui.phone .modal-intro { font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
#sanctuary-ui.phone .modal-close { right: 6px; top: 6px; width: 40px; height: 40px; }
#sanctuary-ui.phone .map-layout .place-list { max-height: none; }

/* Sideways: little height, so things move to the corners and the middle stays open. */
#sanctuary-ui.landscape .hud-map { top: calc(var(--st) + 60px); }
#sanctuary-ui.landscape .minimap { width: 72px; height: 72px; }
#sanctuary-ui.landscape .practice-toggle { top: calc(var(--st) + 58px); }
#sanctuary-ui.landscape .hud-practice { top: calc(var(--st) + 8px); width: min(300px, 44vw); max-height: calc(100% - var(--st) - var(--sb) - 16px); z-index: 7; }
#sanctuary-ui.landscape .joystick { left: calc(var(--sl) + 22px); bottom: calc(var(--sb) + 14px); width: 104px; height: 104px; }
#sanctuary-ui.landscape .chat-open { bottom: calc(var(--sb) + 128px); }
#sanctuary-ui.landscape .hud-chat { right: auto; width: min(360px, 48vw); }
#sanctuary-ui.landscape .chat-log { height: clamp(48px, 30vh, 150px); }
#sanctuary-ui.landscape .hud-stack { bottom: calc(var(--sb) + 10px); max-width: calc(100vw - 2 * (var(--sl) + 200px)); }
#sanctuary-ui.landscape .progress-chip { width: min(260px, calc(100vw - 2 * (var(--sl) + 200px))); }
#sanctuary-ui.landscape .dharma-caption { top: calc(var(--st) + 8px); width: calc(100vw - 2 * (var(--sl) + 176px)); max-width: 540px; padding: 7px 12px 8px; }
#sanctuary-ui.landscape .dharma-caption p { font-size: 12.8px; line-height: 1.5; }
#sanctuary-ui.landscape .place-prompt { bottom: calc(var(--sb) + 112px); }
#sanctuary-ui.landscape .ritual-toast { top: calc(var(--st) + 80px); max-width: calc(100vw - 2 * (var(--sl) + 176px)); }
#sanctuary-ui.landscape .countdown { top: 18%; }
#sanctuary-ui.landscape .countdown strong { font-size: 50px; }
#sanctuary-ui.landscape .sanctuary-modal { width: min(600px, 100%); padding: 20px 18px 14px; }
#sanctuary-ui.landscape .sanctuary-modal.wide { width: min(780px, 100%); }
#sanctuary-ui.landscape .modal-eyebrow { display: none; }
#sanctuary-ui.landscape .sanctuary-modal h2 { margin-top: 0; }
#sanctuary-ui.landscape .menu-grid { grid-template-columns: repeat(6, 1fr); }
#sanctuary-ui.landscape .menu-grid button { min-height: 62px; }
#sanctuary-ui.landscape .map-layout { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); }

/* ---- the special gatherings: notice board, the written line, the offering ---- */
.schedule-list li.special b { color: var(--gold); }
.schedule-list li b { font-weight: 600; }
.rite-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; text-align: left; }
.rite-list li { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 11px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.2); }
.rite-list .option-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(230, 198, 130, 0.14); color: var(--gold); font: 600 18px var(--serif); }
.rite-list strong { display: block; font: 600 14.5px var(--serif); }
.rite-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.3px; line-height: 1.5; }
.trial-row { grid-template-columns: repeat(2, 1fr); }
.offering-text { text-align: left; margin: 4px 0 6px; padding: 14px 16px; border-radius: 12px; background: rgba(230, 198, 130, 0.08); border: 1px solid rgba(222, 186, 118, 0.22); }
.offering-text p { margin: 0 0 8px; font: 500 14.5px/1.75 var(--serif); word-break: keep-all; }
.offering-text p:last-child { margin: 0; color: var(--gold-soft); }

/* Choosing the figure: a button in the profile, and two large choices in the dialog. */
.profile-look { display: flex; align-items: center; gap: 5px; margin-left: 4px; padding: 6px 11px; border-radius: 18px; border: 1px solid rgba(214, 178, 110, 0.5);
  background: rgba(214, 178, 110, 0.1); color: var(--gold); font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.profile-look:hover { background: rgba(214, 178, 110, 0.22); }
.profile-look svg { width: 15px; height: 15px; flex: none; }
.body-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.body-choice button { display: grid; justify-items: center; gap: 5px; padding: 14px 8px 12px; border-radius: 14px; border: 1px solid rgba(214, 178, 110, 0.28);
  background: rgba(255, 255, 255, 0.03); color: inherit; cursor: pointer; }
.body-choice button i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 600 21px var(--serif); font-style: normal;
  background: rgba(214, 178, 110, 0.16); color: var(--gold); }
.body-choice button b { font: 600 16px var(--serif); }
.body-choice button small { font-size: 11.5px; color: var(--muted); }
.body-choice button.selected { border-color: var(--gold); background: rgba(214, 178, 110, 0.15); }
.body-choice button.selected small { color: var(--gold); }
#sanctuary-ui.phone .profile-look { padding: 5px 8px; margin-left: 0; font-size: 11.5px; }
#sanctuary-ui.phone .profile-look svg { width: 13px; height: 13px; }

/* The office: tabs, and cards that keep each subject apart. */
.office-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 6px 0 2px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); }
.office-tabs button { padding: 9px 4px; border-radius: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.office-tabs button:hover { color: var(--text); }
.office-tabs button.selected { background: rgba(230, 198, 130, 0.2); color: #fff1cf; box-shadow: inset 0 0 0 1px rgba(222, 186, 118, 0.45); }
.office-card { margin-top: 12px; padding: 14px 16px 15px; border-radius: 14px; border: 1px solid rgba(222, 186, 118, 0.2); background: rgba(255, 255, 255, 0.035); text-align: left; }
.office-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; font: 600 15px var(--serif); color: var(--gold); }
.office-card h3::before { content: ''; flex: none; width: 4px; height: 15px; border-radius: 2px; background: var(--gold); }
.office-card .card-note { margin: 0 0 11px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.office-card .level-now { margin: 0 0 9px; font-size: 13.5px; line-height: 1.65; }
.office-card .level-now b { display: block; color: var(--gold); font-weight: 600; }
.office-card .body-choice { margin: 0; }
.point-list { list-style: none; margin: 0; padding: 0; display: grid; }
.point-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed rgba(222, 186, 118, 0.14); font-size: 13.2px; }
.point-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.point-list li small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.point-list li b { color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-text[data-cmd] { cursor: pointer; }
#sanctuary-ui.phone .office-tabs button { font-size: 12px; padding: 8px 2px; }
#sanctuary-ui.phone .office-card { padding: 12px 12px 13px; }
button.profile-text { text-align: left; color: inherit; font: inherit; padding: 0; cursor: pointer; }
button.profile-text .profile-bar { display: block; }

/* The list of languages. */
.language-list { display: grid; gap: 8px; margin-top: 14px; }
.language-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-radius: 12px;
  border: 1px solid rgba(222, 186, 118, 0.24); background: rgba(255, 255, 255, 0.04); color: var(--text); font-size: 15.5px; cursor: pointer; text-align: left; }
.language-list button small { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.language-list button:hover { border-color: rgba(222, 186, 118, 0.55); }
.language-list button.selected { border-color: var(--gold); background: rgba(230, 198, 130, 0.16); color: #fff1cf; }
.language-list button.selected small { color: var(--gold); }

/* Other languages run longer than Korean: the labels under the action buttons may take two lines, and the profile's button keeps to its icon where room is short. */
#sanctuary-ui:not([data-language="ko"]) .action-bar .action-label { max-width: 100%; font-size: 11px; line-height: 1.15; white-space: normal; text-align: center; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#sanctuary-ui:not([data-language="ko"]).narrow .profile-look span, #sanctuary-ui:not([data-language="ko"]).phone .profile-look span { display: none; }
#sanctuary-ui:not([data-language="ko"]) .office-tabs button { font-size: 12px; line-height: 1.2; }
@media (max-width: 1180px) { #sanctuary-ui:not([data-language="ko"]) .profile-look span { display: none; } }

/* What only the operator's account sees stays out of the layout for everyone else. */
#sanctuary-ui [data-owner][hidden] { display: none !important; }

/* Titles, group by group: the group's name with how far the visitor has come, then its titles and what each takes. */
.title-group { padding: 9px 0 10px; border-bottom: 1px dashed rgba(222, 186, 118, 0.14); }
.title-group:first-of-type { padding-top: 2px; }
.title-group:last-of-type { border-bottom: 0; padding-bottom: 0; }
.title-group h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 7px; font: 600 12.8px var(--sans); color: var(--text); }
.title-group h4 small { font-size: 11.5px; color: var(--gold); font-variant-numeric: tabular-nums; }
.chip-row small { margin-left: 5px; font-size: 11px; opacity: 0.75; }

/* ---- first visit (welcome.mjs) ------------------------------------------------------------------- */
#sanctuary-ui > .welcome-layer { position: absolute; inset: 0; pointer-events: none !important; }
.welcome-layer > * { pointer-events: auto; }
/* While the view passes over the grounds, nothing of the interface shows; during the first quest only the way and what F does there. */
.welcome-intro > :not(.welcome-layer, .modal-backdrop, .fade-curtain),
.welcome-quest > :is(.hud-profile, .hud-map, .hud-top, .hud-practice, .practice-toggle, .connection-chip, .hud-chat, .chat-open, .quick-bar, .countdown, .dharma-caption) { visibility: hidden; opacity: 0; }
.welcome-quest .scene-guide.faded { opacity: 1; }
.welcome-quest .action-bar button { opacity: 0.38; }
.welcome-there .place-prompt { animation: prompt-in 0.25s ease-out, welcome-glow 1.6s ease-in-out 0.25s infinite; }
.welcome-reveal > :is(.hud-profile, .hud-map, .hud-top, .hud-practice, .practice-toggle, .hud-chat, .chat-open, .quick-bar) { animation: welcome-in 1.6s ease both; }
@keyframes welcome-glow { 50% { box-shadow: 0 0 0 3px rgba(22, 16, 12, 0.6), 0 0 34px rgba(255, 210, 130, 0.9); filter: brightness(1.15); } }
@keyframes welcome-beckon { 50% { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 0 3px rgba(22, 16, 12, 0.6), 0 0 30px rgba(255, 210, 130, 0.85); } }
@keyframes welcome-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes welcome-fade { from { opacity: 0; } }

.welcome-veil { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 58%, rgba(10, 8, 6, 0.25), rgba(10, 8, 6, 0.72) 75%); transition: opacity 1.2s ease; }
.welcome-veil.lifting { opacity: 0; pointer-events: none; }
/* For a return: the start screen darkens to black before the grounds open where the visitor last stood. */
.welcome-veil::after { content: ''; position: absolute; inset: 0; background: #0b0f0e; opacity: 0; transition: opacity 0.7s ease; pointer-events: none; }
.welcome-veil.closing::after { opacity: 1; }
.welcome-title { display: grid; justify-items: center; text-align: center; max-width: 420px; animation: welcome-in 2.4s ease both; }
.welcome-seal { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 12px; background: #8e2b22; color: #f6e3b8; font: 600 28px var(--serif); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.welcome-eyebrow { margin: 18px 0 0; font-size: 13px; letter-spacing: 0.2em; color: var(--gold-soft); text-shadow: 0 1px 6px #000; }
.welcome-title h1 { margin: 6px 0 10px; font: 700 clamp(44px, 9vw, 72px)/1.1 var(--serif); letter-spacing: 0.08em; color: #fbf3e2; text-shadow: 0 4px 28px rgba(0, 0, 0, 0.7); }
.welcome-line { margin: 0; font: 500 16px/1.75 var(--serif); color: var(--text); text-shadow: 0 1px 8px #000; }
.welcome-enter { width: auto; min-width: 220px; margin-top: 26px; padding: 14px 34px; font-size: 16px; transition: filter 0.6s, opacity 0.6s; }
.welcome-enter:disabled { cursor: progress; opacity: 0.72; filter: saturate(0.4); }
.welcome-sound { margin-top: 10px; font-size: 12px; color: var(--muted); text-shadow: 0 1px 4px #000; }
/* The languages, at the top of the start screen: each name written in itself, the one in use lit. */
.welcome-languages { position: absolute; top: max(var(--gap), env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: max-content; max-width: calc(100% - 2 * var(--gap)); animation: welcome-fade 1.2s ease both; }
.welcome-languages button { padding: 6px 13px; border-radius: 16px; border: 1px solid var(--line); background: rgba(16, 22, 20, 0.55); color: var(--text); font: 500 13px var(--sans); white-space: nowrap; backdrop-filter: blur(6px); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.welcome-language { display: none; position: absolute; top: max(var(--gap), env(safe-area-inset-top)); right: max(var(--gap), env(safe-area-inset-right)); height: 36px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); color: var(--gold); font: 600 12.5px var(--sans); box-shadow: var(--shadow); white-space: nowrap; animation: welcome-fade 0.9s ease both; }
.welcome-language::before { content: '🌐'; margin-right: 6px; font-size: 13px; }
.welcome-language:hover { border-color: var(--line-strong); }
.welcome-quest .welcome-language { display: block; }
/* A dialog opened during the quest (the languages, the notice board) comes in front of the quest's card. */
.welcome-quest > .modal-backdrop { z-index: 8; }
/* On a phone the first quest's card spans the top: the button keeps only its globe, and the card makes room for it. */
#sanctuary-ui.phone .welcome-language { top: calc(var(--st, 0px) + 10px); right: calc(var(--sr, 0px) + 8px); width: 40px; height: 40px; padding: 0; font-size: 0; border-radius: 50%; }
#sanctuary-ui.phone .welcome-language::before { margin: 0; font-size: 18px; }
#sanctuary-ui.phone:not(.landscape) .welcome-card:not(.welcome-done) { left: calc(var(--sl, 0px) + 8px); right: calc(var(--sr, 0px) + 56px); width: auto; transform: none; }
.welcome-languages button:hover { border-color: var(--line-strong); color: #fbf3e2; }
.welcome-languages button[aria-pressed="true"] { border-color: var(--gold); background: rgba(230, 198, 130, 0.2); color: var(--gold); font-weight: 600; }

.welcome-card { position: absolute; left: var(--gap); top: var(--gap); width: min(320px, calc(100vw - 2 * var(--gap))); padding: 16px 18px 12px; animation: welcome-fade 0.9s ease both; }
.welcome-step { margin: 0; font-size: 11px; letter-spacing: 0.2em; color: var(--gold-soft); }
.welcome-card h3 { margin: 4px 0 6px; font: 600 17px/1.4 var(--serif); color: #fbf3e2; word-break: keep-all; }
.welcome-question { margin: 10px 0; font: 600 16px/1.6 var(--serif); color: var(--gold); word-break: keep-all; }
.welcome-question::before { content: '“'; } .welcome-question::after { content: '”'; }
.welcome-hint { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text); word-break: keep-all; }
.welcome-buttons { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.welcome-buttons .text-button { margin: 0; }
.welcome-walk { padding: 9px 18px; border-radius: 20px; border: 1px solid var(--line-strong); color: var(--gold); font: 600 13.5px var(--sans); background: rgba(230, 198, 130, 0.08); }
.welcome-walk.active, .welcome-walk:hover { background: rgba(230, 198, 130, 0.2); }
.welcome-done { width: min(340px, calc(100vw - 2 * var(--gap))); top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 20px 20px 10px; text-align: center; }
.welcome-done h3 { font-size: 18.5px; }
.welcome-next { display: grid; gap: 8px; margin: 14px 0 4px; }
.welcome-next button { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 240, 210, 0.04); color: var(--text); font-size: 14px; text-align: left; }
.welcome-next button:hover { border-color: var(--line-strong); background: rgba(255, 240, 210, 0.1); }
.welcome-next b { font: 600 17px var(--serif); color: var(--gold); }
.welcome-next span { flex: 1; }
.welcome-next em { font-style: normal; color: var(--muted); }
.welcome-note { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.welcome-note .text-button { margin: 0; padding: 0 2px; font-size: 12px; color: var(--gold); }
#sanctuary-ui.phone .welcome-card:not(.welcome-done) { left: 50%; transform: translateX(-50%); top: calc(var(--st, 0px) + 10px); padding: 12px 14px 8px; }
#sanctuary-ui.phone .welcome-card h3 { font-size: 15.5px; }
#sanctuary-ui.phone .welcome-hint { font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .welcome-there .place-prompt { animation: none; } }
/* The practice that today's guide is leading to (today.mjs). */
.action-bar button.beckon .action-disc { animation: welcome-beckon 1.6s ease-in-out infinite; color: #fff1cc; border-color: #f6dca0; }
@media (prefers-reduced-motion: reduce) { .action-bar button.beckon .action-disc { animation: none; } }

/* ---- every language fits (English, Vietnamese and Thai run far longer than Korean) ----
   The header stays on one line: what it says about the next assembly gives way first (it is also in the practice panel),
   then the channel's name; each is cut with an ellipsis rather than pushed under the profile or onto a second row. */
.hud-top { flex-wrap: nowrap; max-width: calc(100vw - 390px); }
.hud-top > *, .header-right > * { flex: none; }
.header-right { min-width: 0; flex: 0 1 auto; }
.world-status { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.world-status .status-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-right > .channel-chip { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.channel-chip strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.login-button > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1366px) { #sanctuary-ui:not([data-language="ko"]) .world-status { display: none; } }
@media (max-width: 1180px) { .hud-top { max-width: calc(100vw - 320px); } }
@media (max-width: 900px) { .hud-top { max-width: calc(100vw - 190px); } }

/* The chat's tabs give way before the fold button does. */
.hud-chat .tabs [role="tab"] { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-chat .tabs .chat-collapse { flex: none; }
#sanctuary-ui:not([data-language="ko"]) .hud-chat .tabs [role="tab"] { padding-left: 10px; padding-right: 10px; font-size: 13px; }
.practice-body .task-value { white-space: nowrap; }
.practice-list .task-label { min-width: 0; overflow-wrap: break-word; }

/* Two-line labels under the practices make the row taller: what floats above it (the way, a count) moves up to match. */
#sanctuary-ui:not(.phone):not([data-language="ko"]) .hud-stack { bottom: 136px; }
@media (max-width: 900px) { #sanctuary-ui:not(.phone):not([data-language="ko"]) .hud-stack { bottom: 116px; } }
#sanctuary-ui.phone:not([data-language="ko"]):not(.landscape) .hud-stack,
#sanctuary-ui.phone:not([data-language="ko"]):not(.landscape) .chat-open { bottom: calc(var(--sb) + 172px); }
/* Upright phones: the way's chip may use the whole width between the chat button and the right edge. */
#sanctuary-ui.phone:not(.landscape) .hud-stack { left: calc(var(--sl) + 64px); right: calc(var(--sr) + 8px); transform: none; max-width: none; }
#sanctuary-ui.phone:not([data-language="ko"]):not(.landscape) .place-prompt { bottom: calc(var(--sb) + 262px); }
/* The way's chip never runs wider than the room it has: the place's name gives way. */
.hud-stack { grid-template-columns: minmax(0, 1fr); }
.nav-chip { max-width: 100%; }
.nav-chip [data-nav-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-chip button { flex: none; }
.place-prompt { max-width: calc(100vw - 32px); }
.place-prompt [data-prompt-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* keep-all keeps Korean words whole; Japanese and Chinese have no spaces between words, so there it would hold a whole
   clause on one line and push it out of its box. Words that visitors wrote may be in any language, so those may break anywhere when they must. */
#sanctuary-ui:is([data-language="ja"], [data-language="zh"]) :is(.dharma-caption p, .nahan-card p, .menu-status, .offering-text p, .welcome-card h3, .welcome-question, .welcome-hint) { word-break: normal; }
.journal-list p, .nahan-card p, .welcome-question { overflow-wrap: anywhere; }

/* The first visit on a phone held sideways (about 390px high): the name, the way in and the card after the first question must all stay on screen. */
#sanctuary-ui:not([data-language="ko"]) .welcome-title h1 { font-size: clamp(34px, 7vw, 60px); letter-spacing: 0.03em; }
.welcome-veil { overflow-y: auto; }
.welcome-done { max-height: calc(100% - 2 * var(--gap)); overflow-y: auto; overscroll-behavior: contain; }
#sanctuary-ui.landscape .welcome-title h1 { margin: 2px 0 6px; font-size: 34px; }
#sanctuary-ui.landscape .welcome-seal { width: 40px; height: 40px; font-size: 21px; }
#sanctuary-ui.landscape .welcome-eyebrow { margin-top: 10px; }
#sanctuary-ui.landscape .welcome-line { font-size: 14px; line-height: 1.6; }
#sanctuary-ui.landscape .welcome-enter { margin-top: 14px; padding: 11px 28px; }
#sanctuary-ui.landscape .welcome-done { width: min(440px, calc(100vw - 2 * var(--gap))); padding: 14px 18px 6px; }
#sanctuary-ui.landscape .welcome-done h3 { font-size: 16px; }
#sanctuary-ui.landscape .welcome-question { margin: 6px 0; }
/* Sideways, the languages sit in the top right corner beside the name instead of above it; upright and narrow, they wrap to two rows and the name moves down. */
#sanctuary-ui.landscape .welcome-languages { left: auto; right: max(var(--gap), env(safe-area-inset-right)); transform: none; display: grid; grid-template-columns: repeat(3, auto); gap: 5px; }
#sanctuary-ui.landscape .welcome-languages button { padding: 4px 10px; font-size: 12px; }
@media (max-width: 520px) { .welcome-veil { padding-top: 92px; } }
#sanctuary-ui.landscape .welcome-next { gap: 6px; margin: 10px 0 2px; }
#sanctuary-ui.landscape .welcome-next button { padding: 7px 12px; font-size: 13px; }

/* 대불 공양 (육법공양): how many of each offering are on the stand today. */
.gongyang-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 10px; }
.gongyang-counts span { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(222, 186, 118, 0.16); font-size: 13px; }
.gongyang-counts b { font-family: "Noto Serif KR", serif; color: #e6c682; font-size: 16px; }
.gongyang-counts em { font-style: normal; flex: 1; }

/* Why a payment did not go through */
#sanctuary-ui .pay-fail-reason { margin: 10px auto 2px; max-width: 30em; color: #f3e6c8; font-size: 15px; line-height: 1.55; text-align: center; }
#sanctuary-ui .pay-fail-code { margin: 0 0 8px; opacity: .45; font-size: 11px; letter-spacing: .04em; text-align: center; }
/* 내 기록: a paid tile or offering */
#sanctuary-ui .journal-list .journal-amount { display: inline-block; margin: 2px 8px 0 0; opacity: .6; font-size: 12px; }

/* The start screen's account line: who is coming in, or why to sign in (welcome.mjs gate). */
.welcome-account { max-width: 360px; margin: 12px auto 0; font-size: 13px; line-height: 1.6; color: var(--muted); text-shadow: 0 1px 6px #000; }
.welcome-account b { color: var(--text); font-weight: 600; margin-left: 6px; }
#sanctuary-ui.landscape .welcome-account { margin-top: 8px; font-size: 12px; }
