/* 반쪽 찾기 — 참석자 화면 미니 디자인 시스템
   무드: 밝고 발랄 (크림 배경 + 코랄/민트). 낮 행사·폰 우선.
   시그니처: 반쪽 하트가 맞물리는 모티프(코랄+민트 두 조각). 자립형(외부 폰트·의존성 0). */

:root {
  --cream: #fff9f2; /* 페이지 배경 */
  --card: #ffffff; /* 카드 */
  --field: #fbf4ec; /* 입력 바탕 */
  --ink: #2b2b33; /* 본문 텍스트 */
  --muted: #6f6a76; /* 보조·설명 */
  --line: #efe6db; /* 경계선 */
  --coral: #ff6b6b; /* 주 포인트 */
  --coral-hi: #ff8585; /* hover */
  --coral-lo: #ec5252; /* active */
  --mint: #16c79a; /* 보조 포인트 */
  --mint-lo: #10a882;
  --danger-bg: #ffe3e3;
  --danger-fg: #c0392b;
  --brand: #f79ab6; /* 브랜드 색 */
  --radius: 14px;
  --radius-lg: 22px;
  --touch: 3.25rem; /* 최소 터치 타깃 */
  --font:
    "Apple SD Gothic Neo", "Pretendard", system-ui, "Noto Sans KR", Roboto,
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 상단 은은한 코랄·민트 얼룩 — 발랄한 분위기 (연하게, 가독 유지) */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 45vh;
  background:
    radial-gradient(
      80% 60% at 12% 0%,
      rgba(255, 107, 107, 0.14),
      transparent 60%
    ),
    radial-gradient(
      80% 55% at 92% 4%,
      rgba(22, 199, 154, 0.12),
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

/* 지속 헤더 — 교회 브랜드 = 홈 링크(전 참석자 화면 공통 네비).
   배경 투명 = 상단 그라데이션이 헤더로 자연스럽게 이어짐(하드 라인 제거).
   backdrop blur = 스크롤 시 뒤 콘텐츠만 흐려 브랜드 가독 유지. */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.55rem 1.15rem;
  background: transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--brand);
  text-decoration: none;
}
.brand-logo {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  /* 교회 아이콘(하트+십자가) — 투명 배경이라 헤더 그라데이션 위에 자연히 얹힘 */
  background: url(/static/church-logo.png) center / contain no-repeat;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}
.brand-church {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--brand);
}
.brand-event {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--mint);
  letter-spacing: 0.01em;
}

main {
  position: relative;
  z-index: 1;
  max-width: 30rem;
  margin-inline: auto;
  padding: 1rem 1.15rem 3rem;
}

/* 하위 화면 하단 홈 버튼 */
.home-back {
  margin-top: 1.5rem;
  text-align: center;
}

/* ── 타이포 ── */
h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}
h1 {
  font-size: 1.9rem;
  font-weight: 800;
}
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 1.6rem;
}
p {
  margin: 0.5rem 0;
}
small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
strong {
  font-weight: 700;
}
a {
  color: var(--coral-lo);
  text-underline-offset: 3px;
}

/* ── 카드 ── */
article,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.25rem;
  margin: 1rem 0;
  box-shadow: 0 14px 34px -22px rgba(43, 43, 51, 0.5);
}

/* ── 폼 ── */
label {
  display: block;
  margin: 0.9rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}
input,
select {
  display: block;
  width: 100%;
  min-height: var(--touch);
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  background: var(--field);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.05rem;
}
input::placeholder {
  color: #a79fae;
}
input:focus,
select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.18);
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) 55%,
    calc(100% - 0.8rem) 55%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 1rem 1rem;
  margin: 1rem 0;
}
legend {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 0.4rem;
}

/* 체크박스 = 가로 배치 */
label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 400;
  font-size: 0.9rem;
}
input[type="checkbox"] {
  width: 1.4rem;
  height: 1.4rem;
  min-height: 0;
  margin: 0;
  flex: none;
  accent-color: var(--coral);
}

/* 필수 표시 별표 */
.req {
  color: var(--coral);
  font-weight: 700;
}

/* 연락처 = [010]-[4자리]-[4자리] 3박스 한 줄 */
.contact-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.contact-part {
  margin-top: 0;
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.contact-field input:not(.contact-fixed) {
  flex: 1 1 0;
  min-width: 0;
}
.contact-fixed {
  flex: 0 0 3.6rem;
  font-weight: 600;
  color: var(--ink);
}
.contact-sep {
  flex: none;
  color: var(--muted);
  font-weight: 700;
}

/* 희망 또래 = [최소 또래] ~ [최대 또래] 한 줄 */
.pref-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pref-row select {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0.35rem;
}
.pref-sep {
  flex: none;
  color: var(--muted);
  font-weight: 700;
}

/* ── 버튼 ── */
button,
a[role="button"],
input[type="submit"] {
  display: inline-block;
  width: 100%;
  min-height: var(--touch);
  margin-top: 0.6rem;
  padding: 0.85rem 1.2rem;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(255, 107, 107, 0.8);
  transition:
    transform 0.08s ease,
    background 0.15s ease;
}
button:hover,
a[role="button"]:hover {
  background: var(--coral-hi);
}
button:active,
a[role="button"]:active {
  transform: scale(0.97);
  background: var(--coral-lo);
}
button:focus-visible,
a[role="button"]:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

/* 보조 버튼 = 민트 외곽선 */
.secondary,
button.secondary,
a.secondary[role="button"] {
  background: var(--card);
  color: var(--mint-lo);
  box-shadow: inset 0 0 0 1.5px var(--mint);
}
.secondary:hover,
a.secondary[role="button"]:hover {
  background: rgba(22, 199, 154, 0.08);
}

/* ── 오류·상태 ── */
mark {
  display: block;
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ── details / 로그인 접기 ── */
details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.3rem 1rem;
  margin: 1rem 0;
}
summary {
  cursor: pointer;
  padding: 0.6rem 0;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: "＋ ";
  color: var(--coral);
}
details[open] summary::before {
  content: "－ ";
}

/* ── 홈: 자기소개 카드 ── */
.intro-card {
  text-align: center;
  padding-top: 1.9rem;
}
.intro-heart {
  width: 72px;
  height: 64px;
  margin: 0 auto 0.7rem;
  display: block;
}
.intro-name {
  margin: 0.3rem 0;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.intro-code {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.05em 0.4em;
  color: var(--mint-lo);
  border: 2px dashed var(--mint);
  border-radius: 0.6rem;
  vertical-align: middle;
}

.round-now {
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 1.2rem;
}
.round-now strong {
  color: var(--coral-lo);
  font-size: 1.15em;
}

/* seated 상태 강조 */
#status h2 {
  text-align: center;
  font-size: 2rem;
  color: var(--coral-lo);
  margin: 1.5rem 0;
}

/* PIN 입력 */
#status input[name="code"] {
  font-size: 1.7rem;
  text-align: center;
  letter-spacing: 0.4em;
  padding-left: 0.4em; /* letter-spacing 우측 쏠림 보정 */
}

/* ── 홈 액션 링크 ── */
.home-links {
  margin-top: 1.5rem;
}
.home-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
}
.home-links li {
  list-style: none;
}
.home-links a[role="button"] {
  display: block;
  text-align: center;
}

/* ── 태깅: 사람별 카드 + ♥/보통/패스 세그먼트 ── */
/* ── 찜 & 순위 화면 ─────────────────────────────────────────── */
.sec-head {
  font-size: 1.15rem;
  margin: 1.6rem 0 0.6rem;
}
.rank-note {
  color: var(--mint-lo);
}
.rank-empty {
  color: var(--muted);
}

/* 내 찜 — 순서대로 카드 */
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rank-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  margin: 0.55rem 0;
  box-shadow: 0 10px 26px -20px rgba(43, 43, 51, 0.5);
}
.rank-num {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
}
.rank-name {
  flex: 1 1 auto;
  font-size: 1.1rem;
}
.rank-name small {
  margin-left: 0.35rem;
  color: var(--mint-lo);
}
.rank-card .reorder {
  display: flex;
  gap: 0.3rem;
  margin: 0;
}
.rank-card .fav {
  margin: 0;
}

/* 하트 토글 — 빈것(♡)=미찜 / 찬것(♥)=찜 */
.heart {
  width: var(--touch);
  min-width: var(--touch);
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.6rem;
  line-height: 1;
}
.heart.on {
  color: var(--coral);
}
.heart.off {
  color: var(--muted);
}
.heart:hover {
  background: rgba(255, 107, 107, 0.1);
}
.reorder button {
  width: auto;
  min-width: 2.4rem;
  margin: 0;
  padding: 0.5rem 0.5rem;
  background: var(--field);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: none;
}
.reorder button:hover {
  background: #f2e7db;
}

/* 만난 사람 — 라운드별 가로 스크롤 스트립 */
.strip-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1rem 0 0.35rem;
}
.met-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.1rem 0.1rem 0.6rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.met-card {
  flex: 0 0 auto;
  width: 8.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.5rem;
  box-shadow: 0 10px 26px -20px rgba(43, 43, 51, 0.5);
  scroll-snap-align: start;
}
.met-name {
  font-size: 1.02rem;
  text-align: center;
}
.met-name small {
  display: block;
  color: var(--mint-lo);
}

/* 제출 — 목록과 분리된 큰 버튼 */
.rank-submit {
  margin: 1.8rem 0 0.5rem;
  padding-top: 1.2rem;
  border-top: 2px dashed var(--line);
}
.submit-lg {
  width: 100%;
  font-size: 1.15rem;
  padding: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
