/* ===================================
   KMS — Korea Mace SMP  |  공유 스타일
=================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&family=Black+Han+Sans&display=swap');

:root {
  --gold:    #f5c518;
  --orange:  #e8873a;
  --dark:    #0a0a0f;
  --dark2:   #12121a;
  --dark3:   #1a1a26;
  --card-bg: #1e1e2e;
  --text:    #f0f0f0;
  --muted:   #8888aa;
  --accent:  #ff6b35;
  --discord: #5865f2;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 60px;
  height: 72px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(245, 197, 24, 0.15);
  transition: background 0.3s, border-color 0.3s;
}

header.scrolled {
  background: rgba(10, 10, 15, 0.98);
  border-bottom-color: rgba(245, 197, 24, 0.3);
}

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

.logo-icon { font-size: 1.6rem; filter: drop-shadow(0 0 8px var(--gold)); }

.logo h1 {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul { list-style: none; display: flex; gap: 4px; }

nav ul li a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: #bbb;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--gold);
  background: rgba(245, 197, 24, 0.08);
}

.nav-join {
  background: linear-gradient(135deg, var(--gold), var(--orange)) !important;
  color: #000 !important;
  font-weight: 700 !important;
}

.nav-join:hover {
  opacity: 0.85 !important;
  background: linear-gradient(135deg, var(--gold), var(--orange)) !important;
}

/* ── Page wrapper (push below fixed header) ── */
.page-wrap { padding-top: 72px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all 0.25s;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #000;
  box-shadow: 0 0 24px rgba(245, 197, 24, 0.3);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 36px rgba(245, 197, 24, 0.45);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.btn-outline:hover {
  border-color: rgba(245, 197, 24, 0.5);
  color: var(--gold);
  background: rgba(245, 197, 24, 0.07);
  transform: translateY(-3px);
}

.btn-discord {
  background: var(--discord);
  color: #fff;
}
.btn-discord:hover {
  background: #4752c4;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(88, 101, 242, 0.4);
}

/* ── Section common ── */
.section-tag {
  display: inline-block;
  background: rgba(245, 197, 24, 0.1);
  border: 1px solid rgba(245, 197, 24, 0.3);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
}

/* ── Card ── */
.kms-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
              border-color 0.35s, box-shadow 0.35s;
}

.kms-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 197, 24, 0.22);
  box-shadow: 0 16px 50px rgba(0,0,0,0.4);
}

.kms-card .card-accent {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}

.kms-card:hover .card-accent { opacity: 1; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Page hero (sub-pages) ── */
.page-hero {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/images/season1_banner.jpg') center/cover no-repeat;
  filter: brightness(0.18) saturate(0.5);
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--dark) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 10;
  padding: 0 24px;
}

.page-hero-content .section-tag { display: block; margin-bottom: 16px; }

.page-hero-content h1 {
  font-family: 'Black Han Sans', sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  background: linear-gradient(135deg, #fff, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero-content p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ── Footer ── */
footer {
  background: #07070d;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 36px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.83rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold); }

.footer-copy {
  color: #3a3a4a;
  font-size: 0.78rem;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 16px;
}

/* ── Toast ── */
.copied-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--card-bg);
  border: 1px solid rgba(245, 197, 24, 0.3);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  opacity: 0;
  transition: all 0.3s;
  z-index: 99999;
  pointer-events: none;
}
.copied-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #18182a;
  border: 1px solid rgba(245, 197, 24, 0.18);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 90px rgba(0,0,0,0.75);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--gold) 50%, transparent 95%);
  opacity: 0.55;
}

@keyframes modalIn {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.05rem;
  color: var(--gold);
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
}
.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.modal-body {
  padding: 20px 26px 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.84rem;
  color: #aaaacc;
  line-height: 1.75;
  scrollbar-width: thin;
  scrollbar-color: rgba(245,197,24,0.25) transparent;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(245,197,24,0.25); border-radius: 2px; }

.modal-body h3 {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 18px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p  { margin-bottom: 8px; }
.modal-body ul { padding-left: 18px; margin-bottom: 8px; }
.modal-body ul li { margin-bottom: 4px; }

/* 약관 동의 체크박스 */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
}
.form-check-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.form-check-text a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.form-check-text a:hover { text-decoration: underline; }

/* ── Nav Login Button ── */
.nav-login {
  border: 1px solid rgba(245, 197, 24, 0.35) !important;
  color: var(--gold) !important;
  border-radius: 8px;
}
.nav-login:hover {
  background: rgba(245, 197, 24, 0.1) !important;
  border-color: var(--gold) !important;
}

/* ── Nav User Menu ── */
.nav-user-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-user-btn:hover {
  background: rgba(245, 197, 24, 0.08);
  border-color: rgba(245, 197, 24, 0.3);
  color: var(--gold);
}

.nav-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(245, 197, 24, 0.3);
}

.nav-chevron {
  opacity: 0.55;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-user-item:has(.nav-dropdown.open) .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #1a1a28;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 6px;
  min-width: 170px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  z-index: 10000;
}
.nav-dropdown.open {
  display: block;
  animation: dropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.nav-dropdown-user {
  padding: 10px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 4px;
}
.nav-dropdown-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.nav-dropdown-user-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  border-radius: 9px;
  color: #ccccdd;
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  text-decoration: none;
}
.nav-dropdown-item:hover {
  background: rgba(255, 80, 80, 0.1);
  color: #ff8080;
}
.nav-dropdown-item svg { flex-shrink: 0; opacity: 0.75; }

/* ── 햄버거 메뉴 버튼 ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.06); }
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, background 0.2s;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ── */
@media (max-width: 900px) {
  header { padding: 0 24px; }
  footer  { padding: 28px 24px; }
}

/* 태블릿/모바일: 햄버거 전환 */
@media (max-width: 768px) {
  header {
    flex-direction: row;
    height: 60px;
    padding: 0 16px;
    position: fixed;
    align-items: center;
  }

  .nav-hamburger { display: flex; }

  .page-wrap { padding-top: 60px; }

  header nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: rgba(8, 8, 14, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(245, 197, 24, 0.18);
    padding: 8px 12px 16px;
    z-index: 9997;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  header nav.nav-open { display: block; }

  header nav ul {
    flex-direction: column;
    gap: 2px;
  }
  header nav ul li { width: 100%; }
  header nav ul li a {
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 10px;
    display: block;
    width: 100%;
  }
  .nav-join {
    margin-top: 8px;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    text-align: center;
    width: 100%;
    display: block !important;
  }
  .nav-login {
    margin-top: 4px;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    display: block !important;
    text-align: center;
    width: 100%;
  }
  .nav-user-item {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 4px;
  }
  .nav-user-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    justify-content: flex-start;
  }
  .nav-dropdown {
    position: static;
    box-shadow: none;
    min-width: unset;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    margin-top: 4px;
    display: none;
  }
  .nav-dropdown.open { display: block; animation: none; }

  /* 푸터 */
  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
    gap: 12px;
  }
  .footer-links { justify-content: center; gap: 12px; flex-wrap: wrap; }

  /* 서브페이지 히어로 */
  .page-hero { height: 220px; }
  .page-hero-content h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }

  /* 모달: 아래에서 올라오는 시트 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    width: 100%;
    max-width: 100%;
  }
}

/* 소형 모바일 */
@media (max-width: 480px) {
  .page-hero { height: 180px; }
  .page-hero-content h1 { font-size: 1.7rem; }
  .page-hero-content p  { font-size: 0.85rem; }

  /* 버튼 풀-width */
  .btn { width: 100%; max-width: 340px; justify-content: center; }

  /* 토스트: iOS 홈바 위 */
  .copied-toast {
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}
