:root {
  --bg: #090d1f;
  --bg-soft: #0d1430;
  --card: #111a3a;
  --card-border: #1e2a52;
  --blue: #2fb6ff;
  --blue-dim: #1c7fb8;
  --cyan: #5eead4;
  --text: #eaf2ff;
  --text-dim: #8fa3c8;
  --gold: #f2b705;
  --danger: #ff5c7a;
  --ok: #3ddc84;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(47, 182, 255, 0.18), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(94, 234, 212, 0.10), transparent 35%),
    var(--bg);
  min-height: 100vh;
  padding-bottom: 32px;
}

.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, var(--bg) 100%);
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.brand h1 {
  font-size: 19px;
  margin: 0;
  letter-spacing: 0.2px;
}

.card {
  background: linear-gradient(180deg, var(--card), rgba(17, 26, 58, 0.6));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card h2 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.status-badge.ok { background: rgba(61, 220, 132, 0.15); color: var(--ok); }
.status-badge.warn { background: rgba(242, 183, 5, 0.15); color: var(--gold); }
.status-badge.bad { background: rgba(255, 92, 122, 0.15); color: var(--danger); }

.status-title {
  font-size: 22px;
  font-weight: 800;
  margin: 6px 0 2px;
}
.status-sub {
  color: var(--text-dim);
  font-size: 14px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: 14px;
}
.progress > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .4s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-tile {
  background: rgba(47, 182, 255, 0.07);
  border: 1px solid rgba(47, 182, 255, 0.18);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.stat-tile .num {
  font-size: 24px;
  font-weight: 800;
  color: var(--blue);
}
.stat-tile .lbl {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tier {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.tier:active { transform: scale(0.98); }
.tier.popular {
  border-color: var(--gold);
  background: rgba(242, 183, 5, 0.08);
}
.tier .badge-pop {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--gold);
  color: #241a00;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}
.tier .left .title { font-size: 16px; font-weight: 700; }
.tier .left .per-day { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.tier .right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--gold);
  white-space: nowrap;
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: #04131f;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 6px 18px rgba(47, 182, 255, 0.3);
}
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--card-border);
  box-shadow: none;
}

.ref-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ref-link-row span {
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref-link-row button {
  background: var(--blue);
  color: #04131f;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.ref-stats {
  display: flex;
  gap: 10px;
}
.ref-stats .stat-tile { flex: 1; }

.skeleton {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
  font-size: 14px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden { display: none !important; }
