/* =========================================================
   Oculux â€“ styles (mobile first, no frameworks)
   ========================================================= */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --ink: #17171a;
  --muted: #62626b;
  --line: #d4d4dc;
  --primary: #0066cc;
  --primary-2: #2583e6;
  --accent-ink: #0057b8;
  --accent-soft: #dcecff;
  --accent: #30c78a;
  --danger: #e5484d;
  --warn: #f5a524;
  --radius: 20px;
  --shadow: 0 2px 12px rgba(20, 20, 30, 0.045);
  --nav-h: 68px;
  --top-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1.3rem;
  font-weight: 800;
}
h3 {
  font-size: 1rem;
  font-weight: 700;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
input,
select {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.muted {
  color: var(--muted);
}
.muted-w {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  display: block;
}
.small {
  font-size: 0.82rem;
}
.center {
  text-align: center;
}
.mt8 {
  margin-top: 8px;
}
.mt12 {
  margin-top: 12px;
}
.pad {
  padding: 8px 0 20px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--bg);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}
.page-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-orbit {
  width: 92px;
  height: 92px;
  position: relative;
  display: grid;
  place-items: center;
}
.loader-orbit img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
}
.loader-orbit-ring {
  position: absolute;
  inset: 2px;
  border: 2px solid rgba(0, 102, 204, 0.17);
  border-top-color: #0066cc;
  border-right-color: #2583e6;
  border-radius: 50%;
  animation: loader-orbit 1s linear infinite;
}
.loader-orbit-ring::after {
  content: "";
  position: absolute;
  top: -5px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0066cc;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}
@keyframes loader-orbit {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loader-orbit-ring {
    animation: none;
    border-top-color: #0066cc;
  }
}

/* ---------- App shell ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 244, 250, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chip-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.chip-balance .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 194, 168, 0.18);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.views {
  padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 28px);
}
.view {
  animation: fade 0.25s ease;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.page-title {
  margin: 6px 0 14px;
}
.section-title {
  margin: 22px 2px 10px;
}

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 -6px 24px rgba(30, 30, 80, 0.06);
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  position: relative;
}
.bottomnav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottomnav a.active {
  color: var(--primary);
}
.bottomnav a.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--primary);
}

/* ---------- Cards & primitives ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(79, 61, 245, 0.1);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  transition:
    transform 0.12s ease,
    opacity 0.2s,
    box-shadow 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 61, 245, 0.28);
}
.btn-light {
  background: #fff;
  color: var(--primary);
}
.btn-ghost-w {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-outline {
  border: 1.5px solid var(--line);
  background: var(--surface);
}
.btn-text {
  color: var(--danger);
}

.progress {
  height: 10px;
  background: #eceefa;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.6s ease;
}
.progress-bar.alt {
  background: linear-gradient(90deg, var(--accent), #5ee6d2);
}

/* ---------- Home ---------- */
.hello {
  margin: 4px 0 14px;
}
.balance-card {
  background: linear-gradient(140deg, #3a28e0 0%, #6a58ff 55%, #00b5a0 130%);
  color: #fff;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 14px 34px rgba(79, 61, 245, 0.35);
  position: relative;
  overflow: hidden;
}
.balance-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}
.bc-label {
  font-size: 0.85rem;
  opacity: 0.85;
}
.bc-amount {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 2px 0 14px;
}
.bc-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.bc-row strong {
  font-size: 0.98rem;
}
.bc-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}
.bc-actions .btn {
  flex: 1;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  min-height: 4px;
  transition: height 0.6s ease;
}
.bar.today {
  background: linear-gradient(180deg, #5ee6d2, var(--accent));
}
.bar-col span {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Lists ---------- */
.list {
}
.list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child {
  border-bottom: 0;
}
.list.card li:first-child {
  padding-top: 0;
}
.list.card li:last-child {
  padding-bottom: 0;
}
.ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: rgba(79, 61, 245, 0.1);
}
.ico.green {
  background: rgba(0, 194, 168, 0.14);
}
.ico.amber {
  background: rgba(245, 165, 36, 0.16);
}
.ico.red {
  background: rgba(229, 72, 77, 0.12);
}
.li-main {
  flex: 1;
  min-width: 0;
}
.li-main strong {
  display: block;
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li-main span {
  font-size: 0.76rem;
  color: var(--muted);
}
.amt {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: right;
}
.amt.pos {
  color: #0a9d87;
}
.amt.neg {
  color: var(--ink);
}
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 2px;
}
.status.pending {
  background: rgba(245, 165, 36, 0.18);
  color: #b36f00;
}
.status.done {
  background: rgba(0, 194, 168, 0.16);
  color: #07806d;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 22px 8px;
  font-size: 0.9rem;
}

/* ---------- Tabs & pills ---------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #e7e9f6;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 14px;
}
.tab {
  padding: 10px;
  border-radius: 11px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 30, 80, 0.1);
}
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar {
  display: none;
}
.pill {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.83rem;
}
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.summary-row {
  display: flex;
  gap: 12px;
  margin: 6px 0 12px;
}
.summary-row > div {
  flex: 1;
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.summary-row strong {
  display: block;
  font-size: 1.1rem;
}
.day-label {
  margin: 14px 2px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Ads ---------- */
.notice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(
    135deg,
    rgba(79, 61, 245, 0.1),
    rgba(0, 194, 168, 0.12)
  );
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.ad-list {
  display: grid;
  gap: 12px;
}
.ad {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.ad-thumb {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.7rem;
}
.ad-thumb .play {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  font-size: 0.6rem;
}
.ad-body {
  flex: 1;
  min-width: 0;
}
.ad-body strong {
  display: block;
  font-size: 0.98rem;
}
.ad-body p {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-meta {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.meta {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0fa;
  color: var(--muted);
}
.meta.tier {
  background: rgba(79, 61, 245, 0.1);
  color: var(--primary);
}
.ad-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.ad-reward {
  font-weight: 800;
  color: #0a9d87;
  font-size: 1rem;
}
.watch-btn {
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}
.watch-btn.locked {
  background: #e7e9f6;
  color: var(--muted);
}
.watch-btn.done {
  background: #e7e9f6;
  color: var(--muted);
  cursor: default;
}
.ad.is-locked .ad-thumb {
  filter: grayscale(0.6) opacity(0.75);
}

/* ---------- Wallet ---------- */
.wallet-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.wallet-top > div {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.big {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.big.alt {
  color: var(--accent);
}

.form {
  display: grid;
  gap: 14px;
}
.form label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.form input,
.form select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fafbff;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.form input:focus,
.form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 61, 245, 0.12);
}
.input-affix {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fafbff;
  padding-left: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.input-affix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 61, 245, 0.12);
}
.input-affix span {
  font-weight: 700;
  color: var(--muted);
}
.input-affix input {
  border: 0;
  box-shadow: none !important;
  background: transparent;
  padding-left: 8px;
}
.mini {
  margin-right: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(79, 61, 245, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  flex: none;
}
.fee-box {
  background: #f5f6fd;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}
.fee-box > div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.fee-box strong {
  color: var(--ink);
}
.error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
}

.amount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.amount {
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fafbff;
  font-weight: 800;
  font-size: 1.2rem;
  text-align: left;
  transition: all 0.15s;
}
.amount small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.amount.active {
  border-color: var(--primary);
  background: rgba(79, 61, 245, 0.07);
  color: var(--primary);
}

.plans {
  display: grid;
  gap: 10px;
}
.plan {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.plan.current {
  border-color: var(--primary);
}
.plan .ico {
  font-size: 1.3rem;
}
.plan-main {
  flex: 1;
}
.plan-main strong {
  display: block;
}
.plan-main span {
  font-size: 0.78rem;
  color: var(--muted);
}
.plan-x {
  font-weight: 800;
  color: var(--primary);
}

/* ---------- Referrals ---------- */
.ref-hero {
  background: var(--surface);
  border-radius: 22px;
  padding: 20px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.ref-emoji {
  font-size: 2.4rem;
  margin-bottom: 4px;
}
.ref-hero .small {
  margin: 6px 0 16px;
  color: var(--muted);
}
.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px dashed #c9c5ff;
  background: rgba(79, 61, 245, 0.05);
}
.code-box strong {
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--primary);
  display: block;
}
.link-box {
  display: flex;
  align-items: center;
  margin-top: 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fafbff;
}
.link-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  outline: none;
}
.stats-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
}
.stat span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Profile ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.big-av {
  width: 68px;
  height: 68px;
  font-size: 1.7rem;
  flex: none;
}
.profile-head h3 {
  font-size: 1.2rem;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  gap: 12px;
}
.switch-row:first-of-type {
  border-top: 0;
}
.switch-row span {
  font-weight: 600;
  font-size: 0.92rem;
}
.switch-row small {
  display: block;
  font-weight: 400;
  font-size: 0.76rem;
}
.card h3 {
  margin-bottom: 4px;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #d6d9ec;
  position: relative;
  transition: background 0.2s;
  flex: none;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(18px);
}

/* ---------- Video player ---------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0b0b1a;
  color: #fff;
  display: flex;
  flex-direction: column;
  animation: fade 0.25s ease;
  padding-top: var(--safe-t);
}
.player-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.ad-tag {
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}
.timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1rem;
}
.player-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 16px;
  border-radius: 4px;
  overflow: hidden;
}
.player-progress div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.12s linear;
}
.stage {
  flex: 1;
  position: relative;
  margin: 14px 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.stage .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.7;
  animation: float 8s ease-in-out infinite;
}
.o1 {
  width: 260px;
  height: 260px;
  background: var(--c1, #7a6bff);
  top: -40px;
  left: -60px;
}
.o2 {
  width: 300px;
  height: 300px;
  background: var(--c2, #00c2a8);
  bottom: -80px;
  right: -80px;
  animation-delay: -3s;
}
.o3 {
  width: 180px;
  height: 180px;
  background: var(--c3, #f5a524);
  top: 40%;
  left: 55%;
  animation-delay: -5s;
  opacity: 0.5;
}
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -24px) scale(1.15);
  }
}
.stage-content {
  position: relative;
  text-align: center;
  padding: 0 24px;
  animation: pop 0.7s ease both;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.stage-logo {
  width: 88px;
  height: 88px;
  border-radius: 26px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
}
.stage-content h2 {
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}
.stage-content p {
  margin-top: 6px;
  opacity: 0.85;
  font-size: 1.05rem;
}
.stage-cta {
  display: inline-block;
  margin-top: 22px;
  padding: 11px 24px;
  border-radius: 999px;
  background: #fff;
  color: #14142b;
  font-weight: 700;
}
.paused-note {
  position: absolute;
  inset: auto 16px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.player-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px calc(16px + var(--safe-b));
}
.reward-preview strong {
  font-size: 1.4rem;
}
.player-bottom .btn {
  min-width: 160px;
}
.player-bottom .btn.ready {
  background: var(--accent);
  color: #05342d;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 194, 168, 0.6);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(0, 194, 168, 0);
  }
}

/* ---------- Toasts ---------- */
.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  background: #14142b;
  color: #fff;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.25s ease;
  max-width: 420px;
}
.toast.ok {
  background: #0b8f7c;
}
.toast.err {
  background: var(--danger);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  body {
    background: linear-gradient(160deg, #e5e7f8, #e0f6f2);
  }
  .app {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 32px;
    box-shadow: 0 30px 80px rgba(30, 30, 80, 0.18);
    overflow: clip;
  }
  .topbar {
    border-radius: 32px 32px 0 0;
  }
  .bottomnav {
    bottom: 24px;
    border-radius: 0 0 32px 32px;
  }
  .toast-wrap {
    bottom: 110px;
  }
  .player {
    max-width: 560px;
    left: 50%;
    right: auto;
    width: 100%;
    transform: translateX(-50%);
    border-radius: 32px;
    top: 24px;
    bottom: 24px;
  }
}
@media (max-width: 360px) {
  .bc-amount {
    font-size: 2.1rem;
  }
  .ad-thumb {
    width: 62px;
    height: 62px;
  }
  .watch-btn {
    padding: 8px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- iOS-inspired finish ---------- */
body {
  background: #f2f2f7;
  letter-spacing: -0.01em;
}
.app {
  background: var(--bg);
}
.topbar {
  background: rgba(242, 242, 247, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.brand {
  gap: 9px;
  font-size: 1.1rem;
  letter-spacing: -0.035em;
}
.brand svg {
  width: 28px;
  height: 28px;
}
.chip-balance {
  border: 1px solid #d0d0d8;
  background: #e5e5eb;
  box-shadow: none;
  padding: 8px 12px;
  font-size: 0.88rem;
}
.chip-balance .dot {
  background: var(--accent);
  box-shadow: none;
}
.avatar {
  background: linear-gradient(145deg, #60aaff, #087cff);
}
.views {
  padding-top: 10px;
}
.page-title {
  font-size: 1.9rem;
  letter-spacing: -0.045em;
  margin: 4px 2px 18px;
}
h1,
h2,
h3 {
  letter-spacing: -0.035em;
}
.section-title {
  margin: 24px 3px 10px;
  font-size: 1.15rem;
}
.card,
.wallet-top > div,
.summary-row > div,
.ad,
.plan,
.stat,
.ref-hero {
  border: 1px solid rgba(30, 30, 40, 0.035);
  box-shadow: 0 2px 10px rgba(20, 20, 30, 0.035);
}
.card {
  padding: 18px;
}
.card-head {
  margin-bottom: 14px;
}
.balance-card {
  border-radius: 26px;
  padding: 23px 20px 18px;
  background: linear-gradient(145deg, #0874e8 0%, #005fc7 58%, #004ca8 100%);
  box-shadow: 0 12px 28px rgba(0, 83, 180, 0.24);
}
.balance-card::after {
  background: rgba(255, 255, 255, 0.075);
}
.bc-label {
  font-size: 0.9rem;
  font-weight: 500;
}
.bc-amount {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.muted-w {
  color: rgba(255, 255, 255, 0.86);
}
.bc-row {
  border-color: rgba(255, 255, 255, 0.2);
}
.bc-row strong {
  font-size: 0.92rem;
  font-weight: 650;
}
.btn {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.btn-primary,
.watch-btn {
  background: var(--primary);
  box-shadow: none;
}
.btn-light {
  color: var(--accent-ink);
}
.btn-ghost-w {
  border-color: rgba(255, 255, 255, 0.38);
}
.progress {
  height: 8px;
  background: #ededf2;
}
.progress-bar {
  background: var(--primary);
}
.progress-bar.alt {
  background: var(--accent);
}
.bottomnav {
  background: rgba(250, 250, 252, 0.86);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(60, 60, 67, 0.2);
  box-shadow: 0 -3px 18px rgba(30, 30, 40, 0.035);
}
.bottomnav a {
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #62626b;
}
.bottomnav svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.9;
}
.bottomnav a.active {
  color: var(--primary);
}
.bottomnav a.active::before {
  display: none;
}
.tabs {
  background: #e6e6eb;
  border-radius: 12px;
  padding: 3px;
}
.tab {
  border-radius: 9px;
  padding: 9px 8px;
  font-size: 0.86rem;
  font-weight: 600;
}
.tab.active {
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.pill {
  border-color: #d0d0d8;
  background: #e5e5eb;
  color: #44444c;
}
.pill.active {
  background: var(--primary);
}
.form input,
.form select,
.input-affix,
.link-box {
  border-color: #c9c9d1;
  background: #fff;
  border-radius: 13px;
}
.form label {
  color: #44444c;
}
.big.alt {
  color: #16845c;
}
.form input:focus,
.form select:focus,
.input-affix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 124, 255, 0.12);
}
.switch:checked {
  background: #34c759;
}
.mini {
  color: var(--primary);
  background: var(--accent-soft);
}
.amount.active,
.plan.current {
  border-color: var(--primary);
}
.amount.active {
  background: rgba(8, 124, 255, 0.06);
}
.notice {
  background: #e3efff;
  color: #173e68;
}
.meta {
  background: #e7e7ed;
  color: #55555d;
}
.meta.tier,
.badge {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.ico {
  background: rgba(8, 124, 255, 0.1);
}
.ico.green {
  background: rgba(48, 199, 138, 0.13);
}
.status.done {
  background: rgba(48, 199, 138, 0.13);
  color: #16845c;
}
.amt.pos,
.ad-reward {
  color: #16845c;
}
.bar {
  background: linear-gradient(180deg, #54a3ff, #087cff);
}
.bar.today {
  background: linear-gradient(180deg, #7be3b4, #30c78a);
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8, 124, 255, 0.35);
  outline-offset: 2px;
}
.bottomnav {
  bottom: calc(var(--safe-b) + 12px);
  width: calc(100% - 32px);
  max-width: 528px;
  height: var(--nav-h);
  padding-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(190%) blur(28px);
  -webkit-backdrop-filter: saturate(190%) blur(28px);
  box-shadow:
    0 8px 30px rgba(25, 35, 55, 0.16),
    0 1px 4px rgba(25, 35, 55, 0.08);
}
.toast-wrap {
  bottom: calc(var(--nav-h) + var(--safe-b) + 28px);
}
.app:not(.is-authenticated) .chip-balance,
.app:not(.is-authenticated) #topAvatar {
  display: none;
}
.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app.is-authenticated .auth-actions {
  display: none;
}
.auth-login,
.auth-register {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
}
.auth-login {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.auth-register {
  color: #fff;
  background: #0066cc;
}
.auth-login:active,
.auth-register:active {
  transform: scale(0.97);
}
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + var(--safe-b));
  background: rgba(17, 22, 34, 0.42);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.auth-dialog {
  width: min(100%, 420px);
  max-height: calc(100vh - 48px - var(--safe-t) - var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 80px rgba(10, 20, 40, 0.24);
  animation: auth-pop 0.2s ease both;
}
@keyframes auth-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.auth-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.auth-eyebrow {
  margin-bottom: 5px;
  color: var(--accent-ink);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}
.auth-dialog h2 {
  font-size: 1.7rem;
  letter-spacing: -0.045em;
}
.auth-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ededf2;
  color: #45454c;
  font-size: 1.45rem;
  line-height: 1;
}
.auth-description {
  margin: 7px 0 20px;
  color: #62626b;
  font-size: 0.92rem;
}
.auth-form {
  gap: 13px;
}
.auth-form label {
  gap: 7px;
  color: #44444c;
  font-size: 0.82rem;
}
.auth-form input {
  min-height: 48px;
}
.auth-form .btn {
  margin-top: 3px;
}
.auth-text-link,
.auth-inline-link {
  padding: 0;
  color: var(--accent-ink);
  font-size: 0.86rem;
  font-weight: 650;
}
.auth-text-link {
  justify-self: end;
  margin-top: -5px;
}
.auth-switch {
  padding-top: 2px;
  text-align: center;
  color: #62626b;
  font-size: 0.86rem;
}
.auth-demo-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e5e5ea;
  color: #62626b;
  font-size: 0.76rem;
  text-align: center;
}
.auth-error {
  margin: 0;
}
body.auth-open {
  overflow: hidden;
}
@media (min-width: 600px) {
  body {
    background: #e8e8ee;
  }
  .bottomnav {
    bottom: 36px;
    width: calc(100% - 48px);
    max-width: 512px;
    border-radius: 24px;
  }
  .toast-wrap {
    bottom: 120px;
  }
}

/* ---------- Profile security and customization ---------- */
.setting-intro {
  margin: 3px 0 8px;
}
.security-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.security-action-row strong {
  display: block;
  font-size: 0.92rem;
}
.security-action-row small {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
}
.security-action-row .mini {
  margin-right: 0;
}
.password-change-form {
  margin: 4px 0 12px;
  padding: 14px;
  border-radius: 16px;
  background: #f2f2f7;
}
.password-change-form .form {
  gap: 12px;
}
.security-demo-note {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.setting-select {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: #44444c;
  font-size: 0.84rem;
  font-weight: 600;
}
.setting-select select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #c9c9d1;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.app-customization-note {
  margin-top: 10px;
}
:root[data-text-size="large"] {
  font-size: 112.5%;
}
:root[data-reduce-motion="true"] *,
:root[data-reduce-motion="true"] *::before,
:root[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

/* Dark appearance. Keep the hero card bright as the main brand accent. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111115;
  --surface: #1d1d22;
  --ink: #f5f5f7;
  --muted: #aaaab4;
  --line: #3a3a42;
  --primary: #4a9eff;
  --primary-2: #72b4ff;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
}
:root[data-theme="dark"] body {
  background: #111115;
}
:root[data-theme="dark"] .topbar {
  background: rgba(17, 17, 21, 0.9);
}
:root[data-theme="dark"] .chip-balance {
  color: var(--ink);
  background: #29292f;
  border-color: #414149;
}
:root[data-theme="dark"] .bottomnav {
  color: var(--ink);
  background: rgb(29 29 34 / 17%);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.42);
}
:root[data-theme="dark"] .bottomnav a {
  color: #b7b7c0;
}
:root[data-theme="dark"] .bottomnav a.active {
  color: var(--primary);
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .wallet-top > div,
:root[data-theme="dark"] .summary-row > div,
:root[data-theme="dark"] .ad,
:root[data-theme="dark"] .plan,
:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .ref-hero {
  color: var(--ink);
  background: var(--surface);
  border-color: #303038;
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .tabs {
  background: #303038;
}
:root[data-theme="dark"] .tab {
  color: #c1c1ca;
}
:root[data-theme="dark"] .tab.active {
  color: #1c1c20;
  background: #fff;
}
:root[data-theme="dark"] .pill {
  color: #dedee4;
  background: #2c2c32;
  border-color: #42424a;
}
:root[data-theme="dark"] .pill.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
:root[data-theme="dark"] .form input,
:root[data-theme="dark"] .form select,
:root[data-theme="dark"] .input-affix,
:root[data-theme="dark"] .link-box,
:root[data-theme="dark"] .amount,
:root[data-theme="dark"] .setting-select select {
  color: var(--ink);
  background: #25252b;
  border-color: #484850;
}
:root[data-theme="dark"] .input-affix input {
  background: transparent;
}
:root[data-theme="dark"] .fee-box,
:root[data-theme="dark"] .password-change-form {
  color: var(--ink);
  background: #29292f;
}
:root[data-theme="dark"] .notice {
  color: #d8eaff;
  background: #1c3048;
}
:root[data-theme="dark"] .meta {
  color: #c0c0c9;
  background: #303038;
}
:root[data-theme="dark"] .meta.tier,
:root[data-theme="dark"] .badge,
:root[data-theme="dark"] .mini,
:root[data-theme="dark"] .auth-login {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
:root[data-theme="dark"] .auth-register {
  color: #fff;
  background: #0874e8;
}
:root[data-theme="dark"] .auth-dialog {
  color: var(--ink);
  background: rgba(31, 31, 36, 0.98);
  border-color: #43434b;
}
:root[data-theme="dark"] .auth-close {
  color: #e8e8ed;
  background: #3a3a42;
}
:root[data-theme="dark"] .auth-description,
:root[data-theme="dark"] .auth-switch,
:root[data-theme="dark"] .auth-demo-note,
:root[data-theme="dark"] .security-demo-note {
  color: var(--muted);
}
:root[data-theme="dark"] .auth-demo-note {
  border-color: var(--line);
}
:root[data-theme="dark"] .setting-select {
  color: #dddde3;
}
:root[data-theme="dark"] .password-change-form {
  background: #24242a;
}
:root[data-theme="dark"] .page-loader {
  background: var(--bg);
}
:root[data-theme="dark"] .bar {
  background: linear-gradient(180deg, #72b4ff, #0874e8);
}

.recovery-codes-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 13px;
  border-radius: 14px;
  background: #f2f2f7;
}
.recovery-codes-panel code {
  display: block;
  padding: 11px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.8;
  letter-spacing: 0.08em;
  white-space: pre-wrap;
  font-variant-numeric: tabular-nums;
}
.recovery-codes-panel .mini {
  justify-self: end;
}
:root[data-theme="dark"] .recovery-codes-panel {
  background: #24242a;
}
:root[data-theme="dark"] .recovery-codes-panel code {
  background: #303038;
}

:root[data-accent="violet"] {
  --primary: #7051df;
  --primary-2: #9b85ff;
  --accent-ink: #5234b8;
  --accent-soft: #eee9ff;
}
:root[data-accent="teal"] {
  --primary: #087f79;
  --primary-2: #36b3a9;
  --accent-ink: #09685f;
  --accent-soft: #ddf5f1;
}
:root[data-theme="dark"][data-accent="violet"] {
  --primary: #a18bff;
  --primary-2: #c0b3ff;
  --accent-ink: #d0c6ff;
  --accent-soft: #382e5a;
}
:root[data-theme="dark"][data-accent="teal"] {
  --primary: #5bd4c8;
  --primary-2: #8be9df;
  --accent-ink: #a8eee7;
  --accent-soft: #1b4845;
}
:root[data-accent="violet"] .auth-register,
:root[data-accent="teal"] .auth-register {
  background: var(--primary);
}
