/* ============================================================
   RRC 허브 — app.css
   네이비 + 화이트 (업그레이드 버전)
   ============================================================ */

:root {
  --bg:       #0a1428;
  --bg2:      #0f1a35;
  --surface:  #142042;
  --surface2: #1a2752;
  --line:     rgba(255,255,255,.08);
  --line2:    rgba(255,255,255,.15);

  --navy:     #1e2a52;
  --navy-light: #243762;

  --tx:       #ffffff;
  --tx2:      #a4b0c5;
  --tx3:      #5a6582;

  --r:  16px;
  --r2: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(60, 100, 200, .15) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(60, 100, 200, .08) 0%, transparent 50%),
    var(--bg);
  color: var(--tx);
  font-family: 'Pretendard', -apple-system, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fade { animation: fadeIn .42s ease both; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ============================================================
   허브 메인
   ============================================================ */
.hub {
  width: 100%;
  max-width: 420px;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   상단 헤더
   ============================================================ */
.topbar {
  text-align: center;
  padding: 20px 0 10px;
}

.topbar-logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -.04em;
  color: #fff;
  line-height: .9;
  font-style: italic;
  transform: skewX(-8deg);
  display: inline-block;
  padding: 0 12px 0 4px;
  background: linear-gradient(180deg, #ffffff 0%, #c5d2e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 24px rgba(255,255,255,.08);
}

.topbar-divider {
  width: 180px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  margin: 6px auto 6px;
}

.topbar-sub {
  font-family: 'Archivo Black', sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .28em;
  color: rgba(255,255,255,.7);
  margin-right: -0.28em;
}

/* ============================================================
   히어로
   ============================================================ */
.hero {
  position: relative;
  padding: 18px 24px 22px;
  margin-top: 4px;
  background:
    linear-gradient(135deg, rgba(30, 42, 82, .9) 0%, rgba(15, 24, 48, .9) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
}

.hero-glow {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(120, 160, 240, .12) 0%, transparent 50%);
  pointer-events: none;
}

/* 캐릭터 컨테이너 */
.hero-char-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.hero-char-circle {
  width: 130px;
  height: 130px;
  border-radius: 0;
  background: #ffffff;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.08),
    0 6px 20px rgba(0, 0, 0, .4);
}

.hero-char {
  width: 130px;
  height: 130px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* 히어로 텍스트 */
.hero-text {
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -.01em;
}

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #6ee7c7;
  box-shadow: 0 0 8px #6ee7c7;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.hero h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 0%, #b4c5e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .hl {
  background: linear-gradient(135deg, #fff 0%, #b4c5e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tag {
  font-size: 12px;
  color: var(--tx2);
  font-weight: 500;
}

/* ============================================================
   카테고리 그리드
   ============================================================ */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 12px;
  background: var(--surface);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, border-color .15s, background .15s;
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
}

.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 0%, rgba(120, 160, 240, .08) 0%, transparent 60%);
  pointer-events: none;
}

.cat-card:active { transform: scale(.97); }
.cat-card:hover {
  border-color: #fff;
  background: var(--surface2);
}

.cat-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: #ffffff;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.cat-icon-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.cat-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
  margin-bottom: 2px;
}

.cat-desc {
  font-size: 10px;
  color: var(--tx2);
  line-height: 1.4;
}

/* ============================================================
   푸터
   ============================================================ */
.foot {
  margin-top: 14px;
  text-align: center;
}

.foot-line {
  width: 32px;
  height: 1px;
  background: var(--line2);
  margin: 0 auto 8px;
}

.foot-text {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  letter-spacing: .2em;
  color: var(--tx3);
}

/* ============================================================
   모달
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}

.modal.on { opacity: 1; pointer-events: auto; }

.modal-body {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(135deg, rgba(30, 42, 82, 1) 0%, rgba(15, 24, 48, 1) 100%);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 24px 20px 20px;
  transform: scale(.95);
  transition: transform .22s;
}

.modal.on .modal-body { transform: scale(1); }

.modal-body h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 16px;
  color: #fff;
}

.event-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line2);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
  transition: border-color .15s, transform .12s, background .15s;
}

.event-link:active { transform: scale(.98); }
.event-link:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.07); }

.event-icon { font-size: 28px; flex-shrink: 0; }
.event-info { flex: 1; min-width: 0; }
.event-name { font-size: 14px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.event-desc { font-size: 11px; color: var(--tx2); }
.event-arrow { font-size: 18px; color: var(--tx3); }

.modal-close {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--tx2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s;
}

.modal-close:hover { color: #fff; }

/* safe-area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .hub { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
}
