/* ==========================================================================
   KYANOS SOVEREIGN REALM - MOBILE OPTIMIZATION ENGINE
   전용 모바일 반응형 UI & PWA 쾌속 내비게이션 표준 스타일시트
   ========================================================================== */

/* 1. Header Mobile Toggle Button */
.mobile-menu-btn {
  display: none;
  background: rgba(34, 46, 79, 0.85);
  border: 1.5px solid var(--gold, #f59e0b);
  border-radius: 10px;
  color: var(--gold-light, #fde68a);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 101;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(245, 158, 11, 0.25);
  transition: all 0.3s ease;
  padding: 0;
}

.mobile-menu-btn:active {
  transform: scale(0.92);
  background: rgba(245, 158, 11, 0.2);
}

/* 2. Mobile Slide-out Drawer Overlay */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 24, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: linear-gradient(180deg, #19223c 0%, #12182b 100%);
  border-left: 1.5px solid rgba(245, 158, 11, 0.35);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.active {
  right: 0;
}

/* Drawer Header */
.drawer-header {
  padding: 1.25rem 1.2rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(40, 54, 92, 0.4);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.drawer-symbol {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold, #f59e0b);
  background: radial-gradient(circle, #00d2ff 0%, #06152d 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.drawer-title-group h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: #fff;
  line-height: 1.1;
  margin: 0;
}

.drawer-title-group span {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--gold-light, #fde68a);
  text-transform: uppercase;
}

.drawer-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover, .drawer-close-btn:active {
  color: #fff;
  border-color: var(--gold, #f59e0b);
  background: rgba(245, 158, 11, 0.15);
}

/* Drawer Navigation List */
.drawer-content {
  padding: 1rem 0.8rem;
  flex: 1;
}

.drawer-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold, #f59e0b);
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  margin-top: 0.6rem;
}

.drawer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: rgba(25, 34, 60, 0.4);
  border: 1px solid transparent;
}

.drawer-nav-item a:active, .drawer-nav-item a:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fff;
  transform: translateX(4px);
}

.drawer-nav-item a .item-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.drawer-nav-item a .item-arrow {
  margin-left: auto;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Drawer Footer */
.drawer-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  text-align: center;
  background: rgba(15, 21, 38, 0.6);
}

.drawer-footer p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.drawer-motto {
  font-size: 0.68rem;
  color: var(--gold-light, #fde68a);
  font-style: italic;
}

/* 3. Mobile Bottom Floating Bar (스마트폰 엄지손가락 퀵 컨트롤러) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(18, 25, 45, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.6);
  z-index: 9990;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-container {
  display: flex;
  height: 100%;
  justify-content: space-around;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  gap: 3px;
  width: 20%;
  height: 100%;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item .b-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.bottom-nav-item:active, .bottom-nav-item.active {
  color: var(--gold-bright, #fde68a);
}

.bottom-nav-item:active .b-icon {
  transform: translateY(-2px) scale(1.1);
}

/* 4. Responsive Breakpoint Rules */
@media (max-width: 992px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  
  header {
    padding: 0.85rem 1.2rem !important;
  }

  .nav-links {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 74px !important; /* 바텀 바에 가려지지 않도록 안전 공간 확보 */
  }

  .mobile-bottom-nav {
    display: block;
  }

  /* Intro Gateway (index.html) Mobile Polish */
  .top-brand-emblem {
    top: 0.8rem !important;
    left: 0.8rem !important;
    padding: 5px 12px !important;
  }

  .intro-main-container {
    margin-top: 4.5rem !important;
    padding: 0 10px;
  }

  .flag-card-wrap {
    width: 86vw !important;
    max-width: 340px !important;
  }

  .brand-cards-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 92vw !important;
    max-width: 440px !important;
  }

  .brand-mini-card {
    padding: 10px 12px !important;
  }

  /* Main Portal (main.html) Content Tweaks */
  .hero-title {
    font-size: clamp(2rem, 8vw, 2.8rem) !important;
    letter-spacing: 0.12em !important;
  }

  .hero-motto-box {
    padding: 1rem 1.2rem !important;
    font-size: 0.88rem !important;
  }

  .cta-group {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 1.5rem auto 0 !important;
  }

  .cta-group .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .pillars-grid {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
  }

  .virtue-grid-layout {
    grid-template-columns: 1fr !important;
  }

  .virtue-frame-preview {
    max-width: 100% !important;
  }
}
