/* ═══════════════════════════════════════════════════════════════
   PWA INSTALL — Universal App Banner + iOS Install Guide Modal
   Theme: dark glassmorphism + indigo/violet neon accent (matches game).
   ═══════════════════════════════════════════════════════════════ */

/* ── Banner strip (base) ─────────────────────────────────────── */
.pwa-app-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1500;

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;

  background: rgba(16, 16, 34, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.6);

  animation: pwaAppBannerTopIn 0.38s cubic-bezier(0.34, 1.28, 0.64, 1) both;
}

/* —— Top position ————————————————————————————————————— */
.pwa-app-banner--top {
  top: 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow:
    0 1px 0 0 rgba(99, 102, 241, 0.3),
    0 4px 24px rgba(0, 0, 0, 0.6);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  animation-name: pwaAppBannerTopIn;
}

.pwa-app-banner--top.pwa-app-banner--closing {
  animation: pwaAppBannerTopOut 0.32s ease forwards;
}

/* —— Bottom position ————————————————————————————————————— */
.pwa-app-banner--bottom {
  bottom: 0;
  border-top: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow:
    0 -1px 0 0 rgba(99, 102, 241, 0.3),
    0 -4px 24px rgba(0, 0, 0, 0.6);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  animation-name: pwaAppBannerBottomIn;
}

.pwa-app-banner--bottom.pwa-app-banner--closing {
  animation: pwaAppBannerBottomOut 0.32s ease forwards;
}

/* —— Keyframes for top ———————————————————————————————————— */
@keyframes pwaAppBannerTopIn {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pwaAppBannerTopOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-100%); }
}

/* —— Keyframes for bottom —————————————————————————————————— */
@keyframes pwaAppBannerBottomIn {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pwaAppBannerBottomOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(100%); }
}

/* ── App icon ────────────────────────────────────────────────── */
.pwa-app-banner__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* ── Text block ──────────────────────────────────────────────── */
.pwa-app-banner__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pwa-app-banner__name {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.pwa-app-banner__desc {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.48);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.pwa-app-banner__stars {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: #FBBF24;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  margin-top: 1px;
  letter-spacing: 0.5px;
}

.pwa-app-banner__stars-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0;
}

/* ── Install button ──────────────────────────────────────────── */
.pwa-app-banner__install-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow:
    0 2px 14px rgba(79, 70, 229, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.pwa-app-banner__install-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.pwa-app-banner__install-btn--loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.pwa-app-banner__install-btn--done {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 2px 14px rgba(16, 185, 129, 0.45);
  cursor: default;
  opacity: 0.9;
}

/* ── Close (×) button ────────────────────────────────────────── */
.pwa-app-banner__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  margin-left: 2px;
}

.pwa-app-banner__close:active {
  transform: scale(0.88);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 340px) {
  .pwa-app-banner__desc { display: none; }
  .pwa-app-banner__install-btn { padding: 8px 14px; font-size: 12px; }
}


/* ═══════════════════════════════════════════════════════════════
   iOS INSTALL GUIDE MODAL
   Bottom-sheet popup with 3 animated steps.
   ═══════════════════════════════════════════════════════════════ */

/* ── Backdrop ────────────────────────────────────────────────── */
.pwa-ios-guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: pwaGuideBackdropIn 0.28s ease both;
}

.pwa-ios-guide-backdrop--closing {
  animation: pwaGuideBackdropOut 0.35s ease forwards;
}

@keyframes pwaGuideBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pwaGuideBackdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Sheet ───────────────────────────────────────────────────── */
.pwa-ios-guide {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(175deg, #16213e 0%, #0a0a1a 100%);
  border-top: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  position: relative;
  animation: pwaGuideSheetIn 0.42s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.pwa-ios-guide--closing {
  animation: pwaGuideSheetOut 0.35s ease forwards;
}

@keyframes pwaGuideSheetIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes pwaGuideSheetOut {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

/* ── Drag handle ─────────────────────────────────────────────── */
.pwa-ios-guide__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  margin: 12px auto 0;
}

/* ── Shimmer accent line ─────────────────────────────────────── */
.pwa-ios-guide__shimmer {
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #6366f1 30%, #a855f7 60%, #06b6d4, transparent);
  background-size: 200% 100%;
  animation: pwaGuideShimmer 2.5s ease-in-out infinite;
  margin: 0 20px 20px;
  border-radius: 1px;
  opacity: 0.8;
}

@keyframes pwaGuideShimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* ── Header ──────────────────────────────────────────────────── */
.pwa-ios-guide__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
}

.pwa-ios-guide__app-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-ios-guide__app-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.pwa-ios-guide__title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.pwa-ios-guide__subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin: 2px 0 0;
}

/* ── Close button (top-right) ────────────────────────────────── */
.pwa-ios-guide__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.pwa-ios-guide__close:active {
  transform: scale(0.88);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Steps list ──────────────────────────────────────────────── */
.pwa-ios-guide__steps {
  list-style: none;
  padding: 0 20px;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
}

.pwa-ios-guide__step {
  display: flex;
  gap: 14px;
  animation: pwaGuideStepIn 0.4s cubic-bezier(0.34, 1.1, 0.64, 1) both;
  animation-delay: var(--step-delay, 0s);
}

@keyframes pwaGuideStepIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Left column: number + vertical connector */
.pwa-ios-guide__step-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.pwa-ios-guide__step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border: 1.5px solid rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-ios-guide__step-line {
  width: 1.5px;
  flex: 1;
  min-height: 24px;
  background: linear-gradient(to bottom, rgba(99, 102, 241, 0.35), transparent);
  margin: 4px 0;
}

/* Right column: icon + text */
.pwa-ios-guide__step-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 0 20px;
  flex: 1;
  min-width: 0;
}

.pwa-ios-guide__step-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-ios-guide__step-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 3px;
}

.pwa-ios-guide__step-label {
  font-family: 'Outfit', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.pwa-ios-guide__step-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.4;
}

/* ── Footer tip ──────────────────────────────────────────────── */
.pwa-ios-guide__footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 20px 20px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: rgba(255, 255, 255, 0.38);
}

.pwa-ios-guide__footer svg {
  flex-shrink: 0;
  color: rgba(99, 102, 241, 0.7);
}

.pwa-ios-guide__footer span {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

/* ── Got it button ───────────────────────────────────────────── */
.pwa-ios-guide__got-it {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 16px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(79, 70, 229, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pwa-ios-guide__got-it:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
}

/* ── Safe area bottom spacer ─────────────────────────────────── */
.pwa-ios-guide__safe-area {
  height: calc(20px + env(safe-area-inset-bottom, 0px));
}
