:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #151821;
  --line: rgba(255, 255, 255, .14);
  --text: #f7f8fb;
  --muted: rgba(247, 248, 251, .72);
  --blue: #1877f2;
  --green: #28c76f;
  --red: #ff4d67;
  --amber: #ffcc48;
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(24, 119, 242, .18), transparent 26rem),
    linear-gradient(120deg, #08090d, #10131a 52%, #090b10);
  color: var(--text);
  overflow: hidden;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 430px);
  justify-content: center;
  align-items: center;
  padding: clamp(.75rem, 2vw, 1.5rem);
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  height: min(100dvh - 1.5rem, 900px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 28px;
  background: #020305;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.topbar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  color: #fff;
}

.topbar {
  top: 0;
  justify-content: flex-start;
  gap: .6rem;
  padding: calc(env(safe-area-inset-top) + .75rem) .85rem .7rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--blue);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.icon-btn,
.action-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(14px);
}

.action-btn.active {
  color: #fff;
}

.tabs {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 2.35rem;
  padding: .18rem .35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(16px);
}

.tab {
  min-width: 0;
  min-height: 2rem;
  padding: 0 .95rem;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: .9rem;
  font-weight: 700;
}

.tab.active {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.feed {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.feed.shop-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  align-items: start;
  gap: .85rem;
  padding: 5rem .8rem 1rem;
  scroll-snap-type: none;
  background: #f0f2f5;
}

.feed::-webkit-scrollbar {
  display: none;
}

.reel {
  position: relative;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #111;
}

.shop-card {
  flex: 0 0 calc((100% - .85rem) / 2);
  width: calc((100% - .85rem) / 2);
  display: grid;
  grid-template-rows: auto minmax(1.88rem, auto) minmax(1.94rem, auto) auto;
  align-content: start;
  gap: .42rem;
  min-width: 0;
  min-height: 19.2rem;
  padding: .45rem;
  border: 1px solid rgba(17, 24, 39, .08);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  appearance: none;
  font: inherit;
  text-align: left;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .08);
  overflow: hidden;
}

.shop-card > * {
  min-width: 0;
}

.shop-thumb {
  display: block;
  height: clamp(10.75rem, 44vw, 13.25rem);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--product);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.shop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #111827;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.18;
}

.shop-desc {
  display: -webkit-box;
  min-height: 1.88rem;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #4b5563;
  font-size: .72rem;
  line-height: 1.3;
}

.shop-cta {
  display: grid;
  place-items: center;
  min-height: 2.1rem;
  padding: 0 .4rem;
  border-radius: 8px;
  background: #1877f2;
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 2px 6px rgba(24, 119, 242, .24);
  overflow-wrap: anywhere;
}

.visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--scene);
}

.visual-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.visual-embed {
  border: 0;
  background: #000;
}

.visual.has-media::before,
.visual.has-media::after {
  display: none;
}

.visual::before,
.visual::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-image: var(--pattern);
  background-size: 160px 160px;
  opacity: .4;
  animation: drift 16s linear infinite;
}

.visual::after {
  inset: 12% 5%;
  border-radius: 35% 65% 54% 46%;
  background: var(--object);
  filter: saturate(1.15);
  opacity: .96;
  animation: floaty 4.8s ease-in-out infinite;
}

.reel.active .visual::before {
  animation-duration: 10s;
}

.shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 34%, rgba(255,255,255,.18) 42%, transparent 52% 100%);
  transform: translateX(-75%);
  animation: shine 3.4s ease-in-out infinite;
  mix-blend-mode: screen;
}

.reel-shadow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.38), transparent 27%, transparent 58%, rgba(0,0,0,.76)),
    linear-gradient(to right, rgba(0,0,0,.18), transparent 45%, rgba(0,0,0,.28));
}

.unmute-button {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 5.35rem;
  height: 5.35rem;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.32), transparent 1.35rem),
    rgba(10, 12, 18, .56);
  color: #fff;
  box-shadow: 0 18px 56px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.08);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px);
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

.unmute-button:hover {
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.38), transparent 1.35rem),
    rgba(24, 119, 242, .62);
  transform: translate(-50%, -50%) scale(1.04);
}

.unmute-button:active {
  transform: translate(-50%, -50%) scale(.98);
}

.unmute-button[hidden],
.sound-enabled .unmute-button {
  display: none;
}

.unmute-icon {
  display: grid;
  place-items: center;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
}

.unmute-icon svg {
  width: 2.15rem;
  height: 2.15rem;
  stroke-width: 2.25;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.32));
}

.side-actions {
  position: absolute;
  right: .75rem;
  bottom: 5.15rem;
  z-index: 5;
  display: grid;
  gap: .72rem;
  justify-items: center;
}

.action-wrap {
  display: grid;
  gap: .18rem;
  justify-items: center;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}

.action-wrap span {
  font-size: .76rem;
  font-weight: 800;
}

.action-btn {
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255,255,255,.16);
}

.action-btn.active {
  background: var(--red);
  border-color: transparent;
}

.content {
  position: absolute;
  left: 1rem;
  right: 5.05rem;
  bottom: 2.1rem;
  z-index: 6;
  display: grid;
  gap: .7rem;
}

.creator {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

.avatar {
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: var(--avatar);
}

.creator strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: .92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator span,
.caption-text {
  color: rgba(255,255,255,.82);
  font-size: .82rem;
}

.caption-wrap {
  display: grid;
  gap: .2rem;
}

.caption-text {
  margin: 0;
  line-height: 1.35;
}

.caption-text.collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.caption-toggle {
  width: max-content;
  padding: 0;
  background: transparent;
  color: rgba(255,255,255,.74);
  font-size: .82rem;
  font-weight: 800;
}

.product-strip {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 4.35rem;
  padding: .48rem .55rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(12, 14, 20, .62);
  backdrop-filter: blur(18px);
}

.thumb,
.sheet-media,
.cart-thumb {
  background: var(--product);
}

.thumb {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.product-copy {
  min-width: 0;
}

.product-copy strong {
  display: block;
  overflow: hidden;
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-copy span {
  display: block;
  margin-top: .18rem;
  color: var(--amber);
  font-size: .82rem;
  font-weight: 800;
}

.mini-cta {
  display: grid;
  place-items: center;
  width: min(6rem, 24vw);
  min-height: 2.25rem;
  padding: 0 .55rem;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.desktop-panel {
  align-self: stretch;
  display: none;
  align-content: center;
  gap: 1rem;
  max-width: 430px;
}

.panel-head {
  padding: .25rem 0;
}

.eyebrow {
  margin: 0 0 .5rem;
  color: var(--green);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panel-head h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: .96;
  letter-spacing: 0;
}

.cart-preview {
  display: grid;
  gap: .7rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  gap: .8rem;
  align-items: center;
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.cart-thumb {
  width: 4.4rem;
  aspect-ratio: 1;
  border-radius: 8px;
}

.cart-item strong,
.cart-item span {
  display: block;
}

.cart-item span {
  margin-top: .22rem;
  color: var(--muted);
  font-size: .88rem;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 1rem;
  pointer-events: none;
}

.sheet.open {
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  transition: opacity .22s ease;
}

.sheet.open .sheet-backdrop {
  opacity: 1;
}

.sheet-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1rem;
  width: min(100%, 600px);
  max-height: min(82dvh, 540px);
  overflow: auto;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: var(--shadow);
  transform: translateY(110%);
  transition: transform .24s ease;
}

.confirm-card {
  grid-template-columns: 1fr;
  max-width: 380px;
}

.confirm-card .sheet-copy {
  padding: 1.7rem .8rem .65rem;
}

.sheet.open .sheet-card {
  transform: translateY(0);
}

.close-sheet {
  position: absolute;
  top: .6rem;
  right: .6rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(17, 24, 39, .08);
  color: #111827;
}

.sheet-media {
  min-height: 16rem;
  border-radius: 8px;
}

.sheet-copy {
  align-self: center;
  padding: 1.4rem .6rem .6rem 0;
}

.sheet-kicker {
  margin: 0 0 .35rem;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-copy h2 {
  margin: 0 2.1rem .55rem 0;
  font-size: 1.45rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.sheet-copy p {
  margin: 0;
  color: #4b5563;
  line-height: 1.45;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  margin: 1rem 0;
}

.price-row strong {
  font-size: 1.4rem;
}

.price-row span {
  color: #9ca3af;
  text-decoration: line-through;
}

.primary-cta {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 3rem;
  padding: 0 .9rem;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 60;
  max-width: min(92vw, 360px);
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 13, .92);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, .8rem);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes drift {
  to {
    transform: translate3d(-80px, -80px, 0);
  }
}

@keyframes floaty {
  50% {
    transform: translate3d(0, -2.5%, 0) scale(1.04) rotate(1.5deg);
  }
}

@keyframes shine {
  55%, 100% {
    transform: translateX(75%);
  }
}

@media (max-width: 860px) {
  body {
    background: #020305;
  }

  .app {
    display: block;
    padding: 0;
  }

  .phone-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .desktop-panel {
    display: none;
  }
}

@media (max-width: 520px) {
  .content {
    right: 4.7rem;
    left: .85rem;
  }

  .product-strip {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
  }

  .thumb {
    width: 3rem;
    height: 3rem;
  }

  .sheet {
    padding: 0;
  }

  .sheet-card {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 86dvh;
    border-radius: 8px 8px 0 0;
  }

  .sheet-media {
    min-height: 13rem;
  }

  .sheet-copy {
    padding: .2rem .1rem .35rem;
  }
}

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