:root {
  --ink: #1b1a18;
  --cream: #fff4de;
  --wood: #e5b879;
  --accent: #ff7a00;
  --accent-dark: #d85f00;
  --shadow: rgba(0,0,0,0.2);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: "Comic Neue", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f6efe3;
}

#app {
  min-height: 100%;
  padding: 16px;
}

.is-hidden { display: none !important; }

.vn-screen {
  position: relative;
  width: min(1200px, 100%);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(0,0,0,0.25);
}

.vn-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(6px) saturate(1.1);
  transition: filter 1.2s ease;
}

.vn-glass {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  transition: backdrop-filter 1.2s ease, background 1.2s ease;
}

.vn-skip {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}

.vn-char {
  position: absolute;
  bottom: 18%;
  height: 320px;
  width: auto;
  opacity: 0.45;
  filter: grayscale(0.1);
  transition: opacity 0.4s ease, transform 0.6s ease;
  z-index: 1;
}

.vn-chef {
  left: 8%;
  height: 416px;
}
.vn-mom {
  right: 8%;
  mix-blend-mode: multiply;
}

.vn-char.is-speaking {
  opacity: 1;
  transform: translateY(-6px);
  filter: none;
}

.vn-dialog {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 33%;
  background: rgba(15,15,15,0.55);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  display: grid;
  place-items: center;
  z-index: 2;
}

.vn-text {
  width: 86%;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 8px rgba(0,0,0,0.6);
  min-height: 48px;
}

.vn-screen.vn-end .vn-char {
  opacity: 0;
  transform: translateY(10px);
}

.vn-screen.vn-end .vn-bg {
  filter: blur(0) saturate(1);
}

.vn-screen.vn-end .vn-glass {
  backdrop-filter: blur(0);
  background: rgba(255,255,255,0);
}

.start-screen {
  position: relative;
  width: min(1200px, 100%);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(0,0,0,0.25);
}

.start-screen__bg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #111;
}

.start-screen__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: calc(100% / 3) 100%, 100% calc(100% / 3);
  pointer-events: none;
}

.start-screen__icon {
  position: absolute;
  width: 270px;
  height: 270px;
  display: grid;
  place-items: center;
  cursor: pointer;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.35));
}

.start-screen__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.start-screen__label {
  position: absolute;
  top: calc(100% - 22px);
  left: 50%;
  transform: translateX(-50%);
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 2px 2px rgba(0,0,0,0.65),
    0 0 10px rgba(0,0,0,0.55);
  letter-spacing: 1px;
  font-size: 18px;
}

.start-screen__plane {
  left: calc(33.333% - 135px);
  top: calc(33.333% - 135px);
}

.start-screen__ticket {
  left: calc(33.333% - 135px);
  top: calc(66.666% - 135px);
}

.start-screen__ticket img {
  transform: scale(0.6);
  transform-origin: center;
}

.start-screen__credits {
  position: absolute;
  left: 2%;
  top: 6%;
  width: 30%;
  display: none;
  font-size: 22px;
  font-weight: 700;
  line-height: 2.2;
  color: #fff;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.start-screen__credits.is-visible {
  display: block;
}

.start-screen__exit {
  position: absolute;
  left: 2%;
  bottom: 4%;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  font-weight: 700;
  cursor: pointer;
  display: none;
}

.start-screen__exit.is-visible {
  display: inline-block;
}

.game-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  position: relative;
}

.game-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  text-align: center;
  animation: hintPulse 1.2s infinite;
  pointer-events: none;
}

@keyframes hintPulse {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.game-exit {
  position: fixed;
  right: 20px;
  bottom: 16px;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  align-items: center;
  gap: 12px;
}

.title {
  font-size: 20px;
  font-weight: 700;
}

.tempo {
  text-align: right;
  font-size: 14px;
  opacity: 0.8;
}

.progress {
  height: 14px;
  background: #ece1cf;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px var(--shadow);
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ffb66b);
  transition: width 80ms linear;
}

.stage {
  display: flex;
  justify-content: center;
}

.kitchen {
  width: min(1200px, 100%);
  aspect-ratio: 16 / 9;
  background: #f0dfc4 url("background.png") center/cover no-repeat;
  border-radius: 18px;
  box-shadow: 0 16px 30px rgba(0,0,0,0.25);
  position: relative;
  overflow: hidden;
}

.chefs {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 6%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  align-items: end;
}

.chef {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 0;
  transition: transform 120ms ease, background 120ms ease;
  touch-action: none;
}

.chef.is-active {
  transform: translateY(-4px);
}

.chef__img {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,0.25));
  pointer-events: none;
}

.chef__img--alt {
  transform: scale(1.28);
  transform-origin: center bottom;
}

.chef__slot {
  display: none;
}

.library {
  background: var(--cream);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.library__title {
  font-weight: 700;
  margin-bottom: 10px;
}

.library__grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
}

.sound {
  background: white;
  border-radius: 14px;
  padding: 10px 8px;
  border: 2px solid #f1d6b7;
  box-shadow: 0 6px 10px rgba(0,0,0,0.08);
  display: grid;
  gap: 6px;
  justify-items: center;
  cursor: grab;
  user-select: none;
  transition: transform 120ms ease, border-color 120ms ease;
  touch-action: none;
  min-height: 110px;
}

.sound:active { cursor: grabbing; }

.sound__chip {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffe0b8, #ffc06f);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #7a3a00;
  box-shadow: inset 0 3px 4px rgba(255,255,255,0.8);
}

.sound__icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
  mix-blend-mode: multiply;
}

.sound__label {
  font-size: 12px;
  text-align: center;
  font-weight: 700;
}

.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 12px 20px rgba(0,0,0,0.25);
  font-weight: 700;
}

@media (max-width: 900px) {
  .vn-char { height: 240px; }
  .vn-chef { height: 312px; }
  .vn-text { font-size: 18px; }

  .start-screen__icon {
    width: 180px;
    height: 180px;
  }

  .start-screen__label {
    font-size: 14px;
  }

  .start-screen__plane {
    left: calc(33.333% - 90px);
    top: calc(33.333% - 90px);
  }

  .start-screen__ticket {
    left: calc(33.333% - 90px);
    top: calc(66.666% - 90px);
  }

  .start-screen__ticket img {
    transform: scale(0.6);
    transform-origin: center;
  }

  .start-screen__credits {
    font-size: 18px;
  }

  .chefs {
    grid-template-columns: repeat(4, 1fr);
    bottom: 4%;
  }

  .chef__img { width: 60px; }

  .library__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .tempo { text-align: left; }
}
