:root {
  --bg: #f6f8fb;
  --bg-soft: #eef4ff;
  --card: #fff;
  --ink: #1f2937;
  --muted: #64748b;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --accent: #f59e0b;
  --accent-soft: #fff7ed;
  --danger: #dc2626;
  --ok: #16a34a;
  --line: #dbe3ef;
  --shadow: 0 18px 45px #0f172a14;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, #dbeafe 0, transparent 34rem),
    linear-gradient(180deg, #ffffff 0, var(--bg) 24rem);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

a { color: var(--brand); }

a:hover { color: var(--brand-dark); }

img { max-width: 100%; height: auto; }

.site-header {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 1rem 0 0;
  text-align: center;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 76px;
}

.site-logo { max-width: 100%; max-height: 110px; }

.text-logo {
  font-size: clamp(1.7rem, 5vw, 2.35rem);
  font-weight: 900;
  color: var(--brand-dark);
  letter-spacing: -.03em;
}

.public-nav {
  display: inline-flex;
  gap: .25rem;
  justify-content: center;
  align-items: center;
  background: var(--brand-dark);
  padding: .35rem;
  border-radius: 999px;
  margin: 1rem auto;
  box-shadow: 0 8px 20px #1e3a8a22;
}

.public-nav a,
.public-nav .nav-logout button {
  color: white;
  text-decoration: none;
  padding: .65rem 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
}

.public-nav a:hover,
.public-nav .nav-logout button:hover,
.public-nav a.is-active { background: #ffffff22; }

.public-nav .nav-cta {
  background: var(--accent);
  color: #111827;
}

.public-nav .nav-cta:hover,
.public-nav .nav-cta.is-active {
  background: #fbbf24;
  color: #111827;
}

.page-shell {
  width: min(1180px, 94vw);
  margin: 1rem auto 2.5rem;
}

.centered { text-align: center; }

.hero {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
}

.hero-card {
  position: relative;
  isolation: isolate;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 62%, #fff7ed 100%);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 1px solid #ffffffa8;
  border-radius: 1rem;
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: fit-content;
  margin: 0 auto;
  padding: .4rem .75rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand-dark);
  font-size: .85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hero h1 {
  max-width: 930px;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  line-height: 1;
  letter-spacing: -.06em;
  margin: .35rem auto .7rem;
  color: #111827;
}

.hero .lead,
.lead {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
}

.hero-actions,
.actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions { justify-content: center; }

.ian-desk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: .2rem auto 0;
  padding: .4rem;
  border: 1px solid #fbbf2480;
  border-radius: 999px;
  background: #ffffff18;
  text-decoration: none;
  box-shadow: inset 0 1px 0 #ffffff35, 0 12px 26px #00000024;
  backdrop-filter: blur(10px);
}

.ian-desk-badge:hover {
  border-color: #fbbf24;
  background: #ffffff24;
}

.ian-desk-badge img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 2px solid #fbbf24;
  border-radius: 999px;
  box-shadow: 0 6px 16px #00000030;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: .25rem auto 0;
  max-width: 840px;
}

.trust-strip span,
.stats span,
.metric,
.product-card,
.form-panel,
.empty-state {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: .95rem;
  padding: 1rem;
}

.trust-strip strong,
.stat-value {
  display: block;
  color: #111827;
  font-size: 1.35rem;
  line-height: 1.1;
}

.ad-section-label {
  margin: .5rem 0 -.35rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.text-ad-grid,
.banner-ad-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin: 1.2rem auto;
}

.text-ad {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(220px, 100%);
  max-width: 280px;
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .75rem;
  text-decoration: none;
  font-weight: 900;
  color: var(--brand-dark);
  box-shadow: 0 4px 16px #0f172a12;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.text-ad:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 12px 24px #0f172a18;
}

.banner-ad-grid a { line-height: 0; }

.banner-ad-grid img,
.banner-placeholder {
  width: 468px;
  height: 60px;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fff;
}

.ad-placeholder,
.banner-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  color: var(--muted);
  border-radius: .75rem;
  padding: .75rem;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: var(--brand);
  color: white !important;
  border: 0;
  border-radius: .75rem;
  padding: .78rem 1.1rem;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 20px #1d4ed826;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px #1d4ed82e;
}

.btn-large { font-size: 1.15rem; padding: 1rem 1.6rem; }

.btn-giant {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  padding: 1rem 2rem;
  background: var(--accent);
  color: #111827 !important;
}

.btn-secondary {
  background: white;
  color: var(--brand-dark) !important;
  border: 1px solid #bfdbfe;
  box-shadow: none;
}

.btn-secondary:hover { background: #eff6ff; color: var(--brand-dark) !important; }

.auth-card,
.content-card,
.install-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2rem);
  margin: 1.5rem auto;
}

.auth-card { max-width: 820px; }
.install-card { max-width: 860px; }

.auth-header,
.section-header {
  display: grid;
  gap: .35rem;
  margin-bottom: 1.25rem;
}

.auth-header h1,
.section-header h1,
.section-header h2,
.content-card h1,
.content-card h2 { margin-top: 0; }

.auth-header p,
.section-header p { margin: 0; color: var(--muted); }

.stacked-form { display: grid; gap: 1rem; }

.stacked-form label { display: grid; gap: .35rem; font-weight: 800; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea,
.copy-field,
.actions input,
.actions select,
.inline-form input,
.inline-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .65rem;
  padding: .85rem;
  font: inherit;
  background: white;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus,
.copy-field:focus,
.actions input:focus,
.actions select:focus,
.inline-form input:focus,
.inline-form select:focus {
  outline: 0;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px #bfdbfe66;
}

.stacked-form textarea { min-height: 120px; }

.form-hint { color: var(--muted); font-size: .9rem; font-weight: 500; }

.alert {
  padding: 1rem;
  border-radius: .85rem;
  margin: 1rem 0;
  font-weight: 800;
}

.alert.success { background: #dcfce7; color: #14532d; }
.alert.error { background: #fee2e2; color: #7f1d1d; }

.ref-box,
.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: .85rem;
  padding: 1rem;
}

.member-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.member-sidebar,
.member-content {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1rem;
  box-shadow: 0 10px 24px #0f172a10;
}

.member-sidebar { position: sticky; top: 1rem; }

.member-layout--focus {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

.member-profile {
  display: grid;
  gap: .2rem;
  padding: .3rem .3rem .9rem;
  border-bottom: 1px solid var(--line);
}

.member-profile strong { font-size: 1.1rem; }

.member-sidebar nav { display: grid; gap: .35rem; margin-top: 1rem; }

.member-sidebar a,
.member-sidebar .sidebar-logout button {
  display: flex;
  justify-content: space-between;
  text-decoration: none;
  padding: .7rem .8rem;
  border-radius: .65rem;
  color: var(--ink);
  font-weight: 800;
}

.member-sidebar a:hover,
.member-sidebar .sidebar-logout button:hover,
.member-sidebar a.is-active { background: #eff6ff; color: var(--brand); }

.badge {
  display: inline-block;
  width: fit-content;
  background: var(--accent);
  border-radius: 999px;
  padding: .18rem .6rem;
  margin-left: .3rem;
  font-size: .8rem;
  font-weight: 900;
}

.status-badge { margin-left: 0; text-transform: capitalize; }

.muted-badge { background: #e2e8f0; color: #334155; }

.top-ads { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }

.two-col,
.card-grid,
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.product-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.stats,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem;
  margin: 1rem 0;
}

.stats span,
.metric { min-height: 88px; }

.stats span strong,
.metric strong,
.stat-value { font-size: 1.8rem; }

.metric span,
.stat-label {
  display: block;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
}

.quick-actions { margin-top: 1.25rem; }

.admin-image {
  display: block;
  max-height: 220px;
  width: auto;
  margin: 1rem auto;
  border-radius: 1rem;
  border: 1px solid var(--line);
}

.product-card,
.form-panel { display: grid; gap: .75rem; align-content: start; }
.product-card h2,
.product-card h3,
.form-panel h3 { margin: 0; }
.price { font-size: 1.8rem; font-weight: 900; color: #111827; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}

.site-footer {
  text-align: center;
  border-top: 1px solid var(--line);
  padding: 2rem 1rem;
  color: var(--muted);
  background: #ffffffa8;
}

.footer-support {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: .5rem 0 1rem;
}

.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.viewer-page { overflow: hidden; }

.viewer-topbar {
  min-height: 104px;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #111827;
  color: white;
  text-align: center;
}

.ad-iframe { width: 100%; height: calc(100vh - 104px); border: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: .75rem; text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #334155; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
tr:nth-child(even) td { background: #fbfdff; }

.muted { color: var(--muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: 1rem;
  background: #f8fafc;
}

.stat-card strong {
  display: block;
  font-size: 1.8rem;
  color: var(--brand-dark);
}

.stat-card span { color: var(--muted); font-weight: 700; }
.compact-form { max-width: 560px; }
.inline-form { display: flex; gap: .45rem; align-items: center; }
.inline-form input { width: 92px; }
.table-responsive { overflow-x: auto; border-radius: .85rem; }
.ref-box { margin: 1rem 0; }
.ref-box textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: .6rem; padding: .8rem; font: inherit; background: white; }
small { color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; margin: 0 0 1rem; }
legend { font-weight: 900; color: var(--brand-dark); padding: 0 .4rem; }
summary { cursor: pointer; font-weight: 900; color: var(--brand); }
.admin-layout .member-sidebar small { display: block; color: var(--muted); margin-top: .25rem; }
.actions label { display: flex; gap: .4rem; align-items: center; font-weight: 800; }
.content-card > :last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .member-layout,
  .two-col,
  .card-grid,
  .field-grid { grid-template-columns: 1fr; }
  .member-sidebar { position: static; }
  .trust-strip { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header,
  .page-shell { width: min(100% - 1rem, 1180px); }
  .public-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 1rem; width: 100%; }
  .public-nav a,
.public-nav .nav-logout button { padding: .8rem .6rem; }
  .hero { padding: 1.1rem; }
  .hero-card::before { display: none; }
  .hero-actions .btn,
  .actions .btn,
  .stacked-form .btn { width: 100%; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form input { width: 100%; }
  .banner-ad-grid img,
  .banner-placeholder { height: auto; min-height: 60px; }
  th, td { padding: .65rem; }
  .viewer-topbar { height: auto; flex-direction: column; }
  .ad-iframe { height: calc(100vh - 150px); }
}

.nav-logout,
.sidebar-logout {
  margin: 0;
}

.nav-logout button,
.sidebar-logout button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.game-hero {
  position: relative;
  isolation: isolate;
  min-height: 620px;
  align-content: center;
  background:
    linear-gradient(135deg, #170f39 0%, #1e1b4b 44%, #6d28d9 100%);
  border: 1px solid #fbbf2470;
  border-radius: 2rem;
  box-shadow: 0 28px 70px #312e8170;
  color: white;
}

.game-hero::before {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 2px dashed #fbbf24aa;
  border-radius: 1.35rem;
  pointer-events: none;
  z-index: -1;
}

.game-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffffff2e 1px, transparent 1px),
    linear-gradient(90deg, #22d3ee18 1px, transparent 1px),
    linear-gradient(0deg, #22d3ee18 1px, transparent 1px);
  background-size: 22px 22px, 72px 72px, 72px 72px;
  border-radius: inherit;
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  pointer-events: none;
  z-index: -2;
}

.game-hero h1 {
  color: white;
  text-shadow: 0 8px 24px #00000060;
}

.game-hero .lead {
  color: #dbeafe;
}

.game-orb {
  position: absolute;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .8;
  z-index: -1;
}

.game-orb-one {
  top: -4rem;
  right: 8%;
  background: radial-gradient(circle, #fbbf24 0%, #f97316 40%, transparent 68%);
}

.game-orb-two {
  bottom: -5rem;
  left: 7%;
  background: radial-gradient(circle, #22d3ee 0%, #2563eb 42%, transparent 70%);
}

.game-eyebrow {
  border-color: #fbbf24;
  background: #fef3c7;
  color: #422006;
  box-shadow: 0 0 24px #fbbf2440;
}

.btn-prize {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  color: #111827 !important;
  box-shadow: 0 14px 34px #f9731655;
}

.btn-prize:hover {
  background: linear-gradient(135deg, #fde047 0%, #fb923c 100%);
  color: #111827 !important;
}

.game-scoreboard,
.game-instructions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  width: min(900px, 100%);
  margin: .4rem auto 0;
}

.game-scoreboard span,
.game-instructions span {
  position: relative;
  overflow: hidden;
  border: 1px solid #fbbf2460;
  border-radius: 1rem;
  background: #ffffff16;
  padding: 1rem;
  color: #f8fafc;
  box-shadow: inset 0 1px 0 #ffffff3b, 0 12px 26px #00000024;
  backdrop-filter: blur(10px);
}

.game-scoreboard strong,
.game-instructions b {
  display: block;
  color: #fbbf24;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1;
  text-shadow: 0 0 18px #fbbf2480;
}

.game-arena {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, #fef3c7 0, transparent 24rem),
    radial-gradient(circle at bottom right, #dbeafe 0, transparent 26rem),
    #ffffff;
}

.game-instructions {
  margin: 0 auto 1.25rem;
}

.game-instructions span {
  background: #111827;
  color: white;
  text-align: left;
}

.game-instructions b {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-right: .65rem;
  border-radius: 50%;
  background: #fbbf24;
  color: #111827;
  font-size: 1.35rem;
  text-shadow: none;
}

.prize-panel {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #c4b5fd;
  border-radius: 1.35rem;
  background: #ffffffb8;
  box-shadow: inset 0 1px 0 #fff, 0 18px 42px #312e8118;
}

.prize-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .35rem;
}

.prize-panel-header .ad-section-label {
  margin: 0;
  color: #5b21b6;
}

.slot-counter {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #111827;
  color: #fbbf24;
  padding: .35rem .7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
}

.game-arena .banner-ad-grid,
.game-arena .text-ad-grid {
  display: grid;
  gap: .9rem;
}

.game-arena .banner-ad-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-arena .banner-ad-grid a,
.game-arena .text-ad {
  position: relative;
  overflow: hidden;
  border: 2px solid #fbbf2466;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 12px 24px #312e8120;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.game-arena .banner-ad-grid a:hover,
.game-arena .text-ad:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: #f59e0b;
  box-shadow: 0 20px 34px #f59e0b33;
}

.game-arena .banner-ad-grid a::after,
.game-arena .text-ad::after {
  content: 'Click to win';
  position: absolute;
  right: .55rem;
  top: .45rem;
  border-radius: 999px;
  background: #fbbf24;
  color: #111827;
  padding: .16rem .48rem;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px #00000020;
}

.game-arena .banner-ad-grid img,
.game-arena .banner-placeholder {
  display: flex;
  width: 100%;
  height: 72px;
  object-fit: cover;
  border: 0;
  border-radius: .85rem;
}

.game-arena .banner-placeholder,
.game-arena .ad-placeholder {
  color: #312e81;
  text-decoration: none;
  background:
    linear-gradient(135deg, #fff7ed 0%, #fef3c7 52%, #dbeafe 100%);
}

.game-arena .text-ad-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-arena .text-ad {
  width: 100%;
  max-width: none;
  min-height: 84px;
  padding: 1.25rem .9rem .9rem;
  color: #1e1b4b;
}

.bonus-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.35rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #111827 0%, #312e81 100%);
  color: white;
  text-align: left;
}

.bonus-callout h2,
.bonus-callout p { margin: .45rem 0 0; }
.bonus-callout p { color: #dbeafe; }

@media (max-width: 900px) {
  .game-scoreboard,
  .game-instructions,
  .game-arena .banner-ad-grid,
  .game-arena .text-ad-grid {
    grid-template-columns: 1fr;
  }

  .bonus-callout {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .game-hero { min-height: auto; }
  .game-hero::before { display: none; }
  .prize-panel-header { align-items: flex-start; flex-direction: column; }
  .game-arena .banner-ad-grid a::after,
  .game-arena .text-ad::after { position: static; margin-left: .45rem; }
}

.banner-ad-grid .banner-placeholder {
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  text-decoration: none;
}

.click-win-hero {
  min-height: 520px;
  margin-bottom: 1rem;
}

.progress-shell {
  width: min(760px, 100%);
  height: 1rem;
  margin: 1.1rem auto .4rem;
  overflow: hidden;
  border: 1px solid #fbbf2480;
  border-radius: 999px;
  background: #0f172a88;
  box-shadow: inset 0 2px 8px #00000055, 0 0 26px #fbbf2430;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e 0%, #fbbf24 55%, #f97316 100%);
  box-shadow: 0 0 18px #fbbf24aa;
}

.streak-note {
  margin: .8rem auto 0;
  color: #fef3c7;
  font-weight: 900;
}

.alert.notice {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fbbf24;
}

.reward-empty h2 { margin-top: 0; }

.prize-vault {
  background:
    radial-gradient(circle at top right, #fef3c7 0, transparent 22rem),
    #fff;
}

.prize-grid span {
  border-color: #fbbf2470;
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}

.login-ad-card .viewer-frame-wrap {
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: #f8fafc;
  margin-bottom: 1rem;
}

.login-ad-card .ad-iframe {
  display: block;
  height: min(70vh, 720px);
  min-height: 420px;
}

.login-ad-full-page {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #020617;
}

.login-ad-topbar {
  height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .45rem .85rem;
  background: #0f172a;
  border-bottom: 1px solid rgba(148, 163, 184, .28);
  color: #f8fafc;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .24);
  position: relative;
  z-index: 2;
}

.login-ad-mini-timer {
  --timer-progress: 0%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--brand) var(--timer-progress), rgba(148, 163, 184, .25) 0);
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1;
  position: relative;
}

.login-ad-mini-timer::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #0f172a;
}

.login-ad-mini-timer span {
  position: relative;
  z-index: 1;
}

.login-ad-topbar-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .08rem;
}

.login-ad-topbar-copy strong,
.login-ad-topbar-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-ad-topbar-copy strong {
  font-size: .95rem;
}

.login-ad-topbar-copy span {
  color: #cbd5e1;
  font-size: .78rem;
}

.login-ad-continue-form {
  margin: 0;
}

.login-ad-continue-form .btn-small {
  min-height: 0;
  padding: .52rem .85rem;
  border-radius: 999px;
  white-space: nowrap;
}

.login-ad-notice {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(94vw, 680px);
  padding: .7rem .95rem;
  border: 1px solid #fbbf24;
  border-radius: .85rem;
  background: #fef3c7;
  color: #78350f;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-ad-full-iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 58px);
  border: 0;
  background: #fff;
}

@media (max-width: 640px) {
  .login-ad-topbar {
    height: 64px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .login-ad-continue-form {
    grid-column: 2;
    justify-self: start;
    margin-top: -.25rem;
  }

  .login-ad-topbar-copy span {
    display: none;
  }

  .login-ad-full-iframe {
    height: calc(100vh - 64px);
  }
}

.checkout-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  background: #f8fbff;
  margin-bottom: 1.25rem;
}
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 20, 40, 0.72);
}
.payment-modal.is-open { display: flex; }
.payment-modal__panel {
  position: relative;
  width: min(960px, 96vw);
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}
.payment-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: #eef3fb;
  font-size: 1.5rem;
  cursor: pointer;
}
.payment-options-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.payment-option-card {
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  padding: 1rem;
  background: #fbfdff;
}
.payment-option-card--instant {
  border-color: #9fd2ff;
  background: linear-gradient(135deg, #f3f9ff, #fff);
}
.payment-option-card--instant h3 {
  margin-top: 0;
}
.payment-option-card summary {
  cursor: pointer;
  list-style: none;
}
.payment-option-card summary small {
  display: block;
  color: #667085;
  margin-top: 0.2rem;
}
.payment-instructions {
  margin: 0.85rem 0;
  padding: 0.75rem;
  border-radius: 10px;
  background: #f1f6ff;
  color: #22324d;
}
.compact-form textarea { min-height: 5rem; }
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.inline-admin-form {
  display: grid;
  gap: 0.4rem;
  min-width: 180px;
}
.template-editor {
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  padding: 1rem;
}

.alert.warning {
  background: #fef3c7;
  color: #92400e;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.impersonation-banner form { margin: 0; }

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
}

.link-button:hover { color: var(--brand-dark); }

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #991b1b;
}

.table-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.table-actions form { margin: 0; }

.matrix-stats span strong {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.matrix-progress {
  height: .85rem;
  margin: 1.2rem 0 .35rem;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #e0ecff;
  box-shadow: inset 0 1px 3px #1e3a8a18;
}

.matrix-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #38bdf8, var(--ok));
  box-shadow: 0 0 18px #38bdf855;
}

.matrix-tree {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem minmax(760px, 1fr);
  gap: 1rem 1.25rem;
  margin-top: 1.25rem;
  overflow-x: auto;
  padding: 1.25rem;
  border: 1px solid #dbeafe;
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 50% 0, #dbeafe 0, transparent 18rem),
    linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.matrix-tree::before {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 1px dashed #bfdbfe;
  border-radius: 1rem;
  pointer-events: none;
}

.matrix-level-labels {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 132px 132px 132px;
  gap: 2.1rem;
  color: var(--brand-dark);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.matrix-level-labels span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
}

.matrix-root {
  position: relative;
  z-index: 1;
  display: flex;
  grid-column: 2;
  justify-content: center;
}

.matrix-root::after {
  content: '';
  position: absolute;
  bottom: -2.05rem;
  left: 50%;
  width: 2px;
  height: 2.05rem;
  background: #93c5fd;
  transform: translateX(-50%);
}

.matrix-branches {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 1.35rem;
  min-width: 760px;
}

.matrix-branches::before {
  content: '';
  position: absolute;
  top: -1.05rem;
  left: 25%;
  right: 25%;
  height: 2px;
  background: #93c5fd;
}

.matrix-branch {
  display: grid;
  gap: 2.1rem;
  position: relative;
}

.matrix-branch::before,
.matrix-branch::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 2px;
  background: #93c5fd;
  transform: translateX(-50%);
}

.matrix-branch::before {
  top: -1.05rem;
  height: 1.05rem;
}

.matrix-branch::after {
  top: 132px;
  height: 2.1rem;
}

.matrix-children {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.matrix-children::before {
  content: '';
  position: absolute;
  top: -1.05rem;
  left: 25%;
  right: 25%;
  height: 2px;
  background: #93c5fd;
}

.matrix-children .matrix-node::before {
  content: '';
  position: absolute;
  top: -1.05rem;
  left: 50%;
  width: 2px;
  height: 1.05rem;
  background: #93c5fd;
  transform: translateX(-50%);
}

.matrix-node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .35rem;
  min-height: 132px;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: 1.2rem;
  background: #f8fafc;
  text-align: center;
  align-content: center;
  box-shadow: 0 16px 32px #0f172a0d;
}

.matrix-node--filled {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  box-shadow: 0 18px 36px #1d4ed81c;
}

.matrix-node--empty {
  border-style: dashed;
  border-color: #cbd5e1;
  color: var(--muted);
}

.matrix-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #38bdf8);
  color: white;
  font-weight: 900;
  box-shadow: 0 8px 18px #1d4ed830;
}

.matrix-node--empty .matrix-avatar {
  border: 2px dashed #94a3b8;
  background: white;
  color: #64748b;
  box-shadow: none;
}

.matrix-node strong {
  color: #111827;
  font-size: 1.05rem;
}

.matrix-position {
  color: var(--brand-dark);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}


.matrix-tree--grid {
  grid-template-columns: minmax(220px, 280px) minmax(320px, 1fr);
  align-items: start;
  min-width: 0;
}

.matrix-tree--grid::before { inset: .85rem; }

.matrix-owner,
.matrix-grid {
  position: relative;
  z-index: 1;
}

.matrix-owner {
  display: grid;
  gap: .5rem;
}

.matrix-owner::after {
  content: 'Owner, not one of the 4 matrix entries';
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.matrix-grid .matrix-node {
  min-height: 150px;
}

@media (max-width: 760px) {
  .matrix-tree {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .matrix-level-labels,
  .matrix-root::after,
  .matrix-branches::before,
  .matrix-branch::before,
  .matrix-branch::after,
  .matrix-children::before,
  .matrix-children .matrix-node::before { display: none; }

  .matrix-root,
  .matrix-branches { grid-column: 1; }

  .matrix-branches,
  .matrix-children {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .matrix-branch { gap: .9rem; }

  .matrix-tree--grid,
  .matrix-grid {
    grid-template-columns: 1fr;
  }
}

.credit-trade-form {
  display: grid;
  gap: .25rem;
}

.link-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1rem 0 1.5rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  padding: .25rem .6rem;
}

.status-pill.success {
  background: #dcfce7;
  color: #14532d;
}

.status-pill.danger {
  background: #fee2e2;
  color: #7f1d1d;
}

.log-output {
  background: #0f172a;
  border-radius: 12px;
  color: #e2e8f0;
  font-size: .85rem;
  line-height: 1.5;
  max-width: 100%;
  overflow-x: auto;
  padding: .9rem;
  white-space: pre-wrap;
}

.migration-log {
  max-height: 420px;
  overflow: auto;
}

.member-activity-ticker {
  display: flex;
  align-items: center;
  gap: .75rem;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: linear-gradient(90deg, #eff6ff, #fff7ed);
  box-shadow: inset 0 1px 0 #ffffffcc, 0 10px 22px #1e3a8a12;
}

.ticker-label {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: .65rem 1rem;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
}

.ticker-window {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  gap: 1.75rem;
  min-width: max-content;
  padding: .65rem 0;
  animation: ticker-scroll 42s linear infinite;
}

.member-activity-ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ink);
  font-weight: 800;
}

.ticker-item strong { color: var(--brand-dark); }

.ticker-item em {
  color: var(--ok);
  font-style: normal;
  font-weight: 900;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

@media (max-width: 640px) {
  .member-activity-ticker {
    align-items: stretch;
    border-radius: 1rem;
    flex-direction: column;
    gap: 0;
  }

  .ticker-label { justify-content: center; }

  .ticker-track { padding: .75rem 0; }
}

.user-avatar,
.profile-photo-preview__image,
.member-profile__avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px #0f172a26;
  background: #f8fafc;
}

.profile-photo-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: #f8fafc;
}

.profile-photo-preview__image {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
}

.profile-image-options {
  display: grid;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  padding: 1rem;
}

.profile-image-options legend {
  padding: 0 .35rem;
  font-weight: 800;
}

.member-profile__avatar {
  width: 64px;
  height: 64px;
  margin-bottom: .35rem;
}
