.pretend-cafe {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  gap: clamp(8px, 1.6dvh, 18px);
  padding: clamp(10px, 2.5dvh, 26px) max(10px, calc((100% - 1120px) / 2));
  background: #0b667e url('/assets/pretend-cafe/v2/counter.webp') center/cover;
}
.pretend-cafe[hidden] { display: none; }
body:has(.pretend-cafe) .picture-action > span:not([aria-hidden]) { display: none; }
body:has(.pretend-cafe) .play-header .picture-action > span[aria-hidden] { font-size: 24px; }
body:has(.pretend-cafe) .play-header { background: #fff4dc; }
.pretend-cafe img { display: block; user-select: none; pointer-events: none; }
.cafe-progress { display: flex; justify-content: center; gap: 8px; }
.cafe-progress i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  background: #20617f;
  box-shadow: 0 2px 4px #17254d66;
}
.cafe-progress .filled { background: #ffce45; }
.cafe-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  gap: clamp(10px, 2.7vw, 34px);
  align-items: stretch;
  width: 100%;
}
.cafe-stage figure, .cafe-payment, .cafe-confirm {
  min-height: 0;
  min-width: 0;
  margin: 0;
  border-radius: clamp(16px, 3vw, 36px);
  border: 3px solid #fffdf0;
  box-shadow: 0 8px 0 #142f6a58, 0 18px 28px #10265750;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 42%, #fffdf4, #ffe2a5);
}
.cafe-stage .cafe-ticket {
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 8px;
}
.cafe-stage figure { overflow: hidden; pointer-events: none; }
.cafe-stage .cafe-work { background: radial-gradient(ellipse at 50% 42%, #d9fffa, #75d4e8); }
.cafe-recipe {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: clamp(3px, .7vw, 10px);
  padding-block: 6px;
}
.cafe-recipe span {
  width: min(17%, 56px);
  aspect-ratio: 1;
  padding: 3px;
  border: 2px solid #dfbc84;
  border-radius: 11px;
  background: #fffbec;
}
.cafe-recipe .active { background: #ffd663; border-color: #166579; }
.cafe-recipe img, .cafe-tools img { width: 100%; height: 100%; object-fit: contain; }
.cafe-dish { position: relative; width: min(100%, 440px, 60dvh); aspect-ratio: 1.13; max-height: 100%; }
.cafe-dish-plate { position: absolute; inset: 0; margin: auto; top: 40%; width: 95%; max-height: 54%; object-fit: contain; }
.cafe-piece { position: absolute; width: 35%; height: 38%; object-fit: contain; }
.cafe-piece.ghost { opacity: .12; filter: grayscale(1); }
.cafe-stack .cafe-piece { left: 18%; width: 64%; height: 45%; object-position: center bottom; }
.cafe-stack .piece-0 { bottom: 24%; }
.cafe-stack .piece-1 { bottom: 30%; }
.cafe-stack .piece-2 { bottom: 36%; }
.cafe-stack .piece-3 { bottom: 42%; }
.cafe-pasta .piece-0 { left: 20%; bottom: 28%; transform: rotate(-18deg); }
.cafe-pasta .piece-1 { left: 39%; bottom: 39%; transform: rotate(19deg); }
.cafe-pasta .piece-2 { left: 47%; bottom: 25%; transform: rotate(-9deg); }
.cafe-fish .piece-0 { left: 10%; bottom: 27%; width: 60%; height: 50%; transform: rotate(-10deg); }
.cafe-fish .piece-1 { left: 54%; bottom: 33%; transform: rotate(37deg); }
.cafe-fish .piece-2 { left: 59%; bottom: 34%; transform: rotate(45deg); }
.cafe-fish .piece-3 { left: 62%; bottom: 29%; transform: rotate(32deg); }
.cafe-fish .piece-4 { left: 59%; bottom: 25%; transform: rotate(52deg); }
.cafe-breakfast .piece-0 { left: 13%; bottom: 27%; width: 55%; height: 50%; }
.cafe-breakfast .piece-1 { left: 52%; bottom: 34%; transform: rotate(-40deg); }
.cafe-breakfast .piece-2 { left: 60%; bottom: 25%; transform: rotate(-35deg); }
.cafe-tools { position: relative; z-index: 1; display: flex; gap: clamp(4px, 1.3vw, 16px); justify-content: center; align-items: center; }
.pretend-cafe button {
  box-sizing: border-box;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  width: clamp(44px, 13vw, 116px);
  height: clamp(48px, 12dvh, 104px);
  padding: clamp(4px, 1vw, 12px);
  border: 2px solid #fffdf0;
  border-radius: clamp(12px, 2vw, 24px);
  background: #fff3cf;
  box-shadow: 0 5px 0 #17396c, inset 0 -5px #e9b7604d;
}
.pretend-cafe button:hover { background: #fff9e8; }
.pretend-cafe button:focus-visible { outline: 4px solid #ffca38; outline-offset: 2px; }
.pretend-cafe .cafe-undo { color: #143d68; width: clamp(44px, 7vw, 70px); font-size: clamp(24px, 5vw, 44px); line-height: 1; }
.pretend-cafe [data-control="register"], .pretend-cafe [data-control="serve"], .pretend-cafe [data-control="next"] { background: #ffda59; }
.cafe-payment {
  position: relative;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: clamp(8px, 2vw, 20px);
}
.cafe-reader { min-height: 0; height: 100%; width: 85%; position: relative; }
.cafe-reader img, .cafe-confirm img { width: 100%; height: 100%; object-fit: contain; }
.cafe-payment [data-control="card"] { width: clamp(65px, 20vw, 144px); }
.cafe-payment button img { width: 100%; height: 100%; object-fit: contain; }
.cafe-tapping [data-control="card"] { transition: transform .45s ease; transform: translate(var(--tap-x), var(--tap-y)) scale(.78); }
.cafe-confirm img { max-width: 70%; max-height: 70%; }
.cafe-delivered .cafe-work .cafe-dish { animation: cafe-delivered .48s ease both; }
.cafe-try { animation: cafe-try .28s ease-out; }
@keyframes cafe-try { 30% { transform: translateX(-5px); } 65% { transform: translateX(5px); } }
@keyframes cafe-delivered { to { transform: translateX(40%) scale(.68); opacity: .25; } }
.cafe-sr,
body:has(.pretend-cafe) .reward-card h2,
body:has(.pretend-cafe) .reward-message {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 600px) and (orientation: portrait) {
  .cafe-stage { grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .cafe-dish { width: min(100%, 34dvh); }
  .cafe-stage .cafe-ticket { padding: 4px; }
  .cafe-recipe { padding-block: 3px; }
  .cafe-recipe span { width: min(14%, 38px); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .pretend-cafe { padding-block: 7px; }
  .cafe-dish { width: min(100%, 40dvh); }
  .cafe-recipe { padding-block: 2px; }
  .cafe-recipe span { max-width: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .cafe-try, .cafe-delivered .cafe-work .cafe-dish { animation: none; }
  .cafe-tapping [data-control="card"] { transition: none; }
}
.cafe-launch { position: relative; padding: 0; overflow: hidden; }
.cafe-launch .launch-cover-button { display: block; width: 100%; padding: 0; border: 0; }
.cafe-launch img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }
.cafe-launch .cover-play { display: none; }
.cafe-launch .cafe-start {
  display: grid;
  place-items: center;
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(60px, 12vw, 100px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #fffbea;
  box-shadow: 0 6px 0 #854416, 0 12px 24px #38284988;
  font-size: clamp(24px, 5vw, 42px);
  color: #292148;
  background: #ffcf45;
}
