:root {
  --bg: #10120f;
  --panel: #181c16;
  --panel-2: #20261d;
  --ink: #f8f4df;
  --muted: #b7b99c;
  --line: rgba(248, 244, 223, 0.14);
  --gold: #ffc247;
  --gold-2: #ffdf86;
  --cyan: #4be8de;
  --mint: #78e08f;
  --coral: #ff785f;
  --danger: #ff5f77;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 194, 71, 0.14), transparent 28%),
    linear-gradient(135deg, #10120f 0%, #171a13 52%, #0f1514 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  flex: 1 1 220px;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  min-width: 220px;
}

.brand-mark,
.icon-button,
.tab-button svg,
.primary-action svg,
.secondary-action svg,
.hold-button svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #1b1607;
  background: linear-gradient(135deg, var(--gold), var(--cyan));
  box-shadow: 0 10px 28px rgba(255, 194, 71, 0.22);
}

svg {
  fill: currentColor;
}

.brand strong {
  display: block;
  font-size: 1.1rem;
}

.brand small,
.muted,
.timer-line,
.stat-card small,
.wallet-panel small,
.hero-subcopy,
.security-list {
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  flex: 1 1 520px;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 28, 22, 0.78);
  backdrop-filter: blur(20px);
  overflow-x: auto;
}

.tab-button,
.icon-button,
.primary-action,
.secondary-action,
.hold-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  color: var(--ink);
}

.tab-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 7px;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.tab-button.is-active {
  color: #171305;
  background: var(--gold);
}

.hero-band {
  position: relative;
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: end;
  gap: 24px;
  padding: clamp(22px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 18, 15, 0.22), rgba(16, 18, 15, 0.58) 44%, rgba(16, 18, 15, 0.88));
}

.hero-copy,
.wallet-panel {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(2.35rem, 5vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.hero-subcopy {
  max-width: 650px;
  margin-bottom: 0;
  font-size: 1.04rem;
  line-height: 1.55;
}

.wallet-panel {
  justify-self: end;
  width: min(310px, 100%);
  padding: 20px;
  border: 1px solid rgba(255, 194, 71, 0.32);
  border-radius: 8px;
  background: rgba(16, 18, 15, 0.78);
  backdrop-filter: blur(18px);
}

.wallet-panel span,
.stat-card span,
.mini-ledger span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.wallet-panel strong {
  display: block;
  margin: 6px 0;
  color: var(--gold-2);
  font-size: 2.2rem;
}

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

.stat-card,
.action-card,
.surf-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 28, 22, 0.86);
}

.stat-card {
  min-height: 102px;
  padding: 16px;
}

.stat-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.75rem;
}

.meter,
.surf-progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(248, 244, 223, 0.12);
}

.meter span,
.surf-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  transition: width 0.25s ease;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

html:not([data-route="home"]) .home-only,
html:not([data-route="home"]) .guest-only {
  display: none !important;
}

html[data-route="dashboard"] .view-panel:not([data-panel="dashboard"]),
html[data-route="faucet"] .view-panel:not([data-panel="faucet"]),
html[data-route="shortlinks"] .view-panel:not([data-panel="shortlinks"]),
html[data-route="quests"] .view-panel:not([data-panel="quests"]),
html[data-route="autosurf"] .view-panel:not([data-panel="autosurf"]),
html[data-route="daily"] .view-panel:not([data-panel="daily"]),
html[data-route="links"] .view-panel:not([data-panel="links"]),
html[data-route="wallet"] .view-panel:not([data-panel="wallet"]),
html[data-route="admin"] .view-panel:not([data-panel="admin"]) {
  display: none !important;
}

html[data-route="dashboard"] .view-panel[data-panel="dashboard"].is-active,
html[data-route="faucet"] .view-panel[data-panel="faucet"].is-active,
html[data-route="shortlinks"] .view-panel[data-panel="shortlinks"].is-active,
html[data-route="quests"] .view-panel[data-panel="quests"].is-active,
html[data-route="autosurf"] .view-panel[data-panel="autosurf"].is-active,
html[data-route="daily"] .view-panel[data-panel="daily"].is-active,
html[data-route="links"] .view-panel[data-panel="links"].is-active,
html[data-route="wallet"] .view-panel[data-panel="wallet"].is-active,
html[data-route="admin"] .view-panel[data-panel="admin"].is-active {
  display: block;
}

.auth-only {
  display: none !important;
}

body.is-authenticated .guest-only,
body.is-authenticated .home-only {
  display: none !important;
}

body.is-authenticated .auth-only {
  display: revert !important;
}

body.is-authenticated .tab-button.auth-only,
body.is-authenticated .primary-action.auth-only,
body.is-authenticated .secondary-action.auth-only {
  display: inline-flex !important;
}

body.is-authenticated .stats-grid.auth-only,
body.is-authenticated .two-column.auth-only,
body.is-authenticated .admin-grid.auth-only {
  display: grid !important;
}

body.is-authenticated .view-panel.auth-only.is-active {
  display: block !important;
}

.two-column,
.admin-grid,
.autosurf-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  margin-top: 14px;
  padding: 22px;
}

.level-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #6d70ff, #9b5cff);
  box-shadow: 0 14px 34px rgba(109, 112, 255, 0.32);
  font-size: 1.45rem;
  font-weight: 900;
}

.dashboard-profile-main {
  min-width: 0;
}

.dashboard-meter {
  margin: 10px 0;
}

.benefit-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(120, 224, 143, 0.24);
  border-radius: 8px;
  background: rgba(120, 224, 143, 0.08);
}

.benefit-strip span {
  color: var(--muted);
}

.benefit-strip strong {
  color: var(--mint);
  text-align: right;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
}

.earning-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.earning-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.18);
}

.earning-card:hover {
  border-color: rgba(75, 232, 222, 0.38);
  background: rgba(75, 232, 222, 0.08);
}

.earning-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.lower-grid {
  margin-top: 14px;
}

.action-card,
.surf-control {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.reward-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 194, 71, 0.3);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(255, 194, 71, 0.1);
  font-size: 0.82rem;
  font-weight: 800;
}

.claim-gate {
  display: grid;
  gap: 10px;
  margin: 18px 0 14px;
  padding: 14px;
  border: 1px solid rgba(75, 232, 222, 0.22);
  border-radius: 8px;
  background: rgba(75, 232, 222, 0.06);
}

.turnstile-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  margin: 14px 0;
  padding: 10px;
  border: 1px solid rgba(248, 244, 223, 0.12);
  border-radius: 8px;
  background: rgba(248, 244, 223, 0.05);
  color: var(--muted);
}

.turnstile-action {
  width: 100%;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.gate-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}

code {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--gold-2);
  background: rgba(0, 0, 0, 0.22);
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.22);
  outline: 0;
}

input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(75, 232, 222, 0.14);
}

.hold-button {
  position: relative;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(248, 244, 223, 0.1);
}

.hold-button > * {
  position: relative;
  z-index: 1;
}

.hold-fill {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 194, 71, 0.8), rgba(75, 232, 222, 0.7));
  transition: width 0.05s linear;
}

.hold-button.is-done {
  color: #12150f;
  background: var(--mint);
}

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 7px;
  font-weight: 850;
}

.primary-action {
  color: #171305;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}

.primary-action:disabled {
  cursor: not-allowed;
  color: rgba(248, 244, 223, 0.42);
  background: rgba(248, 244, 223, 0.12);
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(248, 244, 223, 0.08);
}

.timer-line {
  min-height: 20px;
  margin: 12px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.activity-list,
.security-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.activity-list li {
  line-height: 1.4;
}

.splash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 14px;
}

.splash-copy h2 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.feature-grid div {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.feature-grid strong {
  color: var(--gold-2);
}

.feature-grid span,
.quest-item p,
.quest-item small {
  color: var(--muted);
}

.single-column-form {
  grid-template-columns: 1fr;
}

.quest-list {
  display: grid;
  gap: 12px;
}

.quest-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.quest-item header,
.quest-item footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quest-item header span {
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.quest-item p {
  margin-bottom: 0;
}

.quest-item footer .secondary-action {
  width: auto;
  min-width: 140px;
  min-height: 40px;
}

.quest-item footer .secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: rgba(248, 244, 223, 0.08);
}

.autosurf-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.surf-stage {
  min-height: 820px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8f4df;
  color: #17211c;
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  padding: 0 14px;
  color: #5d6257;
  background: #e5dfc5;
}

.browser-chrome span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--coral);
}

.browser-chrome span:nth-child(2) {
  background: var(--gold);
}

.browser-chrome span:nth-child(3) {
  background: var(--mint);
}

.browser-chrome strong {
  min-width: 0;
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surf-preview {
  display: grid;
  align-content: center;
  min-height: 772px;
  height: clamp(720px, 82vh, 940px);
  padding: clamp(24px, 5vw, 64px);
  background:
    linear-gradient(135deg, rgba(255, 194, 71, 0.24), transparent 45%),
    linear-gradient(160deg, #fff9df 0%, #d9fff8 100%);
}

.surf-preview.is-embedded {
  position: relative;
  display: block;
  padding: 0;
}

.surf-frame {
  display: block;
  width: 100%;
  min-height: 772px;
  height: clamp(720px, 82vh, 940px);
  border: 0;
  background: #fff;
}

.surf-frame-fallback {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(16, 18, 15, 0.86);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.surf-frame-fallback a {
  color: var(--gold-2);
  font-weight: 850;
}

.surf-preview h2 {
  max-width: 700px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.surf-preview p:not(.eyebrow) {
  max-width: 650px;
  line-height: 1.55;
}

.surf-control {
  align-self: start;
}

.surf-buttons {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.mini-ledger {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.toggle-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-top: 14px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.link-list,
.review-list {
  display: grid;
  gap: 10px;
}

.link-item,
.review-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.link-item header,
.review-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.link-item a,
.review-item a {
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reject-action {
  color: #fff;
  background: var(--danger);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.home-aads-unit {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 28, 22, 0.72);
}

.home-aads-unit iframe {
  min-height: 90px;
}

.non-home-ad {
  display: block;
}

html[data-route="home"] .non-home-ad {
  display: none !important;
}

.adblock-gate {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(8, 10, 8, 0.78);
  backdrop-filter: blur(16px);
}

.adblock-gate.is-visible {
  display: grid;
}

.adblock-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 194, 71, 0.32);
  border-radius: 8px;
  background: rgba(24, 28, 22, 0.96);
  box-shadow: var(--shadow);
}

.adblock-card h2 {
  margin-bottom: 10px;
  font-size: 1.65rem;
}

body.adblock-blocked main,
body.adblock-blocked .topbar {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(24, 28, 22, 0.96);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .topbar,
  .hero-band,
  .two-column,
  .dashboard-grid,
  .admin-grid,
  .autosurf-layout,
  .splash-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .nav-tabs {
    width: 100%;
    flex-basis: 100%;
  }

  .hero-band {
    min-height: 520px;
    align-items: end;
  }

  .wallet-panel {
    justify-self: start;
  }

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

@media (max-width: 620px) {
  .app-shell {
    padding: 10px;
  }

  .brand {
    min-width: 0;
  }

  .tab-button {
    padding: 0 10px;
  }

  .stats-grid,
  .dashboard-profile,
  .earning-grid,
  .form-grid,
  .gate-row,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .benefit-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .benefit-strip strong {
    text-align: left;
  }

  .quest-item header,
  .quest-item footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .quest-item header span,
  .quest-item footer .secondary-action {
    width: 100%;
    text-align: left;
  }

  .hero-band {
    min-height: 590px;
    padding: 20px;
  }

  .hero-band::after {
    background: linear-gradient(180deg, rgba(16, 18, 15, 0.25), rgba(16, 18, 15, 0.92));
  }

  .surf-preview {
    min-height: 360px;
  }
}
