:root {
  --bg: #05070a;
  --bg2: #071114;
  --panel: rgba(3, 18, 22, 0.86);
  --panel2: rgba(0, 255, 213, 0.09);
  --line: rgba(0, 255, 213, 0.36);
  --line2: rgba(255, 255, 255, 0.11);
  --text: #ecfffb;
  --muted: rgba(236, 255, 251, 0.68);
  --dim: rgba(236, 255, 251, 0.46);
  --neon: #00ffd5;
  --neon2: #00aaff;
  --danger: #ff3df2;
  --good: #52ff9a;
  --shadow: 0 0 28px rgba(0, 255, 213, 0.28);
  --radius: 28px;
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 255, 213, 0.28), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(0, 170, 255, 0.16), transparent 28%),
    radial-gradient(circle at 10% 90%, rgba(255, 61, 242, 0.12), transparent 30%),
    linear-gradient(180deg, #020304 0%, #05070a 44%, #071114 100%);
}

button {
  font: inherit;
}

.gz-app {
  width: 100%;
  min-height: 100svh;
}

.hud-shell {
  min-height: 100svh;
  padding:
    calc(22px + var(--safe-top))
    calc(18px + var(--safe-right))
    calc(22px + var(--safe-bottom))
    calc(18px + var(--safe-left));
  display: grid;
  place-items: center;
}

.hud-hero {
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(0, 255, 213, 0.12), rgba(0, 255, 213, 0.025)),
    rgba(0, 0, 0, 0.38);
  box-shadow: var(--shadow), inset 0 0 40px rgba(0, 255, 213, 0.05);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-orb {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: rgba(0, 255, 213, 0.12);
  border: 1px solid rgba(0, 255, 213, 0.42);
  box-shadow: 0 0 26px rgba(0, 255, 213, 0.34);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--neon);
  font-size: 12px;
  letter-spacing: 0.24em;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 9vw, 54px);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.hud-subtitle {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.35;
  margin: 24px 0;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.hud-card {
  min-height: 94px;
  border: 1px solid var(--line2);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 24px rgba(0, 255, 213, 0.035);
}

.hud-card span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 900;
}

.hud-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.hud-player {
  grid-column: span 2;
  background:
    linear-gradient(90deg, rgba(0, 255, 213, 0.18), rgba(0, 170, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.online {
  color: var(--good) !important;
}

.gz-button {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 22px;
  color: #001412;
  background: linear-gradient(90deg, var(--neon), #73fff0);
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  box-shadow: 0 0 34px rgba(0, 255, 213, 0.36);
  cursor: pointer;
  text-transform: uppercase;
}

.gz-button:active {
  transform: scale(0.985);
}

.install-wizard {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100svh;
  height: 100svh;
  padding:
    calc(14px + var(--safe-top))
    calc(14px + var(--safe-right))
    calc(12px + var(--safe-bottom))
    calc(14px + var(--safe-left));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  background:
    radial-gradient(circle at 50% -8%, rgba(0, 255, 213, 0.34), transparent 34%),
    radial-gradient(circle at 92% 58%, rgba(0, 170, 255, 0.18), transparent 30%),
    radial-gradient(circle at 8% 72%, rgba(255, 61, 242, 0.12), transparent 28%),
    linear-gradient(180deg, #010203 0%, #05070a 52%, #071114 100%);
  overflow: hidden;
}

.install-wizard[hidden] {
  display: none;
}

.install-wizard::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(rgba(0, 255, 213, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 213, 0.055) 1px, transparent 1px);
  background-size: 38px 38px;
  transform: perspective(900px) rotateX(58deg) translateY(18%);
  transform-origin: center bottom;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 74%, transparent);
}

.wizard-top,
.wizard-body,
.wizard-bottom,
.wizard-progress {
  position: relative;
  z-index: 2;
}

.wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizard-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--neon);
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 1000;
  min-width: 0;
}

.wizard-logo span {
  white-space: nowrap;
}

.wizard-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #001412;
  background: var(--neon);
  box-shadow: 0 0 24px rgba(0, 255, 213, 0.52);
  flex: 0 0 auto;
}

.wizard-progress-text {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 900;
  white-space: nowrap;
  flex: 0 0 auto;
}

.wizard-progress {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.22);
}

.wizard-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  box-shadow: 0 0 20px rgba(0, 255, 213, 0.7);
  transition: width 220ms ease;
}

.wizard-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 6px 2px 8px;
  scrollbar-width: none;
}

.wizard-body::-webkit-scrollbar {
  display: none;
}

.wizard-copy {
  text-align: left;
}

.wizard-kicker {
  margin: 0 0 6px;
  color: var(--neon);
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 1000;
}

.wizard-title {
  margin: 0;
  font-size: clamp(34px, 12vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.075em;
  text-shadow: 0 0 26px rgba(0, 255, 213, 0.24);
}

.wizard-text {
  margin: 14px 0 0;
  color: var(--text);
  font-size: clamp(18px, 6vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 850;
}

.wizard-extra {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 650;
}

.wizard-visual {
  min-height: 150px;
  display: grid;
  place-items: center;
}

.phone-demo {
  width: min(100%, 300px);
  min-height: 220px;
  border-radius: 34px;
  border: 1px solid rgba(0, 255, 213, 0.35);
  background:
    linear-gradient(180deg, rgba(0, 255, 213, 0.11), rgba(0, 0, 0, 0.24)),
    rgba(0, 0, 0, 0.44);
  box-shadow:
    0 0 38px rgba(0, 255, 213, 0.24),
    inset 0 0 26px rgba(0, 255, 213, 0.06);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.phone-demo::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 84px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: #020304;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.phone-screen {
  min-height: 188px;
  border-radius: 24px;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 255, 213, 0.16), transparent 42%),
    #071114;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.controller-chip {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(0, 255, 213, 0.08);
  text-align: center;
}

.controller-chip-icon {
  font-size: 40px;
  filter: drop-shadow(0 0 18px rgba(0, 255, 213, 0.5));
}

.controller-chip-title {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.safari-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 58px;
  border-radius: 20px;
  background: rgba(236, 255, 251, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.safari-menu-dotgrid {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 7px;
  place-content: center;
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.25);
}

.safari-menu-dotgrid i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text);
}

.share-sheet {
  width: min(100%, 300px);
  border-radius: 30px;
  border: 1px solid rgba(0, 255, 213, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(4, 14, 18, 0.94);
  box-shadow: var(--shadow);
  padding: 14px;
}

.sheet-handle {
  width: 50px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 14px;
  background: rgba(255, 255, 255, 0.24);
}

.sheet-row {
  min-height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-icon {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #001412;
  background: var(--neon);
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 0 22px rgba(0, 255, 213, 0.3);
  flex: 0 0 auto;
}

.sheet-label {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.final-core {
  width: min(100%, 300px);
  min-height: 210px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 34px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, rgba(0, 255, 213, 0.21), transparent 58%),
    rgba(0, 0, 0, 0.42);
  box-shadow:
    0 0 52px rgba(0, 255, 213, 0.34),
    inset 0 0 46px rgba(0, 255, 213, 0.08);
}

.final-icon {
  width: 98px;
  height: 98px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-size: 46px;
  background: linear-gradient(180deg, var(--neon), #67fff0);
  color: #001412;
  box-shadow: 0 0 42px rgba(0, 255, 213, 0.55);
}

.final-label {
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 0.1em;
  color: var(--neon);
}

.highlight-target {
  position: relative;
  outline: 3px solid var(--neon);
  box-shadow:
    0 0 0 10px rgba(0, 255, 213, 0.13),
    0 0 42px rgba(0, 255, 213, 0.58);
  animation: pulseTarget 1.2s ease-in-out infinite;
}

.big-arrow {
  position: absolute;
  z-index: 4;
  color: var(--neon);
  font-size: 64px;
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 0 22px rgba(0, 255, 213, 0.68);
  animation: arrowBounce 1s ease-in-out infinite;
}

.arrow-down {
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
}

.arrow-row {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.wizard-bottom {
  width: min(100%, 560px);
  margin: 0 auto;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  padding-bottom: 2px;
  background: linear-gradient(180deg, rgba(5, 7, 10, 0), rgba(5, 7, 10, 0.82) 24%, rgba(5, 7, 10, 0.98) 100%);
  backdrop-filter: blur(8px);
}

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

.wizard-button {
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 20px;
  color: #001412;
  background: linear-gradient(90deg, var(--neon), #6ffff0);
  box-shadow:
    0 0 34px rgba(0, 255, 213, 0.42),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wizard-button:active {
  transform: scale(0.985);
}

.wizard-skip {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: rgba(236, 255, 251, 0.52);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body.controller-started .gz-button {
  opacity: 1;
  background: linear-gradient(90deg, #73fff0, #00ffd5);
}

@keyframes pulseTarget {
  0%, 100% {
    box-shadow:
      0 0 0 8px rgba(0, 255, 213, 0.11),
      0 0 38px rgba(0, 255, 213, 0.48);
  }

  50% {
    box-shadow:
      0 0 0 16px rgba(0, 255, 213, 0.19),
      0 0 58px rgba(0, 255, 213, 0.78);
  }
}

@keyframes arrowBounce {
  0%, 100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}

@media (max-width: 390px) {
  .wizard-title {
    font-size: clamp(30px, 11.5vw, 56px);
  }

  .wizard-text {
    font-size: clamp(17px, 5.8vw, 24px);
  }

  .wizard-extra {
    font-size: 14px;
  }

  .brand-orb {
    width: 58px;
    height: 58px;
    font-size: 30px;
  }

  .hud-hero {
    padding: 20px;
  }
}

@media (max-height: 780px) {
  .install-wizard {
    gap: 8px;
    padding-top: calc(12px + var(--safe-top));
  }

  .wizard-body {
    gap: 12px;
    padding-top: 2px;
  }

  .wizard-title {
    font-size: clamp(30px, 10vw, 52px);
  }

  .wizard-text {
    margin-top: 10px;
    font-size: clamp(17px, 5.6vw, 23px);
  }

  .wizard-extra {
    margin-top: 8px;
    font-size: 14px;
  }

  .wizard-visual {
    min-height: 120px;
  }

  .phone-demo {
    width: min(100%, 270px);
    min-height: 178px;
    padding: 12px;
  }

  .phone-demo::before {
    width: 72px;
    height: 16px;
  }

  .phone-screen {
    min-height: 150px;
    padding: 12px;
  }

  .controller-chip {
    margin-top: 20px;
    padding: 12px;
  }

  .controller-chip-icon {
    font-size: 34px;
  }

  .controller-chip-title {
    font-size: 15px;
  }

  .safari-bottom {
    height: 48px;
    bottom: 12px;
  }

  .safari-menu-dotgrid {
    width: 36px;
    height: 36px;
  }

  .share-sheet {
    width: min(100%, 270px);
    padding: 12px;
  }

  .sheet-row {
    min-height: 48px;
    padding: 8px 10px;
  }

  .sheet-label {
    font-size: 15px;
  }

  .sheet-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .big-arrow {
    font-size: 52px;
  }

  .arrow-down {
    bottom: 62px;
  }

  .wizard-button {
    min-height: 56px;
    font-size: 15px;
  }
}

@media (max-height: 700px) {
  .wizard-top {
    gap: 8px;
  }

  .wizard-logo {
    font-size: 11px;
    gap: 10px;
  }

  .wizard-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }

  .wizard-progress-text {
    font-size: 11px;
  }

  .wizard-kicker {
    font-size: 11px;
  }

  .wizard-title {
    font-size: clamp(28px, 9vw, 44px);
  }

  .wizard-text {
    font-size: 16px;
  }

  .wizard-extra {
    font-size: 13px;
  }

  .wizard-visual {
    min-height: 98px;
  }

  .phone-demo,
  .share-sheet,
  .final-core {
    width: min(100%, 238px);
  }

  .phone-demo {
    min-height: 160px;
  }

  .phone-screen {
    min-height: 132px;
  }

  .final-core {
    min-height: 150px;
  }

  .wizard-button {
    min-height: 52px;
    border-radius: 18px;
    font-size: 14px;
  }

  .wizard-skip {
    min-height: 34px;
    font-size: 11px;
  }
}
