:root {
  --bg: #14122b; --bg2: #221d45; --card: #ffffff12; --line: #ffffff22;
  --text: #f4f1ff; --sub: #b9b3d9; --gold: #ffd54a; --accent: #8f7bff;
  font-family: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background: radial-gradient(120% 70% at 50% 0%, var(--bg2), var(--bg) 70%) fixed;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 480px; margin: 0 auto; padding: 16px 18px calc(32px + env(safe-area-inset-bottom)); }
h1 { font-size: 26px; margin: 18px 0 4px; letter-spacing: -.5px; }
.sub { color: var(--sub); margin: 0 0 20px; font-size: 14px; line-height: 1.5; }
a { color: inherit; }

/* 만들기 */
label.lbl { display: block; font-size: 14px; color: var(--sub); margin: 18px 0 8px; }
input.title {
  width: 100%; font-size: 17px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); outline: none;
}
input.title:focus { border-color: var(--accent); }
.count-hint { text-align: right; font-size: 12px; color: var(--sub); margin-top: 4px; }
.picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pick {
  border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 8px 6px 10px;
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.pick svg { width: 100%; height: 130px; display: block; }
.pick[aria-pressed="true"] { border-color: var(--gold); background: #ffd54a1a; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 16px; padding: 16px; font: inherit;
  font-size: 17px; font-weight: 700; cursor: pointer; color: #1b1640; background: var(--gold);
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.mt { margin-top: 22px; }

.mine { margin-top: 34px; }
.mine h2 { font-size: 16px; color: var(--sub); font-weight: 600; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px;
  background: var(--card); margin-bottom: 8px; text-decoration: none;
}
.item svg { width: 48px; height: 58px; flex: none; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .c { font-size: 13px; color: var(--sub); }

/* 기도 화면 */
.topbar {
  position: sticky; top: 0; z-index: 5; margin: -16px -18px 0; padding: 12px 18px 10px;
  background: #14122bd9; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.next { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.next b { color: var(--gold); font-size: 20px; }
.next .what { font-size: 12px; color: var(--sub); }
.bar { height: 6px; border-radius: 6px; background: #ffffff1a; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .25s; }
.home-link { font-size: 13px; color: var(--sub); text-decoration: none; display: inline-block; margin-top: 14px; }
.ptitle { font-size: 24px; text-align: center; margin: 12px 0 2px; word-break: keep-all; overflow-wrap: anywhere; }
.lvname { text-align: center; color: var(--sub); font-size: 14px; }
.stage { position: relative; height: min(56vh, 420px); margin: 6px 0; }
.stage svg { width: 100%; height: 100%; }
.stage.up svg { animation: up .9s ease; }
@keyframes up { 0% { filter: brightness(3) saturate(0); transform: scale(.94); } 100% { filter: none; transform: none; } }
.total { text-align: center; font-size: 15px; color: var(--sub); margin-bottom: 14px; }
.total b { color: var(--text); font-size: 20px; }
.praybtn { font-size: 20px; padding: 20px; touch-action: manipulation; user-select: none; transition: transform .06s; }
.praybtn:active { transform: scale(.97); }
.plus {
  position: absolute; left: 50%; bottom: 20%; pointer-events: none; color: var(--gold); font-weight: 800;
  font-size: 22px; animation: plus .9s ease-out forwards;
}
@keyframes plus { to { transform: translate(var(--dx), -120px); opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #000c; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 동상 애니메이션 */
.statue-svg .tw { animation: tw 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes tw { 0%, 100% { opacity: .2; scale: .6; } 50% { opacity: 1; scale: 1; } }
.statue-svg .float { animation: fl 3s ease-in-out infinite; }
@keyframes fl { 50% { transform: translateY(-6px); } }
.statue-svg .spin { animation: sp 40s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.statue-svg .pulse { animation: pu 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pu { 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .statue-svg * { animation: none !important; } }

/* 로고·버튼 아이콘 (이모티콘 대신 직접 그린 모양) */
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: radial-gradient(circle at 50% 38%, #fff6c8 0 18%, transparent 19%),
              linear-gradient(160deg, var(--gold), #c98a12); box-shadow: 0 0 18px #ffd54a55; }
.hands { display: inline-block; width: 14px; height: 18px; margin-right: 10px; vertical-align: -2px;
  background: #1b1640; clip-path: polygon(50% 0, 100% 100%, 50% 85%, 0 100%); }

/* 공유 창 */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: #0009; animation: fade .2s; }
.sheet-box { position: relative; width: 100%; max-width: 480px; background: #221d45; border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 10px; animation: rise .25s ease; }
.sheet-t { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.linkbox { font-size: 14px; color: var(--sub); background: #0003; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.btn.text { background: none; color: var(--sub); font-weight: 500; padding: 10px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* 다른 사람의 기도 */
.plus.other {
  color: #7ff0dc; font-size: 17px; white-space: nowrap; bottom: 32%;
  text-shadow: 0 0 12px #7ff0dc88; animation: plus-other 1.6s ease-out forwards;
  translate: -50% 0;
}
@keyframes plus-other { 0% { opacity: 0; transform: translateY(10px); } 15% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(var(--dx), -110px); } }
.bar i.glow { animation: barglow 1s ease; }
@keyframes barglow { 0% { box-shadow: 0 0 0 #7ff0dc; filter: hue-rotate(-60deg) brightness(1.4); } 100% { box-shadow: none; filter: none; } }
