:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-ui);
  color: var(--ink); background: var(--canvas); color-scheme: dark; font-synthesis: none;
  --canvas: #211630; --surface: #30213f; --ink: #fff5ec; --muted: #e2cfe9;
  --line: #624d74; --accent: #f1ce9b; --accent-light: #493457;
  --title-gold: #ffd379;
  --title-gradient: linear-gradient(#fff0b3 12%, var(--title-gold) 55%, #db9c36);
  --iris-glass: rgb(58 32 140 / 55%);
  --iris-glass-hover: rgb(78 44 182 / 65%);
  --action-height: 54px;
  --safe-top: 0px; --safe-bottom: 0px; --safe-left: 0px; --safe-right: 0px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.9px; }
h2 { font-size: 22px; letter-spacing: -.6px; }
p { line-height: 1.5; }
svg { flex-shrink: 0; }
.chevron { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.screen { margin: 0; padding: 0; border: 0; min-inline-size: 0; width: 100%; max-width: 100%; }
.shell { max-width: 680px; margin: auto; padding: var(--safe-top) max(20px,var(--safe-right)) 0 max(20px,var(--safe-left)); }
.header { display: flex; align-items: center; gap: 12px; padding: 18px 0 22px; }
.brand { display: flex; align-items: center; gap: 6px; background: none; padding: 0; text-align: left; }
.brand img, .storefront-logo { clip-path: circle(46% at 49.4% 50.1%); object-fit: contain; }
.brand > span { font-size: 15px; line-height: 1; font-weight: 900; letter-spacing: -.5px; }
.brand span span { display: block; margin-top: 4px; font-size: 11px; letter-spacing: 3px; }
.icon-button { margin-inline-start: auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.cart-button { position: relative; margin-inline-start: auto; width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-light); color: var(--accent); }
.cart-button + .icon-button, .cart-button + .film-settings { margin-inline-start: 0; }
.cart-count { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; min-width: 15px; padding: 2px 3px; border-radius: 12px; background: var(--accent); color: var(--canvas); font-size: 9px; font-weight: 750; line-height: 1.2; text-align: center; }
main { padding-bottom: 120px; }
.first-screen {
  --left: max(16px, var(--safe-left), env(safe-area-inset-left));
  --right: max(16px, var(--safe-right), env(safe-area-inset-right));
  height: var(--tg-viewport-stable-height, 100dvh);
  width: 100%;
  max-width: 680px;
  margin: auto;
  padding: max(8px, var(--safe-top), env(safe-area-inset-top)) 0
    max(12px, var(--safe-bottom), env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(8px, 1.8dvh, 16px);
  overflow: hidden;
}
.storefront {
  height: auto;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2dvh, 12px);
  padding-inline: var(--left) var(--right);
  padding-bottom: max(14px, var(--safe-bottom), env(safe-area-inset-bottom));
  overflow-x: clip;
  overflow-y: visible;
  background: #29193f url('/assets/welcome-backdrop.webp') center / cover;
  background-blend-mode: luminosity;
  color: #fff6e3;
}
.storefront-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.storefront-top .icon-button { margin: 0; justify-self: start; }
.storefront-top .cart-button { margin: 0; justify-self: end; }
.storefront-logo {
  justify-self: center;
  width: clamp(62px, 19vw, 88px);
  height: auto;
  aspect-ratio: 1;
}
.deck {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: clamp(2px, .6dvh, 8px);
  margin-block: clamp(2px, 1dvh, 10px);
  padding: 4px 4px 8px;
}
.deck-row {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
}
.deck-card {
  flex: 0 0 27%;
  max-width: 140px;
  aspect-ratio: 4 / 5;
  min-width: 0;
  padding: 0;
  border: 1px solid #ffdbad66;
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 10px 20px #12092080;
  transform: rotate(var(--tilt, 0deg)) translateY(var(--dy, 0px));
  transform-origin: 50% 85%;
}
.deck-card + .deck-card { margin-inline-start: -10px; }
.deck-card:nth-child(1) { --tilt: -5deg; --dy: 7px; z-index: 1; }
.deck-card:nth-child(2) { --tilt: -2deg; --dy: -5px; z-index: 2; }
.deck-card:nth-child(3) { --tilt: 2deg; --dy: 1px; z-index: 3; }
.deck-card:nth-child(4) { --tilt: 5deg; --dy: 6px; z-index: 4; }
.deck-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.deck-card.is-active {
  z-index: 10;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 14px 26px #120920a6;
}
.deck-card:active { transform: rotate(var(--tilt, 0deg)) translateY(var(--dy, 0px)) scale(.985); }
.deck-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.film-header, .film-products-heading {
  margin-inline: var(--left) var(--right);
  display: flex;
  align-items: center;
  gap: 8px;
}
.film-back, .film-settings { display: flex; align-items: center; min-height: 44px; background: transparent; }
.film-back { padding: 0; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.film-settings { margin-inline-start: auto; justify-content: center; width: 44px; border-radius: 10px; background: var(--accent-light); color: var(--accent); }
.film-carousel {
  position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  min-height: 0; margin-inline: var(--left) var(--right);
}
.film-covers {
  min-height: 0; display: flex;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x;
}
.film-covers:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.film-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--accent); background: transparent;
}
.film-arrow svg { filter: drop-shadow(0 1px 3px var(--canvas)); }
.film-arrow-prev { inset-inline-start: clamp(-4px, calc((100% - 440px) / 4), 48px); }
.film-arrow-next { inset-inline-end: clamp(-4px, calc((100% - 440px) / 4), 48px); }
.film-slide {
  flex: 0 0 100%; min-width: 0; display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center; scroll-snap-stop: always;
}
.film-slide img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 100%;
  border-radius: 16px; user-select: none;
}
.film-products-heading { justify-content: space-between; min-height: var(--action-height); margin-bottom: 8px; }
.film-products-heading h2 { font-size: clamp(17px, 4.8vw, 20px); }
.film-products > .primary { width: calc(100% - var(--left) - var(--right)); margin: 0 var(--right) 8px var(--left); }
.film-view-only { color: var(--muted); font-size: 12px; }
.film-previews {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(112px, 36%, 169px);
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0 var(--right) 5px var(--left);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--left) var(--right);
  scrollbar-width: thin;
  scrollbar-color: #a68bb9 var(--canvas);
}
.film-previews:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.film-preview {
  min-width: 0; overflow: hidden; border-radius: 12px; background: #f9f5fa;
  color: #2b2037; scroll-snap-align: start; display: flex; flex-direction: column;
}
.film-preview img { display: block; width: 100%; height: clamp(58px, 14dvh, 104px); object-fit: contain; background: #e8f1f7; }
.film-preview button { flex: 1; display: flex; flex-direction: column; padding: 0; background: transparent; text-align: start; }
.film-preview button:focus-visible { outline-offset: -3px; }
.film-preview-details {
  flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 3px;
  padding: 7px 9px 8px; font-size: 12px; line-height: 1.2; font-weight: 700;
}
.film-preview-details > span { min-block-size: 2.4em; overflow-wrap: anywhere; }
.film-preview strong { color: #45304f; text-align: right; white-space: nowrap; }
.film-preview small { font-size: 10px; font-weight: 500; }
.selection-hint { font-size: 13px; color: var(--muted); margin: 4px 0 18px; }
.products { display: grid; gap: 20px; }
.product { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; min-width: 0; }
.product-image { height: 276px; background: #e8f1f7; display: flex; align-items: center; justify-content: center; }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-body { padding: 16px 20px 20px; display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 10px; }
.price { display: block; font-size: 24px; letter-spacing: -.8px; white-space: nowrap; }
.price small { display: block; text-align: right; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.packaging { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.quantity-row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-top: 17px; gap: 10px; }
.quantity-row > span { color: var(--muted); font-size: 13px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: 164px; }
.stepper button { background: var(--accent-light); width: 46px; min-height: 46px; font-size: 24px; flex-shrink: 0; color: var(--accent); }
.stepper input { background: var(--surface); color: var(--ink); border: 0; min-width: 0; width: 100%; text-align: center; font-size: 16px; font-weight: 650; padding: 10px 0; appearance: textfield; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.eyebrow { font-size: 10px; line-height: 1.4; letter-spacing: 1.5px; font-weight: 750; color: var(--muted); }
.note-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 17px; margin: 22px 0; color: var(--muted); font-size: 12px; }
.snowflake { font-size: 36px; color: var(--accent); flex-shrink: 0; }
.wide-link { display: flex; align-items: center; gap: 12px; min-height: 54px; background: none; border-top: 1px solid var(--line); width: 100%; font-size: 13px; text-align: left; }
.wide-link .chevron { margin-inline-start: auto; }
.dock { position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 680px; background: var(--surface); border-top: 1px solid var(--line); padding: 14px max(20px,var(--safe-right)) max(16px,env(safe-area-inset-bottom),var(--safe-bottom)) max(20px,var(--safe-left)); display: flex; align-items: center; gap: 17px; box-shadow: 0 -8px 24px #10091b26; }
.dock > div { flex-shrink: 0; }
.dock span { display: block; font-size: 10px; color: var(--muted); }
.dock strong { display: block; font-size: 20px; margin-top: 3px; letter-spacing: -.5px; }
.primary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: var(--action-height); padding: 16px 19px; border-radius: 10px;
  font-size: 14px; font-weight: 650; color: var(--accent);
  background: var(--iris-glass);
  -webkit-backdrop-filter: blur(2.2px) brightness(1.1) saturate(1.5);
  backdrop-filter: blur(2.2px) brightness(1.1) saturate(1.5);
}
.primary:hover { background: var(--iris-glass-hover); }
.back { display: flex; align-items: center; gap: 3px; background: none; min-height: 44px; padding: 0; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.page-heading { margin-bottom: 25px; }
.page-heading h1 { margin: 10px 0 13px; }
.page-heading > p:last-child:not(.eyebrow) { font-size: 14px; color: var(--muted); max-width: 460px; }
.document { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 19px; margin-bottom: 20px; }
pre { white-space: pre-wrap; font: 13px/1.65 var(--font-ui); overflow-wrap: anywhere; margin: 0; }
.secondary { min-height: 50px; background: var(--accent-light); color: var(--accent); border-radius: 12px; font-size: 13px; font-weight: 600; width: 100%; padding: 12px 15px; margin-top: 10px; }
.fine-print { color: var(--muted); font-size: 12px; margin: 20px 0; line-height: 1.6; }
.summary { background: var(--surface); border: 1px solid var(--line); padding: 20px; border-radius: 18px; margin-bottom: 16px; overflow-wrap: anywhere; }
.summary h2 { font-size: 19px; margin-bottom: 12px; }
.summary > strong { display: block; margin-top: 12px; }
.summary > p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.order-lines > div { display: flex; gap: 14px; justify-content: space-between; padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.order-lines small { display: block; color: var(--muted); margin-top: 6px; font-size: 12px; }
.order-lines strong { white-space: nowrap; font-size: 14px; }
.order-line-price { text-align: end; }
.order-line-price .text-button { display: block; margin-inline-start: auto; }
.grand-total { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; font-size: 14px; }
.grand-total strong { font-size: 26px; letter-spacing: -1px; }
.cart-topics { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cart-topics button { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; }
.cart-topics button[aria-pressed=true] { background: var(--iris-glass); border-color: var(--accent); color: var(--accent); }
.cart-recipient { margin-top: 8px; }
.text-button { background: none; color: var(--accent); font-size: 13px; padding: 12px 0; min-height: 44px; text-align: left; }
.success-mark { width: 78px; height: 78px; border-radius: 50%; background: #dceee6; color: #2d8068; display: grid; place-items: center; margin: 25px 0; }
.success-mark svg { width: 36px; height: 36px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 22px; }
label input { display: block; width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 14px; margin-top: 10px; font-size: 16px; font-weight: 400; min-height: 54px; }
input::placeholder { color: var(--muted); font-size: 13px; }
#notice { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(110px + max(var(--safe-bottom),env(safe-area-inset-bottom))); width: calc(100% - 36px); max-width: 650px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 16px 18px; border-radius: 16px; box-shadow: 0 8px 25px #10091b40; font-size: 13px; line-height: 1.5; pointer-events: none; }
.loading { padding: 100px 30px; text-align: center; }
.loading h1 { font-size: 26px; margin: 20px 0; }
.loading p { font-size: 14px; color: var(--muted); }
[data-theme=dark] { --canvas: #1a1128; --surface: #2b1c3b; --accent-light: #402d50; }
@media (min-width:600px) {
  .products { grid-template-columns: 1fr 1fr; gap: 16px; }
  .product-image { height: 290px; }
  .product-body { padding: 16px 16px 18px; grid-template-columns: 1fr; }
  .price { margin-top: 16px; }
  .price small { display: inline; margin-left: 4px; }
}
@media (max-width:440px) {
  .film-arrow { background: radial-gradient(circle, #211630c7 14px, transparent 14.5px); }
}
@media (max-width:359px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .product-image { height: 252px; }
  .product-body { padding: 14px 16px 18px; }
  .product-body h2 { font-size: 19px; }
  .price { font-size: 21px; }
  .dock { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .dock strong { font-size: 18px; }
  .dock .primary { font-size: 12px; padding: 15px 13px; }
}
@media (prefers-reduced-motion:no-preference) {
  button { transition: background-color 150ms ease-out; }
  button:active:not(:disabled) { filter: brightness(.94); }
}
