/* ==========================================================
   갈색 테마 (Brown Theme) - 할머니 생신 & 권사님 임직 축하 사이트
   ========================================================== */

:root {
  --color-bg-darkest: #1a0f0a;
  --color-bg-dark: #2a1810;
  --color-bg-card: #382116;
  --color-bg-card-rgb: 56, 33, 22;
  --color-border-dark: #5a3522;
  --color-border-gold: #c68a4c;
  --color-border-soft: #845336;
  --color-btn-gradient-top: #683d25;
  --color-btn-gradient-bottom: #472615;
  --color-btn-hover-top: #7d4a2e;
  --color-btn-hover-bottom: #552f1b;
  --color-text-title: #f5dfbe;
  --color-text-main: #f0dfcc;
  --color-text-muted: #c9ab8f;
  --color-text-paper: #2e1a10;
  --color-paper-bg: #f9f2e7;
  --color-paper-bg-warm: #f1e4ce;
  --color-paper-border: #8b5a35;
  --font-serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --font-sans: 'Noto Sans KR', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-serif);
  background: radial-gradient(circle at center, #351e14 0%, #20110b 60%, #120906 100%);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* 캔버스 (폭죽 & 컨페티) */
#fxCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
}

/* 음악 컨트롤 바 (우측 상단) */
.audio-control-bar {
  position: fixed;
  top: 20px;
  right: 25px;
  z-index: 200;
  animation: fadeInDown 0.6s ease;
}

.audio-btn {
  background: rgba(56, 33, 22, 0.85);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--color-border-gold);
  color: var(--color-text-title);
  padding: 9px 18px;
  border-radius: 25px;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.audio-btn:hover {
  background: var(--color-btn-gradient-top);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 138, 76, 0.35);
}

/* 메인 컨테이너 */
.main-container {
  width: 100%;
  max-width: 900px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* 화면 섹션 전환 */
.screen-section {
  display: none;
  width: 100%;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen-section.active {
  display: block;
  opacity: 1;
  transform: scale(1);
}

/* 브라운 테마 카드 */
.brown-card {
  background: linear-gradient(145deg, rgba(62, 37, 25, 0.94), rgba(42, 24, 16, 0.96));
  border: 2px solid var(--color-border-gold);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(245, 223, 190, 0.2),
    0 0 25px rgba(198, 138, 76, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-ornament {
  color: var(--color-border-gold);
  font-size: 1.1rem;
  letter-spacing: 6px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.card-title {
  color: var(--color-text-title);
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.7);
}

.card-subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-bottom: 25px;
}

/* 로그인 카드 */
.login-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 40px 35px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.95rem;
  color: var(--color-text-title);
  margin-bottom: 8px;
  font-weight: 600;
}

.brown-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 6px;
  background-color: var(--color-bg-darkest);
  color: var(--color-text-title);
  border: 1.5px solid var(--color-border-soft);
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.brown-input:focus {
  border-color: var(--color-border-gold);
  box-shadow: 0 0 15px rgba(198, 138, 76, 0.4), inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.error-text {
  color: #ff9e80;
  font-size: 0.95rem;
  min-height: 24px;
  margin-bottom: 16px;
  font-weight: bold;
}

/* 브라운 버튼 공통 */
.brown-btn {
  background: linear-gradient(180deg, var(--color-btn-gradient-top) 0%, var(--color-btn-gradient-bottom) 100%);
  color: var(--color-text-title);
  border: 1.5px solid var(--color-border-gold);
  padding: 14px 38px;
  font-size: 1.15rem;
  font-family: var(--font-serif);
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
  letter-spacing: 1px;
}

.brown-btn:hover {
  background: linear-gradient(180deg, var(--color-btn-hover-top) 0%, var(--color-btn-hover-bottom) 100%);
  border-color: #ffd699;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(198, 138, 76, 0.4);
}

.brown-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}

.pulse-btn {
  animation: brownPulse 2s infinite ease-in-out;
}

@keyframes brownPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(198, 138, 76, 0.6);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(198, 138, 76, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(198, 138, 76, 0);
  }
}

/* 이미지 카드 & 래퍼 */
.image-card {
  padding: 24px;
  max-width: 780px;
  margin: 0 auto;
}

.image-wrapper {
  width: 100%;
  max-height: 60vh;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--color-border-soft);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  margin-bottom: 24px;
  background-color: var(--color-bg-darkest);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.btn-container {
  display: flex;
  justify-content: center;
  padding: 5px 0 10px 0;
}

/* ==========================================================
   5단계: 5cm 여백 축하 편지 모달 (종이)
   ========================================================== */
.paper-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(22, 12, 7, 0.78);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  /* 화면 상하좌우 5cm 여백 */
  padding: 5cm;
  box-sizing: border-box;
}

.paper-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

/* 화면이 작을 경우 반응형 여백 (모바일/태블릿 등) */
@media (max-width: 1000px), (max-height: 850px) {
  .paper-modal-overlay {
    padding: clamp(20px, 4vw, 5cm);
  }
}

.paper-envelope-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vintage-paper {
  background: radial-gradient(circle at 50% 40%, var(--color-paper-bg) 0%, var(--color-paper-bg-warm) 85%, #dfcbb0 100%);
  width: 100%;
  height: 100%;
  max-width: 820px;
  max-height: 640px;
  border-radius: 16px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.65),
    0 0 40px rgba(139, 90, 53, 0.35),
    inset 0 0 60px rgba(110, 68, 38, 0.18);
  border: 3px solid var(--color-paper-border);
  position: relative;
  padding: 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  animation: paperAppear 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes paperAppear {
  0% {
    transform: scale(0.65) rotate(-2deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.paper-corner {
  position: absolute;
  color: var(--color-paper-border);
  font-size: 1.6rem;
  opacity: 0.75;
}
.paper-corner.top-left { top: 12px; left: 14px; }
.paper-corner.top-right { top: 12px; right: 14px; }
.paper-corner.bottom-left { bottom: 12px; left: 14px; }
.paper-corner.bottom-right { bottom: 12px; right: 14px; }

.paper-inner-border {
  border: 1.5px dashed var(--color-paper-border);
  border-radius: 10px;
  height: 100%;
  padding: 30px 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

.paper-header {
  width: 100%;
}

.paper-badge {
  display: inline-block;
  background: var(--color-paper-border);
  color: #fff9f0;
  padding: 4px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  letter-spacing: 2px;
  font-weight: bold;
  margin-bottom: 8px;
}

.paper-divider {
  color: var(--color-paper-border);
  font-size: 1rem;
  letter-spacing: 8px;
  opacity: 0.8;
}

.paper-body {
  margin: 15px 0;
}

.paper-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-text-paper);
  line-height: 1.45;
  margin-bottom: 18px;
  font-family: 'Nanum Myeongjo', 'Gowun Batang', serif;
}

.paper-highlight {
  color: #933816;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  display: inline-block;
  margin-top: 6px;
  font-size: 2.4rem;
}

.paper-blessing-text {
  font-size: 1.15rem;
  line-height: 1.85;
  color: #442a1d;
  font-weight: 600;
  max-width: 620px;
  margin: 0 auto;
}

.paper-footer {
  width: 100%;
}

.paper-signature {
  font-size: 1.25rem;
  color: var(--color-text-paper);
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: 2px;
}

/* 애니메이션 헬퍼 */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
