:root {
  color-scheme: dark;
  --pwa-bg: #07101f;
  --pwa-panel: rgba(17, 31, 52, 0.96);
  --pwa-text: #f6f8fc;
  --pwa-muted: #9ca9ba;
  --pwa-accent: #5b8cff;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--pwa-bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, Roboto, sans-serif;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
}

#pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--pwa-text);
  background:
    radial-gradient(circle at 50% 32%, rgba(71, 112, 219, 0.24), transparent 34%),
    linear-gradient(160deg, #0b1729 0%, #050a13 100%);
  transition: opacity 220ms ease, visibility 220ms ease;
}

#pwa-splash.pwa-ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pwa-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  font-size: 36px;
  font-weight: 800;
  color: white;
  background: linear-gradient(145deg, #6c9cff, #3158c8);
  box-shadow: 0 18px 50px rgba(37, 80, 190, 0.36), inset 0 1px 0 rgba(255,255,255,.3);
}

.pwa-name { font-size: 25px; font-weight: 760; letter-spacing: -.5px; }
.pwa-caption { color: var(--pwa-muted); font-size: 13px; }
.pwa-loader {
  width: 28px;
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
}
.pwa-loader::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--pwa-accent);
  animation: pwa-load 1s ease-in-out infinite alternate;
}
@keyframes pwa-load { to { transform: translateX(125%); } }

.pwa-toast, .pwa-install {
  position: fixed;
  z-index: 10000;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  color: var(--pwa-text);
  background: var(--pwa-panel);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 16px 44px rgba(0,0,0,.36);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.pwa-toast {
  top: max(12px, env(safe-area-inset-top));
  padding: 11px 15px;
  border-radius: 14px;
  text-align: center;
  font-size: 13px;
}

.pwa-install {
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  padding: 16px;
  border-radius: 20px;
}
.pwa-install strong { font-size: 15px; }
.pwa-install span { grid-column: 1; color: var(--pwa-muted); font-size: 12px; line-height: 1.35; }
.pwa-action {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--pwa-accent);
  font-weight: 700;
}
.pwa-close {
  position: absolute;
  top: -9px;
  right: -5px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  color: var(--pwa-muted);
  background: #15233a;
  font-size: 19px;
}

[hidden] { display: none !important; }
