:root {
  color-scheme: dark;
  --bg: #070810;
  --panel: rgba(18, 21, 34, .82);
  --panel-strong: rgba(25, 29, 48, .94);
  --text: #f7f8ff;
  --muted: #a8adc4;
  --line: rgba(255, 255, 255, .12);
  --red: #ff274f;
  --red-dark: #a90f31;
  --violet: #8f4dff;
  --cyan: #23d7ff;
  --green: #38e08b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(143, 77, 255, .14), transparent 34%),
    linear-gradient(215deg, rgba(35, 215, 255, .10), transparent 42%),
    var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}

button:active {
  transform: translateY(2px) scale(.99);
}

button[disabled] {
  cursor: wait;
  filter: grayscale(.35) brightness(.75);
}

button.is-loading {
  position: relative;
  overflow: hidden;
}

button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: translateX(-100%);
  animation: loadingSweep 1.05s ease-in-out infinite;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 20px;
  background: #070810;
  animation: introOut .75s ease 1.35s forwards;
}

.brand-mark {
  width: 178px;
  height: 178px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 42px;
  background: radial-gradient(circle at 50% 25%, rgba(143,77,255,.55), rgba(35,215,255,.10) 52%, rgba(255,255,255,.04));
  box-shadow: 0 0 48px rgba(143,77,255,.42), inset 0 0 28px rgba(255,255,255,.08);
  animation: logoIn .9s cubic-bezier(.2,.9,.1,1) both, glowPulse 1.8s ease-in-out infinite;
  overflow: hidden;
}

.brand-mark img,
.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.brand-fallback {
  font-size: 26px;
  font-weight: 900;
}

.intro-title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  animation: fadeUp .8s ease .25s both;
}

.content {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(14px);
  animation: contentIn .55s ease 1.55s forwards;
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 2px 20px;
}

.hero-logo {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(143,77,255,.82), rgba(35,215,255,.22));
  box-shadow: 0 0 38px rgba(143,77,255,.42), inset 0 0 20px rgba(255,255,255,.08);
  overflow: hidden;
}

.hero-fallback {
  font-size: 28px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
}

.status-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}

.status-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 900;
}

.shield {
  filter: drop-shadow(0 0 12px rgba(35,215,255,.5));
}

dl {
  margin: 0;
  display: grid;
  gap: 11px;
}

dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.action {
  margin-top: 14px;
  box-shadow: 0 16px 36px rgba(0,0,0,.34);
}

.trial {
  min-height: 68px;
  font-size: 19px;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  box-shadow: 0 0 32px rgba(255,39,79,.34), 0 16px 36px rgba(0,0,0,.34);
}

.connect {
  min-height: 68px;
  font-size: 19px;
  background: linear-gradient(145deg, rgba(143,77,255,.96), rgba(35,215,255,.86));
  box-shadow: 0 0 32px rgba(35,215,255,.25), 0 16px 36px rgba(0,0,0,.34);
}

.buy-extend {
  min-height: 58px;
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  border: 1px solid var(--line);
}

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

.tile {
  min-height: 74px;
  padding: 10px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
}

.tile span {
  display: block;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.velion-app {
  border-color: rgba(143,77,255,.58);
  background: linear-gradient(145deg, rgba(143,77,255,.92), rgba(77,40,180,.72));
  box-shadow: 0 0 26px rgba(143,77,255,.32), 0 12px 28px rgba(0,0,0,.24);
}

.admin {
  min-height: 58px;
  background: linear-gradient(145deg, rgba(35,215,255,.32), rgba(143,77,255,.34));
  border: 1px solid rgba(35,215,255,.35);
}

.notice {
  min-height: 22px;
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.screen-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(20, 24, 40, .96), rgba(12, 14, 24, .92));
  box-shadow: 0 18px 48px rgba(0,0,0,.32);
}

.back-button {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  color: var(--muted);
  font-size: 13px;
}

.screen-panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.1;
}

.screen-text {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.screen-cards {
  display: grid;
  gap: 10px;
}

.screen-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
}

.screen-card h3 {
  margin: 2px 0 4px;
  font-size: 17px;
}

.screen-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.screen-card-actions {
  display: grid;
  gap: 8px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(35,215,255,.10);
  font-size: 11px;
  font-weight: 850;
}

.screen-buttons {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.screen-search-wrap {
  margin: 12px 0 16px;
}

.screen-search-title {
  margin: 0 0 4px;
  font-size: 16px;
}

.screen-search-text {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.screen-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 0;
}

.screen-search-input {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  outline: none;
  user-select: text;
}

.screen-search-input:focus {
  border-color: rgba(143,77,255,.74);
}

.screen-button {
  min-height: 48px;
  border: 1px solid rgba(143,77,255,.42);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(143,77,255,.82), rgba(45,48,76,.74));
}

.screen-button.small {
  min-height: 42px;
  font-size: 13px;
}

.pay-now {
  margin: 8px 0 10px;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
}

.link-box {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid rgba(35,215,255,.28);
  border-radius: 14px;
  background: rgba(35,215,255,.08);
  color: #e9fbff;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  user-select: text;
}

.debug {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(35,215,255,.25);
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(35,215,255,.08);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@keyframes logoIn {
  from { opacity: 0; transform: scale(.74) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes glowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes introOut {
  to { opacity: 0; visibility: hidden; }
}

@keyframes contentIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loadingSweep {
  to { transform: translateX(100%); }
}

@media (min-width: 560px) {
  .app-shell {
    display: grid;
    place-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
