.app-mode.is-hidden {
  display: none !important;
}


body {
  padding: 0;
  min-height: 100dvh;
  display: block;
  background: #171315;
}

#app {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
}

#app.is-ticket-mode {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

#app.is-home-mode,
#app.is-merch-mode {
  padding: 0;
}

.home-screen,
.merch-app {
  --merch-bg: #171315;
  --merch-bg-deep: #100e10;
  --merch-surface: #222222;
  --merch-surface-soft: rgba(34, 34, 34, 0.94);
  --merch-pink: #ef0f5c;
  --merch-pink-dark: #cc0d4f;
  --merch-text: #ffffff;
  --merch-muted: rgba(255, 255, 255, 0.58);
  --merch-muted-strong: rgba(255, 255, 255, 0.75);
  --merch-border: rgba(255, 255, 255, 0.08);
  --merch-radius-lg: 22px;
  --merch-radius-md: 16px;
  color: var(--merch-text);
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.home-screen *,
.merch-app * {
  font-family: inherit;
}

.home-screen__surface,
.merch-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(15, 13, 14, 0.08), rgba(15, 13, 14, 0.88)),
    url('/assets/merch/bg-texture.svg') center / cover no-repeat,
    var(--merch-bg);
  padding: max(24px, env(safe-area-inset-top)) clamp(22px, 7vw, 36px) calc(84px + env(safe-area-inset-bottom));
}

.home-screen__surface::after,
.merch-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, 0.34));
  mix-blend-mode: screen;
  opacity: 0.42;
}

.miniapp-header,
.merch-nav-row,
.home-screen__main,
.merch-catalog,
.merch-details,
.merch-cart,
.miniapp-footer,
.merch-sticky-cta,
.merch-inline-message {
  position: relative;
  z-index: 1;
}

.miniapp-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
}

.miniapp-brand {
  color: #fff;
  font-size: clamp(24px, 6.2vw, 30px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.home-action:active,
.merch-back-pill:active,
.merch-cart-pill:active,
.merch-plus:active,
.merch-sticky-cta:active,
.merch-size:active,
.merch-qty button:active,
.merch-trash:active {
  transform: scale(0.98);
}

.miniapp-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  color: rgba(255, 255, 255, 0.38);
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
}

.home-screen__main {
  min-height: calc(100dvh - 166px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
  padding-top: clamp(72px, 13vh, 116px);
}

.home-screen__actions {
  display: grid;
  gap: 20px;
}

.home-action {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #f01764, #d62c5e);
  color: #fff;
  font-size: clamp(17px, 4.8vw, 20px);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: transform 150ms ease, background-color 150ms ease;
}

.home-action:hover {
  background: #f21765;
}

.home-orb {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding: 8px 8px 28px;
}

.home-orb img {
  width: min(92%, 400px);
  display: block;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.42));
}

.merch-shell {
  padding-inline: clamp(22px, 7vw, 36px);
}

.merch-header {
  margin-bottom: 38px;
}

.merch-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 42px;
}

.merch-back-pill,
.merch-cart-pill {
  border: 0;
  background: var(--merch-pink);
  color: #fff;
  min-height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease;
}

.merch-back-icon {
  width: 11px;
  height: 11px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

.merch-cart-pill {
  min-width: 56px;
  padding-inline: 18px;
}

.merch-cart-pill--empty {
  opacity: 0.82;
}

.merch-view-title {
  color: var(--merch-pink);
  font-size: clamp(20px, 5.4vw, 24px);
  line-height: 1;
  font-weight: 800;
  margin: 0 0 28px;
}

.merch-inline-message {
  width: fit-content;
  max-width: 100%;
  margin: -22px 0 26px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(239, 15, 92, 0.16);
  border: 1px solid rgba(239, 15, 92, 0.32);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.merch-catalog {
  display: grid;
  gap: 58px;
  padding-bottom: 80px;
}

.merch-product {
  animation: merch-rise 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--item-index, 0) * 55ms);
}

@keyframes merch-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.merch-product__copy {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.merch-product__copy h2,
.merch-details__intro h1,
.merch-info-block h2 {
  margin: 0;
  color: var(--merch-pink);
  font-size: clamp(21px, 5.4vw, 24px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0;
}

.merch-product__copy p,
.merch-details__intro p,
.merch-info-block p,
.merch-empty p,
.merch-cart-item__body p {
  color: var(--merch-muted);
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.18;
  margin: 7px 0 14px;
  max-width: 34ch;
}

.merch-product__media {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 1.46 / 1;
  background: #ddd;
  cursor: pointer;
}

.merch-product__media::after,
.merch-gallery__item::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.74));
  pointer-events: none;
}

.merch-product__media img,
.merch-gallery__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.merch-product__buy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 10px;
  margin-top: -74px;
  position: relative;
  z-index: 2;
}

.merch-price-bar {
  min-height: 74px;
  border: 0;
  border-radius: 18px;
  background: var(--merch-surface-soft);
  color: #fff;
  font-size: clamp(20px, 5.8vw, 24px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 24px rgba(0, 0, 0, 0.24);
}

.merch-plus {
  width: 74px;
  min-height: 74px;
  border: 0;
  border-radius: 22px;
  background: var(--merch-pink);
  color: #fff;
  position: relative;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.merch-plus::before,
.merch-plus::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.merch-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.merch-plus:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.merch-details {
  padding-bottom: 92px;
}

.merch-details__intro {
  margin-top: -12px;
  margin-bottom: 16px;
}

.merch-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(282px, 72%);
  gap: 28px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  margin: 0 -8px 16px;
  padding: 0 8px 4px;
  scrollbar-width: none;
}

.merch-gallery::-webkit-scrollbar {
  display: none;
}

.merch-gallery__item {
  position: relative;
  min-height: 462px;
  aspect-ratio: 0.72 / 1;
  border-radius: var(--merch-radius-lg);
  overflow: hidden;
  background: #ece9e5;
  scroll-snap-align: start;
}

.merch-detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 12px;
  align-items: stretch;
  margin: 14px 0 28px;
}

.merch-sizes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.merch-size {
  min-height: 74px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--merch-surface-soft);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.merch-size.is-selected {
  border-color: rgba(239, 15, 92, 0.95);
  background: rgba(239, 15, 92, 0.24);
}

.merch-plus--detail {
  min-height: 74px;
}

.merch-info-block {
  margin-top: 26px;
}

.merch-size-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 0;
  margin-top: 18px;
}

.merch-size-table {
  width: 100%;
  min-width: 430px;
  border-collapse: collapse;
  color: rgba(255, 255, 255, 0.64);
  font-size: 15px;
}

.merch-size-table th,
.merch-size-table td {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  text-align: left;
  font-weight: 400;
}

.merch-size-table tr:last-child td {
  border-bottom: 0;
}

.merch-cart {
  display: grid;
  gap: 24px;
  padding-bottom: 104px;
}

.merch-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 126px;
  padding: 14px 48px 14px 14px;
  border-radius: 18px;
  background: var(--merch-surface-soft);
}

.merch-cart-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
}

.merch-cart-item__body h2,
.merch-empty h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(17px, 4.6vw, 21px);
  line-height: 1.04;
  font-weight: 800;
}

.merch-cart-item__body h2 {
  max-width: none;
  overflow-wrap: normal;
  word-break: keep-all;
}

.merch-cart-item__body p {
  margin: 5px 0 24px;
}

.merch-cart-item__body strong {
  color: var(--merch-pink);
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.merch-cart-item__controls {
  position: absolute;
  top: 13px;
  right: 10px;
  bottom: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.merch-trash {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  position: relative;
  cursor: pointer;
}

.merch-trash::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 9px;
  width: 12px;
  height: 15px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.merch-trash::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 4px -3px 0 -1px currentColor;
}

.merch-qty {
  display: grid;
  grid-template-columns: 30px 28px 30px;
  align-items: center;
  gap: 4px;
  color: #fff;
}

.merch-qty button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.merch-qty span {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.merch-empty {
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 18px;
  background: var(--merch-surface-soft);
}

.merch-empty p {
  margin: 0;
}

.merch-empty button {
  width: fit-content;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--merch-pink);
  color: #fff;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.merch-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  min-height: 76px;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: var(--merch-pink);
  color: #fff;
  font-size: clamp(17px, 4.8vw, 20px);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  z-index: 8;
  box-shadow: 0 -18px 36px rgba(0, 0, 0, 0.36);
}

.merch-sticky-cta:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.merch-sticky-cta--checkout {
  border-radius: 16px 16px 0 0;
}

@media (max-width: 380px) {
  .home-screen__surface,
  .merch-shell {
    min-height: 100dvh;
    padding-inline: 16px;
  }

  .home-screen__main {
    padding-top: 70px;
  }

  .home-action {
    min-height: 56px;
    font-size: 15px;
  }

  .merch-nav-row {
    margin-bottom: 34px;
  }

  .merch-back-pill,
  .merch-cart-pill {
    min-height: 36px;
    font-size: 13px;
    padding-inline: 13px;
  }

  .merch-catalog {
    gap: 54px;
  }

  .merch-product__buy,
  .merch-detail-actions {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .merch-price-bar,
  .merch-plus,
  .merch-plus--detail,
  .merch-size {
    min-height: 64px;
  }

  .merch-plus {
    width: 64px;
    border-radius: 18px;
  }

  .merch-plus::before,
  .merch-plus::after {
    width: 30px;
    height: 4px;
  }

  .merch-gallery {
    grid-auto-columns: minmax(248px, 78%);
    gap: 18px;
  }

  .merch-gallery__item {
    min-height: 366px;
  }

  .merch-sizes {
    gap: 8px;
  }

  .merch-cart-item {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 12px 44px 12px 12px;
  }

  .merch-cart-item__controls {
    top: 10px;
    right: 8px;
    bottom: 10px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .merch-product {
    animation: none;
  }

  .home-action,
  .merch-back-pill,
  .merch-cart-pill,
  .merch-plus,
  .merch-sticky-cta,
  .merch-size {
    transition: none;
  }
}

.merch-details__intro h1 {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--merch-pink);
}

.merch-size-table {
  min-width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

.merch-size-table th,
.merch-size-table td {
  padding: 0 9px;
}

.merch-catalog--loading {
  gap: 18px;
}

.merch-skeleton {
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.13), rgba(255,255,255,0.06));
  background-size: 220% 100%;
  animation: merch-shimmer 1.4s ease-in-out infinite;
}

.merch-skeleton--title {
  width: 54%;
  height: 28px;
}

.merch-skeleton--image {
  width: 100%;
  aspect-ratio: 1.42 / 1;
  border-radius: var(--merch-radius-lg);
}

.merch-skeleton--bar {
  width: 78%;
  height: 70px;
}

@keyframes merch-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.merch-checkout {
  display: grid;
  gap: 20px;
  padding-bottom: 104px;
}

.merch-pay-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  background: var(--merch-surface-soft);
}

.merch-pay-card h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.merch-pay-total {
  color: var(--merch-pink);
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.merch-copy-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 68px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.merch-copy-card span {
  color: var(--merch-muted);
  font-size: 14px;
}

.merch-copy-card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.merch-upload {
  min-height: 180px;
  border: 1px dashed rgba(255,255,255,0.24);
  border-radius: 16px;
  background: rgba(0,0,0,0.2);
  color: var(--merch-muted-strong);
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  cursor: pointer;
}

.merch-upload img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
