@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-border {
  to {
    --angle: 360deg;
  }
}

:root {
  --bg-deep: #0a0618;
  --accent-pink: #ff2d8a;
  --accent-purple: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-gold: #fbbf24;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* TikTok live UI (close btn, viewers, etc.) — content neeche rakhen */
  --tiktok-safe-top: 92px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.is-transparent {
  background: transparent !important;
}

body.is-transparent::after,
body.is-transparent::before,
body.is-transparent .live-app::before {
  display: none !important;
}

body.is-transparent .rates-panel,
body.is-transparent .products-panel {
  background: rgba(10, 6, 24, 0.85) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, 0.45), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 45, 138, 0.25), transparent),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(34, 211, 238, 0.2), transparent),
    linear-gradient(180deg, #12082a 0%, #0a0618 55%, #050310 100%);
}

.live-app {
  width: 100%;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(var(--tiktok-safe-top) + var(--safe-top)) 12px calc(8px + var(--safe-bottom));
  position: relative;
}

.live-app::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
}

/* Top header: logo + rates (TikTok safe zone ke neeche) */
.top-header {
  flex-shrink: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.brand-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.logo-ring {
  position: relative;
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple), var(--accent-cyan));
  box-shadow:
    0 0 28px rgba(255, 45, 138, 0.35),
    0 0 50px rgba(139, 92, 246, 0.18);
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 28px rgba(255, 45, 138, 0.35), 0 0 50px rgba(139, 92, 246, 0.18); }
  50% { box-shadow: 0 0 38px rgba(34, 211, 238, 0.4), 0 0 60px rgba(255, 45, 138, 0.3); }
}

.logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1a0f2e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.logo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-placeholder {
  font-size: 32px;
}

.shop-name {
  font-size: 20px;
  font-weight: 800;
  text-align: left;
  line-height: 1.2;
  background: linear-gradient(90deg, #fff, var(--accent-cyan), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
}

.shop-phone {
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  color: var(--accent-cyan);
  letter-spacing: 0.03em;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
}

.shop-address {
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: var(--text-muted);
  max-width: 200px;
}

.rates-panel {
  flex: 0 0 178px;
  width: 178px;
  margin-top: 0;
  padding: 18px 14px 12px;
  border-radius: 16px;
  background: rgba(10, 6, 24, 0.65);
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
  overflow: visible;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}

.rates-floating-label {
  position: absolute;
  top: 0;
  left: 14px;
  transform: translateY(-50%);
  z-index: 3;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: linear-gradient(180deg, #12082a, #0a0618);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
  white-space: nowrap;
}

.rates-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(var(--angle), var(--accent-gold), var(--accent-pink), var(--accent-cyan), var(--accent-purple), var(--accent-gold));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: rotate-border 6s linear infinite;
}

/* Single country rate — 3s rotate, compact side-by-side header */
.rate-showcase {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.rate-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow: hidden;
}

.rate-country-text {
  display: inline-block;
  max-width: 100%;
  font-family: "Space Grotesk", "Outfit", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rate-body {
  display: flex;
  align-items: flex-end;
  width: 100%;
}

.rate-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rate-flag-img {
  width: 28px;
  height: 18px;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  object-fit: cover;
  display: block;
}

.rate-value-wrap {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.rate-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  padding: 0;
  background: linear-gradient(95deg, #fff 0%, var(--accent-gold) 45%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.35));
}

.rate-code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-cyan);
  line-height: 1;
  margin: 0;
  padding: 0;
}

.rate-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.06) 48%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.06) 52%,
    transparent 60%
  );
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 0;
}

.rate-showcase.cycle-enter .rate-header {
  animation: rateHeaderIn 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  opacity: 0;
}

.rate-showcase.cycle-enter .rate-value-wrap {
  animation: rateValueWrapIn 0.75s cubic-bezier(0.19, 1, 0.22, 1) 0.15s forwards;
  opacity: 0;
}

@keyframes rateHeaderIn {
  0% {
    opacity: 0;
    transform: translateY(-16px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes rateValueWrapIn {
  0% {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.rate-showcase.cycle-enter .rate-shine {
  animation: rateShineSweep 1.1s ease 0.42s forwards;
}

@keyframes rateShineSweep {
  0% { opacity: 0; transform: translateX(-120%); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateX(120%); }
}

.rate-showcase.is-settled .rate-header,
.rate-showcase.is-settled .rate-value-wrap {
  opacity: 1;
  transform: none;
  filter: none;
  animation: none;
}

.rate-showcase.cycle-exit .rate-header {
  animation: rateHeaderExit 0.35s ease forwards;
}

.rate-showcase.cycle-exit .rate-value-wrap {
  animation: rateValueWrapExit 0.35s ease forwards;
}

@keyframes rateHeaderExit {
  to {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(3px);
  }
}

@keyframes rateValueWrapExit {
  to {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px);
  }
}

.payment-marquee-container {
  overflow: hidden;
  width: 100%;
  position: relative;
  margin: 4px auto 0;
  padding: 2px 0;
  display: flex;
  align-items: center;
}

.payment-marquee-track {
  display: flex;
  width: max-content;
  align-items: center;
  animation: marquee-scroll 18s linear infinite;
}

.payment-marquee-item {
  flex-shrink: 0;
  width: 100px;
  height: 60px;
  border-radius: 5px;
  margin: 0 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-marquee-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}

.payment-text-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-text-strip span {
  background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.payment-text-strip .dot-separator {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
  -webkit-text-fill-color: var(--accent-cyan);
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.live-spacer {
  flex: 1;
  min-height: 0;
}

/* Products — rates ke neeche, one-by-one */
.products-zone {
  flex-shrink: 0;
  z-index: 2;
  margin-top: 14px;
}

.products-panel {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-top: 10px;
  padding: 1.5px;
  border-radius: 18px;
  background: rgba(10, 6, 24, 0.65);
  position: relative;
  overflow: visible;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.products-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1.5px;
  background: linear-gradient(var(--angle), var(--accent-pink), var(--accent-purple), var(--accent-cyan), var(--accent-pink));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: rotate-border 6s linear infinite;
}

.products-floating-label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-pink);
  background: linear-gradient(180deg, #12082a, #0a0618);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 45, 138, 0.35);
  white-space: nowrap;
}

.products-zone.is-hidden {
  display: none;
}

.product-showcase {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-height: 0;
}

.product-img-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 16.5px;
  overflow: hidden;
  background: linear-gradient(180deg, #2a1a4a, #1a1030);
  position: relative;
  width: 100%;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-img-wrap .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.5;
}

.product-price {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 10px;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-gold);
  opacity: 1;
  line-height: 1.1;
}

.product-price .currency {
  font-size: 15px;
  color: var(--accent-cyan);
  margin-right: 3px;
}

.product-showcase.cycle-enter .product-img-wrap {
  animation: productImgIn 0.85s cubic-bezier(0.19, 1, 0.22, 1) 0.1s forwards;
  opacity: 0;
}

.product-showcase.cycle-enter .product-name {
  animation: productNameIn 0.8s cubic-bezier(0.19, 1, 0.22, 1) 0.22s forwards;
  opacity: 0;
}

.product-showcase.cycle-enter .product-price {
  animation: productPriceIn 0.95s cubic-bezier(0.19, 1, 0.22, 1) 0.35s forwards;
  opacity: 0;
}

.product-showcase.is-settled .product-img-wrap,
.product-showcase.is-settled .product-name,
.product-showcase.is-settled .product-price {
  opacity: 1;
  transform: none;
  filter: none;
  animation: none;
}

.product-showcase.cycle-exit .product-body {
  animation: rateExit 0.38s ease forwards;
}

@keyframes productImgIn {
  0% {
    opacity: 0;
    transform: scale(0.85) rotate(-4deg);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
    filter: blur(0);
  }
}

@keyframes productNameIn {
  0% {
    opacity: 0;
    transform: translateX(16px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

@keyframes productPriceIn {
  0% {
    opacity: 0;
    transform: translateX(20px) scale(1.08);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

.sync-dot {
  position: fixed;
  top: calc(var(--tiktok-safe-top) + var(--safe-top) - 6px);
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}

.sync-dot.active {
  opacity: 1;
  animation: blink 0.6s ease;
}

@keyframes blink {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

@media (min-width: 431px) {
  .live-app {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* --- Premium & HD Custom Additions --- */
.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #000000;
  border: 1px solid rgba(74, 222, 128, 0.55);
  padding: 2px 6px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.live-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: live-blink 1.2s infinite ease-in-out;
}

.live-badge-text {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #4ade80;
  line-height: 1;
}

.panel-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
  width: 0%;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  z-index: 10;
  box-shadow: 0 0 8px var(--accent-cyan);
}

@keyframes live-blink {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.shop-phone-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.whatsapp-icon {
  width: 14px;
  height: 14px;
  color: #25D366 !important;
  fill: #25D366 !important;
  filter: drop-shadow(0 0 5px rgba(37, 211, 102, 0.5));
  flex-shrink: 0;
}

.whatsapp-label {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.shop-address-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.location-icon {
  width: 12px;
  height: 12px;
  color: var(--accent-cyan) !important;
  fill: var(--accent-cyan) !important;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.4));
  flex-shrink: 0;
}
