
:root {
  --cream: #f8eedc;
  --cream-deep: #edd9bc;
  --paper: #fffaf0;
  --coffee: #5a3425;
  --coffee-dark: #3e2118;
  --caramel: #c67a3a;
  --orange: #e88a42;
  --turquoise: #58a9a4;
  --turquoise-dark: #367d79;
  --ink: #35231c;
  --muted: #806a5e;
  --white: #ffffff;
  --success: #4f9580;
  --warning: #d76d3c;
  --shadow-soft: 0 12px 32px rgba(82, 47, 30, 0.12);
  --shadow-card: 0 18px 44px rgba(73, 40, 23, 0.16);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Heebo", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button,
a { font: inherit; }
button { -webkit-user-select: none; user-select: none; }

.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 480px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,.7), transparent 28%),
    linear-gradient(160deg, #fff8e9 0%, var(--cream) 52%, #f1ddc2 100%);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
}

.screen.active { display: flex; }

.primary-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  padding: 0 24px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.primary-button {
  color: var(--white);
  background: linear-gradient(135deg, var(--orange), var(--caramel));
  box-shadow: 0 12px 28px rgba(198, 122, 58, .3);
}

.secondary-button {
  color: var(--coffee);
  background: #fff7e9;
  border: 1px solid rgba(90, 52, 37, .14);
}

.primary-button:active,
.secondary-button:active,
.ingredient-button:active,
.segmented-control button:active { transform: scale(.98); }

.primary-button:focus-visible,
.secondary-button:focus-visible,
.ingredient-button:focus-visible,
.segmented-control button:focus-visible,
.icon-button:focus-visible,
.copy-button:focus-visible {
  outline: 3px solid rgba(88, 169, 164, .45);
  outline-offset: 2px;
}

/* Start */
.start-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 22px max(16px, env(safe-area-inset-bottom));
  text-align: center;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .7;
  pointer-events: none;
}

.ambient-one {
  width: 240px;
  height: 240px;
  left: -110px;
  top: -70px;
  background: rgba(88, 169, 164, .16);
}

.ambient-two {
  width: 300px;
  height: 300px;
  right: -160px;
  bottom: -120px;
  background: rgba(232, 138, 66, .16);
}

.brand-lockup {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  text-align: left;
}

.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--coffee);
  border-radius: 50%;
}

.logo-mark::before,
.logo-mark::after,
.logo-mark span {
  content: "";
  position: absolute;
  width: 9px;
  height: 22px;
  border-radius: 90% 10% 90% 10%;
  border: 2px solid var(--coffee);
  transform-origin: 50% 100%;
}

.logo-mark::before { transform: rotate(-42deg) translateY(-1px); }
.logo-mark::after { transform: rotate(42deg) translateY(-1px); }
.logo-mark span { transform: translateY(-2px); }
.logo-mark.small { width: 31px; height: 31px; border-width: 1.5px; }
.logo-mark.small::before,
.logo-mark.small::after,
.logo-mark.small span { width: 5px; height: 13px; border-width: 1px; }

.brand-name { margin: 0; font-size: .92rem; font-weight: 800; letter-spacing: .11em; color: var(--coffee); }
.brand-tagline { margin: 1px 0 0; font-size: .52rem; font-weight: 700; letter-spacing: .18em; color: var(--caramel); }

.hero-art {
  position: relative;
  width: min(270px, 68vw);
  height: min(238px, 29vh);
  min-height: 168px;
  margin: clamp(12px, 2vh, 24px) 0 clamp(8px, 1.5vh, 18px);
}

.hero-cup {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 19px;
  width: 145px;
  height: 130px;
  transform: translateX(-50%);
  border: 4px solid rgba(90, 52, 37, .82);
  border-radius: 14px 14px 38px 38px;
  background: rgba(255,255,255,.62);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), 0 18px 30px rgba(71, 39, 21, .18);
  overflow: visible;
}

.hero-coffee {
  position: absolute;
  inset: 19px 7px 7px;
  border-radius: 7px 7px 30px 30px;
  background: linear-gradient(180deg, #8b5838 0%, #5a2e1f 100%);
  overflow: hidden;
}

.hero-coffee::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 0;
  width: 100%;
  height: 15px;
  border-radius: 50%;
  background: #c99260;
  box-shadow: inset 0 3px 3px rgba(255,255,255,.3);
}

.hero-cup-logo {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 57%;
  transform: translate(-50%, -50%);
  color: #f9ebd7;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.hero-handle {
  position: absolute;
  right: -39px;
  top: 35px;
  width: 44px;
  height: 55px;
  border: 4px solid rgba(90, 52, 37, .82);
  border-left: 0;
  border-radius: 0 30px 30px 0;
}

.hero-saucer {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 0;
  width: 215px;
  height: 38px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #fffdf7, #e7d3b7);
  box-shadow: 0 16px 22px rgba(65, 35, 20, .12);
}

.hero-steam {
  position: absolute;
  z-index: 3;
  top: 3px;
  width: 17px;
  height: 75px;
  border: 4px solid rgba(88, 169, 164, .44);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: steam 2.4s ease-in-out infinite;
}
.steam-a { left: 42%; }
.steam-b { left: 54%; animation-delay: .6s; transform: scale(.8); }

@keyframes steam {
  0%, 100% { opacity: .18; transform: translateY(8px) rotate(4deg); }
  50% { opacity: .72; transform: translateY(-5px) rotate(-7deg); }
}

.coffee-bean {
  position: absolute;
  width: 24px;
  height: 34px;
  border-radius: 50%;
  background: #6f3a24;
  transform: rotate(35deg);
  box-shadow: 0 8px 12px rgba(68, 35, 20, .18);
}
.coffee-bean::after {
  content: "";
  position: absolute;
  left: 48%; top: 4px; bottom: 4px;
  width: 2px;
  background: #b97b4d;
  border-radius: 50%;
  transform: rotate(8deg);
}
.bean-a { left: 10px; bottom: 20px; }
.bean-b { right: 10px; bottom: 37px; transform: rotate(-25deg) scale(.78); }

.start-copy { position: relative; z-index: 2; max-width: 520px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--turquoise-dark);
  background: rgba(88,169,164,.12);
  font-size: .78rem;
  font-weight: 800;
}
.start-copy h1,
.final-content h2,
.round-result-screen h2 {
  margin: 10px 0 4px;
  color: var(--coffee-dark);
  line-height: 1.05;
}
.start-copy h1 { font-size: clamp(2rem, 7vw, 3.3rem); }
.start-copy p { margin: 0; color: var(--muted); font-size: clamp(.98rem, 3vw, 1.18rem); }

.start-button {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(360px, 100%);
  margin-top: clamp(16px, 2.5vh, 28px);
}
.button-arrow { font-size: 1.25rem; }
.microcopy { position: relative; z-index: 2; margin: 10px 0 0; color: var(--muted); font-size: .8rem; }

/* Game */
.game-screen {
  flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  gap: 8px;
}

.game-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  color: var(--coffee);
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .08em;
}

.round-progress { text-align: center; color: var(--muted); font-weight: 700; font-size: .77rem; }
.progress-dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.progress-dot { width: 18px; height: 4px; border-radius: 99px; background: rgba(90,52,37,.14); }
.progress-dot.active { background: var(--turquoise); }
.progress-dot.done { background: var(--caramel); }

.timer {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 63px;
  padding: 5px 9px;
  border-radius: 14px;
  color: var(--coffee-dark);
  background: rgba(255,255,255,.66);
  box-shadow: 0 4px 14px rgba(64,35,20,.08);
  direction: ltr;
}
.timer span { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.timer small { font-size: .55rem; color: var(--muted); }
.timer.warning { color: #b84c2d; animation: timerPulse .72s ease-in-out infinite; }
@keyframes timerPulse { 50% { transform: scale(1.05); background: #fff2e6; } }

.compact-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 47px;
  padding: 7px 11px;
  border-radius: 15px;
  background: rgba(255,250,240,.82);
  border: 1px solid rgba(90,52,37,.08);
  box-shadow: 0 6px 18px rgba(72,42,26,.07);
}
.compact-order > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.compact-order span { color: var(--caramel); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.compact-order strong { color: var(--coffee-dark); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  color: var(--turquoise-dark);
  background: rgba(88,169,164,.12);
  font-weight: 800;
  cursor: pointer;
}

.game-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.size-selector { display: flex; align-items: center; gap: 8px; }
.size-selector > span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.segmented-control {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(90,52,37,.08);
}
.segmented-control button {
  min-width: 56px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
}
.segmented-control button.selected {
  color: var(--coffee-dark);
  background: #fffaf0;
  box-shadow: 0 3px 9px rgba(73,40,22,.11);
}

.cup-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.cup-shell {
  position: relative;
  width: clamp(118px, 27vw, 150px);
  height: clamp(142px, 25vh, 208px);
  border: 4px solid rgba(90,52,37,.68);
  border-top-width: 3px;
  border-radius: 13px 13px 34px 34px;
  background: rgba(255,255,255,.25);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.56), 0 14px 24px rgba(70,38,21,.12);
  transition: width .2s ease, height .2s ease;
}
.cup-shell.size-small { width: clamp(100px, 23vw, 124px); height: clamp(120px, 21vh, 165px); }
.cup-shell.size-medium { width: clamp(110px, 25vw, 138px); height: clamp(132px, 23vh, 186px); }
.cup-shell.size-large { width: clamp(118px, 27vw, 150px); height: clamp(142px, 25vh, 208px); }

.cup-rim {
  position: absolute;
  z-index: 7;
  left: -7px;
  right: -7px;
  top: -8px;
  height: 16px;
  border: 3px solid rgba(90,52,37,.72);
  border-radius: 50%;
  background: rgba(255,255,255,.55);
}

.cup-interior {
  position: absolute;
  inset: 8px 5px 5px;
  overflow: hidden;
  border-radius: 7px 7px 26px 26px;
}

.liquid-layers { position: absolute; inset: 0; }
.liquid-layer {
  position: absolute;
  left: 0;
  width: 100%;
  transition: height .18s ease, bottom .18s ease;
  box-shadow: inset 0 3px 4px rgba(255,255,255,.12);
}
.liquid-layer::before {
  content: "";
  position: absolute;
  left: 0;
  top: -4px;
  width: 100%;
  height: 8px;
  border-radius: 50%;
  background: inherit;
  opacity: .92;
}

.ice-layer { position: absolute; inset: 6px 7px 12px; z-index: 5; pointer-events: none; }
.ice-cube {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.76);
  border-radius: 5px;
  background: rgba(194,237,239,.42);
  box-shadow: inset 0 0 7px rgba(255,255,255,.7), 0 2px 5px rgba(40,111,117,.15);
  transform: rotate(16deg);
}
.ice-cube:nth-child(1) { left: 12%; bottom: 22%; }
.ice-cube:nth-child(2) { right: 14%; bottom: 37%; transform: rotate(-12deg); }
.ice-cube:nth-child(3) { left: 35%; bottom: 56%; transform: rotate(28deg); }
.ice-cube:nth-child(4) { right: 32%; bottom: 12%; transform: rotate(-30deg); }

.foam-layer {
  position: absolute;
  z-index: 6;
  left: 2px;
  right: 2px;
  bottom: var(--foam-bottom, 0%);
  height: 0;
  border-radius: 50% 50% 18% 18%;
  background: linear-gradient(180deg, #fffdf9, #f6e8d0);
  box-shadow: 0 -3px 7px rgba(255,255,255,.75), inset 0 -5px 6px rgba(204,178,145,.2);
  transition: height .18s ease, bottom .18s ease;
}
.foam-layer.visible { height: 11%; }


.cup-target-line {
  position: absolute;
  z-index: 11;
  left: 0;
  right: 0;
  bottom: var(--target-level, 70%);
  border-top: 2px dashed rgba(88, 169, 164, .95);
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,.65));
}
.cup-target-line span {
  position: absolute;
  left: 4px;
  top: -16px;
  padding: 1px 4px;
  border-radius: 5px;
  color: var(--turquoise-dark);
  background: rgba(239,250,248,.88);
  font-size: .5rem;
  font-weight: 800;
  line-height: 1.25;
}

.cup-shine {
  position: absolute;
  z-index: 8;
  top: 8%;
  left: 10%;
  width: 12%;
  height: 60%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.08));
  pointer-events: none;
}

.cup-brand {
  position: absolute;
  z-index: 9;
  left: 50%; top: 53%;
  transform: translate(-50%,-50%);
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 3px rgba(54,27,16,.34);
  font-weight: 800;
  letter-spacing: .15em;
  font-size: .82rem;
}

.cup-measurements { position: absolute; z-index: 10; inset: 0; pointer-events: none; }
.cup-measurements span {
  position: absolute;
  left: 4px;
  width: 10px;
  height: 1px;
  background: rgba(90,52,37,.3);
}

.target-guide {
  position: absolute;
  z-index: 12;
  left: calc(50% + clamp(68px, 15vw, 91px));
  bottom: 39px;
  width: clamp(74px, 20vw, 120px);
  height: calc(clamp(142px, 25vh, 208px) - 10px);
  pointer-events: none;
}
.target-guide span {
  position: absolute;
  left: 0;
  bottom: calc(var(--target-level, 70%) - 9px);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--turquoise-dark);
  background: rgba(232,248,246,.92);
  font-size: .58rem;
  font-weight: 800;
  white-space: nowrap;
}
.target-guide-line {
  position: absolute;
  right: 100%;
  bottom: var(--target-level, 70%);
  width: 24px;
  border-top: 2px dashed var(--turquoise);
}
.target-guide::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: var(--target-level, 70%);
  width: 5px;
  height: 5px;
  transform: translateY(50%);
  border-radius: 50%;
  background: var(--turquoise);
}

.build-summary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.build-summary span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.52);
  font-size: .61rem;
  font-weight: 700;
}

.controls-panel { flex: 0 0 auto; }
.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.ingredient-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 54px;
  padding: 4px 2px;
  border: 1px solid rgba(90,52,37,.1);
  border-radius: 13px;
  color: var(--coffee-dark);
  background: rgba(255,250,240,.82);
  box-shadow: 0 5px 13px rgba(66,37,22,.07);
  cursor: pointer;
}
.ingredient-button .ingredient-icon { font-size: 1rem; line-height: 1; font-weight: 800; }
.ingredient-button .ingredient-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .56rem; font-weight: 800; }
.ingredient-button .ingredient-badge {
  position: absolute;
  top: -4px;
  left: -3px;
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  color: #fff;
  background: var(--turquoise-dark);
  font-size: .58rem;
  font-weight: 800;
  line-height: 18px;
}
.ingredient-button.has-value .ingredient-badge { display: block; }
.ingredient-button.reset { color: #9c5137; background: rgba(255,238,225,.9); }
.ingredient-button:disabled { opacity: .45; cursor: default; }
.finish-button { width: 100%; min-height: 47px; margin-top: 7px; }

/* Order modal */
.order-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(62,33,24,.42);
  backdrop-filter: blur(6px);
}
.order-modal[hidden] { display: none; }
.order-ticket {
  position: relative;
  width: min(370px, 100%);
  padding: 18px 20px 15px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 0 0, transparent 9px, #fffaf0 10px) 0 0 / 20px 20px repeat-x,
    linear-gradient(#fffaf0,#fffaf0);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: ticketIn .22s ease both;
}
@keyframes ticketIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.ticket-topline { display: flex; justify-content: space-between; color: var(--caramel); font-size: .72rem; font-weight: 800; }
.ticket-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 12px auto 5px; border-radius: 50%; color: var(--coffee); background: rgba(198,122,58,.12); font-size: 1.55rem; }
.order-ticket h2 { margin: 6px 0 12px; color: var(--coffee-dark); font-size: 1.55rem; }
.order-ticket ul { margin: 0; padding: 0; list-style: none; border-top: 1px dashed rgba(90,52,37,.2); border-bottom: 1px dashed rgba(90,52,37,.2); }
.order-ticket li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 31px; color: var(--muted); font-size: .87rem; }
.order-ticket li::before { content: "✓"; color: var(--turquoise-dark); font-weight: 800; }
.ticket-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: .72rem; }
.ticket-footer strong { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--orange); font-size: .9rem; }

/* Round result */
.round-result-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
  overflow-y: auto;
}
.result-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: white;
  background: var(--success);
  box-shadow: 0 12px 24px rgba(79,149,128,.25);
  font-size: 1.7rem;
  font-weight: 800;
}
.result-icon.medium { background: var(--caramel); box-shadow: 0 12px 24px rgba(198,122,58,.24); }
.result-icon.low { background: var(--warning); box-shadow: 0 12px 24px rgba(215,109,60,.22); }
.round-result-screen h2 { font-size: clamp(1.8rem, 7vw, 2.5rem); }

.accuracy-ring { position: relative; width: 132px; height: 132px; margin: 16px 0 5px; direction: ltr; }
.accuracy-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track,
.ring-progress { fill: none; stroke-width: 9; }
.ring-track { stroke: rgba(90,52,37,.09); }
.ring-progress { stroke: var(--turquoise); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset .8s ease; }
.accuracy-ring > div { position: absolute; inset: 0; display: grid; place-content: center; color: var(--coffee-dark); }
.accuracy-ring strong { font-size: 2.3rem; line-height: 1; }
.accuracy-ring span { font-size: .85rem; color: var(--muted); }
.round-feedback { margin: 0 0 13px; color: var(--muted); font-weight: 700; }

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: min(430px, 100%);
  margin-bottom: 17px;
}
.breakdown-item { padding: 9px 6px; border-radius: 13px; background: rgba(255,255,255,.58); }
.breakdown-item span { display: block; color: var(--muted); font-size: .65rem; }
.breakdown-item strong { color: var(--coffee-dark); font-size: .9rem; }
.round-result-screen .primary-button { width: min(360px, 100%); }

/* Final */
.final-screen {
  flex-direction: column;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 15px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
}
.final-brand { margin-bottom: 9px; }
.final-content { position: relative; z-index: 3; width: min(520px, 100%); text-align: center; }
.final-content h2 { font-size: clamp(1.9rem, 7vw, 2.7rem); }

.final-cup-wrap { height: 118px; margin: 8px 0 3px; }
.final-cup {
  position: relative;
  width: 100px;
  height: 106px;
  margin: 0 auto;
  border-radius: 7px 7px 20px 20px;
  background: linear-gradient(150deg, var(--turquoise), #3f817e);
  box-shadow: 0 14px 22px rgba(49,107,103,.2);
  transform: rotate(-2deg);
}
.final-cup::after { content: ""; position: absolute; left: 10px; top: 14px; width: 8px; height: 66px; border-radius: 99px; background: rgba(255,255,255,.17); }
.final-cup-lid { position: absolute; z-index: 2; left: -5px; right: -5px; top: -6px; height: 14px; border-radius: 7px; background: var(--coffee-dark); }
.final-cup-logo { position: absolute; inset: 0; display: grid; place-content: center; color: #fff9e8; font-size: 1rem; font-weight: 800; letter-spacing: .12em; line-height: 1.15; }
.final-cup-logo small { font-size: .49rem; letter-spacing: .17em; }

.final-stats { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.stat-card { display: flex; flex-direction: column; justify-content: center; min-height: 79px; padding: 9px 6px; border-radius: 16px; background: rgba(255,255,255,.62); border: 1px solid rgba(90,52,37,.08); }
.stat-card.featured { background: linear-gradient(135deg, #6aacaa, var(--turquoise-dark)); color: white; border: 0; box-shadow: 0 10px 22px rgba(56,127,123,.2); }
.stat-card span { font-size: .65rem; font-weight: 700; color: var(--muted); }
.stat-card.featured span,
.stat-card.featured small { color: rgba(255,255,255,.8); }
.stat-card strong { color: var(--coffee-dark); font-size: 1.25rem; line-height: 1.1; }
.stat-card.featured strong { color: white; font-size: 1.5rem; }
.stat-card small { color: var(--muted); font-size: .57rem; }

.reward-card {
  margin-top: 10px;
  padding: 13px;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff9ed, #f0dcc1);
  border: 1px solid rgba(198,122,58,.18);
  box-shadow: 0 10px 24px rgba(77,43,24,.1);
}
.reward-label { color: var(--caramel); font-size: .69rem; font-weight: 800; }
.reward-card h3 { margin: 2px 0 9px; color: var(--coffee-dark); font-size: 1.15rem; }
.reward-card > p { margin: 7px 0 0; color: var(--muted); font-size: .63rem; }
.coupon-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 5px 7px 5px 10px;
  border: 1px dashed rgba(90,52,37,.28);
  border-radius: 13px;
  background: rgba(255,255,255,.62);
  direction: ltr;
}
.coupon-box span { color: var(--muted); font-size: .65rem; }
.coupon-box strong { color: var(--coffee-dark); font-size: 1.14rem; letter-spacing: .14em; }
.coupon-box.locked strong { filter: blur(5px); user-select: none; }
.copy-button { height: 32px; border: 0; border-radius: 9px; padding: 0 10px; color: white; background: var(--turquoise-dark); font-size: .67rem; font-weight: 800; cursor: pointer; }
.copy-button:disabled { opacity: .45; }

.final-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; margin-top: 10px; }
.final-actions .primary-button,
.final-actions .secondary-button { min-height: 47px; padding: 0 12px; }
.link-button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.link-button.disabled { pointer-events: none; opacity: .5; }

.confetti { position: absolute; z-index: 2; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -18px; width: 8px; height: 14px; border-radius: 2px; animation: confettiFall var(--fall-duration) linear var(--fall-delay) forwards; }
@keyframes confettiFall { to { transform: translate3d(var(--drift), 110vh, 0) rotate(720deg); } }

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 9px 15px;
  border-radius: 999px;
  color: white;
  background: rgba(62,33,24,.92);
  font-size: .77rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Compact phones */
@media (max-width: 480px) {
  .game-screen { gap: 6px; }
  .ingredient-grid { gap: 4px; }
  .ingredient-button { height: 52px; border-radius: 12px; }
  .ingredient-button .ingredient-label { font-size: .53rem; }
  .target-guide { left: calc(50% + clamp(62px, 16vw, 80px)); width: 78px; }
  .target-guide span { max-width: 75px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 350px) {
  .game-screen { padding-inline: 8px; }
  .mini-brand > span { display: none; }
  .game-header { grid-template-columns: 34px 1fr auto; }
  .compact-order { min-height: 42px; padding-block: 5px; }
  .segmented-control button { min-width: 49px; padding-inline: 5px; }
  .ingredient-button { height: 48px; }
  .ingredient-button .ingredient-icon { font-size: .9rem; }
  .ingredient-button .ingredient-label { font-size: .49rem; }
  .finish-button { min-height: 44px; }
  .target-guide { display: none; }
  .final-stats { gap: 5px; }
  .stat-card { min-height: 72px; }
}

@media (max-height: 650px) {
  .game-screen { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); gap: 5px; }
  .game-header { min-height: 42px; }
  .compact-order { min-height: 40px; }
  .cup-shell.size-small { height: 112px; }
  .cup-shell.size-medium { height: 124px; }
  .cup-shell.size-large { height: 136px; }
  .target-guide { height: 126px; bottom: 35px; }
  .build-summary { margin-top: 4px; }
  .ingredient-button { height: 45px; }
  .finish-button { min-height: 43px; margin-top: 5px; }
  .size-selector { gap: 5px; }
  .segmented-control button { height: 27px; }
  .hero-art { height: 170px; min-height: 150px; margin-block: 8px; transform: scale(.88); }
  .start-copy h1 { margin-top: 6px; }
  .start-button { min-height: 47px; margin-top: 13px; }
  .round-result-screen { justify-content: flex-start; padding-top: 14px; }
  .result-icon { width: 54px; height: 54px; margin-bottom: 7px; }
  .accuracy-ring { width: 112px; height: 112px; margin: 9px 0 3px; }
  .score-breakdown { margin-bottom: 10px; }
  .final-cup-wrap { height: 89px; margin-block: 3px; transform: scale(.78); transform-origin: top center; }
  .final-brand { margin-bottom: 4px; }
  .reward-card { margin-top: 7px; padding: 10px; }
  .final-actions { margin-top: 7px; }
}

@media (min-width: 760px) {
  .game-screen { width: min(760px, 100%); left: 50%; transform: translateX(-50%); padding-inline: 24px; }
  .ingredient-button { height: 64px; }
  .ingredient-button .ingredient-icon { font-size: 1.2rem; }
  .ingredient-button .ingredient-label { font-size: .67rem; }
  .cup-shell { height: 215px; }
  .target-guide { height: 205px; }
  .finish-button { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* ============================================================
   LUMA V11 — CLEAN CENTERED RESPONSIVE LAYOUT
   This section intentionally overrides the original demo layout.
   ============================================================ */

/* General assets */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.logo-mark {
  width: 58px;
  height: 58px;
  border-radius: 0;
  background: url('assets/logo.png') center / contain no-repeat;
  box-shadow: none;
}
.logo-mark.small { width: 38px; height: 38px; }
.logo-mark::before,
.logo-mark::after,
.logo-mark span { display: none !important; }

/* Start screen keeps the approved poster */
.start-screen {
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #f6ead8;
}
.start-screen-poster {
  width: min(100vw, calc(100dvh * 941 / 1672));
  height: 100dvh;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.start-screen-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.start-image-button {
  position: absolute;
  left: 50%;
  bottom: max(4.5vh, 34px);
  transform: translateX(-50%);
  width: min(72vw, 410px);
  height: clamp(64px, 9.5vh, 108px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.start-image-button:focus-visible {
  outline: 3px solid rgba(88,169,164,.8);
  outline-offset: 4px;
}

/* Full-width game canvas; content itself is centered */
.game-screen {
  width: 100% !important;
  max-width: none !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 18px max(8px, env(safe-area-inset-bottom)) !important;
  gap: 8px !important;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(248,238,220,.24), rgba(241,226,203,.22)),
    url('assets/game-background.png') center / cover no-repeat;
}
.game-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 36%, rgba(255,255,255,.24), transparent 38%);
}
.game-header,
.compact-order,
.game-stage,
.controls-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin-inline: auto;
}

.game-header {
  flex: 0 0 auto;
  min-height: 44px;
}
.compact-order {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 7px 13px;
  border-radius: 17px;
  background: rgba(255,250,240,.9);
  backdrop-filter: blur(7px);
  box-shadow: 0 7px 20px rgba(72,42,26,.08);
}

/* Main gameplay structure */
.game-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 0 !important;
}

.size-selector {
  flex: 0 0 auto;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 6px !important;
  margin: 0 !important;
}
.size-selector-title {
  color: var(--coffee-dark) !important;
  font-size: .96rem !important;
  font-weight: 900 !important;
}
.segmented-control {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: min(370px, 92vw);
  padding: 5px;
  border-radius: 18px;
  background: rgba(255,250,240,.91);
  border: 1px solid rgba(90,52,37,.09);
  box-shadow: 0 8px 20px rgba(72,42,26,.08);
}
.segmented-control button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0 !important;
  height: 43px !important;
  padding: 0 8px !important;
  border-radius: 13px !important;
  color: #7a5847 !important;
  font-size: .82rem !important;
  font-weight: 900 !important;
}
.segmented-control button.selected {
  color: #fff !important;
  background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark)) !important;
  box-shadow: 0 6px 14px rgba(54,125,121,.22) !important;
}
.size-cup {
  position: relative;
  display: inline-block;
  width: 19px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 4px 4px 7px 7px;
}
.size-cup::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 3px;
  width: 7px;
  height: 8px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 6px 6px 0;
}
.small-cup { transform: scale(.78); }
.medium-cup { transform: scale(.9); }
.large-cup { transform: scale(1.04); }

.play-layout {
  flex: 1 1 auto;
  min-height: 0;
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 275px;
  grid-template-areas: 'cup req';
  gap: 24px;
  align-items: center;
  justify-content: center;
  direction: ltr;
}
.cup-zone {
  grid-area: cup;
  direction: rtl;
  position: relative;
  width: 100%;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
.order-requirements {
  grid-area: req;
  direction: rtl;
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  width: 275px !important;
  max-width: 100%;
  max-height: none !important;
  margin: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
  border-radius: 19px;
  background: rgba(255,250,240,.92);
  border: 1px solid rgba(90,52,37,.09);
  box-shadow: 0 10px 28px rgba(66,37,22,.12);
}
.order-requirements-header {
  margin-bottom: 7px !important;
}
.order-requirements-header h3 {
  font-size: .92rem !important;
}
.order-requirements-header span {
  font-size: .64rem !important;
}
.requirements-list {
  display: flex !important;
  flex-direction: column;
  gap: 6px !important;
}
.requirement-item {
  min-height: 42px;
  padding: 6px 8px !important;
  border-radius: 12px !important;
}
.requirement-check {
  width: 21px !important;
  height: 21px !important;
  flex: 0 0 21px;
}
.requirement-copy strong { font-size: .75rem !important; }
.requirement-copy small { font-size: .61rem !important; }
.requirement-status { font-size: .67rem !important; }

/* Original clean glass cup — no external target guide */
.target-guide { display: none !important; }
.cup-shell {
  position: relative;
  width: 178px !important;
  height: 222px !important;
  border: 4px solid rgba(90,52,37,.68) !important;
  border-top-width: 3px !important;
  border-radius: 13px 13px 34px 34px !important;
  background: rgba(255,255,255,.25) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.56), 0 14px 24px rgba(70,38,21,.12) !important;
}
.cup-shell.size-small { width: 145px !important; height: 182px !important; }
.cup-shell.size-medium { width: 161px !important; height: 202px !important; }
.cup-shell.size-large { width: 178px !important; height: 222px !important; }
.cup-shell::before,
.cup-back,
.cup-front { display: none !important; }
.cup-rim {
  display: block !important;
  position: absolute;
  z-index: 7;
  left: -7px;
  right: -7px;
  top: -8px;
  height: 16px;
  border: 3px solid rgba(90,52,37,.72);
  border-radius: 50%;
  background: rgba(255,255,255,.55);
}
.cup-interior {
  position: absolute;
  inset: 8px 5px 5px !important;
  overflow: hidden;
  border-radius: 7px 7px 26px 26px !important;
}
.cup-brand {
  display: block !important;
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 53%;
  transform: translate(-50%,-50%);
  color: rgba(255,255,255,.94);
  text-shadow: 0 1px 4px rgba(54,27,16,.45);
  font-weight: 900;
  letter-spacing: .16em;
  font-size: .82rem;
}
.cup-measurements { display: block !important; }
.cup-target-line { z-index: 11 !important; }
.cup-target-line span { font-size: .56rem; }
.build-summary {
  margin-top: 0 !important;
  min-height: 27px;
  gap: 6px;
}
.build-summary span {
  padding: 4px 8px;
  font-size: .65rem;
  background: rgba(255,255,255,.78);
}

/* Controls are a separate bottom section and can never overlap play-layout */
.controls-panel {
  flex: 0 0 auto !important;
  padding: 0 !important;
}
.ingredient-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 9px !important;
}
.ingredient-button {
  height: 82px !important;
  min-width: 0 !important;
  padding: 5px 4px 7px !important;
  gap: 3px !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  background: rgba(255,250,240,.93) !important;
  box-shadow: 0 7px 16px rgba(66,37,22,.09) !important;
}
.ingredient-icon-frame {
  display: grid;
  place-items: center;
  width: 50px !important;
  height: 50px !important;
  flex: 0 0 50px !important;
}
.ingredient-icon-image {
  display: block;
  width: 50px !important;
  height: 50px !important;
  object-fit: contain;
}
.ingredient-button .ingredient-label {
  font-size: .66rem !important;
  font-weight: 900 !important;
  line-height: 1;
}
.ingredient-button .ingredient-badge {
  top: -4px !important;
  left: -3px !important;
  min-width: 21px !important;
  height: 21px !important;
  line-height: 21px !important;
  font-size: .62rem !important;
}
.finish-button {
  min-height: 48px !important;
  margin-top: 7px !important;
}

/* Order preview card */
.order-modal {
  padding: 12px;
  background: rgba(52,29,18,.52);
  backdrop-filter: blur(9px);
}
.order-ticket {
  width: min(450px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 0 22px 16px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffaf1, #f9efdf);
  border: 1px solid rgba(90,52,37,.1);
  box-shadow: 0 26px 70px rgba(48,25,14,.28);
}
.order-ticket::before {
  content: '';
  display: block;
  height: 8px;
  margin: 0 -22px 13px;
  background: linear-gradient(90deg, var(--orange), var(--caramel), var(--turquoise));
}
.ticket-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ticket-brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  text-align: left;
}
.ticket-brand-lockup img { width: 48px; height: 48px; object-fit: contain; }
.ticket-brand-lockup strong,
.ticket-brand-lockup small { display: block; }
.ticket-brand-lockup strong { color: var(--coffee-dark); font-size: .82rem; letter-spacing: .07em; }
.ticket-brand-lockup small { color: var(--caramel); font-size: .62rem; font-weight: 800; }
.ticket-order-pill {
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--orange);
  font-size: .75rem;
  font-weight: 900;
}
.ticket-drink-icon {
  width: 84px;
  height: 84px;
  margin: 8px auto 2px;
}
.ticket-drink-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ticket-time {
  display: block;
  color: var(--caramel);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .11em;
  direction: ltr;
}
.order-ticket h2 {
  margin: 3px 0 3px;
  color: var(--coffee-dark);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  line-height: 1.06;
}
.ticket-helper {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}
.order-ticket ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}
.order-ticket li {
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--coffee-dark);
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(90,52,37,.07);
  font-size: .9rem;
  font-weight: 800;
}
.order-ticket li::before {
  content: '✓';
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border-radius: 50%;
  color: #fff;
  background: var(--turquoise-dark);
  font-size: .76rem;
}
.ticket-footer {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(90,52,37,.18);
  font-size: .76rem;
}
.ticket-footer strong {
  width: 35px;
  height: 35px;
  background: linear-gradient(135deg, var(--orange), var(--caramel));
}

/* Results retain the approved look, with the branded background */
.round-result-screen,
.final-screen {
  background:
    linear-gradient(180deg, rgba(248,238,220,.35), rgba(241,226,203,.36)),
    url('assets/game-background.png') center / cover no-repeat;
}
.final-cup {
  width: 118px;
  height: 118px;
  border-radius: 0;
  background: url('assets/cup.png') center / contain no-repeat;
  box-shadow: none;
  transform: none;
}
.final-cup::after,
.final-cup-lid,
.final-cup-logo { display: none; }

/* Tablet and narrow desktop */
@media (max-width: 850px) {
  .game-screen { padding-inline: 10px !important; gap: 6px !important; }
  .game-header { min-height: 40px; }
  .compact-order { min-height: 42px; }
  .play-layout {
    width: min(620px, 100%);
    grid-template-columns: minmax(190px, .9fr) minmax(210px, 1.1fr);
    gap: 12px;
  }
  .order-requirements { width: 100% !important; padding: 9px !important; }
  .requirement-item { min-height: 35px; padding: 4px 6px !important; }
  .requirement-copy strong { font-size: .68rem !important; }
  .requirement-copy small { font-size: .56rem !important; }
  .requirement-status { font-size: .59rem !important; }
  .cup-shell.size-small { width: 124px !important; height: 154px !important; }
  .cup-shell.size-medium { width: 137px !important; height: 171px !important; }
  .cup-shell.size-large { width: 151px !important; height: 188px !important; }
  .ingredient-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .ingredient-button { height: 60px !important; flex-direction: row !important; justify-content: center; gap: 4px !important; }
  .ingredient-icon-frame,
  .ingredient-icon-image { width: 34px !important; height: 34px !important; flex-basis: 34px !important; }
  .ingredient-button .ingredient-label { font-size: .6rem !important; }
  .finish-button { min-height: 43px !important; margin-top: 5px !important; }
}

/* Phones */
@media (max-width: 520px) {
  .game-screen { padding-inline: 7px !important; gap: 4px !important; }
  .mini-brand > span { display: none; }
  .game-header { grid-template-columns: 38px 1fr auto; min-height: 38px; }
  .compact-order { min-height: 39px; padding: 5px 8px; }
  .size-selector { gap: 3px !important; }
  .size-selector-title { font-size: .76rem !important; }
  .segmented-control { width: min(310px, 97vw); padding: 3px; }
  .segmented-control button { height: 32px !important; font-size: .68rem !important; gap: 4px; }
  .size-cup { width: 15px; height: 13px; }
  .play-layout {
    width: 100%;
    grid-template-columns: minmax(112px, .8fr) minmax(155px, 1.2fr);
    gap: 7px;
  }
  .cup-shell.size-small { width: 96px !important; height: 118px !important; }
  .cup-shell.size-medium { width: 104px !important; height: 128px !important; }
  .cup-shell.size-large { width: 112px !important; height: 138px !important; }
  .cup-brand { font-size: .62rem; }
  .build-summary { display: none !important; }
  .order-requirements { padding: 6px !important; border-radius: 14px; }
  .order-requirements-header { margin-bottom: 4px !important; }
  .order-requirements-header h3 { font-size: .67rem !important; }
  .order-requirements-header span { display: none; }
  .requirements-list { gap: 4px !important; }
  .requirement-item { min-height: 27px; padding: 3px 5px !important; border-radius: 9px !important; }
  .requirement-check { width: 16px !important; height: 16px !important; flex-basis: 16px; font-size: .55rem !important; }
  .requirement-copy strong { font-size: .57rem !important; }
  .requirement-copy small { display: none !important; }
  .requirement-status { font-size: .52rem !important; }
  .ingredient-button { height: 53px !important; padding: 3px !important; }
  .ingredient-icon-frame,
  .ingredient-icon-image { width: 29px !important; height: 29px !important; flex-basis: 29px !important; }
  .ingredient-button .ingredient-label { font-size: .52rem !important; }
  .finish-button { min-height: 40px !important; font-size: .88rem; }
  .ticket-brand-lockup img { width: 40px; height: 40px; }
  .ticket-drink-icon { width: 70px; height: 70px; }
  .order-ticket { padding-inline: 14px; }
  .order-ticket::before { margin-inline: -14px; }
  .order-ticket h2 { font-size: 1.55rem; }
  .order-ticket li { min-height: 34px; font-size: .82rem; }
}

/* Very short screens: compress height without overlap */
@media (max-height: 650px) {
  .game-screen { padding-top: 5px !important; padding-bottom: 5px !important; gap: 4px !important; }
  .game-header { min-height: 36px; }
  .compact-order { min-height: 37px; }
  .size-selector-title { font-size: .72rem !important; }
  .segmented-control button { height: 30px !important; }
  .play-layout { gap: 7px; }
  .cup-shell.size-small { width: 92px !important; height: 112px !important; }
  .cup-shell.size-medium { width: 99px !important; height: 121px !important; }
  .cup-shell.size-large { width: 106px !important; height: 130px !important; }
  .order-requirements { padding: 6px !important; }
  .requirement-item { min-height: 26px; }
  .ingredient-button { height: 48px !important; }
  .ingredient-icon-frame,
  .ingredient-icon-image { width: 27px !important; height: 27px !important; flex-basis: 27px !important; }
  .finish-button { min-height: 38px !important; margin-top: 4px !important; }
}

/* Complete live-requirements component reset */
.requirements-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.requirement-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  background: rgba(255,255,255,.66);
}
.requirement-item.done {
  background: rgba(88,169,164,.13);
  box-shadow: inset 0 0 0 1px rgba(88,169,164,.22);
}
.requirement-item.over {
  background: rgba(232,138,66,.14);
  box-shadow: inset 0 0 0 1px rgba(232,138,66,.22);
}
.requirement-main {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0;
}
.requirement-copy {
  min-width: 0;
}
.requirement-copy strong,
.requirement-copy small {
  display: block !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.requirement-check {
  display: grid !important;
  place-items: center !important;
  border-radius: 50%;
  color: var(--coffee-dark);
  background: rgba(90,52,37,.08);
  font-weight: 900;
}
.requirement-item.done .requirement-check {
  color: #fff;
  background: var(--turquoise-dark);
}
.requirement-item.over .requirement-check {
  color: #fff;
  background: var(--orange);
}
.requirement-status {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--coffee-dark);
  font-weight: 900;
}


/* === MVP final additions === */
.sound-toggle-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-inline-start: 3px;
  padding: 0;
  border: 1px solid rgba(90,52,37,.1);
  border-radius: 11px;
  color: var(--coffee-dark);
  background: rgba(255,250,240,.78);
  box-shadow: 0 4px 12px rgba(72,42,26,.07);
  cursor: pointer;
  font-size: 1rem;
}
.sound-toggle-button:active { transform: scale(.94); }

.ingredient-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}
.ingredient-button.utility {
  background: rgba(255,244,230,.92) !important;
}
.ingredient-button.undo {
  color: var(--turquoise-dark);
}
.ingredient-button.undo .ingredient-icon-fallback {
  font-size: 2rem;
  line-height: 1;
}
.ingredient-button.is-empty {
  opacity: .48;
}
.ingredient-button:disabled {
  cursor: default;
}

.finish-button.not-ready:not(:disabled) {
  opacity: .68;
  filter: saturate(.72);
}

.press-feedback { animation: mvpControlPress .24s ease; }
.limit-feedback { animation: mvpControlLimit .26s ease; }
.validation-error { animation: mvpValidationShake .3s ease; }
@keyframes mvpControlPress {
  45% { transform: scale(.94); }
}
@keyframes mvpControlLimit {
  35%, 75% { transform: translateX(3px); }
  55% { transform: translateX(-3px); }
}
@keyframes mvpValidationShake {
  25%, 75% { transform: translateX(4px); }
  50% { transform: translateX(-4px); }
}

.requirement-item.over .requirement-status {
  color: #b85d32;
}

.result-feedback-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  width: min(430px, 100%);
  margin-bottom: 17px;
}
.result-feedback-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 14px;
  text-align: right;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(90,52,37,.07);
}
.result-feedback-item.good {
  background: rgba(88,169,164,.12);
}
.result-feedback-item.bad {
  background: rgba(232,138,66,.13);
}
.result-feedback-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50%;
  color: #fff;
  background: var(--turquoise-dark);
  font-weight: 900;
}
.result-feedback-item.bad .result-feedback-icon {
  background: var(--orange);
}
.result-feedback-item strong {
  color: var(--coffee-dark);
  font-size: .82rem;
  line-height: 1.35;
}

@media (max-width: 850px) {
  .ingredient-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@media (max-width: 520px) {
  .sound-toggle-button { width: 30px; height: 30px; border-radius: 9px; font-size: .88rem; }
  .result-feedback-item { min-height: 39px; padding: 7px 9px; }
  .result-feedback-item strong { font-size: .75rem; }
}


/* MVP header stability on narrow screens */
.logo-mark.small {
  flex: 0 0 38px;
}
.mini-brand {
  flex-shrink: 0;
}
.coupon-box.locked strong {
  filter: none !important;
}
@media (max-width: 520px) {
  .game-header {
    grid-template-columns: auto 1fr auto !important;
  }
  .logo-mark.small {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px;
  }
  .mini-brand { gap: 4px; }
}
