/* 한 가지 모습으로 고정한 게임 화면: 밤빛 석조 + 네이비 판 + 은빛 */
:root {
  color-scheme: dark;
  /* 밤 하늘 네이비 바탕에 은빛 선과 글자: 조용하고 성스러운 느낌 */
  --night: #0d1426;
  --night-2: #1a2440;
  --panel: #131b31;
  --panel-a: rgba(15, 22, 40, 0.94);
  --tile: #1b2541;
  --tile-hi: #233052;
  --line: rgba(196, 207, 224, 0.2);
  --frame: rgba(196, 207, 224, 0.28);
  --text: #e9edf4;
  --ink: #d5dce8;
  --muted: #97a3b8;
  --accent: #b9c4d4;
  --accent-l: #eef2f8;
  --silver: linear-gradient(180deg, #f3f6fa 0%, #c9d2df 100%);
  --blue: #a9bde4;
  --display: 'Cormorant Garamond', 'Times New Roman', serif;
  --ui: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 10px 30px rgba(3, 6, 16, 0.5);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font-family: var(--ui);
  -webkit-tap-highlight-color: transparent; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible { outline: 2px solid var(--accent-l); outline-offset: 3px; }

#hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s .6s; }
body.in #hud { opacity: 1; }
#hud > * { pointer-events: auto; }

/* 현판 */
#plaque { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translateX(-50%);
  padding: 9px 30px 10px; text-align: center; color: var(--text); white-space: nowrap;
  background: linear-gradient(180deg, rgba(13, 20, 38, .9), rgba(13, 20, 38, .76));
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%); }
#plaque::after { content: ""; position: absolute; inset: 4px 10px; border-top: 1px solid rgba(214, 223, 236, .4);
  border-bottom: 1px solid rgba(214, 223, 236, .4); pointer-events: none; }
.pl-name { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: .03em; }
.pl-meta { font-size: 12.5px; color: var(--accent-l); letter-spacing: .04em; }
.pl-meta #count { font-weight: 700; }

#bell { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 18px);
  display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 8px; font-size: 12.5px;
  color: var(--text); background: rgba(13, 20, 38, .62); }
#bell svg { width: 16px; height: 16px; fill: var(--accent-l); }
#bell b { color: var(--accent-l); font-weight: 700; }

#mystery { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 74px); transform: translateX(-50%);
  max-width: calc(100vw - 32px); text-align: center; font-family: var(--display); font-style: italic; font-size: 17px;
  color: #f2f5fa; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); opacity: 0; transition: opacity .4s; pointer-events: none; }
#mystery.show { opacity: 1; }
#mystery small { display: block; font-family: var(--ui); font-style: normal; font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-l); }

#hint { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 34px); transform: translateX(-50%);
  font-size: 13px; color: rgba(238, 242, 248, .9); text-shadow: 0 1px 6px rgba(0, 0, 0, .7); white-space: nowrap;
  transition: opacity .6s; pointer-events: none; }
#hint.hide { opacity: 0; }

/* 순례 가방 (왼쪽 아래) */
#satchel-wrap { position: absolute; left: max(18px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); }
#satchel { width: 56px; height: 56px; border-radius: 16px; background: var(--panel-a); color: var(--text);
  box-shadow: var(--shadow); display: grid; place-items: center; transform: rotate(-4deg); transition: transform .2s; }
#satchel:hover { transform: rotate(0); }
#satchel svg { width: 28px; height: 28px; fill: currentColor; }
#satchel-menu { position: absolute; left: 0; bottom: 66px; display: flex; flex-direction: column; gap: 6px; }
#satchel-menu button { text-align: left; white-space: nowrap; padding: 10px 16px; border-radius: 12px; font-size: 14.5px;
  background: var(--panel-a); color: var(--text); box-shadow: var(--shadow); animation: rise .25s both; }
#satchel-menu button:nth-child(2) { animation-delay: .04s; }
#satchel-menu button:nth-child(3) { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* 기도 인장 (오른쪽 아래) + 부채꼴 */
#pray-wrap { position: absolute; right: max(22px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  width: 78px; height: 78px; }
#pray { position: absolute; inset: 0; border-radius: 50%; color: var(--accent-l); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; font-family: var(--display); font-weight: 700; font-size: 15px;
  letter-spacing: .06em; background: radial-gradient(circle at 35% 30%, var(--night-2), var(--night) 70%);
  box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--accent), var(--shadow); transition: transform .2s; }
#pray svg { width: 28px; height: 28px; fill: currentColor; }
#pray:active { transform: scale(.94); }
#pray.busy::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1.5px solid var(--accent-l);
  opacity: .7; animation: halo 2.4s ease-out infinite; }
@keyframes halo { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.25); opacity: 0; } }
/* 기도 단추를 누르면 위로 펼쳐지는 목록(말이 길어져도 넘치지 않게 글자 단추로) */
#fan { position: absolute; right: 0; bottom: 92px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; pointer-events: none; }
#fan button { display: flex; align-items: center; gap: 9px; padding: 6px 15px 6px 7px; border-radius: 26px; background: var(--panel);
  color: var(--text); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 500; white-space: nowrap; opacity: 0;
  transform: translateY(10px) scale(.96); transition: transform .26s cubic-bezier(.2, .9, .3, 1.15), opacity .18s;
  transition-delay: calc((5 - var(--i)) * 22ms); }
#pray-wrap.open #fan { pointer-events: auto; }
#pray-wrap.open #fan button { opacity: 1; transform: none; }
#fan .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(196, 207, 224, .1); flex: none; }
#fan .ic svg { width: 21px; height: 21px; fill: currentColor; display: block; }
#fan em { font-style: normal; }
#fan button.main { background: var(--silver); color: var(--night); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), var(--shadow); }
#fan button.main .ic { background: rgba(13, 20, 38, .1); }
#fan button.on { background: var(--silver); color: var(--night); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), var(--shadow); }

/* 묵주 고리 */
@keyframes pop { 50% { filter: brightness(1.5); } }

#candle-cue { position: absolute; left: 0; top: 0; padding: 9px 14px 9px 30px; border-radius: 20px; font-size: 14px; font-weight: 500;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow); white-space: nowrap; }
#candle-cue::before { content: ""; position: absolute; left: 13px; top: 50%; width: 8px; height: 13px; margin-top: -8px;
  border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6c8, #f2a33a 70%); box-shadow: 0 0 10px #f2a33a; }

#toast { position: absolute; left: 50%; top: 24%; transform: translate(-50%, -8px); padding: 11px 18px; border-radius: 12px;
  background: rgba(13, 20, 38, .94); color: var(--text); font-size: 15px; opacity: 0; transition: .35s; pointer-events: none;
  max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#banner { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 16px calc(env(safe-area-inset-bottom, 0px) + 120px); text-align: center;
  font-family: var(--display); font-size: 21px; font-style: italic; color: #eef2f8;
  background: linear-gradient(rgba(10, 12, 20, 0), rgba(10, 12, 20, .65)); opacity: 0; transition: .8s; pointer-events: none; }
#banner.show { opacity: 1; }

/* 꾸미기 */
#wardrobe { position: fixed; top: 16px; right: 16px; bottom: 16px; width: 360px; background: var(--panel); border-radius: 6px;
  box-shadow: 0 10px 40px rgba(8, 10, 20, .45); padding: 20px 18px; display: flex; flex-direction: column; gap: 12px;
  transform: translateX(calc(100% + 30px)); transition: transform .45s cubic-bezier(.2, .8, .2, 1); z-index: 5; }
#wardrobe::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--frame); border-radius: 3px; pointer-events: none; }
#wardrobe.show { transform: none; }
body.dressing #pray-wrap, body.dressing #satchel-wrap, body.dressing #rosary, body.dressing #hint, body.dressing #candle-cue,
body.dressing #mystery, body.dressing #bell { opacity: 0; pointer-events: none; }
.w-head { display: flex; justify-content: space-between; align-items: flex-start; }
.w-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.w-namerow { display: flex; align-items: baseline; gap: 10px; }
.w-name { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--text); }
.link { font-size: 13px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.w-bap { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.w-bap select { flex: 1; min-width: 0; font: inherit; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--tile); color: var(--text); }
.w-bap select:focus { outline: 2px solid var(--accent-l); border-color: transparent; }
.w-tabs { display: flex; border-bottom: 1px solid var(--line); }
.w-tabs button { flex: 1; padding: 9px 2px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.w-tabs button.on { color: var(--text); border-color: var(--text); font-weight: 700; }
.w-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow-y: auto; padding: 2px; }
.w-card { min-height: 86px; padding: 10px 6px; border-radius: 6px; background: var(--tile); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; text-align: center; }
.w-card.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.w-card.locked { opacity: .5; background: var(--night); }
.w-card small { font-size: 11px; color: var(--muted); }
.w-sec { grid-column: 1 / -1; margin: 8px 2px 0; font: 600 12px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.w-sec:first-child { margin-top: 0; }
.w-card.w-chip { min-height: 52px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .08); }

/* 모달 */
.modal { position: fixed; inset: 0; background: rgba(10, 12, 20, .55); display: grid; place-items: center; opacity: 0;
  pointer-events: none; transition: .3s; z-index: 6; padding: 16px; }
.modal.show { opacity: 1; pointer-events: auto; }
.sheet { position: relative; width: min(520px, 100%); background: var(--panel); border-radius: 6px; padding: 28px 24px 24px; box-shadow: var(--shadow); }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 600; color: var(--text); font-size: 30px; text-align: center; }
.p-sub { margin: 4px 0 18px; text-align: center; color: var(--muted); font-size: 14px; }
.m-close { position: absolute; right: 12px; top: 12px; }
.x { width: 32px; height: 32px; border-radius: 50%; font-size: 21px; line-height: 1; color: var(--muted); flex: none; }
.x:hover { background: rgba(0, 0, 0, .06); }
.stamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(196, 207, 224, .35); display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 2px; color: var(--muted); font-size: 13px; padding: 8px; }
.stamp b { font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1.1; }
.stamp small { font-size: 11px; }
.stamp.got { border: 3px double var(--blue); color: var(--blue); transform: rotate(-6deg); background: rgba(169, 189, 228, .06); }
.sites { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.site { text-align: left; padding: 14px; border-radius: 6px; background: var(--tile); display: flex; flex-direction: column; gap: 2px; }
.site b { font-family: var(--display); color: var(--text); font-size: 19px; font-weight: 600; }
.site small { color: var(--muted); font-size: 12.5px; }
.site em { font-style: normal; font-size: 11.5px; margin-top: 6px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.site.open { background: var(--tile-hi); box-shadow: inset 0 0 0 1px var(--accent); }
.site.open b, .site.open small { color: var(--text); }
.site.open em { color: var(--accent-l); }
.site:disabled { cursor: default; }

/* 첫 화면 */
#intro { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 10;
  background: radial-gradient(ellipse at 50% 40%, rgba(20, 24, 38, .2), rgba(14, 16, 26, .85)); transition: opacity 1s; }
#intro.hide { opacity: 0; pointer-events: none; }
.intro-box { text-align: center; color: var(--text); max-width: 460px; }
.intro-kicker { font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-l); }
.intro-box h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 7vw, 50px); line-height: 1.1; margin: 14px 0;
  text-wrap: balance; }
.intro-box p { font-size: 16px; line-height: 1.6; color: rgba(233, 237, 244, .85); margin: 0 0 26px; }
#enter { background: var(--silver); color: var(--night); font-family: var(--display); font-weight: 700; font-size: 20px; padding: 13px 32px;
  border-radius: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6), 0 0 0 5px rgba(196, 207, 224, .18), 0 8px 30px rgba(0, 0, 0, .35); }
#enter:hover { background: #fff; }
.intro-box small { display: block; margin-top: 16px; font-size: 12.5px; color: rgba(233, 237, 244, .6); }
/* 순례 엽서: 성당마다 우리 3D 장면 사진, 지금 기도하는 사람 수, 다녀온 도장 */
#intro { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.intro-box { max-width: min(980px, 100%); width: 100%; min-width: 0; justify-self: center; }
.intro-box h1, .intro-box p { max-width: 520px; margin-left: auto; margin-right: auto; }
#cards { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px max(16px, calc(50% - 470px)) 18px; margin: 0 -16px 18px;
  scrollbar-width: none; touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
#cards::-webkit-scrollbar { display: none; }
.card { flex: none; width: 152px; aspect-ratio: 3 / 4; border-radius: 10px; position: relative; overflow: hidden; scroll-snap-align: center; text-align: left;
  background: #141a2c; box-shadow: 0 0 0 1px rgba(214, 222, 236, .22), 0 10px 26px rgba(0, 0, 0, .45); transition: transform .25s, box-shadow .25s; }
.card .c-img { position: absolute; inset: 0; background: var(--img) center / cover no-repeat; transition: transform .6s; }
.card:not(.soon):hover .c-img { transform: scale(1.05); }
.card .c-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 13, 24, 0) 45%, rgba(10, 13, 24, .88)); }
.card .c-txt { position: absolute; left: 11px; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
.card b { font: 600 17px/1.12 var(--display); color: #f1f4f9; text-wrap: balance; }
.card small { font-size: 11.5px; color: rgba(225, 231, 242, .7); }
.card.here { transform: translateY(-6px); box-shadow: 0 0 0 2px #dfe5ef, 0 0 0 6px rgba(196, 207, 224, .2), 0 16px 34px rgba(0, 0, 0, .55); }
.card.soon { background: repeating-linear-gradient(135deg, #151b2d 0 10px, #121727 10px 20px); cursor: default; }
.card.soon b { color: rgba(225, 231, 242, .6); }
.c-live { position: absolute; top: 9px; left: 9px; font-size: 11px; padding: 3px 8px 3px 7px; border-radius: 999px; background: rgba(10, 13, 24, .6);
  color: rgba(225, 231, 242, .8); display: flex; align-items: center; gap: 5px; }
.c-live.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9fe0b0; box-shadow: 0 0 6px #9fe0b0; }
.c-stamp { position: absolute; top: 8px; right: 8px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transform: rotate(-12deg);
  font: 700 9.5px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: #e7ecf4; border: 1.5px solid rgba(231, 236, 244, .75);
  box-shadow: inset 0 0 0 3px rgba(10, 13, 24, .35), inset 0 0 0 4px rgba(231, 236, 244, .4); background: rgba(10, 13, 24, .35); }
@media (min-width: 700px) { .card { width: 176px; } }
@media (max-height: 700px) { .intro-box p { display: none; } .intro-box h1 { margin: 8px 0 12px; } }
.site.here { box-shadow: inset 0 0 0 2px var(--accent-l); }
.site.open:not(.here) { cursor: pointer; }

@media (max-width: 640px) {
  #plaque { padding: 7px 24px 8px; }
  .pl-name { font-size: 18px; }
  #bell { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 88px); left: max(18px, env(safe-area-inset-left, 0px)); right: auto; }
  #mystery { top: calc(env(safe-area-inset-top, 0px) + 64px); font-size: 15px; }
  #hint { display: none; }
    #wardrobe { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 56vh; border-radius: 10px 10px 0 0;
    transform: translateY(105%); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
  #wardrobe.show { transform: none; }
  .stamps { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, transparent 55%, rgba(10, 12, 22, .5) 100%); }

/* 사진 담기 단추 (오른쪽 위) */
#snap { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 58px);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(13, 20, 38, .62); }
#snap svg { width: 20px; height: 20px; fill: var(--text); }
body.dressing #snap { opacity: 0; pointer-events: none; }
/* 다른 어린양을 누르면 뜨는 작은 단추들 */
#who { position: absolute; left: 0; top: 0; display: flex; gap: 6px; animation: rise .25s both; }
#who button { padding: 9px 13px; border-radius: 20px; font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
#who button.main { background: var(--silver); color: var(--night); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), var(--shadow); }
#who button[hidden] { display: none; }
/* 함께 기도하자는 부탁 */
#ask { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 96px); transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--panel-a);
  box-shadow: var(--shadow); animation: rise .3s both; width: max-content; max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center; }
#ask .a-text { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--text); }
#ask .primary { padding: 7px 16px; font-size: 15px; }
#ask[hidden], #together[hidden] { display: none; }
/* 함께 기도 카드(묵주 카드와 같은 자리) */
#together { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px)); display: flex; padding: 14px 16px; background: var(--panel-a); border-radius: 10px;
  box-shadow: var(--shadow); animation: rise .3s both; z-index: 3; }
#together::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--frame); border-radius: 7px; pointer-events: none; }
#together .r-prayer { max-height: 7.4em; }
#t-amen { align-self: flex-start; font-size: 16px; padding: 9px 20px; margin-top: auto; }
#t-amen:disabled { opacity: .7; }
#t-close { position: absolute; right: 8px; top: 8px; }
#satchel-menu button:nth-child(4) { animation-delay: .12s; }

/* 선물 카드 */
.gift-card { width: min(380px, 100%); text-align: center; padding: 30px 24px 20px; }
.gift-card::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--frame); border-radius: 3px; pointer-events: none; }
#gift.show .gift-card { animation: giftIn .5s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes giftIn { from { transform: scale(.86) translateY(12px); opacity: 0; } }
.g-kick { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.gift-card h2 { margin: 8px 0 6px; font-size: 32px; }
.g-why { margin: 0 0 18px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.g-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.primary { background: var(--silver); color: var(--night); font-family: var(--display); font-weight: 700; font-size: 18px;
  padding: 11px 28px; border-radius: 4px; min-width: 200px; }
.primary.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.g-count { display: block; margin-top: 14px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }

/* 여권 속 선물 목록 */
.k-title { margin: 22px 0 10px; text-align: center; font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--text); }
.keeps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 34vh; overflow-y: auto; }
.keep { padding: 7px 6px; border-radius: 5px; border: 1px dashed rgba(196, 207, 224, .3); text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.keep b { font-size: 13px; font-weight: 700; }
.keep small { font-size: 10.5px; }
.keep.got { border: 1px solid var(--accent); background: rgba(196, 207, 224, .1); color: var(--text); }
.keep.got small { color: var(--accent); }
#passport .sheet { max-height: calc(100vh - 32px); overflow-y: auto; }

/* 사진 미리보기 */
.snap-card { width: min(560px, 100%); text-align: center; }
.snap-card img { display: block; width: 100%; margin: 14px 0 16px; border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }
@media (max-width: 640px) {
  #snap { top: calc(env(safe-area-inset-top, 0px) + 18px); }
  .keeps { grid-template-columns: repeat(2, 1fr); }
}

/* 초 지향 고르기 */
.intent-card { width: min(400px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.intent-card h2 { font-size: 28px; }
.intents { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.intents button { padding: 14px 10px; border-radius: 6px; background: var(--tile); border: 1px solid var(--line); font-family: var(--display);
  font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.2; }
.intents button:hover, .intents button:focus-visible { border-color: var(--accent); background: var(--tile); }

/* 묵주기도 카드 */
#rosary { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%);
  width: min(600px, calc(100vw - 32px)); display: flex; gap: 14px; align-items: stretch; padding: 14px 16px 14px 10px;
  background: var(--panel-a); border-radius: 10px; box-shadow: var(--shadow); animation: rise .3s both; z-index: 3; }
#rosary::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--frame); border-radius: 7px; pointer-events: none; }
#rosary-svg { width: 150px; flex: none; cursor: pointer; overflow: visible; }
.r-chain { fill: none; stroke: #8f9bb0; stroke-width: 1; opacity: .8; }
.bead { fill: url(#gWood); transition: fill .3s; transform-box: fill-box; transform-origin: center; }
.bead.done { fill: url(#gLit); }
.bead.now { fill: url(#gLit); filter: url(#fGlow); animation: beadPulse 1.6s ease-in-out infinite; }
.medal.now, .cross.now { animation: beadPulse 1.6s ease-in-out infinite; filter: url(#fGlow); }
.bead.pop { animation: beadPop .35s; }
.r-m { font: 700 9px var(--display); fill: #1a2440; }
@keyframes beadPulse { 50% { transform: scale(1.35); } }
@keyframes beadPop { 40% { transform: scale(1.7); } }
.r-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 22px; }
.r-step { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.r-name { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.15; }
.r-name small { font-family: var(--ui); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.r-prayer { margin: 2px 0 6px; font-family: var(--display); font-style: italic; font-size: 16px; line-height: 1.45; color: var(--ink);
  max-height: 6.2em; overflow-y: auto; }
#r-next { align-self: flex-start; min-width: 0; font-size: 16px; padding: 9px 20px; margin-top: auto; }
#r-close { position: absolute; right: 8px; top: 8px; }
body.praying #pray-wrap, body.praying #satchel-wrap, body.praying #hint { opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
  #rosary { gap: 8px; padding: 12px 12px 12px 6px; }
  #rosary-svg { width: 96px; }
  .r-name { font-size: 19px; }
  .r-prayer { font-size: 14.5px; max-height: 5.8em; }
}

/* 함께 있다는 소식 */
#feed { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 84px);
  margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-width: min(320px, calc(100vw - 32px));
  pointer-events: none; }
#feed li { font-family: var(--display); font-style: italic; font-size: 15px; color: #eef2f8; text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
  padding-left: 14px; position: relative; animation: rise .35s both; transition: opacity 1s; }
#feed li::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--accent-l); box-shadow: 0 0 8px var(--accent); }
#feed li.out { opacity: 0; }
body.dressing #feed { opacity: 0; }
@media (max-width: 640px) { #feed { top: calc(env(safe-area-inset-top, 0px) + 70px); } #feed li { font-size: 13.5px; } }

/* 소리 단추 · 크레딧 */
#sound { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 106px);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(13, 20, 38, .62); color: var(--text); }
#sound svg { width: 20px; height: 20px; }
#sound .spk { fill: var(--text); }
#sound .mute { display: none; }
#sound.off .wave { display: none; }
#sound.off .mute { display: block; }
body.dressing #sound { opacity: 0; pointer-events: none; }
#satchel-menu button:nth-child(5) { animation-delay: .16s; }
.about-card { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.about-card h3 { margin: 14px 0 6px; font-family: var(--display); font-size: 19px; color: var(--text); }
.about-card ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.about-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { #sound { top: calc(env(safe-area-inset-top, 0px) + 66px); } }

/* 아직 안 들어간 기도 모임 위 단추 */
#circle-cue { position: absolute; left: 0; top: 0; padding: 9px 15px; border-radius: 20px; font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--silver); color: var(--night); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), var(--shadow); animation: rise .25s both; }
#circle-cue[hidden] { display: none; }
.t-row { display: flex; align-items: center; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.t-row #t-amen { margin-top: 0; }
.t-who { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
body.dressing #circle-cue, body.praying #circle-cue { opacity: 0; pointer-events: none; }
/* 말 고르기 */
.lang-card { width: min(420px, 100%); }
.langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 14px 0 10px; }
.langs .lang { padding: 11px 14px; border-radius: 10px; text-align: left; font-size: 15.5px; background: var(--tile); border: 1px solid var(--line); color: var(--text); }
.langs .lang.on { background: var(--silver); color: var(--night); border-color: transparent; }
#intro-lang { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); right: 16px; z-index: 2; font: 500 14px var(--ui);
  padding: 8px 12px; border-radius: 20px; border: 1px solid rgba(214, 223, 236, .45); background: rgba(13, 20, 38, .6); color: #eef2f8; }
#intro-lang option { color: #0d1426; }

/* 가까이 가면 뜨는 자리 단추(성수·무릎 절·조배·십자가의 길·고해소·요셉·지향 책) */
#place-cue { position: absolute; left: 0; top: 0; display: flex; gap: 6px; animation: rise .25s both; }
#place-cue[hidden] { display: none; }
#place-cue button { padding: 9px 14px; border-radius: 20px; font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
#place-cue button.main { background: var(--silver); color: var(--night); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), var(--shadow); }
body.praying #place-cue, body.dressing #place-cue { opacity: 0; pointer-events: none; }

/* 기도 카드(성체조배·십자가의 길·성 요셉) */
#pcard { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px)); display: flex; padding: 14px 16px; background: var(--panel-a); border-radius: 10px;
  box-shadow: var(--shadow); animation: rise .3s both; z-index: 3; }
#pcard[hidden] { display: none; }
#pcard::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--frame); border-radius: 7px; pointer-events: none; }
#pcard .r-prayer { white-space: pre-line; max-height: 8.6em; }
#p-main { font-size: 16px; padding: 9px 20px; }
#p-close { position: absolute; right: 8px; top: 8px; }
.p-info { flex: 1; font-size: 13px; color: var(--muted); }

/* 지향 책 */
.book-card { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.book-card h3 { margin: 16px 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kinds button { padding: 8px 12px; border-radius: 18px; font-size: 14px; background: var(--tile); border: 1px solid var(--line); color: var(--text); }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.entries li { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: 8px; background: var(--tile); border: 1px solid var(--line); }
.entries li span { flex: 1; font-family: var(--display); font-size: 16px; color: var(--text); line-height: 1.25; }
.entries li small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.entries li button { padding: 6px 11px; border-radius: 16px; font-size: 13px; background: var(--silver); color: var(--night); white-space: nowrap; }
.entries li button.done { background: transparent; color: var(--muted); }
.entries li.empty { color: var(--muted); font-size: 14px; justify-content: center; }

/* 고해소: 화면 전체를 어둡게 덮는 조용한 방 */
#confess { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 38%, #1c2744 0%, #070b16 75%); color: #eef2f8; }
#confess[hidden] { display: none; }
.cf-box { width: min(520px, 100%); text-align: center; display: flex; flex-direction: column; align-items: stretch; }
.cf-step { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.cf-step[hidden] { display: none; }
.cf-step h2 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 600; }
.cf-step p { margin: 0; font-size: 16px; line-height: 1.55; color: #cfd7e4; }
.cf-step .g-kick { color: var(--accent); }
.cf-note { font-size: 13.5px !important; color: #8f9bb0 !important; }
.cf-q { font-family: var(--display); font-style: italic; font-size: 21px !important; color: #f2f5fa !important; min-height: 3em; }
.cf-mode { display: flex; gap: 4px; padding: 3px; border-radius: 20px; background: rgba(255, 255, 255, .07); }
.cf-mode button { padding: 7px 16px; border-radius: 17px; color: #b9c4d4; font-size: 14px; }
.cf-mode button.on { background: rgba(255, 255, 255, .14); color: #fff; }
#cf-text { width: 100%; box-sizing: border-box; padding: 14px; border-radius: 10px; border: 1px solid rgba(196, 207, 224, .25);
  background: rgba(0, 0, 0, .3); color: #f2f5fa; font: 16px/1.5 var(--ui); resize: none; }
#cf-text[hidden] { display: none; }
.cf-speak { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0; }
.cf-speak[hidden] { display: none; }
.cf-orb { width: 74px; height: 74px; border-radius: 50%; transition: transform .08s;
  background: radial-gradient(circle at 40% 35%, #ffffff, #c9d6ea 45%, rgba(201, 214, 234, 0) 72%); }
.cf-hint { font-size: 13.5px !important; color: #8f9bb0 !important; }
.cf-prayer { font-family: var(--display); font-style: italic; font-size: 19px !important; color: #f2f5fa !important; }
.cf-find { text-decoration: none; display: inline-block; }
#confess .link { color: #b9c4d4; }
.cf-box.burn #cf-text, .cf-box.burn .cf-step[data-step="2"] { animation: cfBurn 1.6s ease-out; }
@keyframes cfBurn { 0% { filter: blur(6px) brightness(2); opacity: .2; } 100% { filter: none; opacity: 1; } }
body.confessing #hud { visibility: hidden; }
#confess { transition: opacity .8s; }
#confess.away { opacity: 0; pointer-events: none; }
#confess[data-mode="mary"] .cf-q, #confess[data-mode="mary"] .cf-nextq, #confess[data-mode="mary"] .cf-note, #confess[data-mode="mary"] [data-step="1"] .g-kick { display: none; }

.w-tabs { flex-wrap: wrap; }
.w-tabs button { flex: 1 0 18%; }

/* 조작 설정 */
.set-card { max-width: 420px; }
.set-card .opts { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.opt input[type=range] { width: 46%; accent-color: #c9d2e0; }
.switch { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .14); position: relative; flex: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(214, 222, 236, .3); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #dfe5ef; transition: transform .2s; }
.switch:checked { background: #8fa0bd; }
.switch:checked::after { transform: translateX(20px); }
/* 화면 조이스틱: 왼쪽 아래, 순례 가방 위 */
#stick { position: fixed; left: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); width: 124px; height: 124px; border-radius: 50%; z-index: 4;
  background: radial-gradient(circle, rgba(16, 22, 40, .25), rgba(16, 22, 40, .55)); box-shadow: inset 0 0 0 1.5px rgba(214, 222, 236, .35); touch-action: none; }
#stick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: var(--silver); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); transition: transform .08s; pointer-events: none; }
body.dressing #stick { display: none; }

/* 내 양 옮기기 */
.tr-card { max-width: 440px; }
.tr-card h3 { margin: 16px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tr-code { font: 700 34px/1.2 var(--display); letter-spacing: .12em; text-align: center; padding: 14px; border-radius: 8px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(214, 222, 236, .3); margin-bottom: 10px; }
.tr-code.empty { font: 500 15px var(--ui); letter-spacing: 0; color: var(--muted); }
.tr-load { display: flex; gap: 8px; }
.tr-load input { flex: 1; min-width: 0; font: 600 20px var(--display); letter-spacing: .12em; text-transform: uppercase; padding: 10px 12px; border-radius: 6px;
  border: 1px solid rgba(214, 222, 236, .35); background: rgba(255, 255, 255, .05); color: var(--text); }
.tr-msg { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--accent-l); }
