.match-app {
  --match-paper: #fff5ed;
  --match-ink: var(--deep);
  --match-surface: #641812;
  --match-line: #bc7264;
  --match-width: min(35.5rem, calc(100% - 1rem));
  --match-chrome: calc(10.75rem + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100svh;
  color: var(--match-paper);
  background: var(--match-surface);
}
.match-app :focus-visible { outline-color: #ffc87e; }
.match-card :focus-visible, .match-picker :focus-visible, .match-result :focus-visible, .pizza-meme :focus-visible {
  outline-color: var(--accent);
}
.match-top { padding-top: env(safe-area-inset-top); border-bottom: 1px solid #93463b; background: #4c120e; }
.match-top-inner {
  width: var(--match-width);
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
}
.match-brand {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .15rem 0;
  min-height: 44px;
  text-decoration: none;
}
.match-brand .brand-caption {
  padding: .25rem .4rem;
  border: 0;
  border-radius: 4px;
  background: var(--match-paper);
  font-size: .8rem;
}
.match-brand img {
  display: block;
  width: clamp(72px, 23vw, 107px);
  height: auto;
  padding: .27rem .37rem;
  border-radius: 4px;
  background: var(--match-paper);
}
.match-top nav { width: auto; margin: 0; order: 0; }
.match-top nav a, .match-after a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .4rem;
  min-height: 44px;
  font-size: .82rem;
  color: var(--match-paper);
  text-decoration: none;
}
.match-top nav a:hover, .match-after a:hover { color: white; text-decoration: underline; }

.match-main { width: var(--match-width); margin: 0 auto; padding-bottom: max(.45rem, env(safe-area-inset-bottom)); }
.match-progress { display: flex; padding: 0; list-style: none; gap: .25rem; margin: .45rem 0; }
.match-progress li { flex: 1; height: 3px; border-radius: 4px; background: #a44c41; }
.match-progress li.done { background: #f0a692; }
.match-progress li[aria-current="step"] { background: #ffcc87; }
.match-stage { overflow: clip; border-radius: 13px; background: #4b130f; isolation: isolate; }

.match-card {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: var(--match-paper);
  color: var(--match-ink);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  transform: translateX(var(--shift, 0)) rotate(var(--tilt, 0deg));
  transition: transform .16s ease-out, opacity .16s ease-out;
}
.match-card.dragging { transition: none; cursor: grabbing; }
.match-card.departing { opacity: 0; }
.match-photo, .match-result-picture {
  display: block;
  width: 100%;
  height: clamp(245px, calc(100vh - var(--match-chrome)), 720px);
  height: clamp(245px, calc(100svh - var(--match-chrome)), 720px);
  object-fit: cover;
  object-position: 50% 56%;
  background: #8d3930;
}
.match-card-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: .45rem .75rem .5rem;
  gap: .4rem .8rem;
}
.match-card h2 {
  font-size: clamp(1.13rem, 3.8vw, 1.58rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.match-card-step {
  flex: none;
  margin: 0;
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: .74rem;
  color: var(--muted);
}
.match-card-step span { margin-inline-start: .2rem; }
.match-card h2:focus-visible, .match-result h2:focus-visible, .match-picker h2:focus-visible { outline-offset: 0; }

.match-controls { display: grid; grid-template-columns: 1fr 44px 1fr; gap: .45rem; margin-top: .5rem; }
.match-controls button, .match-checkout, .match-options button {
  display: flex;
  min-width: 0;
  min-height: 49px;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: .45rem .6rem;
  font-size: .89rem;
  line-height: 1.15;
  font-weight: 700;
  transition: background-color .14s ease-out, border-color .14s ease-out;
}
.match-controls span { font-size: 1.1rem; line-height: 1; }
.match-controls .match-no, .match-controls .match-undo { background: #7d2a22; color: var(--match-paper); border-color: var(--match-line); }
.match-controls .match-undo { padding-inline: 0; font-size: 1.33rem; }
.match-yes { background: #ffd5c4; color: #521410; }
.match-controls .match-no:hover, .match-controls .match-undo:hover { background: #953d32; }
.match-yes:hover, .match-deck[data-direction="keep"] .match-yes { background: #fff3e7; }
.match-deck[data-direction="skip"] .match-no { background: #4c120e; border-color: #ffc4ae; }
.match-options button:hover, .match-controls button:active, .match-checkout:active { transform: translateY(1px); }

.match-picker, .match-result { color: var(--match-ink); background: var(--match-paper); border-radius: 13px; overflow: hidden; }
.match-picker, .match-result-copy { padding: clamp(1rem, 4vw, 1.65rem); }
.match-picker h2, .match-result h2 {
  font-size: clamp(1.8rem, 6vw, 3.05rem);
  line-height: 1.05;
  letter-spacing: -.052em;
  overflow-wrap: anywhere;
}
.match-options { display: grid; gap: .4rem; margin: .9rem 0 .45rem; }
.match-options button {
  justify-content: flex-start;
  min-height: 57px;
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--match-ink);
}
.match-options button:hover { background: var(--red-tint); }
.match-thumb { display: block; width: 29px; height: 29px; object-fit: cover; border-radius: 4px; }
.match-options .match-thumb { width: 34px; height: 41px; }
.match-result-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .2em;
  margin: 0;
  padding: .2em 0 .26em;
  background: var(--amasol-red);
  color: #fff8f1;
  font: 800 clamp(2.8rem, 11vw, 5rem)/1 var(--mono);
  letter-spacing: -.08em;
  animation: match-reveal .38s cubic-bezier(.2,.8,.2,1) both;
}
.match-result-banner span { color: #ffccaf; font-weight: 600; }
@keyframes match-reveal {
  from { transform: translateY(-12%); opacity: .35; }
  to { transform: translateY(0); opacity: 1; }
}
.match-result-picture { height: clamp(188px, 41svh, 335px); object-position: 50% 56%; }
.match-result-copy > p { margin: .6rem 0 0; color: var(--muted); }
.match-ingredients { display: flex; flex-wrap: wrap; align-items: center; padding: 0; margin: .7rem 0 1rem; list-style: none; gap: .35rem; }
.match-ingredients li {
  display: flex;
  align-items: center;
  gap: .38rem;
  padding: .18rem .35rem;
  font-size: .82rem;
  color: var(--match-ink);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.match-checkout { width: 100%; justify-content: space-between; padding-inline: .85rem; background: var(--amasol-red); color: #fff; }
.match-checkout:hover { background: var(--red-deep); }
.match-result-options { display: flex; flex-wrap: wrap; gap: .12rem .75rem; margin-top: .35rem; }
.match-text-button {
  color: var(--accent);
  background: transparent;
  padding: .3rem 0;
  border: 0;
  min-height: 44px;
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.match-after { width: auto; margin: 0; }
.match-after a { color: var(--on-red); }
@media (min-width: 800px) {
  .match-main { padding-top: .4rem; }
  .match-app { --match-chrome: 11.25rem; }
}
@media (max-width: 360px) {
  .match-card-copy { padding-inline: .45rem; }
  .match-controls { gap: .25rem; }
  .match-top nav a, .match-brand .brand-caption { font-size: .74rem; }
}
@media (max-width: 310px) {
  .match-brand { gap: .3rem; }
  .match-top nav a, .match-brand .brand-caption { padding-inline: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .match-card, .match-controls button { transition: none; }
  .match-result-banner { animation: none; }
}
