* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #070709;
  --card:     #111114;
  --secondary:#1a1a22;
  --red:      #ff2b6e;
  --purple:   #7b2fff;
  --text:     #f5f5f5;
  --muted:    #666672;
  --border:   rgba(255, 43, 110, 0.15);
}

body {
  background: linear-gradient(160deg, #0d0710 0%, #070709 50%, #07090d 100%);
  min-height: 100vh;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* ── Header ── */
.header {
  position: relative;
  background: #070709;
  border-bottom: 1px solid var(--border);
  padding: 0;
  overflow: hidden;
  height: 280px;
}
.header-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(7,7,9,0.15) 0%, rgba(7,7,9,0.55) 60%, rgba(7,7,9,0.92) 100%);
}
.header-content {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
}
.header-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.header-quote {
  font-size: 13px;
  font-style: italic;
  color: rgba(255,255,255,0.8);
  margin-top: 5px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  font-size: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active { color: var(--red); border-bottom-color: var(--red); }

/* ── Pages ── */
.page { display: none; padding: 20px; }
.page.active { display: block; }

/* ── Cards ── */
.card {
  background: rgba(17, 17, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 43, 110, 0.12);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
}
.card-title {
  color: var(--red);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

/* ── Profile ── */
.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.profile-mistress { color: var(--muted); font-size: 14px; }

/* ── Bars ── */
.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}
.bar {
  background: var(--secondary);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s ease;
}
.bar-energy .bar-fill    { background: linear-gradient(90deg, var(--purple), var(--red)); }
.bar-obedience .bar-fill { background: linear-gradient(90deg, var(--red), #ff6b9d); }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stat-rank { grid-column: 1 / -1; }
.gems-stat { background: linear-gradient(90deg, var(--red), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-item {
  background: rgba(26, 26, 34, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(123, 47, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat-value { font-size: 20px; font-weight: 700; color: var(--red); }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }

/* ── Gems ── */
.gems-row { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.gems-value { font-size: 26px; font-weight: 700; background: linear-gradient(90deg, var(--red), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Mistress cards ── */
.mistress-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 43, 110, 0.3);
  box-shadow: 0 0 24px rgba(255, 43, 110, 0.15);
  margin-bottom: 16px;
  cursor: pointer;
  aspect-ratio: 3/4;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.mistress-card:active { transform: scale(0.98); }
.mistress-card.selected {
  border-color: var(--red);
  box-shadow: 0 0 32px rgba(255, 43, 110, 0.4), 0 0 0 1px var(--red);
}
.mistress-card img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  display: block;
}
.mistress-card .m-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 35%, rgba(0,0,0,0.7) 65%, rgba(0,0,0,0.95) 100%);
}
.mistress-card .m-online {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-radius: 20px; padding: 4px 10px;
  font-size: 10px; font-weight: 700;
  color: var(--red); letter-spacing: 1.5px;
}
.m-online-dot {
  width: 6px; height: 6px;
  background: #00e676; border-radius: 50%;
  box-shadow: 0 0 6px #00e676;
}
.mistress-card .m-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px;
}
.m-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px; letter-spacing: 2px;
  color: #fff; line-height: 1; margin-bottom: 4px;
}
.m-tagline {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.m-tags {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px;
}
.m-tag {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 3px 10px;
  font-size: 10px; color: rgba(255,255,255,0.75);
}
.m-bottom {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,43,110,0.2);
  border-radius: 12px; padding: 9px 12px;
}
.m-role-wrap { display: flex; align-items: center; gap: 10px; }
.m-crown { color: var(--red); font-size: 16px; }
.m-role-title { font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: 1px; }
.m-role-sub { font-size: 9px; color: rgba(255,255,255,0.35); margin-top: 1px; }
.m-gem-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,43,110,0.4);
  background: rgba(255,43,110,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 16px;
}

/* ── Plan cards ── */
.plan-card {
  background: rgba(17, 17, 20, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 43, 110, 0.12);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.plan-card:active { transform: scale(0.97); }
.plan-card:hover  { border-color: var(--red); background: rgba(255, 43, 110, 0.08); box-shadow: 0 0 20px rgba(255, 43, 110, 0.1); }
.plan-card.featured { border-color: rgba(123, 47, 255, 0.4); background: rgba(123, 47, 255, 0.06); }
.plan-card.featured:hover { border-color: var(--purple); box-shadow: 0 0 20px rgba(123, 47, 255, 0.15); }
.plan-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 3px; color: var(--text); }
.plan-info p  { font-size: 12px; color: var(--muted); }
.plan-price   { color: var(--red); font-size: 16px; font-weight: 700; white-space: nowrap; }

/* ── Create card ── */
.mistress-card.create-card {
  border-color: rgba(123, 47, 255, 0.3);
  background: rgba(123, 47, 255, 0.05);
  border-style: dashed;
}
.mistress-card.create-card:hover {
  border-color: var(--purple);
  background: rgba(123, 47, 255, 0.12);
  box-shadow: 0 0 20px rgba(123, 47, 255, 0.15);
}
.mistress-card.create-card h3 { color: var(--purple); }

/* ── Sub status ── */
.sub-status {
  background: rgba(255, 43, 110, 0.08);
  border: 1px solid rgba(255, 43, 110, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 16px;
  text-align: center;
}

/* ── Partner Banner ── */
.partner-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(123,47,255,0.18) 0%, rgba(255,43,110,0.08) 100%);
  border: 1px solid rgba(123,47,255,0.35);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  cursor: pointer;
  transition: border-color .2s;
}
.partner-banner:active { transform: scale(0.98); }
.partner-banner:hover  { border-color: rgba(123,47,255,0.6); }
.partner-banner-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple), var(--red));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.partner-banner-text  { flex: 1; }
.partner-banner-title { font-size: 15px; font-weight: 700; color: var(--text); }
.partner-banner-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.partner-banner-arrow { font-size: 24px; color: var(--muted); }

/* ── Referral ── */
.ref-hero {
  text-align: center;
  padding: 24px 16px 20px;
  background: linear-gradient(135deg, rgba(255,43,110,0.1), rgba(123,47,255,0.1));
  border: 1px solid rgba(255,43,110,0.2);
  border-radius: 16px;
  margin-bottom: 16px;
}
.ref-hero-icon  { font-size: 48px; margin-bottom: 10px; }
.ref-hero-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.ref-hero-sub   { font-size: 13px; color: var(--muted); line-height: 1.4; }

.ref-stats {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  gap: 0;
}
.ref-stat        { flex: 1; text-align: center; }
.ref-stat-val    { font-size: 24px; font-weight: 700; color: var(--text); }
.ref-stat-label  { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ref-stat-divider { width: 1px; background: rgba(255,255,255,0.08); align-self: stretch; }

.ref-link-block {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ref-link-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ref-link-row   { display: flex; align-items: center; gap: 8px; }
.ref-link-text  {
  flex: 1; font-size: 12px; color: var(--text);
  background: rgba(255,255,255,0.05);
  border-radius: 8px; padding: 8px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ref-copy-btn {
  background: rgba(255,43,110,0.15); border: 1px solid rgba(255,43,110,0.3);
  border-radius: 8px; color: var(--red); font-size: 12px; font-weight: 600;
  padding: 8px 12px; cursor: pointer; white-space: nowrap; font-family: inherit;
}
.ref-copy-btn:active { transform: scale(0.95); }

.ref-share-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--red), var(--purple));
  border: none; border-radius: 14px; color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; margin-bottom: 12px;
}
.ref-share-btn:active { transform: scale(0.97); }

.ref-reward-note {
  text-align: center; font-size: 12px; color: var(--muted);
}

/* ── Shop ── */
.shop-energy-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(123,47,255,0.18) 0%, rgba(255,43,110,0.10) 100%);
  border: 1px solid rgba(123,47,255,0.35);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  cursor: pointer;
}
.shop-energy-icon { font-size: 36px; flex-shrink: 0; }
.shop-energy-text { flex: 1; }
.shop-energy-title { font-size: 15px; font-weight: 700; color: var(--text); }
.shop-energy-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.shop-energy-btn {
  background: linear-gradient(135deg, var(--purple), var(--red));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.gem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gem-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gem-card:active  { transform: scale(0.94); }
.gem-card:hover   { border-color: rgba(123,47,255,0.4); }
.gem-card.gem-best { border-color: rgba(123,47,255,0.5); background: rgba(123,47,255,0.08); }
.gem-best-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--purple), var(--red));
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  white-space: nowrap;
  color: #fff;
}
.gem-icon   { font-size: 30px; line-height: 1; }
.gem-amount { font-size: 13px; font-weight: 600; color: var(--text); }
.gem-price  { font-size: 12px; color: var(--muted); }
