/* 함께 기도 (PrayerWall) — mobile-first, 480px base, SlowAcorn 토큰셋 공용.
   가로 스크롤은 어떤 폭에서도 생기지 않는다: 텍스트를 담는 flex 자식은 전부
   min-width:0, 모든 줄은 wrap, body의 overflow-x는 마지막 안전장치일 뿐이다. */

:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel2: #1e222b;
  --line: #2a2f3a;
  --ink: #e7e9ee;
  --muted: #8b93a5;
  --accent: #e0a86a;      /* 따뜻한 쪽으로. 금융 도구들의 파랑과 구분한다 */
  --accent2: #59e0b8;
  --warn: #f0b354;
  --danger: #f2705f;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

img, svg, canvas, video { max-width: 100%; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px
           calc(env(safe-area-inset-bottom, 0px) + 48px);
}

/* -- 게이트웨이로 돌아가기 ------------------------------------------------ */
a.back {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink);
  text-decoration: none; font-size: 15px; font-weight: 600; margin-bottom: 20px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); transition: border-color .15s ease, transform .05s ease;
}
a.back:hover { border-color: var(--accent); transform: translateX(-2px); }

.appHeader { margin: 0 0 14px; }
.titleRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.titleText { min-width: 0; }
.appHeader h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.subTitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* -- 공유 ----------------------------------------------------------------- */
.shareBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 8px 13px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: border-color .15s ease, color .15s ease;
}
.shareBtn:hover { border-color: var(--accent); }
.shareBtn.copied { border-color: var(--accent2); color: var(--accent2); }
.shareBtn .shareIcon { font-size: 14px; line-height: 1; }

/* -- 말씀 -----------------------------------------------------------------
   자리를 많이 차지하면 정작 기도제목이 밀린다. 읽히되 작게. */
.scripture { margin: 0 0 12px; }
.scripture blockquote {
  margin: 0 0 8px;
  padding: 9px 12px;
  border-left: 2px solid var(--accent);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
}
.scripture p {
  margin: 0 0 5px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.scripture p[lang="en"] {
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 4px;
}
.scripture cite {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.scriptureCredit {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  opacity: .75;
}

/* -- 이 게시판의 성격 ------------------------------------------------------ */
.standing {
  margin: 10px 0 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
}
.standing p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.standing p + p { margin-top: 4px; }
.standing strong { color: var(--ink); }

/* -- 카드 ----------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

/* -- 입력 ----------------------------------------------------------------- */
/* 16px 밑으로 내려가면 iOS Safari가 포커스 때 화면을 확대해버린다. */
textarea, input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  resize: vertical;
}
textarea { min-height: 96px; }
textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
::placeholder { color: var(--muted); }

.writeMeta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}
.writeMeta input[type="text"] { flex: 1 1 140px; min-width: 0; }
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.count.over { color: var(--danger); }

.writeHint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.writeHint strong { color: var(--ink); }

.error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 14px;
}

/* -- 버튼 ----------------------------------------------------------------- */
button { font: inherit; cursor: pointer; }

.primary {
  background: var(--accent);
  color: #1a1206;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  padding: 11px 16px;
}
.primary:disabled { opacity: .4; cursor: not-allowed; }
.primary.huge { width: 100%; padding: 14px; font-size: 17px; }

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
}
.ghost:hover { color: var(--ink); border-color: var(--accent); }

/* -- 올린 뒤 안내 --------------------------------------------------------- */
.keyCard { border-color: var(--accent2); }
.keyCard h2 { margin: 0 0 8px; font-size: 18px; }
.keyCard p { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.keyCard .keyWarn { color: var(--muted); }

/* -- 정렬 ----------------------------------------------------------------- */
.sortRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sorts {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.sort {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sort[aria-pressed="true"] { background: var(--panel2); color: var(--ink); }

.stats {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
}

/* -- 목록 ----------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }

.item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
}

.itemHead {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.who { font-weight: 700; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.who.anon { color: var(--muted); font-weight: 600; }
.when { color: var(--muted); font-size: 13px; }
.badge {
  font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.mine { color: var(--accent); border-color: var(--accent); }

.body {
  margin: 0 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.itemActions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.prayBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 700;
  transition: border-color .15s ease, transform .05s ease;
}
.prayBtn:hover { border-color: var(--accent); }
.prayBtn:active { transform: scale(.94); }

/* 몇 번이고 누를 수 있으니 "눌렀음" 상태가 없다. 대신 누를 때마다 튕겨서
   눌렸다는 걸 알린다. */
.prayBtn.bump { animation: bump .25s ease; }
@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.14); border-color: var(--accent); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .prayBtn.bump { animation: none; }
}

.prayWarn {
  flex: 1 1 100%;
  color: var(--warn);
  font-size: 12.5px;
}
/* 기도손은 컬러 이모지다. filter나 color로 손대면 OS별로 결과가 갈라지니
   크기만 키우고 색은 건드리지 않는다. */
.prayBtn .hands { font-size: 17px; line-height: 1; }
.prayBtn .n {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 1.2em;
  text-align: left;
}

.linkBtn {
  background: none; border: none; padding: 4px 2px;
  color: var(--muted); font-size: 13px; text-decoration: underline;
}
.linkBtn:hover { color: var(--ink); }
.linkBtn.danger:hover { color: var(--danger); }
.spacer { flex: 1 1 auto; }

.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 8px; white-space: pre-line; }
.moreBtn { display: block; width: 100%; margin-top: 4px; }

/* 화면 끝을 감지하는 자리. 보이지 않지만 높이가 있어야 관찰이 걸린다. */
.sentinel { height: 1px; }
.loadingNote {
  margin: 0;
  padding: 14px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* -- 바닥글 --------------------------------------------------------------- */
.foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.foot p { margin: 0 0 8px; }

@media (min-width: 560px) {
  .appHeader h1 { font-size: 34px; }
}
