/* gatekeeper.css - Refined Layout & User Branded Styles */

:root {
  /* 사용자가 요청한 이미지 컬러 (앰버/오렌지 계열) */
  --primary: #ff9d42; 
  --primary-glow: rgba(255, 157, 66, 0.4);
  --bg-dark: #0b0d11;
  --text-main: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.4);
  /* 글꼴을 Segoe UI 기반으로 통일 */
  --font-main: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow: hidden;
}

/* Minimalist Dot Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 157, 66, 0.05) 1px, transparent 0);
  background-size: 30px 30px;
  z-index: 1;
  pointer-events: none;
}

#gatekeeper-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100; /* ★ 기본값은 낮게 설정 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-dark);
  text-align: center;
  transition: opacity 0.4s ease;
}

/* ★ 세로 모드 안내 시에만 로딩 바 위로 올라오도록 추가 */
#gatekeeper-container.on-top {
  z-index: 3000 !important;
}

#app-shell-iframe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 10;
  display: none;
}

/* Branding - 세로 모드에서만 강조 */
#brand-header {
  position: relative;
  z-index: 10;
  margin-bottom: 50px;
  transition: display 0.3s ease;
}

.brand-title {
  font-size: 2.6rem;
  font-weight: 800; /* 전체적으로 두꺼운 웨이트 적용 */
  letter-spacing: 0.1em;
  line-height: 1.1; /* 두 줄 배치를 위한 행간 조정 */
  color: #ffffff;
  margin-bottom: 20px; /* 행간 조정에 따른 여백 미세조정 */
  text-transform: uppercase;
}

.brand-logo {
  height: 130px; /* 최종 크기 조정 (130px) */
  width: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 16px var(--primary-glow));
  vertical-align: middle;
}

/* ★ 접음 세로(Cover Screen) 최적화: UI 단순화 (문구만 1.5배 확대 적용) */
@media (max-width: 600px) {
  .brand-logo {
    height: 100px; 
    margin: 0 auto 25px !important; /* 중앙 정렬 위한 auto 마진 추가 */
    display: block !important;
  }
  /* 서브타이틀만 1.5배 확대 유지 */
  .brand-subtitle {
    display: block !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 1.05rem !important; 
    letter-spacing: 0.05em; 
    font-weight: 600;
    margin: 5px auto 0;
    width: 300px;
    text-align: center;
    opacity: 0.9;
  }
  .brand-title {
    font-size: 0 !important;
    margin-bottom: 8px !important;
    text-align: center; /* 부모에서도 중앙 정렬 보장 */
  }
}

.brand-koko {
  display: none;
}

.brand-twin {
  color: #00e5ff; /* 요청하신 파란색 (AI 시안 블루) */
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.brand-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* 가로 모드 최적화: 로고 숨기기 */
@media (orientation: landscape) {
  #brand-header {
    display: none;
  }
}

/* Orientation Guide */
#orientation-guide {
  display: none;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.guide-icon-minimal {
  width: 50px;
  height: 80px;
  border: 2px solid var(--primary); /* 1px 상향 및 불투명 적용 */
  background: rgba(255, 157, 66, 0.1); /* 은은한 내부 채우기 추가 */
  border-radius: 8px;
  position: relative;
  margin-bottom: 25px;
  box-shadow: 0 0 15px var(--primary-glow); /* 글로우 효과 추가 */
  animation: rotateGuideSimple 3s infinite ease-in-out;
}

.guide-icon-minimal::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.guide-text {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.guide-text strong {
  color: var(--primary);
  font-weight: 600;
}

/* Start Interaction - Landscape 집중 모드 */
#start-prompt {
  display: none;
  position: relative;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
}

.start-button-capsule {
  position: relative;
  padding: 18px 50px;
  border-radius: 50px;
  background: rgba(255, 157, 66, 0.05);
  border: 1px solid rgba(255, 157, 66, 0.3);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.start-button-capsule::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 157, 66, 0.2), transparent);
  animation: shimmer 2.5s infinite;
}

.start-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--primary);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--primary-glow);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px var(--primary);
  animation: blink 1.5s infinite;
}

.status-text {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Loading Overlay */
#loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 2000; /* ★ 기본 가시성 확보 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loading-label {
  font-size: 0.8rem;
  color: var(--primary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 25px;
}

.progress-track {
  width: 240px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

#loading-text {
  margin-top: 15px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 1px;
}

/* Status Badge - Unified Amber Theme */
.status-badge {
  margin-top: 40px;
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(255, 157, 66, 0.1);
  border: 1px solid rgba(255, 157, 66, 0.3);
  box-shadow: 0 0 15px rgba(255, 157, 66, 0.1);
  color: #ff9d42;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  animation: badge-glow 2.5s infinite alternate;
}

@keyframes badge-glow {
  from { box-shadow: 0 0 10px rgba(255, 157, 66, 0.1); border-color: rgba(255, 157, 66, 0.3); }
  to { box-shadow: 0 0 20px rgba(255, 157, 66, 0.3); border-color: rgba(255, 157, 66, 0.6); }
}

/* Animations */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.9); }
}

@keyframes rotateGuideSimple {
  0%, 20% { transform: rotate(0deg); }
  45%, 55% { transform: rotate(-90deg); }
  80%, 100% { transform: rotate(0deg); }
}

/* Sleep Overlay (Idle Screen) */
#sleep-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 12, 0.92); /* 조금 더 진한 배경으로 변경 */
  z-index: 5000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  transition: opacity 0.5s ease;
}

.sleep-content {
  text-align: center;
  animation: fadeInDown 0.8s ease-out;
}

.sleep-chick {
  width: 160px; /* 살짝 축소 */
  height: auto;
  margin-bottom: 5px; /* 간격 대폭 축소 */
  filter: drop-shadow(0 0 15px rgba(255, 157, 66, 0.3));
  animation: sleepPulse 3s infinite ease-in-out;
}

.sleep-status {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 4px; /* 12px -> 4px */
  text-shadow: 0 0 15px var(--primary-glow);
}

.sleep-msg {
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  opacity: 0.8;
}

@keyframes sleepPulse {
  0%, 100% { 
    transform: translateY(0) scale(1); 
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(255, 157, 66, 0.2));
  }
  50% { 
    transform: translateY(-12px) scale(1.08); 
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(255, 157, 66, 0.5));
  }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 절전 시간 설정 버튼 스타일 --- */
.idle-time-settings {
  margin-top: 15px; /* 30px -> 15px */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px; /* 15px -> 10px */
  pointer-events: auto; 
}

.idle-btn-group {
  display: flex;
  gap: 8px; /* 10px -> 8px */
}

.idle-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 157, 66, 0.3);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}

.idle-btn:active {
  transform: scale(0.95);
  background: rgba(255, 157, 66, 0.2);
}

.idle-btn.active {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 15px var(--primary-glow);
}

.idle-confirm-msg {
  height: 20px;
  font-size: 0.8rem;
  color: #00e5ff; /* 성공 확인 색상 */
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.idle-confirm-msg.show {
  opacity: 1;
}

.visible { display: flex !important; }
.hidden { display: none !important; }
.no-transition { transition: none !important; }
