/* ========== Tokens ========== */
:root {
  --ink: #fff;
  --muted: #b9c1d9;
  --bg: #070a12;
  --panel: #101426;
  --panel2: #151a33;
  --stroke: #21284a;
  --accent1: #7aa2ff;
  --accent2: #586dff;
  --ring: #2b3347;
  --radius: 14px;
  --orange1: #ffb86b;
  --orange2: #ff7a32;
}

/* ========== Base ========== */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  background: radial-gradient(
      1100px 480px at 50% -15%,
      #1b2141 0%,
      #0b0f1d 55%,
      #070a12 100%
    ),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: #cfd6ff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}

.wrap {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ========== Top bar ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 10, 18, 0.7);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}
.topbar-title {
  font-size: 13px;
  color: #cfd6ff;
  letter-spacing: 0.02em;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--accent1), var(--accent2));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-alt {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}
.btn.orange {
  background: linear-gradient(180deg, var(--orange1), var(--orange2));
  color: #2b1400;
  box-shadow: 0 6px 18px rgba(255, 122, 50, 0.28);
}

/* ========== Title ========== */
.brand {
  margin: 28px 0 6px;
  text-align: center;
}
.brand h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* ========== Start/Close (UTC) line ========== */
.hero-times {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 6px auto 14px;
  color: #cfd6ff;
  font-weight: 700;
}
.hero-times .sep {
  position: relative;
  padding-left: 18px;
}
.hero-times .sep::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%);
}

/* ========== Countdown ========== */
#cdWrap {
  text-align: center;
}
#cdHeading {
  display: none;
}
.cd-rings {
  width: 100%;
  max-width: 960px;
  margin: 6px auto 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.cd-item {
  background: var(--panel2);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 18px 0 14px;
  min-height: 86px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
/* 旧リングの見た目は完全に無効化 */
.cd-ring,
.cd-ring::after {
  all: unset !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.cd-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.3px;
}
.cd-lab {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
  letter-spacing: 0.08em;
}
.cd-lab::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  margin: 10px auto 8px;
  border-radius: 1px;
}

/* ========== Buy panel ========== */
.card {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.buy-legend {
  text-align: center;
  margin: 8px 0 10px;
  color: #cfd6ff;
  font-weight: 700;
}
.row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}
input[type='number'] {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  outline: none;
  background: #0b0f22;
  color: #fff;
  border: 1px solid #232a4e;
  padding: 12px 14px;
}
input[type='number']::placeholder {
  color: #b9c1d9;
  opacity: 0.75;
}
#buy {
  width: 100%;
}

/* 診断メッセージ */
#msg {
  max-width: 520px;
  margin: 8px auto 0;
}
.ok {
  color: #79f7c6;
}
.danger {
  color: #ff6b6b;
}

/* ========== Footer sticky ========== */
.foot {
  margin-top: auto;
  padding: 36px 0 32px;
  text-align: center;
  color: var(--muted);
}
.foot-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  font-weight: 600;
}
.foot .dot {
  opacity: 0.45;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .brand h1 {
    font-size: 32px;
  }
  .cd-rings {
    gap: 14px;
  }
  .cd-num {
    font-size: 28px;
  }
  .cd-lab::before {
    width: 24px;
    margin: 8px auto 6px;
  }
}
.topbar {
  padding: 6px 0;
}
.topbar-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-status .pill {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: ui-monospace;
  font-size: 13px;
}
/* === animated crypto background === */
#bg-net {
  position: fixed;
  inset: 0;
  z-index: 0; /* 本文より背面 */
  pointer-events: none; /* クリックを邪魔しない */
  background: radial-gradient(
      1200px 520px at 50% -10%,
      rgba(38, 48, 94, 0.35),
      transparent 60%
    ),
    radial-gradient(
      900px 380px at 10% 10%,
      rgba(24, 32, 64, 0.25),
      transparent 70%
    ),
    transparent;
}

/* コンテンツは前面に */
.topbar,
.main,
.wrap,
.foot {
  position: relative;
  z-index: 1;
}

/* 余白調整：カウントダウン下と入力ボックス上に少しスペース */
.cd-rings {
  margin: 8px auto 18px !important;
}
.buy-section {
  margin-top: 28px;
} /* お好みで 24〜36px の範囲で */
/* --- topbar layout --- */
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- pills (address / usdt) --- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: #cfe2ff;
  line-height: 1;
}
.pill-addr {
  background: linear-gradient(180deg, var(--orange1), var(--orange2));
  color: #2b1400;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(255, 122, 50, 0.28);
}
.pill-usdt {
  /* デフォルトの pill 色でOK。必要なら強める */
}

/* 小さめのボタン */
.btn-sm {
  padding: 6px 10px;
  font-weight: 700;
}
/* ==== Wallet status on topbar ==== */
.wallet-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 接続後に出る情報を白字でくっきり */
#walletInfo {
  display: flex;
  align-items: center;
  gap: 10px;
}
#walletAddr,
#walletUsdt {
  color: #fff !important;
  font-weight: 700;
}

/* 極小区切りドットは薄めに */
#walletInfo .dot {
  opacity: 0.45;
}

/* 長いアドレスは省略表示 */
#walletAddr {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
/* 上部のアドレスとUSDTを白く */
#tb,
#tb .pill,
#tb .mono {
  color: #fff !important;
}
/* Topbar status must be visible when not hidden */
.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
#tb[hidden] {
  display: none !important;
}
.pill-addr,
.pill-usdt {
  color: #fff;
}
