:root {
  --ink: #171418;
  --muted: #6f6870;
  --paper: #f7f2e8;
  --surface: #fffdf8;
  --line: rgba(23, 20, 24, 0.12);
  --yellow: #ffd62f;
  --coral: #ff5a5f;
  --green: #63e56b;
  --blue: #56c5ff;
  --violet: #8b6cff;
  --shadow: 0 18px 48px rgba(35, 26, 30, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  letter-spacing: 0;
}

body.modal-open { overflow: hidden; }

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

img { display: block; max-width: 100%; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 22px 118px;
}

.app-bar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  background: rgba(247, 242, 232, 0.92);
  border-bottom: 1px solid rgba(23, 20, 24, 0.08);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.wordmark img {
  width: min(210px, 54vw);
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}

.version-pill,
.signal-label,
.arena-kicker {
  border: 1px solid var(--ink);
  background: var(--green);
  padding: 4px 7px;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
}

.avatar-button,
.icon-button,
.modal-close {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  font-family: Fredoka, sans-serif;
  font-weight: 700;
}

.avatar-button:active,
.icon-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.icon-button svg,
.bottom-nav svg,
.product-search svg,
.scanner svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.screen { animation: screenIn 520ms cubic-bezier(.2,.8,.2,1) both; }
.screen[hidden] { display: none; }

.welcome-line,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.welcome-line { padding: 34px 0 22px; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { overflow-wrap: anywhere; }

h1,
h2,
h3 {
  margin: 0;
  font-family: Fredoka, sans-serif;
  line-height: 0.98;
}

h1 { font-size: clamp(2.15rem, 7vw, 4.1rem); }
h2 { font-size: clamp(1.55rem, 4vw, 2.5rem); }

.hero-pick {
  position: relative;
  display: grid;
  min-height: 440px;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 7px 7px 0 var(--ink);
}

.hero-pick::before,
.hero-pick::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.hero-pick::before {
  inset: 0;
  background-image: linear-gradient(rgba(23,20,24,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(23,20,24,.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000 58%);
}

.hero-pick::after {
  top: -20%;
  right: 26%;
  width: 42px;
  height: 150%;
  background: rgba(255,255,255,.55);
  transform: rotate(18deg);
  animation: heroSweep 6s ease-in-out infinite;
}

.hero-pick__copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
}

.hero-pick__copy h2 {
  max-width: 470px;
  margin-top: 18px;
  overflow-wrap: normal;
  font-size: clamp(2.6rem, 5vw, 4.35rem);
  word-break: normal;
}

.hero-pick__copy > p {
  max-width: 440px;
  margin: 14px 0 20px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.hero-pick__score { display: flex; align-items: baseline; gap: 8px; margin-bottom: 22px; }
.hero-pick__score strong { font-family: Fredoka, sans-serif; font-size: 2.8rem; }
.hero-pick__score span { font-weight: 900; }

.hero-pick__media {
  position: relative;
  display: grid;
  min-height: 390px;
  place-items: center;
  overflow: hidden;
  background: var(--coral);
  clip-path: polygon(18% 0,100% 0,100% 100%,0 100%);
}

.hero-pick__media::before {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  content: "";
  animation: orbitSpin 14s linear infinite;
}

.hero-pick__media img {
  position: relative;
  z-index: 2;
  width: min(68%, 360px);
  max-height: 390px;
  object-fit: contain;
  filter: drop-shadow(0 24px 20px rgba(23,20,24,.3));
  animation: packFloat 3.8s ease-in-out infinite alternate;
}

.orbit-label {
  position: absolute;
  z-index: 3;
  top: 25px;
  right: 24px;
  max-width: 180px;
  border: 1px solid var(--ink);
  background: var(--surface);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  transform: rotate(2deg);
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  box-shadow: 4px 4px 0 rgba(255,255,255,.72);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover,
.secondary-button:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 rgba(255,255,255,.72); }
.primary-button:active,
.secondary-button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 rgba(255,255,255,.72); }

.secondary-button { background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }

.ghost-button {
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button { background: transparent; text-decoration: underline; text-underline-offset: 4px; }

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 26px 0;
}

.quick-row button {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease;
}

.quick-row button:hover { background: var(--green); transform: translateY(-3px); }
.quick-row span { font-size: 1.45rem; }

.tasteprint-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--violet);
  color: #fff;
  padding: 24px 26px;
  box-shadow: 5px 5px 0 var(--ink);
}

.tasteprint-callout .eyebrow { color: rgba(255,255,255,.72); }
.tasteprint-callout p:last-child { margin: 7px 0 0; font-weight: 700; }

.content-band { padding: 42px 0 0; }
.section-heading { margin-bottom: 18px; }

.product-rail {
  display: grid;
  grid-auto-columns: minmax(210px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 3px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.product-rail::-webkit-scrollbar { display: none; }

.product-card {
  position: relative;
  display: grid;
  min-height: 315px;
  grid-template-rows: 188px auto;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  scroll-snap-align: start;
}

.product-card__tap {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 315px;
  grid-template-rows: 188px auto;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.product-card__media {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--product-color, var(--blue));
}

.product-card__media img {
  width: 72%;
  height: 170px;
  object-fit: contain;
  filter: drop-shadow(0 12px 12px rgba(23,20,24,.25));
  transition: transform 220ms ease;
}

.product-card:hover .product-card__media img { transform: scale(1.05) rotate(-2deg); }

.match-chip {
  z-index: 2;
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--ink);
  background: var(--surface);
  padding: 5px 7px;
  font-size: .72rem;
  font-weight: 900;
}

.product-card__copy { display: flex; min-width: 0; flex-direction: column; padding: 15px; }
.product-card__copy small { color: var(--muted); font-size: .72rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.product-card__copy strong { margin: 4px 0 10px; font-family: Fredoka, sans-serif; font-size: 1.18rem; line-height: 1.05; }
.product-card__copy em { margin-top: auto; color: var(--muted); font-size: .82rem; font-style: normal; font-weight: 900; }

.product-card__body { padding: 15px; }
.product-card__body small { color: var(--muted); font-weight: 900; text-transform: uppercase; }
.product-card__body h3 { margin: 4px 0 10px; font-size: 1.18rem; line-height: 1.05; }
.rating-line { display: flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 800; }
.rating-line b { color: #f2a500; letter-spacing: 0; }

.trend-list { display: grid; gap: 10px; }
.trend-row {
  display: grid;
  width: 100%;
  grid-template-columns: 36px 64px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 0;
  text-align: left;
  cursor: pointer;
}
.trend-rank { font-family: Fredoka, sans-serif; font-size: 1.2rem; font-weight: 700; }
.trend-image { display: grid; width: 60px; height: 60px; place-items: center; background: var(--product-color); }
.trend-image img { width: 54px; height: 54px; object-fit: contain; }
.trend-copy { display: flex; min-width: 0; flex-direction: column; }
.trend-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-copy small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.trend-arrow { font-size: 1.2rem; font-weight: 900; }
.trend-item {
  display: grid;
  grid-template-columns: 36px 64px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.trend-item > strong { font-family: Fredoka, sans-serif; font-size: 1.35rem; }
.trend-item img { width: 58px; height: 58px; object-fit: contain; }
.trend-item h3 { font-size: 1rem; }
.trend-item p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.trend-score { border: 1px solid var(--ink); background: var(--yellow); padding: 5px 7px; font-weight: 900; }

.arena-heading,
.scan-heading {
  max-width: 760px;
  margin: 0 auto;
  padding: 38px 0 24px;
  text-align: center;
}
.arena-heading h1,
.scan-heading h1 { margin-top: 10px; }
.arena-heading > p,
.scan-heading > p { margin: 12px auto 0; color: var(--muted); font-weight: 700; }
.arena-kicker { display: inline-block; background: var(--coral); color: #fff; transform: rotate(-2deg); }

.streak {
  display: grid;
  width: min(380px,100%);
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 9px;
  margin: 20px auto 0;
  font-size: .75rem;
  font-weight: 900;
}
.streak strong { font-size: 1.2rem; }
.streak i { height: 8px; overflow: hidden; border: 1px solid var(--ink); background: #ddd4c8; }
.streak b { display: block; width: 0; height: 100%; background: var(--green); transition: width 320ms ease; }

.battle-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: stretch;
  gap: 14px;
  max-width: 930px;
  margin: 0 auto;
}

.battle-card {
  position: relative;
  display: grid;
  min-height: 470px;
  grid-template-rows: 300px auto;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.battle-card:hover { transform: translateY(-5px) rotate(var(--battle-tilt,-1deg)); box-shadow: 10px 12px 0 var(--ink); }
.battle-card:active { transform: scale(.98); }
.battle-card.is-picked,
.battle-card.is-winner { animation: winnerPop 760ms cubic-bezier(.2,.9,.2,1); }
.battle-card.is-loser { animation: loserOut 620ms ease both; }
.battle-card__media { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--product-color); }
.battle-card__media i { position: absolute; width: 68%; aspect-ratio: 1; border: 2px solid rgba(255,255,255,.62); border-radius: 50%; box-shadow: 0 0 35px rgba(255,255,255,.4); animation: orbitSpin 10s linear infinite; }
.battle-card__media img { width: 68%; max-height: 270px; object-fit: contain; filter: drop-shadow(0 20px 18px rgba(23,20,24,.28)); animation: battleFloat 3.4s ease-in-out infinite alternate; }
.battle-card__copy { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; text-align: left; }
.battle-card__copy small { color: var(--muted); font-weight: 900; text-transform: uppercase; }
.battle-card__copy h2 { margin-top: 5px; }
.battle-card__copy em { margin-top: 16px; color: var(--coral); font-size: .72rem; font-style: normal; font-weight: 900; }

.versus-mark { display: grid; place-items: center; }
.versus-mark span {
  display: grid;
  width: 64px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: Fredoka, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  animation: versusPulse 2s ease-in-out infinite;
}
.battle-result { display: flex; min-height: 44px; align-items: baseline; justify-content: center; gap: 8px; margin: 18px auto 0; text-align: center; font-weight: 900; }
.battle-result strong { font-family: Fredoka, sans-serif; font-size: 1.65rem; }
#skipBattle { display: block; margin: 0 auto; }

.scanner {
  position: relative;
  width: min(100%, 640px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  box-shadow: 7px 7px 0 var(--coral);
}
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner__idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: var(--violet); color: #fff; text-align: center; }
.scanner__idle svg { width: 58px; }
.scanner__idle strong { font-family: Fredoka, sans-serif; font-size: 1.5rem; }
.scanner__idle span { color: rgba(255,255,255,.75); }
.scanner.is-live .scanner__idle { display: none; }
.scanner__frame { position: absolute; inset: 19%; border: 2px solid rgba(255,255,255,.9); pointer-events: none; }
.scanner__frame::after { position: absolute; left: 5%; right: 5%; top: 50%; height: 2px; background: var(--coral); content: ""; box-shadow: 0 0 16px var(--coral); animation: scanLine 2.1s ease-in-out infinite; }
.scan-button { display: block; margin: 22px auto; }

.product-search {
  display: flex;
  width: min(100%, 640px);
  min-height: 52px;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 15px;
}
.product-search input { width: 100%; border: 0; outline: 0; background: transparent; font-weight: 700; }
.search-results { display: grid; width: min(100%,640px); gap: 8px; margin: 16px auto 0; }
.search-result { display: grid; width: 100%; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 9px 0; text-align: left; cursor: pointer; }
.search-result > span { display: grid; width: 52px; height: 52px; place-items: center; background: var(--product-color); }
.search-result img { width: 48px; height: 48px; object-fit: contain; }
.search-result div { display: flex; min-width: 0; flex-direction: column; }
.search-result small { color: var(--muted); font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.search-result strong { overflow: hidden; font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
.search-result em { margin-top: 2px; color: var(--muted); font-size: .76rem; font-style: normal; }
.search-result b { font-size: .85rem; }

.friends-hero { max-width: 700px; margin: 0 auto; padding: 50px 0 22px; text-align: center; }
.friends-hero > p:not(.eyebrow) { max-width: 560px; margin: 14px auto; color: var(--muted); font-weight: 700; }
.friend-orbits { display: flex; align-items: center; justify-content: center; margin: 32px 0; }
.friend-avatar { display: grid; width: 118px; aspect-ratio: 1; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font-family: Fredoka,sans-serif; font-size: 2.5rem; font-weight: 700; box-shadow: 7px 7px 0 var(--ink); }
.friend-avatar--one { background: var(--yellow); }
.friend-avatar--two { margin-left: -8px; background: var(--blue); }
.match-badge { position: relative; z-index: 2; display: grid; width: 62px; aspect-ratio: 1; place-items: center; margin: 0 -8px; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral); color: #fff; font-family: Fredoka,sans-serif; font-size: 1.7rem; font-weight: 700; animation: versusPulse 2s ease-in-out infinite; }
.future-list { display: grid; gap: 10px; }
.future-list article { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.future-list article > span { font-family: Fredoka,sans-serif; font-size: 1.4rem; color: var(--coral); }
.future-list p { margin: 3px 0 0; color: var(--muted); }

.profile-head { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 24px; max-width: 760px; margin: 0 auto; padding: 42px 0 30px; }
.profile-avatar { position: relative; display: grid; width: 104px; aspect-ratio: 1; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 6px 6px 0 var(--ink); font-family: Fredoka,sans-serif; font-size: 2.5rem; font-weight: 700; }
.profile-avatar i { position: absolute; right: -5px; bottom: 2px; width: 26px; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; background: var(--green); }
.profile-head p:last-child { margin: 8px 0 0; color: var(--muted); font-weight: 700; }

.taste-map { display: grid; max-width: 760px; gap: 13px; margin: 0 auto; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); padding: 24px; box-shadow: 6px 6px 0 var(--ink); }
.taste-axis { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 12px; }
.taste-axis span { font-weight: 900; }
.taste-axis i { height: 13px; overflow: hidden; border: 1px solid var(--ink); background: #e8e1d7; }
.taste-axis b { display: block; width: var(--axis); height: 100%; background: var(--axis-color); animation: meterGrow 800ms cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.taste-axis strong { text-align: right; }

.profile-stats { display: grid; max-width: 760px; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 20px auto 0; }
.profile-stats article { border: 1px solid var(--ink); border-radius: 6px; background: var(--surface); padding: 16px; text-align: center; }
.profile-stats strong { display: block; font-family: Fredoka,sans-serif; font-size: 1.5rem; }
.profile-stats span { color: var(--muted); font-size: .76rem; font-weight: 800; }
.profile-actions { display: grid; max-width: 760px; gap: 8px; margin: 0 auto; }
.button-row { display: flex; min-height: 56px; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 900; }
.button-row b { display: grid; width: 31px; aspect-ratio: 1; place-items: center; border: 1px solid var(--ink); border-radius: 50%; }
.button-row .google-icon {
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23FFC107' d='M43.6 20.5H42V20H24v8h11.3C33.7 32.7 29.2 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.9 1.2 8 3.1l5.7-5.7C34.1 6 29.3 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.3-.1-2.4-.4-3.5Z'/%3E%3Cpath fill='%23FF3D00' d='m6.3 14.7 6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.9 1.2 8 3.1l5.7-5.7C34.1 6 29.3 4 24 4 16.3 4 9.7 8.3 6.3 14.7Z'/%3E%3Cpath fill='%234CAF50' d='M24 44c5.2 0 9.9-2 13.4-5.2l-6.2-5.2C29.2 35.1 26.7 36 24 36c-5.2 0-9.6-3.3-11.3-7.8l-6.5 5C9.6 39.6 16.2 44 24 44Z'/%3E%3Cpath fill='%231976D2' d='M43.6 20.5H42V20H24v8h11.3c-.8 2.4-2.3 4.3-4.1 5.6l6.2 5.2C36.9 39.3 44 34 44 24c0-1.3-.1-2.4-.4-3.5Z'/%3E%3C/svg%3E") center / 23px 23px no-repeat;
}

.bottom-nav {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(calc(100% - 24px), 720px);
  min-height: 72px;
  grid-template-columns: repeat(5,1fr);
  align-items: end;
  margin: 0 auto 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255,253,248,.95);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  backdrop-filter: blur(18px);
}
.bottom-nav button { display: grid; min-width: 0; min-height: 54px; place-items: center; gap: 2px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: .66rem; font-weight: 900; }
.bottom-nav button svg { width: 23px; height: 23px; }
.bottom-nav button.is-active { color: var(--ink); }
.bottom-nav button.is-active:not(.scan-nav) { background: var(--yellow); }
.nav-vs { display: grid; width: 28px; aspect-ratio: 1; place-items: center; border: 1px solid currentColor; transform: rotate(-5deg); font-family: Fredoka,sans-serif; font-size: .72rem; }
.scan-nav { align-self: center; }
.scan-nav__icon { display: grid; width: 54px; aspect-ratio: 1; place-items: center; margin-top: -27px; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.scan-nav.is-active .scan-nav__icon { background: var(--green); color: var(--ink); }

.tasteprint-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; }
.tasteprint-modal[hidden] { display: none; }
.tasteprint-modal__backdrop { position: absolute; inset: 0; background: rgba(23,20,24,.72); backdrop-filter: blur(8px); }
.tasteprint-panel { position: relative; z-index: 2; width: min(100%,760px); max-height: calc(100vh - 36px); overflow: auto; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); padding: clamp(24px,5vw,44px); box-shadow: 9px 9px 0 var(--yellow); }
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--surface); box-shadow: none; font-size: 1.5rem; }
.tasteprint-progress { display: flex; align-items: center; gap: 10px; margin: 0 54px 32px 0; font-size: .78rem; font-weight: 900; }
.tasteprint-progress i { flex: 1; height: 8px; overflow: hidden; border: 1px solid var(--ink); background: #ddd5ca; }
.tasteprint-progress b { display: block; width: 20%; height: 100%; background: var(--green); transition: width 260ms ease; }
.tasteprint-panel h2 { max-width: 560px; margin-bottom: 24px; font-size: clamp(2rem,6vw,3.3rem); }
.tasteprint-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.taste-option { position: relative; display: grid; min-height: 330px; grid-template-rows: 215px auto; overflow: hidden; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); cursor: pointer; box-shadow: 5px 5px 0 var(--ink); transition: transform 160ms ease; }
.taste-option:hover { transform: translateY(-4px); }
.taste-option__media { display: grid; place-items: center; background: var(--option-color); }
.taste-option img { width: 66%; height: 190px; object-fit: contain; filter: drop-shadow(0 13px 10px rgba(23,20,24,.26)); animation: battleFloat 3.2s ease-in-out infinite alternate; }
.taste-option__copy { padding: 15px; text-align: left; }
.taste-option small { color: var(--muted); font-weight: 900; text-transform: uppercase; }
.taste-option h3 { margin-top: 4px; font-size: 1.2rem; }
.tasteprint-panel > .ghost-button { display: block; margin: 18px auto 0; }

.rating-modal { position: fixed; z-index: 120; inset: 0; display: none; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.rating-modal.is-open { display: grid; }
.rating-modal__backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(23,20,24,.7); backdrop-filter: blur(8px); }
.rating-sheet {
  position: relative;
  z-index: 2;
  width: min(100%,600px);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  padding: 28px;
  box-shadow: 0 -10px 0 var(--yellow);
  text-align: center;
  animation: ratingIn 260ms cubic-bezier(.2,.8,.2,1) both;
}
.rating-sheet > img { width: 135px; height: 145px; object-fit: contain; margin: 0 auto 14px; filter: drop-shadow(0 12px 10px rgba(23,20,24,.2)); animation: battleFloat 3s ease-in-out infinite alternate; }
.rating-sheet > p:not(.eyebrow) { max-width: 430px; margin: 11px auto 18px; color: var(--muted); font-weight: 700; }
.rating-sheet > small { display: block; margin-top: 13px; color: var(--muted); font-weight: 900; }
.rating-stars { display: flex; justify-content: center; gap: 5px; }
.rating-stars button { border: 0; background: transparent; padding: 2px; color: #d8d0c2; font-size: clamp(2.2rem,10vw,3.5rem); line-height: 1; cursor: pointer; text-shadow: 1px 1px 0 var(--ink); transition: color 130ms ease, transform 130ms ease; }
.rating-stars button.is-on { color: var(--yellow); transform: translateY(-3px) rotate(-4deg); }

.toast { position: fixed; z-index: 130; right: 18px; bottom: 104px; max-width: min(320px,calc(100% - 36px)); border: 2px solid var(--ink); border-radius: 6px; background: var(--green); padding: 12px 16px; box-shadow: 5px 5px 0 var(--ink); font-weight: 900; opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes screenIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes heroSweep { 0%,35% { transform: translateX(-500px) rotate(18deg); } 65%,100% { transform: translateX(700px) rotate(18deg); } }
@keyframes packFloat { from { transform: translateY(7px) rotate(-2deg); } to { transform: translateY(-9px) rotate(2deg); } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes battleFloat { from { transform: translateY(7px) rotate(-1.5deg); } to { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes versusPulse { 50% { transform: scale(1.08) rotate(4deg); box-shadow: 7px 7px 0 var(--ink); } }
@keyframes winnerPop { 35% { transform: scale(1.04) rotate(-2deg); box-shadow: 12px 12px 0 var(--green); } }
@keyframes loserOut { to { opacity: .28; transform: scale(.92) rotate(3deg); filter: grayscale(.6); } }
@keyframes scanLine { 0%,100% { transform: translateY(-80px); } 50% { transform: translateY(80px); } }
@keyframes meterGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ratingIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .app-shell { padding: 0 14px 112px; }
  .app-bar { min-height: 68px; }
  .wordmark img { max-height: 48px; }
  .version-pill { display: none; }
  .welcome-line { padding: 24px 0 16px; }
  .hero-pick { min-height: 490px; grid-template-columns: 1fr; grid-template-rows: auto 235px; }
  .hero-pick__copy { padding: 24px 22px 18px; }
  .hero-pick__copy h2 { font-size: clamp(2.2rem,10.5vw,3.35rem); }
  .hero-pick__copy > p { margin: 10px 0 14px; }
  .hero-pick__score { margin-bottom: 14px; }
  .hero-pick__media { min-height: 235px; clip-path: polygon(0 14%,100% 0,100% 100%,0 100%); }
  .hero-pick__media img { width: min(48%,190px); max-height: 215px; }
  .hero-pick__media::before { width: 210px; }
  .orbit-label { top: 28px; right: 12px; }
  .quick-row { gap: 8px; }
  .quick-row button { min-height: 92px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 11px; }
  .quick-row strong { font-size: .76rem; line-height: 1.1; }
  .tasteprint-callout { align-items: flex-start; flex-direction: column; padding: 20px; }
  .tasteprint-callout .secondary-button { width: 100%; }
  .product-rail { grid-auto-columns: minmax(188px, 72vw); }
  .battle-stage { grid-template-columns: 1fr 44px 1fr; gap: 6px; }
  .battle-card { min-height: 380px; grid-template-rows: 230px auto; box-shadow: 3px 4px 0 var(--ink); }
  .battle-card__media img { width: 78%; max-height: 215px; }
  .battle-card__copy { padding: 14px 11px; }
  .battle-card__copy h2 { font-size: clamp(1.15rem,5vw,1.55rem); }
  .versus-mark span { width: 42px; font-size: .9rem; box-shadow: 2px 2px 0 var(--ink); }
  .tasteprint-pair { gap: 8px; }
  .taste-option { min-height: 300px; grid-template-rows: 195px auto; box-shadow: 3px 3px 0 var(--ink); }
  .taste-option img { width: 78%; height: 175px; }
  .taste-option__copy { padding: 12px 10px; }
  .taste-option h3 { font-size: 1rem; }
  .profile-head { grid-template-columns: 78px 1fr; gap: 16px; }
  .profile-avatar { width: 74px; font-size: 1.8rem; }
  .taste-map { padding: 18px 14px; }
  .taste-axis { grid-template-columns: 76px 1fr 38px; gap: 8px; font-size: .82rem; }
  .profile-stats article { padding: 12px 6px; }
  .profile-stats strong { font-size: 1.25rem; }
  .bottom-nav { width: calc(100% - 16px); margin-bottom: 8px; }
}

@media (min-width: 761px) {
  .product-rail { grid-auto-columns: minmax(220px, 24%); }
}

/* Compact shop-first layout, with enough room for long product names. */
:root { --paper: #f3f6f5; --surface: #ffffff; --muted: #5a6462; }
.app-bar { background: rgba(243,246,245,.96); }
.wordmark img { width: min(244px, calc(100vw - 96px)); height: auto; max-height: none; margin-block: -20px; object-fit: contain; }
h1 { font-size: 52px; }
h2 { font-size: 30px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #186bab; outline-offset: 4px; }
button:disabled { cursor: wait; }
.welcome-line { padding: 26px 0 20px; }
.hero-pick { min-height: 360px; border: 0; border-radius: 0; box-shadow: none; grid-template-columns: minmax(0,1fr) minmax(0,1fr); background: #d8efd9; }
.hero-pick::before { display: none; }
.hero-pick::after { opacity: .3; }
.hero-pick__copy { padding: 30px; }
.hero-pick__copy h2 { font-size: 40px; line-height: 1.04; overflow-wrap: anywhere; }
.hero-pick__copy > p { font-size: 14px; }
.hero-pick__media { min-height: 330px; background: #b9dff0; clip-path: none; }
.hero-pick__media::before { display: none; }
.hero-pick__media img { height: 290px; max-height: 290px; width: 78%; }
.hero-pick__score { flex-wrap: wrap; gap: 4px 10px; margin: 0 0 18px; }
.hero-pick__score strong { font-size: 21px; }
.hero-pick__score span { font-size: 11px; }
.signal-label { background: #fff; border: 0; padding: 6px 9px; }
.orbit-label { top: 16px; right: 16px; background: #fff; border: 0; transform: none; }
.primary-button { box-shadow: 3px 3px 0 #55bd88; }
.quick-row { margin: 18px 0; }
.quick-row button { min-height: 58px; border: 1px solid #ccd6d1; box-shadow: none; }
.tasteprint-callout { margin-top: 24px; padding: 22px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--ink); border-block: 1px solid #ccd6d1; }
.tasteprint-callout h2 { font-size: 25px; }
.tasteprint-callout .eyebrow { color: #477262; }
.tasteprint-callout p:last-child { font-size: 13px; color: var(--muted); }
.flavor-filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 20px; padding: 4px 2px 8px; scrollbar-width: thin; }
.flavor-filters button { flex: 0 0 auto; min-height: 40px; border: 1px solid #ccd6d1; border-radius: 6px; background: #fff; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 800; transition: background 180ms, color 180ms; }
.flavor-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.product-rail { grid-auto-flow: initial; grid-template-columns: repeat(4,minmax(0,1fr)); overflow: visible; gap: 16px; padding: 0; }
.product-card { display: block; min-height: 0; border-color: #d5dfda; box-shadow: 0 4px 10px #152e1808; }
.product-card__tap { height: 100%; min-height: 320px; }
.product-card__media { background: color-mix(in srgb, var(--product-color) 34%, white); }
.product-card__copy strong { overflow-wrap: anywhere; }
.match-chip { border: 0; background: #fffef8e8; font-size: 10px; }
.content-band { padding-top: 30px; }
.bottom-nav { border: 1px solid #b9c8c0; box-shadow: 0 8px 32px #152e1828; background: #fffffff5; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.bottom-nav button { border-radius: 6px; transition: background 200ms, transform 200ms; }
.bottom-nav button.is-active:not(.scan-nav) { background: #d8efd9; }
.bottom-nav button:active { transform: scale(.92); }
.scan-nav__icon { background: #ffd62f; color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.battle-card { min-width: 0; padding: 0; }
.battle-card__copy h2 { font-size: 27px; }
.battle-card.is-winner::after { content: 'VOITTAJA'; position: absolute; top: 18px; left: 14px; padding: 8px 12px; background: var(--green); color: var(--ink); font-size: 12px; font-weight: 900; transform: rotate(-4deg); animation: screenIn 220ms both; }
.battle-result { min-height: 76px; align-items: center; flex-wrap: wrap; max-width: 600px; padding: 10px 16px; }
.battle-result:not(:empty) { background: #d8efd9; border-radius: 6px; animation: screenIn 280ms both; }
.empty-state { padding: 18px 0; color: var(--muted); }
.rating-sheet { max-height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.rating-stars button { font-size: 48px; }
.tasteprint-panel h2 { font-size: 34px; }

@media (max-width: 760px) {
  h1 { font-size: 30px; }
  h2 { font-size: 25px; }
  .welcome-line { padding: 20px 0 16px; align-items: center; }
  .welcome-line h1 { max-width: 250px; }
  .eyebrow { font-size: 10px; }
  .hero-pick { min-height: 300px; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); grid-template-rows: auto; margin-inline: -14px; }
  .hero-pick__copy { padding: 22px 14px; }
  .hero-pick__copy h2 { margin-top: 12px; font-size: 25px; }
  .hero-pick__copy > p { display: none; }
  .hero-pick__score { margin: 14px 0; gap: 2px; flex-direction: column; align-items: flex-start; }
  .hero-pick__score strong { font-size: 17px; }
  .hero-pick__score span { font-size: 10px; }
  .hero-pick__copy .primary-button { min-height: 42px; padding: 10px 14px; font-size: 13px; }
  .hero-pick__media { min-height: 260px; }
  .hero-pick__media img { width: 93%; height: 220px; max-height: 220px; }
  .orbit-label { top: auto; right: 8px; left: 8px; bottom: 12px; padding: 6px; text-align: center; font-size: 10px; }
  .quick-row { gap: 6px; }
  .quick-row button { min-height: 72px; padding: 9px; }
  .tasteprint-callout { flex-direction: row; align-items: center; gap: 14px; padding: 18px 0; margin-top: 8px; }
  .tasteprint-callout h2 { font-size: 21px; }
  .tasteprint-callout p:last-child { display: none; }
  .tasteprint-callout .secondary-button { width: auto; flex-shrink: 0; font-size: 12px; padding: 11px 13px; }
  .section-heading { gap: 10px; }
  .section-heading .text-button { font-size: 12px; white-space: nowrap; }
  .product-rail { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .product-card__tap { min-height: 275px; grid-template-rows: 160px auto; }
  .product-card__media img { height: 137px; width: 82%; }
  .product-card__copy { padding: 12px 10px; }
  .product-card__copy strong { font-size: 17px; }
  .product-card__copy em { font-size: 10px; }
  .battle-card { grid-template-rows: 190px auto; min-height: 340px; }
  .battle-card__copy h2 { font-size: 19px; }
  .battle-card__media img { max-height: 170px; }
  .battle-card.is-winner::after { content: 'VOITTAJA'; font-size: 10px; left: 6px; top: 10px; padding: 5px 8px; }
  .tasteprint-panel h2 { font-size: 26px; }
  .profile-head h1 { font-size: 28px; }
  .trend-row { grid-template-columns: 24px 48px minmax(0,1fr) auto; gap: 8px; }
  .trend-image { width: 46px; height: 52px; }
  .trend-image img { width: 42px; height: 48px; }
  .trend-copy small { font-size: 10px; }
}
