/* ============================================================
   MONSTER HOOPS ACADEMY — common.css
   모든 페이지 공통 기반 스타일
   ============================================================ */

/* ── 리셋 ── */
*, *::before, *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
}

/* ── 루트 변수 ── */
:root {
  --bg: #1c1c1e;
  --accent: #4ade80;
  --purple: #a78bfa;
  --blue: #60a5fa;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── HTML 배경 ── */
html {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(74,222,128,.09) 0%, transparent 60%),
    radial-gradient(ellipse 55% 35% at 85% 85%, rgba(99,150,255,.06) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

/* ── Body ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: #fff;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ── 버튼·링크 기본 리셋 ── */
button, a {
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
  color: inherit;
  text-decoration: none;
}

/* ── 공통 컨테이너 ──
   nav.js / ChannelIO 등 외부 스크립트 충돌 방지를 위해
   개별 속성 + !important 사용
── */
.container {
  max-width: 680px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
}

/* ── 스크롤바 숨김 ── */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ── 한국어 줄바꿈 ── */
p, span, div, h1, h2, h3, h4 {
  word-break: keep-all;
}

/* ── 로딩 스피너 ── */
#loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  gap: 16px;
  transition: opacity .35s;
}
#loading.out {
  opacity: 0;
  pointer-events: none;
}
.spin {
  width: 32px;
  height: 32px;
  border: 2.5px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mh-spin .7s linear infinite;
}
@keyframes mh-spin { to { transform: rotate(360deg); } }

/* ── 섹션 헤더 ── */
.sec-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.sec-divider {
  height: .5px;
  background: rgba(255,255,255,.07);
  margin: 8px 0;
}
.sec-lbl {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,.3);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* ── 빈 상태 ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state-icon { font-size: 44px; }
.empty-state-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.empty-state-sub {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  line-height: 1.65;
  word-break: keep-all;
}
.empty-state-btn {
  margin-top: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.25);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
}

/* ── 날짜 구분선 ── */
.date-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.date-sep-line {
  flex: 1;
  height: .5px;
  background: rgba(255,255,255,.07);
}
.date-sep-txt {
  font-size: 11px;
  color: rgba(255,255,255,.25);
  font-weight: 600;
  white-space: nowrap;
}

/* ── 스켈레톤 로딩 ── */
.skel {
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  animation: mh-skel 1.4s ease-in-out infinite;
}
@keyframes mh-skel {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ── 공통 카드 ── */
.card {
  background: rgba(255,255,255,.04);
  border: .5px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 18px;
}

/* ── 공통 뱃지·태그 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}
.badge-green {
  background: rgba(74,222,128,.12);
  border: .5px solid rgba(74,222,128,.25);
  color: var(--accent);
}
.badge-purple {
  background: rgba(167,139,250,.12);
  border: .5px solid rgba(167,139,250,.25);
  color: var(--purple);
}
.badge-blue {
  background: rgba(96,165,250,.12);
  border: .5px solid rgba(96,165,250,.25);
  color: var(--blue);
}
.badge-yellow {
  background: rgba(251,191,36,.12);
  border: .5px solid rgba(251,191,36,.25);
  color: var(--yellow);
}
.badge-red {
  background: rgba(248,113,113,.12);
  border: .5px solid rgba(248,113,113,.25);
  color: var(--red);
}

/* ── 공통 버튼 ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 100px;
  background: var(--accent);
  color: #000;
  font-size: 15px;
  font-weight: 900;
  font-family: var(--font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s, transform .15s;
}
.btn-primary:active { opacity: .8; transform: scale(.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 100px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity .15s;
}
.btn-secondary:active { opacity: .7; }

/* ── online/offline nav 숨김 (PWA) ── */
.site-nav { display: none !important; }
