:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --card-bg: #ffffff;
  --text: #1e2b2c;
  --text-soft: #6f7f7e;
  --border: #e2ebe9;
  --well: #14707a;
  --well-deep: #0e3d44;
  --well-light: #6bc6c9;
  --gold: #c9932f;
  --radius: 18px;
  --max: 720px;
  --font-hand: "Pretendard", -apple-system, sans-serif;
  --font-trendy: "Pretendard", -apple-system, sans-serif;
}

/* 컴퓨터처럼 화면이 넓을 때는 가운데 좁은 폭만 쓰지 않고 좌우로 조금 더 넓게 써서
   답답해 보이지 않게 한다. 본문 글줄은 너무 길어지면 오히려 읽기 불편해지므로
   과하지 않게 두 단계로만 늘린다(관리자 페이지의 가로 컬럼 목록도 이만큼은 더 넓어야
   화면 하나에 더 많이 보인다). */
@media (min-width: 900px) {
  :root { --max: 880px; }
}
@media (min-width: 1200px) {
  :root { --max: 1080px; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(640px circle at 6% -8%, rgba(107, 198, 201, 0.16), transparent 60%),
    radial-gradient(720px circle at 96% 6%, rgba(201, 147, 47, 0.11), transparent 55%),
    radial-gradient(820px circle at 50% 100%, rgba(20, 112, 122, 0.09), transparent 60%),
    url("bg-pattern.png");
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, 800px 800px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  background-attachment: scroll, scroll, scroll, fixed;
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 60px;
}

header.site {
  padding: 20px 20px 8px;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.site .logo {
  font-family: var(--font-trendy);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: var(--well-deep);
}

header.site nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

header.site nav a {
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
}

header.site nav a.active,
header.site nav a:hover {
  color: var(--well);
}

.event-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, var(--gold) 0%, #dba949 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 16px;
}

.event-banner + .event-banner { margin-top: 10px; }

.event-banner-title {
  font-weight: 800;
  font-size: 14.5px;
}

.event-banner-desc {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
}

.event-banner-arrow {
  flex: none;
  font-weight: 800;
  font-size: 16px;
}

/* 초대 코드로 오이코스에 막 참여했을 때 잠깐 보여주는 성공 효과 */
.joined-flash {
  background: linear-gradient(90deg, var(--well) 0%, var(--well-light) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  animation: joined-flash-in 0.4s ease-out, joined-flash-out 0.5s ease-in 2.6s forwards;
}

@keyframes joined-flash-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes joined-flash-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.hero {
  text-align: center;
  padding: 40px 20px 34px;
  background-image: url(hero-bg.jpg);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  margin: 4px 0 16px;
}

.hero .badge {
  display: inline-block;
  font-size: 12px;
  color: var(--well);
  background: rgba(42, 111, 119, 0.09);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-hand);
  font-size: 27px;
  line-height: 1.5;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  color: var(--well-deep);
  font-weight: 700;
}

.hero p {
  color: var(--text-soft);
  font-size: 14.5px;
  margin: 0;
}

.nav-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0;
}

.nav-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 61, 68, 0.1);
}

.nav-card .icon { font-size: 22px; }
.nav-card .icon img { width: 30px; height: 30px; display: block; object-fit: contain; }
.nav-card .title { font-weight: 700; font-size: 14.5px; }
.nav-card .desc { font-size: 12.5px; color: var(--text-soft); }

.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.5;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
}

/* 관리자 페이지처럼 카드가 여러 개 쌓이는 화면에서, 처음엔 제목만 보이고 눌러야 펼쳐지게
   하는 아코디언. 제목(h3)을 눌러서 열고 닫는다 — 스크롤이 한없이 길어지는 것을 막아준다. */
.accordion-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}
.accordion-toggle .accordion-chevron {
  flex: none;
  color: var(--text-soft);
  font-size: 13px;
  transition: transform 0.15s ease;
}
.accordion-toggle.open .accordion-chevron { transform: rotate(90deg); }
.accordion-body { margin-top: 16px; }

/* 넓은 화면(컴퓨터)에서는 두 카드를 나란히, 좁은 화면(모바일)에서는 그대로 위아래로 쌓는다 */
.side-by-side { display: flex; flex-direction: column; gap: 16px; }
.side-by-side > .card { margin-bottom: 0; }

@media (min-width: 900px) {
  .side-by-side { flex-direction: row; align-items: flex-start; }
  .side-by-side > .card:first-child { flex: 2; min-width: 0; }
  .side-by-side > .card:last-child { flex: 1; min-width: 280px; }
}

.verse-card {
  --verse-bg-image: none;
  background-color: var(--well);
  background-image:
    linear-gradient(180deg, rgba(6, 20, 23, 0.55) 0%, rgba(6, 20, 23, 0.22) 30%, rgba(6, 20, 23, 0.28) 70%, rgba(6, 20, 23, 0.6) 100%),
    var(--verse-bg-image),
    linear-gradient(180deg, var(--well-light) 0%, var(--well) 45%, var(--well-deep) 100%);
  background-size: cover;
  background-position: top center;
  color: #fff;
  border-radius: 20px;
  padding: 34px 26px;
  margin: 18px auto;
  /* 배경 사진들이 세로로 긴 폰 배경화면용(1080x2340)이라, 카드가 데스크탑처럼 가로로
     넓고 낮아지면 cover 처리 시 이미지 중 극히 일부(주로 밋밋한 구간)만 확대돼 보여서
     거의 새까맣게 보이는 문제가 있었다. 카드 자체 너비를 제한해 세로 긴 이미지와
     비율 차이를 줄이고, 읽기에도 더 편한 줄 길이가 되게 한다. */
  max-width: 560px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(14, 61, 68, 0.2);
}

.verse-card .ref {
  font-size: 12.5px;
  opacity: 0.8;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.verse-card-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.verse-card .text {
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 700;
  margin: 0 0 14px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.verse-card .note {
  font-size: 12.5px;
  opacity: 0.8;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 큐티 스타일: 말씀(위 .text) 아래로 설명/적용/이달의 키워드를 좌측 정렬 블록으로 이어붙인다 */
.verse-card .qt-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  text-align: left;
}

.verse-card .qt-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.85;
  margin-bottom: 5px;
}

.verse-card .qt-body {
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.95;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.verse-card-toggle {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.verse-card-more[hidden] {
  display: none;
}

.well-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 30px 24px;
  margin: 18px 0;
  box-shadow: 0 10px 26px rgba(14, 61, 68, 0.08);
}

.well-card .well-ref {
  text-align: center;
  font-size: 13px;
  color: var(--well);
  font-weight: 700;
  margin-bottom: 14px;
}

.well-card .well-verse-text {
  font-family: var(--font-hand);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
  color: var(--text);
  margin: 0 0 20px;
}

.well-card .well-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.well-card .well-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--well);
  margin-bottom: 10px;
}

.well-card .well-meditation {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  margin: 0 0 20px;
}

.well-card .well-prayer-box {
  background: rgba(20, 112, 122, 0.08);
  border-radius: 16px;
  padding: 20px 18px;
}

.well-card .well-prayer-box .well-label {
  color: var(--well-deep);
}

.well-card .well-prayer-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  margin: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 4px;
}

.tabs button {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--text-soft);
  cursor: pointer;
}

.tabs button.active {
  background: var(--well);
  color: #fff;
  border-color: var(--well);
}

textarea, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14.5px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--well);
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover { background: var(--well-deep); }

.btn.ghost {
  background: transparent;
  color: var(--well);
  border: 1px solid var(--well);
}

.btn.block { display: block; width: 100%; }

.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.msg {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 8px;
  min-height: 18px;
}

.mbti-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.mbti-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  text-align: center;
}

.mbti-item .code {
  font-weight: 800;
  color: var(--well);
  font-size: 15px;
}

.mbti-item .figure {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 2px;
}

.mbti-detail {
  display: none;
  margin-top: 16px;
}

.mbti-detail.open { display: block; }

.mbti-detail h3 {
  margin: 0 0 4px;
  color: var(--well-deep);
}

.mbti-detail .sub {
  font-size: 13px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}

.wall-preview {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 22px auto;
  border-radius: 26px;
  box-shadow: 0 16px 34px rgba(124, 60, 28, 0.22);
}

/* 목록을 세로로 쭉 이어붙이는 대신, 항목별로 옆으로 나란히 넘겨볼 수 있게 하는 가로 컬럼
   레이아웃 (모바일에서는 좌우로 스와이프). 관리자 페이지의 회원/기록/오이코스 목록과
   홈 화면의 "실시간 나눔"(하루인사/감사노트/기도제목)에서 함께 쓴다. */
.scroll-columns {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 14px -20px 0;
  padding: 0 20px 6px;
  -webkit-overflow-scrolling: touch;
}

.scroll-column {
  flex: 0 0 78%;
  max-width: 320px;
  background: rgba(20, 112, 122, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 14px 10px;
}

.scroll-column .scroll-column-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--well-deep);
  padding: 10px 0 8px;
  position: sticky;
  top: 0;
  background: inherit;
}

.scroll-column .note-item:first-of-type { padding-top: 4px; }

.member-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.member-pager button {
  padding: 5px 12px;
  font-size: 12.5px;
}
.member-pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.note-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.note-item:last-child { border-bottom: none; }

.note-item .meta {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.note-item .content {
  font-size: 14px;
  white-space: pre-wrap;
}

.member-detail {
  margin-top: 10px;
  padding: 4px 12px 6px;
  background: rgba(20, 112, 122, 0.05);
  border-radius: 12px;
}

.member-detail .note-item { padding: 10px 0; }

.streak {
  text-align: center;
  padding: 20px;
}

.streak .num {
  font-family: var(--font-trendy);
  font-size: 44px;
  font-weight: 800;
  color: var(--well);
}

.streak .label {
  font-size: 13px;
  color: var(--text-soft);
}

footer.site {
  text-align: center;
  padding: 30px 20px;
  font-size: 12px;
  color: var(--text-soft);
}

footer.site a { text-decoration: underline; }

.auth-gate {
  text-align: center;
  padding: 40px 20px;
}

.auth-gate p { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; }

.pill-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.pill-toggle button {
  flex: 1;
  padding: 9px 0;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-soft);
}

.pill-toggle button.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

@media (max-width: 380px) {
  .mbti-grid { grid-template-columns: repeat(2, 1fr); }
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 16px 0;
}

.cal-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  padding: 6px 0;
}

.cal-cell {
  min-height: 52px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  position: relative;
  padding: 4px 2px;
  overflow: hidden;
}

.cal-cell.empty {
  background: transparent;
  border: none;
}

.cal-cell.today {
  background: var(--well);
  border-color: var(--well);
}

.cal-cell.today .cal-day-num {
  color: #fff;
  font-weight: 800;
}

.cal-day-num {
  font-size: 13px;
  color: var(--text);
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 3px;
}

.cal-event-title {
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--gold);
  margin-top: 2px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.cal-cell.today .cal-event-title {
  color: #fff;
}

.cal-cell.today .cal-dot {
  background: #fff;
}

/* 하루 인사 달란트 뽑기 */
.talent-well-card {
  background: rgba(20, 112, 122, 0.07);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}

.talent-well {
  position: relative;
  width: 100px;
  height: 116px;
  margin: 0 auto 12px;
}

.talent-well-hole {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--well-deep) 0%, var(--well) 70%, transparent 100%);
  opacity: 0.85;
}

.talent-well-rope {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 58px;
  background: rgba(20, 112, 122, 0.35);
}

.talent-well-bucket {
  position: absolute;
  left: 50%;
  bottom: 76px;
  font-size: 30px;
  opacity: 0;
  transform: translateX(-50%);
  animation: talentWellLower 0.9s ease-in forwards;
}

.talent-well-bucket.rising {
  opacity: 1;
  animation: talentWellRise 2s cubic-bezier(0.34, 1.4, 0.5, 1) forwards;
}

@keyframes talentWellLower {
  0% { bottom: 76px; opacity: 0; }
  100% { bottom: 6px; opacity: 1; }
}

@keyframes talentWellRise {
  0% { bottom: 6px; opacity: 1; }
  65% { bottom: 92px; opacity: 1; }
  100% { bottom: 76px; opacity: 1; }
}

.talent-well-status {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.talent-well-done .talent-well-result-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--well);
}

/* 자유게시판 */
.board-post {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.board-post:last-child { border-bottom: none; }

.board-post .meta,
.board-comment .meta {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.board-post .content,
.board-comment .content {
  font-size: 14px;
  white-space: pre-wrap;
}

.board-comments {
  padding: 10px 12px;
  background: rgba(20, 112, 122, 0.05);
  border-radius: 12px;
}

.board-comment {
  padding: 8px 0;
  border-bottom: 1px solid rgba(20, 112, 122, 0.1);
}

.board-comment:last-of-type { border-bottom: none; }

.board-comment button[data-comment-id] {
  margin-top: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
}

.board-comment-form {
  margin-top: 10px;
}

.board-comment-form textarea {
  min-height: 44px;
}

/* PWA 설치 유도 배너 */
/* 텍스트+닫기를 한 줄(row), 설치 버튼을 그 아래 별도 줄로 둬서, 좁은 화면에서
   버튼이 옆으로 밀려 화면 밖으로 잘리는 일이 없게 세로로 쌓는다. */
.install-banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(90deg, var(--well-deep) 0%, var(--well) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 16px;
}

.install-banner-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.install-banner-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}

.install-banner-text strong {
  font-size: 14.5px;
}

.install-banner-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  background: #fff;
  color: var(--well-deep);
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.install-banner-close {
  flex: none;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
