:root {
  --bg: #f4f1ee;
  --surface: #ffffff;
  --surface-soft: #ece7e1;
  --ink: #171411;
  --muted: #776f67;
  --line: rgba(23, 20, 17, 0.1);
  --accent: #ff6f9f;
  --accent-strong: #e84d82;
  --mint: #74c8aa;
  --gold: #d59a39;
  --shadow: 0 18px 45px rgba(40, 31, 24, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 111, 159, 0.22), transparent 28rem),
    linear-gradient(145deg, #fbf8f4 0%, #eee8df 55%, #f6f1ea 100%);
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
}

body.compactChrome .appChrome {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 14px 96px;
}

.topbar,
.hero,
.stats,
.searchBox,
.profileCard,
.checkoutPanel,
.bonusPanel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
}

.eyebrow,
.heroLabel,
.stats span,
.field span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 21px;
}

.iconButton,
.backButton {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
  border-radius: 8px;
}

.hero strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.primaryButton,
.wideButton,
.ghostButton,
.actionButton {
  min-height: 46px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
}

.primaryButton {
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font-weight: 800;
}

.primaryButton.full,
.wideButton {
  width: 100%;
}

.wideButton {
  margin-top: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.ghostButton {
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 8px;
}

.stats article {
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.stats strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.searchBox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 0 14px;
  height: 52px;
  border-radius: 8px;
}

.searchBox input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.searchBox select {
  min-width: 92px;
  border: 0;
  border-radius: 7px;
  padding: 9px 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  outline: 0;
}

.view {
  display: none;
  margin-top: 18px;
}

.view.isActive {
  display: block;
  animation: rise 180ms ease-out;
}

.promoBanner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 111, 159, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 111, 159, 0.28), transparent 34%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.promoBanner.isHidden {
  display: none;
}

.promoBanner span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.promoBanner strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.promoBanner p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.sectionTitle {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tileGrid,
.productGrid,
.actionGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tile,
.rowItem,
.productCard,
.actionButton {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(40, 31, 24, 0.08);
}

.tile {
  min-height: 106px;
  padding: 14px;
  text-align: left;
}

.tileIcon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--gold));
}

.tile strong,
.rowItem strong,
.productCard strong {
  display: block;
}

.tile span,
.rowItem span,
.productCard span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 9px;
}

.rowItem {
  min-height: 68px;
  padding: 13px;
  text-align: left;
}

.sortBar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chip {
  min-width: max-content;
  padding: 10px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-weight: 700;
}

.chip.isActive {
  color: #fff;
  background: var(--ink);
}

.productCard {
  min-height: 158px;
  padding: 13px;
  text-align: left;
}

.productCard strong {
  min-height: 42px;
  font-size: 15px;
  line-height: 1.35;
}

.price {
  margin-top: 12px;
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 900;
}

.miniActions {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  margin-top: 12px;
}

.miniActions button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.profileCard {
  padding: 18px;
  border-radius: 8px;
}

.profileCard h2 {
  margin: 8px 0;
}

.profileCard strong {
  display: block;
  font-size: 28px;
}

.profilePromoButton {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #f6a642);
  color: white;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(240, 84, 145, 0.26);
}

.actionGrid {
  margin-top: 12px;
}

.actionButton {
  padding: 14px 10px;
  text-align: center;
  font-weight: 800;
}

.bonusPanel,
.checkoutPanel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
}

.bonusPanel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.checkoutPanel {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet {
  width: min(520px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.sheet::backdrop {
  background: rgba(15, 12, 10, 0.42);
  backdrop-filter: blur(6px);
}

.sheetBody {
  position: relative;
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
  color: var(--ink);
}

.closeButton {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
}

.field {
  display: grid;
  gap: 7px;
  margin: 18px 0;
}

.field input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
}

.compactField {
  margin: 10px 0;
  text-align: left;
}

.donateFields {
  margin: 12px 0;
}

.regionSelect {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.smallBuyButton {
  min-height: 42px;
  margin-top: 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.smallBuyButton:disabled {
  opacity: 0.62;
  cursor: wait;
}

.deliveryBox {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 14px 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: 700 14px/1.45 "Trebuchet MS", "Avenir Next", sans-serif;
}

.methodGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.methodCard {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 800;
}

.methodCard input {
  accent-color: var(--accent-strong);
}

.methodCard.isHidden {
  display: none;
}

.wheelSheet {
  width: min(430px, calc(100% - 24px));
}

.wheelBody {
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 126, 182, 0.28), transparent 36%),
    linear-gradient(180deg, #fff8f5 0%, #f7efe6 100%);
}

.wheelStage {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 18px auto 14px;
  display: grid;
  place-items: center;
}

.wheelPointer {
  position: absolute;
  top: -5px;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid var(--ink);
  filter: drop-shadow(0 8px 10px rgba(16, 12, 10, 0.22));
}

.fortuneWheel {
  width: 220px;
  height: 220px;
  position: relative;
  border-radius: 50%;
  border: 10px solid #fffaf5;
  background:
    conic-gradient(
      from -20deg,
      #17110f 0 45deg,
      #ff75b7 45deg 90deg,
      #ffe4a3 90deg 135deg,
      #7bdcb5 135deg 180deg,
      #17110f 180deg 225deg,
      #ff75b7 225deg 270deg,
      #ffe4a3 270deg 315deg,
      #7bdcb5 315deg 360deg
    );
  box-shadow:
    0 20px 55px rgba(54, 33, 19, 0.22),
    inset 0 0 0 8px rgba(255, 255, 255, 0.35);
  transition: transform 3.2s cubic-bezier(0.12, 0.74, 0.16, 1);
}

.fortuneWheel::before {
  content: "";
  position: absolute;
  inset: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fffaf5;
  box-shadow: 0 8px 24px rgba(16, 12, 10, 0.2);
}

.fortuneWheel::after {
  content: "FLASH";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  z-index: 1;
}

.fortuneWheel span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fffaf5;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.9);
}

.fortuneWheel span:nth-child(1) { top: 18px; left: 105px; }
.fortuneWheel span:nth-child(2) { top: 105px; right: 18px; }
.fortuneWheel span:nth-child(3) { bottom: 18px; left: 105px; }
.fortuneWheel span:nth-child(4) { top: 105px; left: 18px; }

.fortuneWheel.isSpinning {
  filter: saturate(1.12);
}

.wheelText {
  min-height: 44px;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  width: min(520px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tabButton {
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tabButton.isActive {
  color: #fff;
  background: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 40;
  max-width: min(520px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 160ms ease;
}

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

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

@media (min-width: 760px) {
  .tileGrid,
  .productGrid,
  .actionGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
