/* 파르티라운지 모임 진행 사이트 - 공통 스타일
   컨셉 : Youth Journey (청춘의 한 페이지 + 설레는 여정) — 종이 바탕, 보딩패스·여권·스탬프
   휴대폰이 다크 모드면 남색 "야간 비행" 버전으로 바뀐다. 큰 화면(screen.html)은 항상 남색. */
:root {
  --bg: #FAF9F6;        /* Warm Paper White */
  --bg2: #F2EFE8;       /* 종이 한 겹 아래 (입력·칩 바탕) */
  --card: #FFFFFF;
  --card2: #F2EFE8;
  --line: rgba(44, 62, 80, 0.14);
  --dash: rgba(44, 62, 80, 0.28);
  --text: #2C3E50;      /* Muted Navy */
  --muted: #5B6B7A;
  --faint: #8C98A3;
  --accent: #82C3EC;    /* Sky Blue - 주 버튼·진행 중 */
  --accent2: #1F5F86;   /* 하늘색 계열 글자 (대비 확보) */
  --accent-ink: #12324A;/* 하늘색 위 글자 */
  --peach: #FFC0D3;     /* Amber Peach - 하트·매치·스탬프 */
  --peach-ink: #A2405E; /* 복숭아 계열 글자·하트 아이콘 */
  --peach-on: #5A1F33;  /* 복숭아색 위 글자 */
  --gold: #FFE3A3;
  --ok: #2E8B57;
  --warn: #E5A33A;
  --danger: #C0392B;
  --male: #1F5F86;
  --female: #A2405E;
  --radius: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 0 rgba(44, 62, 80, 0.06), 0 8px 24px rgba(44, 62, 80, 0.08);
  --shadow-lift: 0 2px 8px rgba(44, 62, 80, 0.18);
  --toast-bg: #2C3E50;
  --toast-fg: #FAF9F6;
  --f-display: "Gowun Batang", "Noto Serif KR", "AppleMyungjo", serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17202A; --bg2: #1E2935; --card: #222E3B; --card2: #2A3846;
    --line: rgba(238, 241, 244, 0.12); --dash: rgba(238, 241, 244, 0.28);
    --text: #EEF1F4; --muted: #B7C1CB; --faint: #8593A1;
    --accent2: #A9D8F5; --peach-ink: #FFC0D3; --male: #A9D8F5; --female: #FFC0D3;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --toast-bg: #EEF1F4; --toast-fg: #17202A;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.01em; }
.mono { font-family: var(--f-mono); }
.label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

/* 카드·버튼·입력 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, opacity 0.15s;
  min-height: 48px;
  color: var(--text);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.peach { background: var(--peach); border-color: var(--peach); color: var(--peach-on); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.input, textarea.input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 96px; }
label.field { display: block; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.count { font-size: 12px; color: var(--faint); text-align: right; margin-top: 4px; }

/* 고르기 칸 : 점선 = 아직 안 고름, 실선 + 하늘색 = 고름 */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; border: 1.5px dashed var(--dash); background: transparent; border-radius: var(--r-sm);
  padding: 10px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg button.on { border-style: solid; border-color: var(--accent); background: rgba(130, 195, 236, 0.18); color: var(--accent2); }
.seg button.on[data-g="F"] { border-color: var(--peach); background: rgba(255, 192, 211, 0.25); color: var(--peach-ink); }

.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg2); color: var(--muted); }
.tag.M { color: var(--male); background: rgba(130, 195, 236, 0.2); }
.tag.F { color: var(--female); background: rgba(255, 192, 211, 0.3); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 99px; border: 1.5px dashed var(--dash); color: var(--muted); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.live { border-style: solid; border-color: var(--peach); background: rgba(255, 192, 211, 0.22); color: var(--peach-ink); }
.chip.live .dot { background: var(--peach-ink); box-shadow: 0 0 0 4px rgba(255, 192, 211, 0.5); }

/* 알림 */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg); color: var(--toast-fg); padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: 0.2s; z-index: 100; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lift);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--gold); color: #3A2A00;
  font-size: 13px; font-weight: 700; text-align: center; padding: calc(6px + env(safe-area-inset-top)) 6px 6px;
}

/* 아래에서 올라오는 창 */
.sheet-bg { position: fixed; inset: 0; background: rgba(23, 32, 42, 0.45); z-index: 50; opacity: 0; transition: opacity 0.2s; }
.sheet-bg.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto;
  transform: translateY(100%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); max-width: 560px; margin: 0 auto;
}
.sheet.show { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--dash); margin: 0 auto 14px; }

/* 절취선 : 점선 + 양옆 반원 홈 (카드 바탕색과 같은 종이색으로 뚫어 보이게) */
.perf { position: relative; border-top: 2px dashed var(--dash); margin: 0 14px; }
.perf::before, .perf::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); }
.perf::before { left: -26px; }
.perf::after { right: -26px; }
.barcode {
  height: 34px; border-radius: 3px; opacity: 0.8;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 4px, var(--text) 4px 5px, transparent 5px 8px, var(--text) 8px 11px, transparent 11px 13px);
}

.heart-ico { width: 1em; height: 1em; vertical-align: -0.12em; fill: currentColor; }
.empty { text-align: center; color: var(--faint); padding: 28px 12px; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--faint); font-size: 12px; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.label.ko { font-family: var(--f-body); letter-spacing: 0.02em; text-transform: none; font-size: 12px; font-weight: 600; }
