* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none !important
}

html,
body {
  height: 100%;
  background: #2b1d16;
  font-family: "Trebuchet MS", sans-serif;
  overflow: hidden
}

body {
  display: flex;
  align-items: center;
  justify-content: center
}

/* Fundos são 3:2 (1536x1024): o palco tem a mesma proporção, nada é cortado */
#stage {
  position: relative;
  width: min(100vw, 150vh);
  aspect-ratio: 3/2;
  overflow: hidden;
  background: #000;
  font-size: min(1.6vw, 2.4vh);
  user-select: none
}

img {
  -webkit-user-drag: none;
  user-select: none;
  display: block
}

#loading {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: #2b1d16;
  color: #ffe9c2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  transition: opacity .5s
}

#loading.done {
  opacity: 0;
  pointer-events: none
}

/* Pata do gato (cursor) */
#paw {
  position: fixed;
  left: -200px;
  top: -200px;
  width: min(8vw, 12vh);
  z-index: 999;
  pointer-events: none;
  transform: translate(-40%, -15%);
  transition: transform .12s ease
}

#paw.press {
  transform: translate(-40%, -15%) scale(.9)
}

#paw.hold {
  transform: translate(-50%, -40%) scale(.95)
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
  background-size: 100% 100%;
  transform: scale(1.03)
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1)
}

#scene-orders {
  background-image: url("bancadaPedidos.png")
}

#scene-tea {
  background-image: url("bancada preparo.png")
}

#scene-food {
  background-image: url("bancadaComidas.png")
}

.pill {
  border: 0;
  background: #e8b878;
  color: #4a2a18;
  font-weight: bold;
  padding: .4em 1em;
  border-radius: 2em;
  font-size: 1em;
  transition: transform .2s, background .2s
}

.pill:hover {
  transform: scale(1.08)
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  gap: .8em;
  padding: .6em 1em;
  pointer-events: none;
  align-items: center
}

#hud>* {
  pointer-events: auto
}

#coins,
#music-ctrl {
  background: rgba(70, 40, 25, .85);
  color: #ffe9c2;
  padding: .35em .9em;
  border-radius: 2em;
  font-weight: bold;
  border: 2px solid #e8b878;
  display: flex;
  align-items: center;
  gap: .5em
}

#hud .pill {
  padding: .55em 1.1em;
  border: 2px solid #e8b878;
  line-height: 1.2
}

#music-ctrl {
  padding: .3em 1.1em .3em .4em;
  transition: transform .2s, background .2s
}

#music-ctrl:hover {
  transform: scale(1.05);
  background: rgba(110, 65, 40, .95)
}

#btn-play {
  border: 0;
  background: #e8b878;
  border-radius: 50%;
  width: 2.3em;
  height: 2.3em;
  font-size: 1em;
  pointer-events: none;
  flex: none
}

/* todos os itens do topo com a mesma altura */
#coins,
#music-ctrl,
#hud .pill {
  height: 3em;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 1em;
  line-height: 1;
  white-space: nowrap
}

/* itens que podem ser removidos com um clique */
.removable {
  cursor: none;
  transition: filter .2s, scale .2s
}

.removable:hover {
  scale: 1.06;
  filter: drop-shadow(0 0 .5em rgba(255, 110, 90, .95))
}

#pot-items img {
  pointer-events: auto;
  transition: scale .2s, box-shadow .2s
}

#pot-items img:hover {
  scale: 1.15;
  box-shadow: 0 0 .6em rgba(255, 110, 90, .95);
  border-color: #e0674f
}

#plate-zone:has(.pl):hover {
  box-shadow: 0 0 1.2em rgba(255, 110, 90, .8)
}

#toast {
  margin-left: auto;
  background: #fff6e6;
  color: #5a3320;
  padding: .4em 1em;
  border-radius: 1em;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  transform: translateY(-10px)
}

#toast.show {
  opacity: 1;
  transform: none
}

.arrow {
  position: absolute;
  top: 50%;
  z-index: 25;
  transform: translateY(-50%);
  border: 0;
  background: rgba(70, 40, 25, .7);
  color: #ffe9c2;
  font-size: 1.6em;
  width: 1.6em;
  height: 2.4em;
  border-radius: .6em;
  transition: all .25s
}

.arrow:hover {
  background: rgba(120, 70, 40, .9);
  transform: translateY(-50%) scale(1.1)
}

.arrow.left {
  left: .5%
}

.arrow.right {
  right: .5%
}

.hidden {
  display: none
}

/* Navegação direta entre as 3 cenas */
#nav {
  position: absolute;
  left: 50%;
  bottom: 1.5%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  gap: .5em;
  background: rgba(60, 32, 20, .8);
  padding: .35em .5em;
  border-radius: 2em;
  border: 2px solid #c9976a
}

#nav .pill {
  background: transparent;
  color: #ffe9c2;
  padding: .3em .9em
}

#nav .pill.cur {
  background: #e8b878;
  color: #4a2a18
}

/* Pedido resumido nas cenas 2 e 3 (canto livre, não cobre as prateleiras) */
#order-mini {
  position: absolute;
  right: 1.5%;
  top: 8%;
  z-index: 20;
  background: rgba(255, 250, 240, .93);
  border: 3px solid #c9976a;
  border-radius: 1em;
  padding: .3em .6em;
  display: flex;
  gap: .3em;
  align-items: center;
  font-size: .85em;
  color: #5a3320;
  font-weight: bold
}

#order-mini img {
  height: 2.8em;
  width: 2.8em;
  object-fit: contain
}

/* ---------- Cena 1 ---------- */
#customer-wrap {
  position: absolute;
  left: 36%;
  bottom: 27%;
  height: 30%;
  transition: transform .6s cubic-bezier(.3, 1.4, .5, 1), opacity .5s;
  transform: translateX(-150%);
  opacity: 0
}

#customer-wrap.in {
  transform: none;
  opacity: 1
}

#customer {
  height: 100%;
  width: auto
}

#customer-wrap.in #customer {
  animation: none
}

@keyframes bob {
  50% {
    translate: 0 -2%
  }
}

#bubble {
  position: absolute;
  left: 55%;
  bottom: 100%;
  background: #fffaf0;
  border: 3px solid #c9976a;
  border-radius: 1em;
  padding: .5em .8em;
  display: flex;
  gap: .8em;
  align-items: flex-start
}

#bubble img {
  height: 4.6em;
  width: 4.6em;
  object-fit: contain
}

#bubble:empty {
  display: none
}

.b-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25em
}

.tea-name {
  font-weight: bold;
  color: #fff6e6;
  font-size: .95em;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  background: linear-gradient(135deg, #b5703f, #8a4a28);
  padding: .25em .8em;
  border-radius: 2em;
  border: 2px solid #e8b878;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  letter-spacing: .02em
}

/* ---------- Bandeja: pousa no balcão de cada cena ---------- */
#tray-box {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: 22%;
  z-index: 22;
  transition: bottom .5s ease, width .5s ease, right .5s ease, scale .25s
}

#tray-box:hover {
  scale: 1.04
}

#stage[data-scene="1"] #tray-box,
#stage[data-scene="2"] #tray-box {
  bottom: 24%;
  width: 20%;
  right: 2.5%
}

#tray-img {
  width: 100%;
  height: auto
}

#tray-items {
  position: absolute;
  inset: 0
}

.t-tea {
  position: absolute;
  left: 9%;
  top: 28%;
  width: 36%;
  animation: pop .35s
}

.t-plate {
  position: absolute;
  left: 47%;
  top: 22%;
  width: 38%;
  animation: pop .35s
}

.t-plate img {
  width: 100%;
  height: auto
}

.t-plate .food {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 62%;
  transform: translate(-50%, -50%)
}

.t-tea img {
  width: 100%
}

@keyframes pop {
  from {
    transform: scale(0)
  }
}

/* ---------- Animações de segurar ---------- */
@keyframes wob {
  25% {
    rotate: -7deg
  }

  75% {
    rotate: 7deg
  }
}

@keyframes sway {
  50% {
    rotate: 2deg
  }

  0%,
  100% {
    rotate: -2deg
  }
}

.shake {
  animation: wob .4s 1, sway 1.2s .4s infinite ease-in-out
}

/* ---------- Cena 2 ---------- */
#shelf {
  position: absolute;
  left: 6%;
  top: 12%;
  width: 36%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .2em;
  padding: .4em;
  background: rgba(80, 45, 25, .55);
  border-radius: 1em;
  border: 2px solid rgba(232, 184, 120, .6)
}

.slot {
  aspect-ratio: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center
}

.slot img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: scale .2s, filter .2s, opacity .2s
}

.slot img:hover {
  scale: 1.12;
  filter: drop-shadow(0 0 .4em #fff3b0)
}

.ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  transform: translate(-50%, -58%);
  object-fit: contain;
  filter: drop-shadow(0 .5em .4em rgba(0, 0, 0, .35))
}

/* xícaras: só sobre o balcão (y 60% a 75%) */
#cups {
  position: absolute;
  left: 6%;
  top: 57.5%;
  width: 25%;
  height: 15.5%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 0 .2em
}

#cups .slot {
  aspect-ratio: auto;
  align-items: center;
  min-height: 0
}

#cups .slot img:hover {
  translate: 0 -6%
}

#cups.ready .slot img {
  animation: glow 1s infinite alternate
}

@keyframes glow {
  to {
    filter: drop-shadow(0 0 .5em #fff3b0)
  }
}

.fire {
  position: absolute;
  width: 6%;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity .35s;
  z-index: 4;
  pointer-events: none
}

.fire.on {
  opacity: 1;
  animation: flame .3s infinite alternate;
  transform-origin: 50% 100%
}

@keyframes flame {
  from {
    transform: translate(-50%, -100%) scale(1)
  }

  to {
    transform: translate(-50%, -100%) scale(1.08, .93)
  }
}

.knob {
  position: absolute;
  width: 4.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  z-index: 6;
  transition: box-shadow .3s
}

.knob:hover {
  box-shadow: 0 0 0 3px rgba(255, 220, 150, .9)
}

.knob.on {
  box-shadow: 0 0 1em 4px rgba(255, 140, 40, .9)
}

#knob0 {
  left: 46.9%;
  top: 70.5%
}

#knob1 {
  left: 53%;
  top: 70.5%
}

/* marcas de onde o bule pode ficar (aparecem ao arrastar) */
.spot {
  position: absolute;
  width: 12%;
  height: 3.6%;
  border: 2px dashed rgba(255, 235, 170, .9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .25s, background .2s;
  pointer-events: none;
  z-index: 3
}

#scene-tea.potdrag .spot {
  opacity: .75
}

#scene-tea.potdrag .spot.near {
  background: rgba(255, 220, 120, .4);
  opacity: 1
}

#pot-area {
  position: absolute;
  width: 12%;
  transform: translate(-50%, -100%);
  z-index: 5;
  transition: left .3s cubic-bezier(.3, 1.4, .5, 1), top .3s cubic-bezier(.3, 1.4, .5, 1)
}

#pot-area.dragging {
  transition: none;
  z-index: 50
}

#bule {
  width: 100%;
  height: auto;
  transform-origin: 50% 90%
}

#bule:hover {
  filter: drop-shadow(0 0 .5em #fff3b0)
}

#pot-area.over #bule {
  filter: drop-shadow(0 0 .9em gold)
}

#pot-area.boiling #bule,
#pot-area.shake #bule {
  animation: wob .4s 1, sway 1.2s .4s infinite ease-in-out
}

#pot-area.boiling #bule {
  animation: wob .25s infinite
}

#pot-items {
  position: absolute;
  left: 50%;
  top: -4%;
  transform: translate(-50%, -100%);
  display: flex;
  gap: .15em
}

#pot-items img {
  width: 2.4em;
  height: 2.4em;
  object-fit: contain;
  background: rgba(255, 248, 235, .9);
  border-radius: 50%;
  padding: .2em;
  border: 2px solid #c9976a;
  animation: pop .3s
}

/* ---------- Cena 3 ---------- */
.food-row {
  position: absolute;
  left: 23%;
  width: 56%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-100%)
}

#food-row1 {
  top: 22.6%
}

#food-row2 {
  top: 36.2%
}

.food-row .slot {
  width: 15%;
  aspect-ratio: 1.2
}

/* prato e bancada: tudo dentro do balcão (y 60% a 75%) */
#plate-stack {
  position: absolute;
  left: 6%;
  top: 60.5%;
  width: 12%
}

#plate-stack img {
  width: 100%;
  transition: scale .25s, filter .2s
}

#plate-stack img:hover {
  scale: 1.08;
  filter: drop-shadow(0 0 .4em #fff3b0)
}

#plate-zone {
  position: absolute;
  left: 38%;
  top: 58.5%;
  width: 15%;
  aspect-ratio: 3/2;
  border-radius: 50%;
  transition: box-shadow .3s, background .3s
}

#plate-zone.over {
  box-shadow: 0 0 1.5em gold;
  background: rgba(255, 230, 150, .2)
}

#plate-zone img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%)
}

#plate-zone .pl {
  width: 100%;
  animation: pop .35s
}

#plate-zone .fd {
  width: 62%;
  top: 46%;
  animation: pop .35s
}

/* ---------- Modais ---------- */
.modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(30, 15, 8, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s
}

.modal.hidden {
  display: flex;
  opacity: 0;
  pointer-events: none
}

.panel {
  background: #fff3df;
  border: 4px solid #c9976a;
  border-radius: 1.2em;
  padding: .8em 1.4em;
  text-align: center;
  color: #4a2a18;
  max-width: 96%;
  max-height: 96%;
  overflow: auto;
  transition: transform .3s
}

.modal.hidden .panel {
  transform: scale(.8)
}

#shop-list {
  gap: 1em;
  margin: 1em 0
}

.disc {
  width: 9em;
  padding: .6em;
  border-radius: 1em;
  background: #fff;
  border: 2px solid #e8b878
}

.disc img {
  width: 100%
}

.disc button {
  border: 0;
  background: #e8b878;
  padding: .4em .9em;
  border-radius: .8em;
  font-weight: bold;
  margin-top: .3em
}

#book .panel {
  width: 94%
}

#book-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5em;
  margin: .5em 0
}

.card {
  background: #fff;
  border: 2px solid #e8b878;
  border-radius: .8em;
  padding: .3em .2em;
  font-size: 1em
}

.card .t {
  width: 5.2em;
  height: 4.6em;
  object-fit: contain;
  margin: auto
}

.card b {
  display: block;
  font-size: 1.1em
}

.card small {
  display: block;
  font-size: .85em;
  color: #7a5238;
  margin: .1em 0
}

.card .row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .15em
}

.card .row img {
  width: 2.5em;
  height: 2.5em;
  object-fit: contain
}

#yt-holder {
  position: absolute;
  width: 200px;
  height: 200px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: 0;
  top: 0
}

/* ---------- Volume ---------- */
#vol-icon {
  border: 0;
  background: transparent;
  font-size: 1em;
  line-height: 1;
  padding: 0 .1em;
  flex: none
}

#vol-icon:hover {
  transform: scale(1.15)
}

#vol-icon.open {
  background: rgba(232, 184, 120, .35);
  border-radius: 50%
}

#vol-pop {
  position: absolute;
  top: 4.3em;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .6em;
  padding: .6em .9em;
  background: rgba(70, 40, 25, .95);
  border: 2px solid #e8b878;
  border-radius: 1.6em;
  color: #ffe9c2;
  font-weight: bold;
  box-shadow: 0 .4em 1em rgba(0, 0, 0, .4);
  transition: opacity .2s, transform .2s;
  transform-origin: top left
}

#vol-pop.hidden {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-.5em) scale(.9)
}

.vbtn {
  border: 0;
  background: #e8b878;
  color: #4a2a18;
  font-weight: bold;
  font-size: 1.1em;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  line-height: 1;
  flex: none;
  transition: transform .15s, background .15s
}

.vbtn:hover {
  transform: scale(1.12);
  background: #f4cb92
}

.vbtn:active {
  transform: scale(.92)
}

#vol-track {
  position: relative;
  width: 13em;
  height: 1.1em;
  border-radius: 1em;
  background: rgba(0, 0, 0, .35);
  border: 2px solid rgba(232, 184, 120, .6);
  touch-action: none;
  margin: 0 .3em
}

/* área de clique maior que a barra visível */
#vol-track::before {
  content: "";
  position: absolute;
  inset: -.9em -.5em
}

#vol-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  border-radius: 1em;
  background: linear-gradient(90deg, #d9893f, #f6c76f);
  pointer-events: none
}

#vol-knob {
  position: absolute;
  top: 50%;
  left: 55%;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: #fff3d6;
  border: 3px solid #e8b878;
  transform: translate(-50%, -50%);
  box-shadow: 0 .15em .4em rgba(0, 0, 0, .45);
  transition: scale .15s;
  pointer-events: none
}

#vol-track.drag #vol-knob,
#vol-track:hover #vol-knob {
  scale: 1.15
}

#vol-num {
  min-width: 2.8em;
  text-align: right
}

#shop-list {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center
}

.disc {
  width: 8.5em
}

.disc.now {
  border-color: #d9893f;
  box-shadow: 0 0 .8em rgba(217, 137, 63, .7)
}

/* ---------- Como jogar ---------- */
#help .panel {
  width: min(92%, 46em);
  text-align: left
}

#help h2 {
  text-align: center
}

#help-list {
  margin: .6em 0 .6em 1.4em;
  line-height: 1.35;
  font-size: .95em
}

#help-list li {
  margin: .35em 0
}

#help-save {
  font-size: .85em;
  color: #7a5238;
  text-align: center;
  margin: .4em 0
}

.help-btns {
  display: flex;
  gap: .8em;
  justify-content: center;
  margin-top: .5em
}

.pill.danger {
  background: #e0a090
}