/* timecapsule.css — 타임캡슐 */
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Noto+Serif+KR:wght@300;400;600&display=swap');

:root {
  --tc-bg:       #1a1208;
  --tc-soil:     #2d1f0e;
  --tc-soil2:    #3d2a12;
  --tc-rust:     #8b4513;
  --tc-rust2:    #a0522d;
  --tc-gold:     #c8960a;
  --tc-gold2:    #e8b420;
  --tc-paper:    #f5e6c8;
  --tc-ink:      #2a1a08;
  --tc-text:     #d4b896;
  --tc-text2:    rgba(212,184,150,0.55);
  --tc-border:   rgba(139,69,19,0.4);
  --tc-card:     linear-gradient(160deg,#2a1a0a,#1e1206);
}

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

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

/* ── 배경 레이어 ──────────────────────────────── */
.tc-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
}
/* 하늘 */
.tc-bg-sky {
  position: absolute; top: 0; left: 0; right: 0; height: 38%;
  background: linear-gradient(180deg, #0d0a04 0%, #1a1208 60%, #241808 100%);
}
/* 땅 */
.tc-bg-ground {
  position: absolute; top: 38%; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #2d1f0e 0%, #1e1408 50%, #120d04 100%);
}
/* 땅 결 */
.tc-bg-grain {
  position: absolute; top: 38%; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 60px,
    rgba(80,40,10,0.08) 60px, rgba(80,40,10,0.08) 61px
  );
}
/* 별 */
.tc-bg-star {
  position: absolute; border-radius: 50%; background: #fff;
  animation: tc-twinkle var(--d, 3s) ease-in-out infinite;
}
/* 달 */
.tc-bg-moon {
  position: absolute; top: 24px; right: 70px;
  width: 30px; height: 30px; border-radius: 50%;
  background: #f5e6a0;
  box-shadow: 0 0 14px rgba(245,230,160,0.5), 0 0 40px rgba(245,230,160,0.15);
}
/* 땅 위 풀 실루엣 */
.tc-bg-grass {
  position: absolute; top: 36%; left: 0; right: 0; height: 18px;
  background: #1a2d0a;
  clip-path: polygon(
    0% 100%, 2% 40%, 4% 100%, 6% 20%, 8% 100%,
    10% 50%, 12% 100%, 14% 30%, 16% 100%, 18% 60%,
    20% 100%, 22% 40%, 24% 100%, 26% 25%, 28% 100%,
    30% 55%, 32% 100%, 34% 35%, 36% 100%, 38% 50%,
    40% 100%, 42% 30%, 44% 100%, 46% 45%, 48% 100%,
    50% 35%, 52% 100%, 54% 55%, 56% 100%, 58% 28%,
    60% 100%, 62% 48%, 64% 100%, 66% 32%, 68% 100%,
    70% 42%, 72% 100%, 74% 22%, 76% 100%, 78% 52%,
    80% 100%, 82% 38%, 84% 100%, 86% 28%, 88% 100%,
    90% 50%, 92% 100%, 94% 34%, 96% 100%, 98% 44%,
    100% 100%
  );
}

/* ── 레이아웃 ─────────────────────────────────── */
.tc-home-wrap,
.tc-card-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px 20px;
}

/* ── 카드 ─────────────────────────────────────── */
.tc-card {
  background: var(--tc-card);
  border: 1px solid var(--tc-border);
  border-radius: 4px;
  padding: 34px 30px;
  width: 100%; max-width: 460px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), inset 0 1px 0 rgba(200,150,10,0.1);
}
.tc-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--tc-rust), var(--tc-gold), var(--tc-rust), transparent);
  border-radius: 4px 4px 0 0;
}
/* 볼트 */
.tc-bolt {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a07030, #4a2a10);
  border: 1px solid #6a3a18;
}
.tc-bolt.tl { top: 10px; left: 10px; }
.tc-bolt.tr { top: 10px; right: 10px; }
.tc-bolt.bl { bottom: 10px; left: 10px; }
.tc-bolt.br { bottom: 10px; right: 10px; }

/* ── 홈 ───────────────────────────────────────── */
.tc-home-auth {
  position: relative; z-index: 1;
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
  width: 100%; max-width: 460px; margin-bottom: 20px;
}
/* 캡슐 일러스트 영역 */
.tc-capsule-scene {
  display: flex; justify-content: center;
  margin-bottom: 28px; position: relative;
}
.tc-home-title {
  font-size: 28px; font-weight: 600; color: #e8d0a0;
  text-align: center; letter-spacing: 0.05em;
  text-shadow: 0 2px 20px rgba(200,150,10,0.3);
  margin-bottom: 8px;
}
.tc-home-sub {
  font-size: 13px; color: var(--tc-text2);
  text-align: center; line-height: 1.9; margin-bottom: 20px;
}
.tc-home-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 100%; max-width: 460px; margin-top: 4px;
}
.tc-card-btn {
  background: rgba(60,30,10,0.5);
  border: 1px solid rgba(139,69,19,0.3);
  border-radius: 3px; padding: 26px 14px;
  cursor: pointer; color: var(--tc-text);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  transition: all 0.25s; width: 100%;
}
.tc-card-btn:hover {
  border-color: rgba(200,150,10,0.5);
  background: rgba(80,40,10,0.6);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}
.tc-card-icon { font-size: 20px; }
.tc-card-title { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; color: #e8d0a0; }
.tc-card-sub { font-size: 11px; color: var(--tc-text2); }
.tc-footer-note { margin-top: 28px; text-align: center; font-size: 10px; color: rgba(212,184,150,0.2); line-height: 2.2; }

/* ── 네비 ─────────────────────────────────────── */
.tc-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid rgba(139,69,19,0.2); }
.tc-nav-right { display: flex; gap: 8px; align-items: center; }
.tc-user-tag { font-size: 11px; color: var(--tc-text2); letter-spacing: 0.06em; }

/* ── 버튼 ─────────────────────────────────────── */
.tc-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #4a2a0a, #6a3a14);
  border: 1px solid rgba(200,150,10,0.5); color: var(--tc-gold2);
  border-radius: 3px; font-family: 'Noto Serif KR', serif; font-size: 14px;
  cursor: pointer; transition: all 0.22s; display: block; margin-top: 12px;
  letter-spacing: 0.04em;
}
.tc-btn:hover { background: linear-gradient(135deg,#5a3510,#7a4418); box-shadow: 0 0 18px rgba(200,150,10,0.2); }
.tc-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tc-ghost {
  width: 100%; padding: 11px; background: transparent;
  border: 1px solid rgba(139,69,19,0.3); color: var(--tc-text2);
  border-radius: 3px; font-family: 'Noto Serif KR', serif;
  font-size: 13px; cursor: pointer; margin-top: 8px;
  transition: all 0.2s; display: block;
}
.tc-ghost:hover { border-color: rgba(139,69,19,0.6); color: var(--tc-text); }
.tc-gsm {
  background: transparent; border: none; color: var(--tc-text2);
  font-size: 11px; cursor: pointer; padding: 3px 6px; transition: color 0.2s;
  font-family: 'Noto Serif KR', serif;
}
.tc-gsm:hover { color: var(--tc-text); }

/* ── 폼 ───────────────────────────────────────── */
.tc-screen-title { font-size: 17px; font-weight: 600; color: #e8d0a0; margin-bottom: 18px; letter-spacing: 0.04em; }
.tc-lbl { font-size: 11px; color: var(--tc-text2); display: block; margin-bottom: 6px; margin-top: 16px; letter-spacing: 0.06em; }
.tc-ta {
  width: 100%; background: rgba(10,6,2,0.6); border: 1px solid rgba(139,69,19,0.25);
  border-radius: 2px; color: var(--tc-paper); padding: 13px;
  font-family: 'Special Elite', 'Noto Serif KR', serif; font-size: 15px; line-height: 1.9;
  min-height: 130px; resize: vertical; outline: none; transition: border-color 0.2s; display: block;
}
.tc-ta:focus { border-color: rgba(200,150,10,0.45); }
.tc-ta::placeholder { color: rgba(212,184,150,0.2); font-family: 'Noto Serif KR', serif; font-size: 13px; }
.tc-inp {
  width: 100%; background: rgba(10,6,2,0.6); border: 1px solid rgba(139,69,19,0.25);
  border-radius: 2px; color: var(--tc-paper); padding: 11px 13px;
  font-family: 'Noto Serif KR', serif; font-size: 14px;
  outline: none; transition: border-color 0.2s; display: block;
}
.tc-inp:focus { border-color: rgba(200,150,10,0.45); }
.tc-inp::placeholder { color: rgba(212,184,150,0.2); }
.tc-char-count { font-size: 10px; color: rgba(212,184,150,0.25); text-align: right; margin-top: 4px; }

/* 개봉일 빠른 선택 버튼 */
.tc-date-quick { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tc-date-btn {
  padding: 7px 12px; background: transparent; border: 1px solid rgba(139,69,19,0.3);
  border-radius: 2px; color: var(--tc-text2); font-size: 11px; cursor: pointer; transition: all 0.2s;
  font-family: 'Noto Serif KR', serif;
}
.tc-date-btn:hover, .tc-date-btn.on { border-color: var(--tc-gold); color: var(--tc-gold2); background: rgba(200,150,10,0.08); }

/* 날짜 직접입력 */
.tc-date-inp {
  width: 100%; background: rgba(10,6,2,0.6); border: 1px solid rgba(139,69,19,0.25);
  border-radius: 2px; color: var(--tc-paper); padding: 11px 13px;
  font-family: 'Noto Serif KR', serif; font-size: 14px;
  outline: none; transition: border-color 0.2s; display: block;
  color-scheme: dark;
}
.tc-date-inp:focus { border-color: rgba(200,150,10,0.45); }

/* 수신자 선택 */
.tc-recipient-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.tc-recipient-btn {
  padding: 14px 10px; background: rgba(30,15,5,0.5); border: 1px solid rgba(139,69,19,0.25);
  border-radius: 2px; color: var(--tc-text2); font-size: 12px; cursor: pointer;
  transition: all 0.2s; text-align: center; font-family: 'Noto Serif KR', serif; line-height: 1.7;
}
.tc-recipient-btn:hover, .tc-recipient-btn.on { border-color: var(--tc-gold); color: var(--tc-gold2); background: rgba(200,150,10,0.08); }
.tc-recipient-btn .tc-ri { display: block; font-size: 18px; margin-bottom: 5px; }

/* ── 코드 발급 화면 ───────────────────────────── */
.tc-code-box {
  background: rgba(0,0,0,0.5); border: 1px solid rgba(200,150,10,0.3);
  border-radius: 3px; padding: 20px; text-align: center; margin: 16px 0;
}
.tc-code-label { font-size: 10px; color: var(--tc-text2); letter-spacing: 0.2em; margin-bottom: 10px; }
.tc-code-val {
  font-family: 'Special Elite', monospace; font-size: 32px; letter-spacing: 0.3em;
  color: var(--tc-gold2); cursor: pointer;
  text-shadow: 0 0 20px rgba(200,150,10,0.5);
  animation: tc-flicker 6s ease-in-out infinite;
}
.tc-code-hint { font-size: 10px; color: rgba(200,150,10,0.3); margin-top: 8px; }
.tc-opens-note { font-size: 13px; color: var(--tc-text2); text-align: center; margin: 8px 0; }
.tc-warn-box {
  background: rgba(200,150,10,0.04); border: 1px solid rgba(200,150,10,0.15);
  border-radius: 2px; padding: 12px 14px; font-size: 12px; color: var(--tc-text2);
  line-height: 2; margin: 14px 0;
}
.tc-warn-box strong { color: rgba(232,180,32,0.8); }

/* ── 봉인 화면 (개봉 전) ──────────────────────── */
.tc-sealed-wrap { text-align: center; padding: 8px 0; }
.tc-capsule-buried {
  display: flex; justify-content: center;
  margin: 16px 0 20px;
}
.tc-seal-title { font-size: 17px; font-weight: 600; color: #e8d0a0; margin-bottom: 10px; }
.tc-opens-when {
  font-size: 18px; font-weight: 600; color: var(--tc-gold2);
  text-shadow: 0 0 16px rgba(200,150,10,0.4);
  margin: 12px 0;
}
.tc-countdown-wrap { margin: 16px 0; }
.tc-countdown-label { font-size: 10px; color: var(--tc-text2); letter-spacing: 0.15em; margin-bottom: 8px; }
.tc-countdown-grid { display: flex; gap: 8px; justify-content: center; }
.tc-countdown-unit {
  background: rgba(0,0,0,0.5); border: 1px solid rgba(139,69,19,0.3);
  border-radius: 3px; padding: 12px 14px; min-width: 60px;
}
.tc-countdown-num { font-family: 'Special Elite', monospace; font-size: 24px; color: var(--tc-gold); display: block; }
.tc-countdown-sub { font-size: 9px; color: var(--tc-text2); letter-spacing: 0.1em; display: block; margin-top: 3px; }

/* ── 개봉 화면 ────────────────────────────────── */
.tc-opened-paper {
  background: linear-gradient(180deg, #faf0d8, #f0e4c0);
  border-radius: 3px; padding: 22px 24px; color: #1a0e04;
  font-family: 'Special Elite', 'Noto Serif KR', serif;
  font-size: 15px; line-height: 1.95; margin-bottom: 16px;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: inset 0 0 20px rgba(100,60,20,0.12);
  position: relative;
}
.tc-opened-paper::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: rgba(100,60,20,0.1); border-radius: 3px 3px 0 0;
}
.tc-opened-from { font-size: 11px; color: var(--tc-text2); text-align: center; margin-bottom: 10px; line-height: 1.8; }
.tc-open-badge {
  display: inline-block; background: rgba(200,150,10,0.12); border: 1px solid rgba(200,150,10,0.3);
  color: var(--tc-gold2); font-size: 11px; padding: 3px 10px; border-radius: 10px; margin-bottom: 14px;
}

/* ── 내 목록 ──────────────────────────────────── */
.tc-list-row {
  background: rgba(30,15,5,0.5); border: 1px solid rgba(139,69,19,0.22);
  border-radius: 3px; padding: 13px 14px; margin-bottom: 8px;
  cursor: pointer; transition: all 0.2s; display: flex;
  justify-content: space-between; align-items: center; gap: 10px;
}
.tc-list-row:hover { border-color: rgba(200,150,10,0.4); background: rgba(50,25,8,0.6); }
.tc-list-sealed { opacity: 0.5; }
.tc-list-code { font-family: 'Special Elite', monospace; font-size: 12px; color: rgba(200,150,10,0.5); letter-spacing: 0.1em; margin-bottom: 4px; }
.tc-list-preview { font-size: 13px; color: var(--tc-text); line-height: 1.6; }
.tc-list-right { text-align: right; flex-shrink: 0; }
.tc-list-opens { font-size: 11px; color: var(--tc-gold); letter-spacing: 0.03em; white-space: nowrap; }
.tc-list-dday { font-size: 10px; color: var(--tc-text2); margin-top: 3px; }
.tc-list-open-tag { color: rgba(50,200,50,0.7) !important; }
.tc-list-empty { text-align: center; padding: 28px 0; font-size: 13px; color: var(--tc-text2); line-height: 2.2; }
.tc-loading { text-align: center; padding: 24px 0; font-size: 12px; color: var(--tc-text2); }

/* ── 에러 / 안내 ───────────────────────────────── */
.tc-err { color: #ff8866; font-size: 12px; margin: 10px 0; background: rgba(180,60,30,0.08); border: 1px solid rgba(180,60,30,0.2); border-radius: 2px; padding: 9px 12px; }
.tc-info-box { background: rgba(200,150,10,0.04); border: 1px solid rgba(200,150,10,0.12); border-radius: 2px; padding: 12px 14px; font-size: 12px; color: var(--tc-text2); line-height: 2; margin: 12px 0; }

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

/* ── 제한 초과 ────────────────────────────────── */
.tc-limit-title { font-size: 15px; font-weight: 600; color: #e8d0a0; margin-bottom: 14px; }
.tc-limit-body { font-size: 13px; color: var(--tc-text2); line-height: 2.1; margin-bottom: 18px; }
.tc-limit-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── 모바일 ───────────────────────────────────── */
@media (max-width: 480px) {
  .tc-card { padding: 26px 18px; }
  .tc-home-title { font-size: 24px; }
  .tc-code-val { font-size: 26px; letter-spacing: 0.22em; }
  .tc-countdown-grid { gap: 5px; }
  .tc-countdown-unit { min-width: 50px; padding: 10px 8px; }
  .tc-countdown-num { font-size: 20px; }
  .tc-home-grid { grid-template-columns: 1fr 1fr; }
  .tc-date-quick { gap: 4px; }
  .tc-date-btn { padding: 6px 8px; font-size: 10px; }
}

/* ── 애니메이션 ───────────────────────────────── */
@keyframes tc-twinkle { 0%,100% { opacity: var(--a,.3); } 50% { opacity: calc(var(--a,.3)*0.1); } }
@keyframes tc-fadein { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes tc-flicker { 0%,92%,100%{opacity:1;} 93%{opacity:.7;} 95%{opacity:1;} 97%{opacity:.85;} }
@keyframes tc-capsule-settle { 0%{transform:translateY(-6px);} 100%{transform:translateY(0);} }
@keyframes tc-shake { 0%,100%{transform:translateX(0);} 20%{transform:translateX(-6px);} 40%{transform:translateX(5px);} 60%{transform:translateX(-4px);} 80%{transform:translateX(3px);} }
@keyframes tc-open-reveal { from{clip-path:inset(0 0 100% 0);opacity:0;} to{clip-path:inset(0 0 0% 0);opacity:1;} }

.tc-fadein { animation: tc-fadein 0.45s cubic-bezier(0.22,1,0.36,1) both; }
.tc-shake  { animation: tc-shake 0.4s ease; }
.tc-open-reveal { animation: tc-open-reveal 0.9s cubic-bezier(0.22,1,0.36,1) both; }
