/* Order Up!: a teal cafe wall and wooden counter on top, a cream menu card below. */

body.game {
  --bg-top: #1f6f6a;
  --bg-bottom: #0f3d3b;
  --hud-ink: #fff;
  --hud-chip: rgba(255, 255, 255, .15);
}
.subhud .chip { white-space: nowrap; }
.subhud .ou-score b { font-size: 16px; }
.subhud .ou-mult { font-weight: 800; transition: background .2s; }
.subhud .ou-mult.hot { background: var(--turmeric); color: var(--ink); }
.subhud .ou-hearts { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; }
.ou-heart { display: inline-grid; width: 18px; height: 18px; transition: opacity .3s, filter .3s, transform .3s; }
.ou-heart svg { width: 100%; height: 100%; }
.ou-heart.off { opacity: .35; filter: grayscale(1); transform: scale(.8); }
.ou-hearts.hurt { animation: ou-hurt .5s ease; }
.ou-hearts.bump { animation: ou-bump .4s ease; }
@keyframes ou-bump { 50% { transform: scale(1.15); background: rgba(47, 143, 107, .7); } }
@keyframes ou-hurt { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); background: rgba(230, 50, 40, .6); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

.ou-stage { display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; }

/* ---------- the counter scene ---------- */
.ou-scene { position: relative; flex: 1 1 auto; min-height: 210px; overflow: hidden; }
.ou-wall::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; opacity: .85;
  background: linear-gradient(135deg, #f2b33d 25%, transparent 25%) 0 0 / 22px 22px, linear-gradient(225deg, #f2b33d 25%, transparent 25%) 0 0 / 22px 22px;
}
.ou-wall {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 22px, transparent 22px 44px),
    radial-gradient(ellipse at 50% 20%, rgba(255, 230, 170, .25), transparent 60%);
}
.ou-counter {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px; z-index: 2;
  background: linear-gradient(180deg, #c98a4b 0 6px, #a86a33 6px, #7d4a20);
  box-shadow: 0 -4px 0 rgba(0, 0, 0, .15);
}
.ou-people {
  position: absolute; left: 0; right: 0; bottom: 26px; top: 16px;
  display: flex; justify-content: center; align-items: flex-end; gap: 10px; padding: 0 10px;
}
.ou-cust {
  position: relative; display: grid; justify-items: center; align-content: end; width: min(100%, 300px); height: 100%;
  animation: ou-in .45s cubic-bezier(.2, 1.2, .4, 1) both;
}
.ou-people.two .ou-cust { width: 50%; }
.ou-cust.idle { opacity: .9; }
.ou-cust.leave { animation: ou-out .3s ease-in both; }
@keyframes ou-in { from { transform: translateX(60px); opacity: 0; } }
@keyframes ou-out { to { transform: translateX(-70px); opacity: 0; } }
.ou-face { width: 104px; height: 104px; margin-bottom: -16px; position: relative; z-index: 1; transition: transform .2s; }
.ou-face svg { width: 100%; height: 100%; }
.ou-people.two .ou-face { width: 76px; height: 76px; }
.ou-cust.talking .ou-face { animation: ou-talk .5s ease-in-out infinite; }
.ou-cust.done .ou-face { animation: ou-hop .45s ease; }
@keyframes ou-talk { 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes ou-hop { 40% { transform: translateY(-12px); } }
.ou-name {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 0 10px; border-radius: 999px; background: #fff; color: var(--ink);
  font-weight: 800; font-size: 13px; line-height: 22px; white-space: nowrap; box-shadow: 0 0 0 2px rgba(0, 0, 0, .12);
}
.ou-cust.asking .ou-name { background: var(--turmeric); }

.ou-bubble {
  position: relative; margin-bottom: 18px; min-width: 132px; min-height: 120px; max-width: 100%; padding: 10px 12px 8px;
  display: grid; place-items: center; gap: 4px; border-radius: 22px; background: #fffaf1; color: var(--ink);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
}
.ou-bubble::after {
  content: ""; position: absolute; bottom: -10px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-bottom: 0;
  border-top-color: #fffaf1;
}
.ou-people.two .ou-bubble { min-width: 0; width: 100%; min-height: 104px; }
.ou-cust.idle .ou-bubble { visibility: hidden; }
.ou-flash { display: grid; place-items: center; min-height: 88px; }
.ou-people.two .ou-flash { min-height: 76px; }
.ou-q { font: 700 52px/1 var(--display); color: #c7b79c; }
.ou-heartbub { font-size: 50px; line-height: 1; color: #e5484d; animation: ou-pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.ou-dots { display: flex; gap: 5px; min-height: 8px; }
.ou-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e3d6c0; }
.ou-dots i.on { background: var(--chili); }

/* food tokens */
.ou-ic {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 30%;
  background: var(--tok); box-shadow: inset 0 0 0 2.5px var(--tok-ink);
}
.ou-ic svg { width: 80%; height: 80%; }
.ou-ic.big { width: 84px; height: 84px; animation: ou-pop .3s cubic-bezier(.2, 1.6, .4, 1) both; box-shadow: inset 0 0 0 3.5px var(--tok-ink); }
.ou-people.two .ou-ic.big { width: 70px; height: 70px; }
.ou-ic.big.out { animation: ou-fade .18s ease-in both; }
@keyframes ou-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes ou-fade { to { transform: scale(.7); opacity: 0; } }
.ou-qty {
  position: absolute; right: -8px; top: -8px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px;
  background: var(--chili); color: #fff; font: 800 17px/30px var(--font); text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .2);
}
.ou-cand .ou-qty, .ou-slot .ou-qty { min-width: 20px; height: 20px; font-size: 12px; line-height: 20px; right: -6px; top: -6px; padding: 0 4px; }
.ou-same-q { font-weight: 800; font-size: 16px; }
.ou-cand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 280px; }
.ou-cand .ou-ic { width: 38px; height: 38px; }

.ou-start {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; align-content: center; gap: 10px; border: 0;
  background: rgba(15, 61, 59, .35); color: #fff; font: 800 19px/1.25 var(--font); padding: 0 24px; text-align: center;
}
.ou-start b { padding: 10px 20px; border-radius: 16px; background: rgba(0, 0, 0, .5); }
.ou-pulse { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff; animation: ou-pulse 1.2s ease-out infinite; }
@keyframes ou-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* ---------- tray + menu card ---------- */
.ou-panel {
  flex: none; background: var(--paper); color: var(--ink); border-radius: 24px 24px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px -10px rgba(0, 0, 0, .4);
  display: grid; gap: 6px;
}
.ou-tray-label { text-align: center; font-weight: 800; font-size: 15px; line-height: 1.25; min-height: 19px; color: var(--ink-soft); text-wrap: balance; }
.ou-tray-label.go { color: var(--mint); }
.ou-tray {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 48px; padding: 4px; border-radius: 16px;
  background: #f3e7d3; transition: background .3s;
}
.ou-tray.served { background: #d6f0e2; }
.ou-slot { width: 40px; height: 40px; border-radius: 30%; border: 2.5px dashed #cdb894; display: grid; place-items: center; }
.ou-tray.small .ou-slot, .ou-tray.small .ou-slot .ou-ic { width: 32px; height: 32px; }
.ou-slot.full { border: 0; }
.ou-slot.full .ou-ic { animation: ou-pop .22s cubic-bezier(.2, 1.6, .4, 1) both; }
.ou-slot.ghost { border-style: solid; border-color: #e5484d; }
.ou-slot.ghost .ou-ic { opacity: .55; }
.ou-slot.wrong { border: 3px solid #e5484d; animation: ou-shake .4s ease; }
@keyframes ou-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.ou-menu-wrap { position: relative; }
.ou-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; transition: opacity .2s; }
.ou-menu[data-n="12"] { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ou-menu.off { opacity: .55; }
.ou-item {
  display: grid; justify-items: center; gap: 2px; min-height: 76px; padding: 6px 2px 4px; border: 0; border-radius: 16px;
  background: #fff; box-shadow: 0 3px 0 var(--line), inset 0 0 0 1.5px var(--line); color: var(--ink); touch-action: manipulation;
  transition: transform .08s;
}
.ou-item .ou-ic { width: 48px; height: 48px; }
.ou-menu[data-n="12"] .ou-item { min-height: 70px; }
.ou-menu[data-n="12"] .ou-item .ou-ic { width: 44px; height: 44px; }
.ou-lbl { font-size: 13px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ou-item:active { transform: scale(.94); }
.ou-item.hit { animation: ou-hit .25s ease; }
.ou-item.miss { animation: ou-shake .4s ease; box-shadow: 0 3px 0 #e5484d, inset 0 0 0 2.5px #e5484d; }
@keyframes ou-hit { 50% { transform: scale(.9); background: #e5f6ec; } }

.ou-yesno { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 4px; background: rgba(255, 250, 241, .85); }
.ou-yn {
  border: 0; border-radius: 20px; font: 800 24px/1 var(--font); color: #fff; min-height: 64px; transition: transform .1s, filter .2s;
}
.ou-yn.yes { background: var(--mint); box-shadow: 0 5px 0 #1f6b4f; }
.ou-yn.no { background: var(--chili); box-shadow: 0 5px 0 var(--chili-2); }
.ou-yn:active { transform: translateY(3px); }
.ou-yn:disabled { filter: saturate(.6); }
.ou-yn.right { outline: 5px solid var(--turmeric); }
.ou-yn.wrong { animation: ou-shake .4s ease; }

/* ---------- effects ---------- */
.ou-banner {
  position: absolute; left: 50%; top: 16%; z-index: 6; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  padding: 10px 22px; border-radius: 18px; background: var(--turmeric); color: var(--ink); font: 700 26px/1.1 var(--display);
  white-space: nowrap; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); transition: opacity .2s, transform .25s cubic-bezier(.2, 1.5, .4, 1);
}
.ou-banner.twist { background: #fff; font: 800 16px/1.25 var(--font); white-space: normal; width: max-content; max-width: calc(100% - 32px); text-align: center; top: 12%; }
.ou-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ou-float {
  position: absolute; z-index: 7; pointer-events: none; transform: translate(-50%, 0); font-weight: 800; font-size: 16px; color: var(--mint);
  animation: ou-up .8s ease-out both;
}
@keyframes ou-up { to { transform: translate(-50%, -34px); opacity: 0; } }

@media (max-height: 760px) {
  .ou-face, .ou-people.two .ou-face { width: 70px; height: 70px; margin-bottom: -10px; }
  .ou-bubble, .ou-people.two .ou-bubble { min-height: 0; margin-bottom: 14px; padding: 8px 10px 6px; }
  .ou-flash, .ou-people.two .ou-flash { min-height: 64px; }
  .ou-ic.big, .ou-people.two .ou-ic.big { width: 62px; height: 62px; }
  .ou-item, .ou-menu[data-n="12"] .ou-item { min-height: 62px; padding-top: 4px; }
  .ou-item .ou-ic, .ou-menu[data-n="12"] .ou-item .ou-ic { width: 40px; height: 40px; }
  .ou-lbl { font-size: 12.5px; }
  .ou-panel { gap: 5px; padding-top: 6px; }
  .ou-slot, .ou-slot .ou-ic { width: 36px; height: 36px; }
  .ou-tray { min-height: 44px; }
}
@media (min-width: 700px) {
  .ou-panel { width: 100%; max-width: 560px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ou-stage *, .ou-stage *::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
