* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior: none;
}
body {
  font-family: ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  color: #36555d;
  background:
    radial-gradient(ellipse at 20% 5%, #f9f6df 0, transparent 45%),
    linear-gradient(145deg, #e1f2e6, #c6e6e3 60%, #dfebdf);
  user-select: none;
  -webkit-user-select: none;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 3px solid #e58a43;
  outline-offset: 4px;
}
button:active {
  filter: brightness(0.96);
  translate: 0 2px;
}
#app {
  width: min(100%, 470px);
  margin: auto;
  padding: max(12px, env(safe-area-inset-top)) 18px
    max(12px, env(safe-area-inset-bottom));
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px 18px;
}
.brand {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -3px;
  color: #337277;
  line-height: 1;
}
.brand span {
  display: block;
  font-size: 9px;
  letter-spacing: 1.3px;
  font-weight: 650;
  margin-top: 7px;
  color: #67878a;
}
.sound {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f2f7e9;
  box-shadow:
    0 3px 0 #b8d2c9,
    0 5px 10px #5b87831a;
  font-size: 23px;
}
.sound span {
  display: block;
  font-size: 8px;
  line-height: 7px;
  font-weight: 700;
}
.sound[aria-pressed="true"] {
  background: #ffdc95;
}
.machine {
  position: relative;
  border-radius: 32px 32px 28px 28px;
  padding: 20px 20px 10px;
  background: linear-gradient(105deg, #fefef3 0, #edf3e9 58%, #dbe6db 100%);
  border: 2px solid #f9fff1;
  box-shadow:
    inset -5px -7px 12px #98b5a537,
    inset 3px 3px 4px white,
    0 13px 0 -5px #a6c5bb,
    0 24px 34px -12px #658b8970;
}
.machine:before,
.machine:after {
  content: "";
  position: absolute;
  bottom: -15px;
  width: 42px;
  height: 12px;
  background: #789994;
  border-radius: 0 0 8px 8px;
  z-index: -1;
}
.machine:before {
  left: 35px;
}
.machine:after {
  right: 35px;
}
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 51px;
  margin-bottom: 18px;
}
.drawer {
  width: 73px;
  height: 44px;
  flex-shrink: 0;
  background: linear-gradient(#fbfff5, #dbe6da);
  border: 1px solid #bbcfc4;
  border-radius: 9px;
  box-shadow: 0 3px 3px #7f9c8e25;
  position: relative;
  transition: transform 0.3s;
}
.drawer span {
  font-size: 25px;
  color: #8da69b;
}
.drawer i {
  display: block;
  width: 32px;
  height: 4px;
  margin: auto;
  background: #b3c8bc;
  border-radius: 3px;
}
.drawer.open {
  transform: translateY(10px) scaleY(1.25);
}
.display {
  height: 51px;
  flex: 1;
  min-width: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #274c50, #183c43);
  border: 4px solid #d5dfd2;
  box-shadow:
    inset 0 2px 6px #102b33,
    0 1px 0 #fff;
  text-align: center;
  color: #d3f4c1;
  padding: 5px 3px;
  position: relative;
}
.display output {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 700;
}
.display small {
  display: block;
  font-size: 8px;
  color: #87bbaa;
  margin-top: 1px;
  letter-spacing: 0.6px;
}
.led {
  position: absolute;
  top: 7px;
  left: 6px;
  width: 4px;
  height: 4px;
  background: #adffc2;
  box-shadow: 0 0 5px #aaffbe;
  border-radius: 50%;
}
.dial {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  border: 3px solid #cad8cb;
  border-radius: 50%;
  background: linear-gradient(135deg, #fffef1, #bdcfc4);
  box-shadow: 2px 3px 4px #56776733;
  position: relative;
}
.dial i {
  position: absolute;
  width: 4px;
  height: 12px;
  border-radius: 3px;
  background: #6b9b95;
  left: 18px;
  top: 3px;
  transform-origin: 2px 16px;
  transition: transform 0.6s;
}
.porthole {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  perspective: 800px;
  border-radius: 50%;
  background: #769491;
  box-shadow:
    0 3px 0 #fcfff5,
    0 -3px 4px #9ab7a8,
    inset 0 0 0 4px #afc4b8,
    inset 0 0 0 11px #eff5e9;
  touch-action: none;
}
#scene {
  position: absolute;
  inset: 7%;
  width: 86%;
  height: 86%;
  border-radius: 50%;
  touch-action: none;
  box-shadow:
    0 0 0 7px #516f72,
    inset 0 10px 10px #132b36;
}
#door {
  padding: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 12px solid #e6eee2;
  background: transparent;
  box-shadow:
    inset 0 0 0 3px #acbfb4,
    inset 0 0 0 8px #eaf2e7,
    0 5px 7px #1c3d4240,
    0 0 0 1px #b4c9bb;
  transform-origin: 7% 50%;
  /* Filter + 3D transform transitions crash WebKit's compositor. */
  filter: none;
  transition: transform 0.65s cubic-bezier(0.2, 0.9, 0.25, 1);
  touch-action: none;
  z-index: 3;
}
.glass {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 4px solid #84a6a795;
  background:
    radial-gradient(ellipse at 35% 28%, #d4eff41b, transparent 60%),
    linear-gradient(145deg, #ccedf21a, transparent 50%, #051d3730);
  box-shadow:
    inset 0 0 17px 9px #041d3045,
    inset 0 -5px 13px #a1dae754;
}
.glass:before {
  content: "";
  position: absolute;
  left: 15%;
  top: 8%;
  width: 50%;
  height: 25%;
  border-radius: 100% 30% 100% 20%;
  background: linear-gradient(150deg, #fff9, #ffffff03);
  transform: rotate(-20deg);
}
.glass:after {
  content: "";
  position: absolute;
  right: 9%;
  bottom: 13%;
  height: 30%;
  width: 10%;
  border-right: 3px solid #edfdf57a;
  border-radius: 50%;
  transform: rotate(30deg);
}
.handle {
  position: absolute;
  right: 0;
  top: 39%;
  width: 18px;
  height: 23%;
  border-radius: 9px;
  background: linear-gradient(90deg, #fafff2, #b6c9be);
  box-shadow: 2px 2px 3px #45675c40;
}
.hinge {
  position: absolute;
  top: 40%;
  left: -2px;
  width: 12px;
  height: 20%;
  border-radius: 4px;
  background: linear-gradient(90deg, #b2c8bc, #eff6e8);
  z-index: 4;
}
#door[aria-expanded="true"] {
  transform: rotateY(-112deg);
}
.porthole.open {
  box-shadow:
    0 3px 0 #fff,
    0 0 14px #ebd78d80;
}
.programs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 14px;
}
.programs button {
  flex: 1;
  max-width: 99px;
  min-height: 57px;
  border-radius: 15px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  color: #7b958e;
  border: 1px solid transparent;
  transition: background 0.2s;
}
.programs b {
  display: block;
  font-size: 23px;
  line-height: 26px;
}
.programs button[aria-pressed="true"] {
  background: #e0ebe0;
  border-color: #becfbd;
  box-shadow: inset 0 2px 3px #78957c25;
  color: #376d6e;
}
.programs button[data-mode="turbo"] b {
  color: #d6a248;
  font-size: 29px;
}
.actions {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 0 5px;
}
.actions button {
  min-height: 56px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.actions button span {
  font-size: 24px;
}
#foam {
  flex: 1;
  background: linear-gradient(#e0f4f1, #c4e3e0);
  box-shadow:
    0 4px 0 #a9cac4,
    inset 0 1px 1px white;
  color: #487e86;
}
#start {
  flex: 1.15;
  background: linear-gradient(#fbd190, #efb775);
  color: #7b5739;
  box-shadow:
    0 5px 0 #c99559,
    inset 0 2px 1px #ffedc1;
}
#start b {
  font-size: 17px;
}
#start.running {
  background: linear-gradient(#eab599, #d6957c);
}
.base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 6px 0;
  font-size: 8px;
  color: #9eb2a6;
  letter-spacing: 1px;
}
.base i {
  width: 42px;
  height: 3px;
  border-radius: 4px;
  background: #b7c9bc;
}
.basket {
  margin-top: 26px;
  padding: 0 3px;
}
.basket-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #69918a;
  margin: 0 6px 7px;
  font-weight: 750;
}
.basket-title button {
  background: none;
  width: 38px;
  height: 24px;
  color: #69918a;
  letter-spacing: 2px;
}
#collection {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 10px;
  scrollbar-width: none;
  touch-action: pan-x;
  min-height: 77px;
}
.item {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 64px;
  border-radius: 16px;
  background: #eef5e6a6;
  box-shadow: 0 3px 0 #a9c6b85c;
  border: 1px solid #f5ffedcc;
  touch-action: pan-x;
  padding: 5px;
}
.item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px #365c4c22);
}
.item.add {
  position: sticky;
  right: 0;
  z-index: 3;
  font-size: 34px;
  color: #527f72;
  background: #deebdc;
  border: 2px dashed #95b9a7;
  box-shadow: none;
  touch-action: manipulation;
}
.delete {
  position: absolute;
  right: -4px;
  top: -5px;
  background: #d57a64;
  color: white;
  border-radius: 50%;
  height: 23px;
  width: 23px;
  padding: 0;
  font-size: 17px;
  z-index: 2;
}
#photo-choices {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}
#photo-choices button {
  padding: 12px;
  border-radius: 14px;
  background: #f4f7e9;
  font-size: 13px;
}
footer {
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  color: #7c9d91;
  padding-top: 13px;
}
.ghost {
  position: fixed;
  width: 58px;
  height: 58px;
  pointer-events: none;
  z-index: 999;
  filter: drop-shadow(0 9px 5px #284c5444);
  transform: translate(-50%, -50%) rotate(-8deg);
}
#powder-effect {
  pointer-events: none;
  position: absolute;
  top: 66px;
  left: 25px;
  color: white;
  text-shadow: 0 1px 3px #86b8be;
  opacity: 0;
  font-size: 22px;
}
.powder-puff {
  animation: powder 0.9s ease-out;
}
.pulse {
  animation: pulse 0.35s ease-out;
}
.shake {
  animation: shake 0.13s infinite alternate;
}
@keyframes powder {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(70px) scale(1.8);
  }
}
@keyframes pulse {
  50% {
    transform: scale(1.055);
  }
}
@keyframes shake {
  from {
    translate: -0.7px 0;
  }
  to {
    translate: 0.7px 0.5px;
  }
}
@media (min-width: 800px) {
  #app {
    padding-top: 28px;
    width: 470px;
  }
  header {
    padding-bottom: 23px;
  }
  .machine {
    padding: 24px 26px 13px;
  }
  .basket {
    margin-top: 28px;
  }
}
@media (max-height: 740px) and (max-width: 600px) {
  #app {
    width: min(100%, 375px);
    padding: max(8px, env(safe-area-inset-top)) 17px
      max(12px, env(safe-area-inset-bottom));
  }
  .porthole {
    max-width: 245px;
    margin-inline: auto;
  }
  header {
    padding-bottom: 10px;
  }
  .brand {
    font-size: 32px;
  }
  .brand span {
    font-size: 8px;
  }
  .sound {
    width: 39px;
    height: 39px;
  }
  .machine {
    padding: 13px 16px 8px;
    border-radius: 25px;
  }
  .top {
    height: 40px;
    margin-bottom: 12px;
    gap: 10px;
  }
  .display {
    height: 44px;
  }
  .drawer {
    height: 37px;
    width: 61px;
  }
  .dial {
    width: 38px;
    height: 38px;
  }
  .dial i {
    left: 14px;
    top: 2px;
    transform-origin: 2px 14px;
  }
  .programs {
    margin: 10px 0;
  }
  .programs button {
    min-height: 45px;
    font-size: 10px;
  }
  .programs b {
    font-size: 20px;
    line-height: 23px;
  }
  .actions button {
    min-height: 48px;
    border-radius: 16px;
  }
  .base {
    margin-top: 12px;
  }
  .basket {
    margin-top: 20px;
  }
  .basket-title {
    margin-bottom: 0;
  }
  .item {
    width: 52px;
    flex-basis: 52px;
    height: 56px;
  }
  #collection {
    min-height: 68px;
  }
  footer {
    padding-top: 4px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shake {
    animation: none;
  }
  #door {
    transition-duration: 0.25s;
  }
}
