:root {
  --bg: #050505;
  --panel: #0d0d0d;
  --text: #f8f7f2;
  --muted: #9d9d9d;
  --line: rgba(255, 255, 255, 0.14);
  --gold: #f6c954;
  --gold-deep: #8f6118;
  --gold-soft: rgba(246, 201, 84, 0.16);
  --green: #32d583;
  --purple: #9b6cff;
  --purple-soft: rgba(155, 108, 255, 0.18);
  --white: #ffffff;
  --black: #050505;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.video-page {
  display: grid;
  min-height: 100svh;
  place-items: start center;
  padding:
    max(14px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.video-card {
  display: grid;
  width: min(100%, 520px);
  align-content: start;
  gap: 12px;
}

.brand-proof {
  position: relative;
  display: grid;
  min-height: 92px;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.brand-logo {
  width: 108px;
  height: 33px;
  object-fit: contain;
  object-position: center;
}

.commission-stack {
  display: grid;
  max-height: 82px;
  gap: 6px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}

.commission-stack.left {
  justify-items: end;
}

.commission-stack.right {
  justify-items: start;
}

.commission-stack span {
  display: grid;
  min-width: 96px;
  min-height: 34px;
  gap: 2px;
  justify-items: start;
  padding: 6px 8px;
  border: 1px solid rgba(155, 108, 255, 0.48);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(155, 108, 255, 0.34), rgba(155, 108, 255, 0.12)),
    rgba(255, 255, 255, 0.07);
  color: var(--white);
  font-size: clamp(0.54rem, 2.35vw, 0.74rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(155, 108, 255, 0.2);
  animation: notification-roll 4.6s linear infinite;
}

.commission-stack span small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.52rem;
  font-weight: 900;
}

.commission-stack.right span {
  animation-delay: -2.3s;
}

.commission-stack.left span:nth-child(2),
.commission-stack.right span:nth-child(3) {
  margin-inline-end: 7px;
}

.commission-stack.left span:nth-child(3),
.commission-stack.right span:nth-child(2) {
  margin-inline-start: 6px;
}

@keyframes notification-roll {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-82px);
  }
}

.headline {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  justify-items: center;
  text-align: center;
}

.headline p {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(1rem, 5vw, 1.7rem);
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.whisper {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--gold);
  font-size: clamp(0.58rem, 2.45vw, 0.78rem);
  font-weight: 800;
  line-height: 1.15;
  opacity: 0.82;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-rotator {
  width: 100%;
  min-height: 28px;
  overflow: hidden;
  padding: 7px 0;
  border: 1px solid rgba(246, 201, 84, 0.36);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(246, 201, 84, 0.16), rgba(246, 201, 84, 0.04));
  color: var(--gold);
  font-size: clamp(0.56rem, 2.55vw, 0.84rem);
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 12px 36px rgba(246, 201, 84, 0.1);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.proof-rotator span {
  display: block;
  overflow: hidden;
  padding-inline: 8px;
  text-align: center;
  text-overflow: ellipsis;
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.proof-rotator span.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

.video-shell {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080808;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: manipulation;
}

.video-shell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 8px;
  place-content: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.045) 0,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 18px
    ),
    #090909;
  text-align: center;
}

.video-placeholder span,
.video-placeholder strong {
  display: block;
}

.video-placeholder span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.video-placeholder strong {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 900;
}

.video-shell.is-playing .video-placeholder strong {
  color: var(--gold);
}

.video-shell.is-playing .video-placeholder strong::after {
  content: " · Watching";
}

.video-shell.is-complete {
  border-color: rgba(50, 213, 131, 0.65);
}

.video-shell.is-complete .video-placeholder strong {
  color: var(--green);
}

.video-shell.is-complete .video-placeholder strong::after {
  content: " · Complete";
}

.claim-button {
  position: relative;
  display: grid;
  min-height: 68px;
  overflow: hidden;
  align-items: center;
  border: 1px solid rgba(246, 201, 84, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 18px 52px rgba(246, 201, 84, 0.14);
  opacity: 0.58;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
  touch-action: manipulation;
}

.claim-button:not(.is-locked) {
  border-color: var(--gold);
  opacity: 1;
  pointer-events: auto;
}

.claim-button:not(.is-locked):active {
  transform: translateY(1px);
}

.button-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(135deg, var(--gold), #ffe58b 46%, var(--gold-deep));
  transition: width 180ms linear;
}

.button-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  text-align: center;
}

.button-content small,
.button-content strong {
  display: block;
}

.button-content small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.claim-button:not(.is-locked) .button-content small,
.claim-button:not(.is-locked) .button-content strong {
  color: var(--black);
}

.affiliate-link {
  justify-self: center;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
}

.affiliate-link:hover {
  color: var(--gold);
}

.is-hidden {
  display: none !important;
}

.portal-shell {
  width: min(1180px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.portal-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-brand img {
  display: block;
  width: 112px;
  height: 34px;
  object-fit: contain;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.portal-nav a,
.text-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.portal-nav a:hover,
.text-button:hover {
  color: var(--gold);
}

.portal-hero {
  display: grid;
  gap: 6px;
  padding: 32px 0 18px;
}

.portal-hero p,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-hero h1,
.auth-panel h2,
.section-heading h2,
.link-panel h2,
.edit-form h2 {
  margin: 0;
  white-space: normal;
}

.portal-hero h1 {
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  line-height: 0.92;
}

.auth-panel,
.link-panel,
.chart-panel,
.leaderboard-panel,
.admin-table-panel,
.edit-form {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(246, 201, 84, 0.08), transparent 38%),
    var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.auth-panel {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 1px minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
  padding: 22px;
}

.auth-form,
.edit-form {
  align-content: start;
}

.auth-form,
.edit-form,
.search-box,
.auth-form label,
.edit-form label {
  display: grid;
  gap: 8px;
}

.auth-form label,
.edit-form label,
.search-box {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  padding: 10px 12px;
}

input:focus {
  border-color: rgba(246, 201, 84, 0.76);
  box-shadow: 0 0 0 3px rgba(246, 201, 84, 0.14);
}

.auth-divider {
  width: 1px;
  min-height: 100%;
  background: var(--line);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 1px solid rgba(246, 201, 84, 0.58);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--gold), #ffe58b 48%, var(--gold-deep));
  color: var(--black);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-note {
  max-width: 640px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.link-panel,
.chart-panel {
  grid-column: span 3;
}

.leaderboard-panel {
  grid-column: span 1;
}

.link-panel,
.chart-panel,
.leaderboard-panel,
.admin-table-panel {
  padding: 18px;
}

.referral-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 112px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 10px;
  min-height: 230px;
  align-items: end;
  overflow-x: auto;
  padding-top: 6px;
}

.bar-item {
  display: grid;
  min-width: 38px;
  gap: 8px;
  justify-items: center;
}

.bar-track {
  display: flex;
  width: 100%;
  height: 148px;
  align-items: end;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.bar-track span {
  display: block;
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, var(--gold), #47d7ac);
}

.bar-count,
.bar-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.leaderboard-row strong {
  color: var(--gold);
}

.leaderboard-row span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 800;
}

.empty-state,
.empty-table {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: 0.86rem;
  font-weight: 800;
}

code {
  color: var(--gold);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
}

.edit-dialog {
  width: min(440px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0;
}

.edit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.edit-form {
  padding: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

@media (max-width: 920px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-divider {
    width: 100%;
    min-height: 1px;
  }

  .dashboard-grid,
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .link-panel,
  .chart-panel,
  .leaderboard-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .portal-header,
  .section-heading,
  .referral-box {
    align-items: stretch;
  }

  .portal-header,
  .section-heading {
    display: grid;
  }

  .portal-nav {
    justify-content: space-between;
  }

  .dashboard-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .referral-box {
    grid-template-columns: 1fr;
  }

  .portal-hero h1 {
    font-size: 2.3rem;
  }
}

.button-content strong {
  color: var(--white);
  font-size: 1rem;
  font-weight: 900;
}

.microcopy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.42;
  text-align: center;
}

.success-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.success-card {
  display: grid;
  width: min(100%, 520px);
  gap: 18px;
  justify-items: center;
  padding: 22px 16px;
  border: 1px solid rgba(246, 201, 84, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(246, 201, 84, 0.12), transparent 42%),
    var(--panel);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.success-copy {
  display: grid;
  gap: 10px;
}

.success-copy p {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.success-copy h1 {
  font-size: clamp(2.15rem, 11vw, 4.7rem);
  line-height: 0.88;
  white-space: normal;
}

.success-copy span {
  color: rgba(248, 247, 242, 0.78);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.45;
}

.success-copy ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.success-copy li {
  padding: 12px;
  border: 1px solid rgba(246, 201, 84, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(248, 247, 242, 0.86);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.35;
}

.success-copy li::before {
  content: "• ";
  color: var(--gold);
}

.success-button {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
}

.success-button .button-fill {
  width: 100%;
}

.notification-proof {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(246, 201, 84, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(246, 201, 84, 0.1), rgba(255, 255, 255, 0.035)),
    var(--panel);
}

.proof-copy {
  display: grid;
  gap: 4px;
  text-align: center;
}

.proof-copy span {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.proof-copy strong {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 900;
}

.proof-video {
  display: block;
  width: 100%;
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080808;
  object-fit: contain;
}

@media (max-width: 380px) {
  .video-card {
    gap: 10px;
  }

  .brand-logo {
    width: 96px;
    height: 29px;
  }

  .headline {
    gap: 5px;
    padding-top: 0;
  }

  h1 {
    font-size: clamp(0.92rem, 4.75vw, 1.15rem);
  }

  .proof-rotator {
    min-height: 24px;
    padding: 6px 8px;
    font-size: clamp(0.45rem, 2.15vw, 0.6rem);
  }

  .whisper {
    font-size: clamp(0.48rem, 2.2vw, 0.62rem);
  }

  .claim-button {
    min-height: 62px;
  }

  .microcopy {
    font-size: 0.78rem;
  }

  .notification-proof {
    padding: 10px;
  }

  .proof-video {
    max-height: 220px;
  }
}

@media (min-width: 720px) {
  .video-page {
    padding: 28px;
  }

  .video-card {
    min-height: calc(100svh - 56px);
  }
}
