/* /assets/css/app.css */
:root{
  --bg:#0b0e14;
  --card:#101522;
  --text:#e9eefc;
  --muted:#9aa7c7;
  --line:rgba(255,255,255,.08);
  --line2:rgba(255,255,255,.12);
  --btn:#1e2a44;
  --btn2:#182133;
  --good:#4be38a;
  --bad:#ff5c5c;
  --pill:rgba(255,255,255,.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; overflow-x:hidden; }  /* 가로 스크롤 완전 차단 */

body{
  margin:0;
  background:
    radial-gradient(800px 420px at 20% -12%, rgba(88,140,255,.16), transparent 60%),
    radial-gradient(700px 380px at 80% -14%, rgba(255,170,70,.08), transparent 58%),
    var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

.page{ min-height:100%; display:flex; flex-direction:column; }
.main-wrap{ width:100%; max-width:1100px; margin:0 auto; padding:20px 16px 50px; flex:1; }
@media (max-width:500px){
  .main-wrap{ padding:14px 12px 40px; }
  .hero h1{ font-size:20px; }
  .hero-actions{ gap:8px; }
  .hero-actions .btn{ padding:9px 12px; font-size:13px; }
  .footer-inner{ padding:14px 12px; }
}

/* =========================
   Header
========================= */
.top-header{
  position:sticky;
  top:0;
  z-index:200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10,12,18,.82);
  border-bottom:1px solid var(--line);
  /* 헤더 자체는 overflow hidden 하지 않음 - 드롭다운이 아래로 나와야 하므로 */
}

.hdr-inner{
  max-width:1100px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height: 54px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  color:var(--text);
  flex-shrink:0;
}
.brand-logo{
  width:30px;
  height:30px;
  border-radius:8px;
  display:block;
  object-fit:cover;
}
.brand-name{
  font-size:14px;
  font-weight:700;
  letter-spacing:.5px;
}

.hdr-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.net-badge{
  font-size:11px;
  color:var(--muted);
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  padding:6px 9px;
  border-radius:10px;
  white-space:nowrap;
  max-width:90px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 버튼 */
.btn{
  cursor:pointer;
  border:1px solid var(--line2);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color:var(--text);
  padding:8px 12px;
  border-radius:12px;
  font-size:13px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
  white-space:nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover{ border-color:rgba(255,255,255,.20); }
.btn:active{ transform: translateY(1px); opacity:.85; }
.btn.ghost{ background: rgba(255,255,255,.03); }

/* pending 상태일 때 게임 실행 버튼 활성화 스타일 */
.btn.btn-open-active{
  border-color: #39ff14;
  color: #39ff14;
  box-shadow: 0 0 8px rgba(57,255,20,.35);
  animation: pulse-green 1.6s ease-in-out infinite;
}
.btn.btn-open-active:hover{ background: rgba(57,255,20,.08); }
@keyframes pulse-green{
  0%,100%{ box-shadow: 0 0 6px rgba(57,255,20,.3); }
  50%    { box-shadow: 0 0 16px rgba(57,255,20,.65); }
}

/* 비활성화 버튼 */
.btn.btn-disabled{
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.btn-google{
  border-color: #4285f4;
  color: #7ab4ff;
  font-size: 12px;
  padding: 7px 10px;
}
.btn.btn-google:hover{ background: rgba(66,133,244,.12); }

/* =========================
   Desktop nav (≥ 900px)
========================= */
.desktop-nav{
  display:flex;
  align-items:center;
  gap:8px;
}

.desktop-nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 13px;
  border-radius:999px;
  font-size:13px;
  font-weight:600;
  letter-spacing:-.1px;
  color:rgba(234,241,255,.86);
  text-decoration:none;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  white-space:nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .12s;
}
.desktop-nav a:hover{
  transform:translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
  color:rgba(234,241,255,1);
}

/* 현재 페이지 강조 */
body[data-page="mypage"]   .desktop-nav a[href="mypage.html"],
body[data-page="offchain"] .desktop-nav a[href="offchain.html"]{
  background: linear-gradient(135deg,rgba(124,243,255,.22),rgba(74,163,255,.18));
  border-color:rgba(124,243,255,.35);
  color:rgba(234,241,255,1);
}

/* 햄버거: 기본 숨김 */
.burger{ display:none; }

/* =========================
   Mobile hamburger (≤ 900px)
========================= */
@media (max-width: 900px){
  .desktop-nav{ display:none; }

  .burger{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:5px;
    width:40px;
    height:40px;
    border-radius:12px;
    border:1px solid var(--line);
    background: rgba(255,255,255,.04);
    cursor:pointer;
    padding:0;
    flex-shrink:0;
    -webkit-tap-highlight-color:transparent;
    transition: background .15s, border-color .15s;
  }
  .burger:hover{ border-color:rgba(255,255,255,.20); background:rgba(255,255,255,.07); }
  .burger span{
    width:16px;
    height:2px;
    background:rgba(255,255,255,.80);
    border-radius:10px;
    transition: transform .2s, opacity .2s;
    display:block;
  }
  /* 열림 상태: X 모양 */
  .nav-open .burger span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
  .nav-open .burger span:nth-child(2){ opacity:0; transform:scaleX(0); }
  .nav-open .burger span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }
}

/* net-badge 모바일에서 축소 */
@media (max-width: 500px){
  .net-badge{ display:none; }
  .hdr-inner{ padding:8px 12px; }
}

/* =========================
   Mobile dropdown menu
   - 햄버거 클릭 → 헤더 바로 아래 드롭다운
   - 측면 슬라이드 없음 → 화면 밀림 없음
========================= */

/* backdrop: 드롭다운 뒤 어두운 배경 (클릭 시 닫힘) */
.nav-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
  z-index:199;
}
.nav-open .nav-backdrop{ opacity:1; pointer-events:auto; }

/* 드롭다운 패널: 헤더 바로 아래에서 아래로 펼침 */
.nav-drawer{
  position:absolute;         /* fixed 아닌 absolute → 화면 밀림 없음 */
  top:100%;                  /* 헤더 바로 아래 */
  left:0;
  right:0;
  z-index:201;
  background:rgba(10,13,20,.96);
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);

  /* 접힌 상태 */
  max-height:0;
  overflow:hidden;
  transition:max-height .22s cubic-bezier(.4,0,.2,1),
             box-shadow .22s ease;
  box-shadow:none;
}
.nav-open .nav-drawer{
  max-height:200px;          /* 메뉴 아이템 수에 맞게 충분히 크게 */
  box-shadow:0 8px 32px rgba(0,0,0,.35);
}

/* nav-top (MENU 타이틀 + X 버튼) — 드롭다운에선 숨김 */
.nav-top{ display:none; }

/* 드롭다운 내 링크: 가로 배치 */
.nav-links{
  display:flex;
  flex-direction:row;       /* ← 세로 → 가로 */
  flex-wrap:wrap;
  gap:8px;
  padding:12px 16px 14px;
  align-items:center;
}

.nav-links a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 16px;
  border-radius:999px;      /* pill 스타일 */
  font-size:13px;
  font-weight:600;
  color:rgba(234,241,255,.88);
  text-decoration:none;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  white-space:nowrap;
  transition:background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color:transparent;
}
.nav-links a:hover,
.nav-links a:active{
  background:rgba(255,255,255,.13);
  border-color:rgba(255,255,255,.22);
  color:rgba(234,241,255,1);
}

/* 데스크탑에선 드롭다운 완전히 숨김 */
@media (min-width: 901px){
  .nav-drawer{ display:none !important; }
  .nav-backdrop{ display:none !important; }
}

/* =========================
   Token bar (shown after wallet connect)
========================= */
.hdr-tokenbar{
  border-top:1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.tokenbar-inner{
  max-width:1100px;
  margin:0 auto;
  padding:10px 18px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.tok{
  display:flex;
  align-items:baseline;
  gap:8px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
}
.tok .s{ color:var(--muted); }
.tok .a{ color:var(--text); font-variant-numeric: tabular-nums; }
.tok.loading .a{ color:var(--muted); }

/* =========================
   Content
========================= */
.page-title{ margin:14px 0 14px; font-size:22px; letter-spacing:.4px; }

.hero{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-radius:18px;
  padding:18px 16px;
}
.hero h1{ margin:2px 0 10px; font-size:26px; }

.desc{ margin:0; color:var(--muted); line-height:1.6; }
.hero-actions{ margin-top:14px; display:flex; gap:10px; flex-wrap:wrap; }

.card{
  margin-top:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius:18px;
  padding:14px;
}
.card-h{ font-size:14px; color:var(--muted); margin-bottom:10px; letter-spacing:.4px; }

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
}
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr; }
}

.kv{
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius:14px;
  padding:10px 12px;
}
.kv .k{ font-size:12px; color:var(--muted); }
.kv .v{ margin-top:6px; font-size:13px; word-break:break-all; color:#39ff14; }

.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.input{
  width:min(320px, 100%);
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  color:var(--text);
  padding:12px 12px;
  border-radius:14px;
  outline:none;
}
.input:focus{ border-color: rgba(120,170,255,.35); }

.pill{
  border:1px solid var(--line);
  background: var(--pill);
  color:var(--muted);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
}

.note{ margin-top:10px; color:var(--muted); font-size:12px; }
.ol{ margin:0; padding-left:18px; color:var(--muted); line-height:1.7; }

/* =========================
   Footer
========================= */
.footer-wrap{
  margin-top:38px;
  border-top:1px solid var(--line2);
  background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.00));
}

.footer-inner{
  max-width:1100px;
  margin:0 auto;
  padding:18px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.footer-left{ display:flex; align-items:center; gap:12px; }
.footer-logo{ width:34px; height:34px; border-radius:10px; object-fit:cover; }
.footer-title{ font-size:14px; }
.footer-sub{ font-size:12px; color:var(--muted); margin-top:4px; }

.footer-right .link{
  color:var(--muted);
  text-decoration:none;
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.02);
}
.footer-right .link:hover{ color:var(--text); border-color: rgba(255,255,255,.18); }
/* 온체인 야광 */
.onchain{
  color:#a6ff4d;
  text-shadow: 0 0 10px rgba(166,255,77,.55);
}
.onchain-strong{
  color:#00ffea;
  text-shadow: 0 0 12px rgba(0,255,234,.65);
}
.onchain-warn{
  color:#ffcc00;
  text-shadow: 0 0 12px rgba(255,204,0,.55);
}

/* 혹시 남아있을 수 있는 구형 클래스 */
.desktop-only{ display:none; }

/* =========================
   Toast 상태 알림
========================= */
#statusToast{
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: #1a2340;
  border: 1px solid var(--line2);
  box-shadow: 0 4px 24px rgba(0,0,0,.55);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .22s, transform .22s;
  pointer-events: none;
  max-width: 320px;
}
#statusToast.show{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#statusToast .toast-icon{ font-size: 15px; flex-shrink: 0; }
#statusToast.toast-loading{ border-color: rgba(88,140,255,.35); }
#statusToast.toast-ok    { border-color: rgba(75,227,138,.45); color: #4be38a; }
#statusToast.toast-err   { border-color: rgba(255,92,92,.40);  color: #ff7a7a; }
