/* bottleletter.css — 병 속의 편지 */
@import url('https://fonts.googleapis.com/css2?family=Gochi+Hand&family=Noto+Serif+KR:wght@300;400;600&display=swap');

:root {
  --bl-navy:    #0a1628;
  --bl-sea:     #1a3a6b;
  --bl-wave:    #1e5080;
  --bl-sand:    #c8a96e;
  --bl-gold:    #e8c87a;
  --bl-paper:   #fffdf0;
  --bl-ink:     #3a2a10;
  --bl-blue:    #2a7dc9;
  --bl-text:    #4a3a20;
  --bl-text2:   #8a7050;
  --bl-border:  #d8c890;
}

/* ── 기본 ─────────────────────────────────────── */
body { background: var(--bl-navy) !important; margin: 0; }

#bl-app {
  font-family: 'Noto Serif KR', Georgia, serif;
  background: transparent;
  min-height: 100vh;
  color: var(--bl-text);
  position: relative;
}

/* ── 배경 레이어 ──────────────────────────────── */
.bl-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
}
.bl-bg-sky {
  position: absolute; top: 0; left: 0; right: 0; height: 52%;
  background: linear-gradient(180deg, #0a1628 0%, #102040 50%, #1a3a6b 100%);
}
.bl-bg-sea {
  position: absolute; top: 52%; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #1a4a7a 0%, #0d2d50 50%, #081828 100%);
}
.bl-bg-moon {
  position: absolute; top: 28px; right: 56px;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff9e6;
  box-shadow: 0 0 18px rgba(255,249,200,0.6), 0 0 50px rgba(255,249,200,0.18);
}
.bl-bg-star {
  position: absolute; border-radius: 50%; background: #fff;
  animation: bl-twinkle var(--d, 3s) ease-in-out infinite;
}
/* 파도 3단 */
.bl-bg-wave {
  position: absolute; left: -10%; width: 120%; height: 50px;
  border-radius: 50%; animation: bl-wave var(--wd, 5s) ease-in-out infinite;
}
.bl-bg-wave1 { top: 49%; background: rgba(26,74,122,0.65); --wd: 5s; }
.bl-bg-wave2 { top: 50%; background: rgba(13,45,80,0.75); --wd: 5s; animation-delay: -2.5s; }
.bl-bg-wave3 { top: 51%; background: rgba(8,24,48,0.55); --wd: 6.5s; animation-delay: -1s; }
/* 모래 */
.bl-bg-sand {
  position: absolute; bottom: 0; left: 0; right: 0; height: 26%;
  background: linear-gradient(180deg, #c8a96e 0%, #b8955a 40%, #9a7840 100%);
}

/* 스캔라인 감성 X — 자연스러운 그레인 */
.bl-bg-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4; pointer-events: none;
}

/* ── 레이아웃 ─────────────────────────────────── */
.bl-home-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 20px;
}
.bl-card-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
}
.bl-card {
  background: rgba(255,253,240,0.97);
  border-radius: 3px;
  padding: 30px 26px;
  width: 100%; max-width: 440px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
}
/* 카드 상단 색띠 */
.bl-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #1a5a9a, #2a8ac9, #1a5a9a);
  border-radius: 3px 3px 0 0;
}

/* ── 홈 ───────────────────────────────────────── */
.bl-home-auth {
  position: relative; z-index: 1;
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
  width: 100%; max-width: 440px; margin-bottom: 20px;
}
.bl-bottle-scene {
  display: flex; justify-content: center; margin-bottom: 24px;
}
.bl-bottle-float { animation: bl-bottle-float 4s ease-in-out infinite; }
.bl-home-title {
  font-size: 26px; font-weight: 600; color: #e8ddc0;
  text-align: center; letter-spacing: 0.04em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 8px;
}
.bl-home-sub {
  font-size: 13px; color: rgba(220,200,160,0.55);
  text-align: center; line-height: 1.9; margin-bottom: 8px;
}
.bl-home-stat {
  font-size: 11px; color: rgba(200,180,140,0.4);
  text-align: center; margin-bottom: 22px;
}
.bl-home-stat strong { color: rgba(100,180,240,0.7); }
.bl-home-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 100%; max-width: 440px;
}
.bl-card-btn {
  background: rgba(255,253,240,0.08);
  border: 1px solid rgba(200,180,140,0.2);
  border-radius: 3px; padding: 26px 14px;
  cursor: pointer; color: rgba(220,200,160,0.85);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  transition: all 0.25s; width: 100%;
}
.bl-card-btn:hover {
  background: rgba(255,253,240,0.14);
  border-color: rgba(200,180,140,0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.bl-card-icon { font-size: 22px; }
.bl-card-title { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.bl-card-sub { font-size: 11px; color: rgba(200,180,140,0.45); }
.bl-footer-note {
  margin-top: 28px; text-align: center;
  font-size: 10px; color: rgba(200,180,140,0.2); line-height: 2.2;
}
.bl-holding-banner {
  width: 100%; max-width: 440px;
  background: rgba(42,125,201,0.15);
  border: 1px solid rgba(42,125,201,0.35);
  border-radius: 3px; padding: 10px 14px;
  font-size: 12px; color: rgba(150,210,255,0.85);
  cursor: pointer; margin-bottom: 12px; text-align: center;
  transition: all 0.2s;
}
.bl-holding-banner:hover { background: rgba(42,125,201,0.25); }

/* ── 네비 ─────────────────────────────────────── */
.bl-nav { margin-bottom: 18px; }
.bl-nav-inner { display: flex; justify-content: space-between; align-items: center; }
.bl-nav-right { display: flex; gap: 8px; align-items: center; }
.bl-user-tag { font-size: 11px; color: var(--bl-text2); letter-spacing: 0.06em; }

/* ── 버튼 ─────────────────────────────────────── */
.bl-btn {
  width: 100%; padding: 13px; background: var(--bl-blue);
  border: none; border-radius: 2px; color: #fff;
  font-family: 'Noto Serif KR', serif; font-size: 14px;
  cursor: pointer; transition: all 0.22s; display: block; margin-top: 12px;
  letter-spacing: 0.04em;
}
.bl-btn:hover { background: #1a6ab8; }
.bl-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bl-btn-sea { background: #1a6090; }
.bl-btn-sea:hover { background: #0e4a72; }
.bl-ghost {
  width: 100%; padding: 11px; background: transparent;
  border: 1px solid var(--bl-border); border-radius: 2px;
  color: var(--bl-text2); font-family: 'Noto Serif KR', serif;
  font-size: 13px; cursor: pointer; margin-top: 8px;
  transition: all 0.2s; display: block;
}
.bl-ghost:hover { background: #f5f0e0; }
.bl-gsm {
  background: transparent; border: none;
  color: rgba(200,180,140,0.5); font-size: 11px;
  cursor: pointer; padding: 3px 6px; transition: color 0.2s;
  font-family: 'Noto Serif KR', serif;
}
.bl-gsm:hover { color: rgba(200,180,140,0.85); }
.bl-back { color: var(--bl-text2); }
.bl-back:hover { color: var(--bl-blue); }

/* ── 폼 ───────────────────────────────────────── */
.bl-screen-title {
  font-size: 17px; font-weight: 600; color: var(--bl-navy);
  margin-bottom: 18px; letter-spacing: 0.04em;
}
.bl-lbl { font-size: 11px; color: var(--bl-text2); display: block; margin-bottom: 5px; margin-top: 14px; }
.bl-ta {
  width: 100%; background: transparent; border: none; outline: none;
  font-family: 'Gochi Hand', cursive; font-size: 16px;
  color: var(--bl-ink); line-height: 2; min-height: 120px;
  resize: none; display: block; padding: 4px 8px;
}
.bl-ta::placeholder { color: #c8b890; font-family: 'Noto Serif KR', serif; font-size: 13px; }
.bl-inp {
  width: 100%; background: #fffdf5; border: 1px solid var(--bl-border);
  border-radius: 2px; color: var(--bl-ink); padding: 11px 13px;
  font-family: 'Noto Serif KR', serif; font-size: 14px;
  outline: none; transition: border-color 0.2s; display: block; margin-bottom: 0;
}
.bl-inp:focus { border-color: var(--bl-blue); }
.bl-inp::placeholder { color: #c8b890; }
.bl-char-count { font-size: 10px; color: #b8a880; text-align: right; margin-top: 4px; }

/* ── 편지지 ────────────────────────────────────── */
.bl-letter-paper {
  background: #fffdf0;
  border: 1px solid #e8dfc0;
  border-radius: 2px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.bl-letter-lines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 31px,
    rgba(180,150,80,0.12) 31px,
    rgba(180,150,80,0.12) 32px
  );
  pointer-events: none;
}

/* ── 편지 카드 (읽기) ─────────────────────────── */
.bl-letter-card {
  background: #fffdf0; border: 1px solid #e0d0a8;
  border-radius: 2px; padding: 18px; margin-bottom: 14px;
  position: relative;
}
.bl-letter-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(
    180deg, transparent, transparent 29px,
    rgba(180,150,80,0.3) 29px, rgba(180,150,80,0.3) 30px
  );
}
.bl-letter-from {
  font-size: 10px; color: #a08050; margin-bottom: 10px;
  padding-left: 10px; line-height: 1.8;
}
.bl-letter-body {
  font-family: 'Gochi Hand', cursive; font-size: 15px;
  color: var(--bl-ink); line-height: 2; padding-left: 10px;
}
.bl-arrival-tag {
  display: inline-block; background: #e8f4ff; border: 1px solid #b8d8f0;
  color: #2a6aaa; font-size: 10px; padding: 1px 7px; border-radius: 10px; margin-left: 4px;
}
.bl-journey-badge {
  display: inline-block; background: #fff8e8; border: 1px solid #e0c880;
  color: #8a6020; font-size: 10px; padding: 1px 7px; border-radius: 10px; margin-left: 4px;
}

/* ── 여정 체인 ────────────────────────────────── */
.bl-journey { margin: 14px 0; }
.bl-journey-title {
  font-size: 11px; color: var(--bl-text2); margin-bottom: 10px;
  letter-spacing: 0.08em;
}
.bl-journey-chain { padding-left: 8px; }
.bl-journey-node { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.bl-journey-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bl-border); flex-shrink: 0; margin-top: 4px;
}
.bl-journey-current .bl-journey-dot {
  background: var(--bl-blue);
  box-shadow: 0 0 8px rgba(42,125,201,0.4);
}
.bl-journey-line {
  width: 1px; height: 16px; background: var(--bl-border);
  margin-left: 3px;
}
.bl-journey-info { font-size: 11px; color: var(--bl-text2); line-height: 1.9; }
.bl-journey-nth { font-size: 10px; color: #fff; background: var(--bl-blue); padding: 1px 6px; border-radius: 8px; flex-shrink: 0; }
.bl-journey-date { color: var(--bl-text); font-weight: 600; }
.bl-journey-arrival { color: var(--bl-blue); }

/* ── 안내 박스 ────────────────────────────────── */
.bl-info-box {
  background: #f0ead8; border: 1px solid #e0d0a8; border-radius: 2px;
  padding: 12px 14px; font-size: 12px; color: #8a6a40; line-height: 2; margin: 12px 0;
}
.bl-err { color: #c03030; font-size: 12px; margin: 10px 0; }
.bl-release-note { font-size: 11px; color: var(--bl-text2); text-align: center; margin: 10px 0 4px; }

/* ── 로그인 유도 ───────────────────────────────── */
.bl-login-prompt {
  background: #e8f4ff; border: 1px solid #b8d8f0;
  border-radius: 2px; padding: 14px; margin: 14px 0; font-size: 12px;
}
.bl-login-prompt-text { color: #4a7aaa; line-height: 1.9; }

/* ── 받은편지함 ────────────────────────────────── */
.bl-inbox-row {
  background: #fffdf5; border: 1px solid var(--bl-border);
  border-radius: 2px; padding: 13px 14px; margin-bottom: 8px;
  cursor: pointer; transition: all 0.18s; display: flex;
  justify-content: space-between; align-items: center; gap: 10px;
}
.bl-inbox-row:hover { border-color: var(--bl-blue); background: #f5f9ff; }
.bl-inbox-holding { border-color: rgba(42,125,201,0.45); }
.bl-inbox-arrival { font-size: 11px; color: var(--bl-blue); margin-bottom: 4px; }
.bl-inbox-preview { font-family: 'Gochi Hand', cursive; font-size: 14px; color: var(--bl-ink); margin-bottom: 4px; }
.bl-inbox-meta { font-size: 10px; color: var(--bl-text2); }
.bl-holding-tag {
  display: inline-block; background: #e8f4ff; border: 1px solid #b8d8f0;
  color: var(--bl-blue); font-size: 10px; padding: 1px 6px; border-radius: 8px; margin-left: 4px;
}
.bl-inbox-arrow { color: var(--bl-border); font-size: 18px; flex-shrink: 0; }
.bl-empty-inbox { text-align: center; padding: 28px 0; font-size: 13px; color: var(--bl-text2); line-height: 2.2; }
.bl-loading { text-align: center; padding: 24px 0; font-size: 12px; color: var(--bl-text2); }

/* ── 메모 입력 (놓아주기) ─────────────────────── */
.bl-reply-wrap {
  margin-top: 16px;
}
.bl-reply-label {
  font-size: 12px; color: var(--bl-text2);
  margin-bottom: 8px; font-weight: 600; letter-spacing: 0.04em;
}
.bl-reply-optional {
  font-weight: 400; color: #b8a880; font-size: 11px;
}

/* ── 여정 reply 표시 ──────────────────────────── */
.bl-journey-meta {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.bl-journey-reply {
  background: #f5f0e0; border-left: 2px solid #d8c890;
  padding: 7px 10px; font-family: 'Gochi Hand', cursive;
  font-size: 13px; color: var(--bl-ink); line-height: 1.8;
  margin: 4px 0 2px; border-radius: 0 3px 3px 0;
}
.bl-journey-here {
  font-size: 10px; color: var(--bl-blue); font-weight: 600; margin-top: 2px;
}

/* ── 인증 ─────────────────────────────────────── */
.bl-auth-sub { font-size: 12px; color: var(--bl-text2); margin-bottom: 16px; line-height: 1.9; }
.bl-auth-switch { text-align: center; margin-top: 12px; font-size: 12px; color: var(--bl-text2); }

/* ── 전송완료 / 파도 ──────────────────────────── */
.bl-sent-bottle { display: flex; justify-content: center; margin: 16px 0; }
.bl-sent-title { font-size: 18px; font-weight: 600; color: var(--bl-navy); text-align: center; margin-bottom: 8px; }
.bl-sent-sub { font-size: 13px; color: var(--bl-text2); text-align: center; line-height: 2; }
.bl-sent-delay { color: var(--bl-blue); font-weight: 600; }
.bl-wave-anim { text-align: center; color: rgba(42,125,201,0.5); letter-spacing: 0.3em; font-size: 20px; margin: 16px 0; animation: bl-wave-text 2s ease-in-out infinite; }

/* ── 모바일 ───────────────────────────────────── */
@media (max-width: 480px) {
  .bl-home-title { font-size: 22px; }
  .bl-card { padding: 24px 18px; }
  .bl-home-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 애니메이션 ───────────────────────────────── */
@keyframes bl-twinkle { 0%,100% { opacity: var(--a,.3); } 50% { opacity: calc(var(--a,.3)*0.1); } }
@keyframes bl-wave { 0%,100% { transform: translateX(-3%) scaleY(1); } 50% { transform: translateX(3%) scaleY(1.07); } }
@keyframes bl-bottle-float {
  0%,100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-14px) rotate(6deg); }
}
@keyframes bl-fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bl-sweep-away {
  0% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(30px); opacity: 0.6; }
  100% { transform: translateY(120px); opacity: 0; }
}
@keyframes bl-wave-text { 0%,100% { opacity: 0.5; } 50% { opacity: 0.9; } }

.bl-fadein { animation: bl-fadein 0.4s cubic-bezier(0.22,1,0.36,1) both; }
.bl-sweep  { animation: bl-sweep-away 1.6s ease-in forwards; }