body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.happy-meal-container {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 10;
}
.happy-meal-container:hover { transform: scale(1.05); }
.happy-meal-container:active { transform: scale(0.95); }
.happy-meal-container img {
  width: 300px;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.2));
  animation: idle 3s ease-in-out infinite;
}

@keyframes idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(1deg); }
  50% { transform: translateY(-10px) rotate(0deg); }
  75% { transform: translateY(-6px) rotate(-1deg); }
}

.click-hint {
  margin-top: 20px;
  font-size: 18px;
  color: black;
  font-weight: bold;
}

.open-count {
  margin-top: 6px;
  font-size: 12px;
  color: #bbb;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-8deg); }
  20% { transform: rotate(8deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  50% { transform: rotate(-5deg); }
  60% { transform: rotate(5deg); }
  70% { transform: rotate(-3deg); }
  80% { transform: rotate(3deg); }
}
.shaking { animation: shake 0.8s ease-in-out; }

/* Wrapper */
.wrapper-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-3deg);
  width: 520px;
  height: 420px;
  display: none;
  z-index: 40;
  background: url('/wrapper.jpeg') repeat;
  background-size: 250px;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.toy-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
}

.wrapped-toy {
  position: absolute;
  width: 165px;
  height: 165px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.wrapped-toy:active { cursor: grabbing; }

.wrapped-toy img {
  width: 165px;
  height: 165px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  pointer-events: none;
}

.food-item {
  cursor: grab;
  z-index: 0 !important;
}
.food-item img {
  width: 260px;
  height: 260px;
}


.wrapper-hint {
  position: fixed;
  top: calc(50% - 280px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 22px;
  font-weight: bold;
  color: black;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 55;
  display: none;
}

.set-label {
  position: fixed;
  bottom: calc(50% - 280px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #999;
  text-align: center;
  max-width: 400px;
  z-index: 110;
  display: none;
}

.toy-label {
  position: fixed;
  bottom: calc(50% - 260px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 22px;
  font-weight: bold;
  color: #333;
  text-align: center;
  max-width: 400px;
  line-height: 1.3;
  z-index: 110;
  display: none;
}

.reset-btn {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 30px;
  background: linear-gradient(180deg, #7ab8f5 0%, #468ccf 45%, #3a7bbd 55%, #2e6aaa 100%);
  color: white;
  border: 1px solid #2a5d94;
  border-radius: 8px;
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: none;
  z-index: 110;
  text-shadow: 0 -1px 1px rgba(0,0,0,0.3);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 1px 0 rgba(255,255,255,0.3) inset;
  transition: all 0.1s;
}
.reset-btn:hover {
  background: linear-gradient(180deg, #8ac4ff 0%, #5098d8 45%, #448bc8 55%, #3876b5 100%);
}
.reset-btn:active {
  background: linear-gradient(180deg, #2e6aaa 0%, #3a7bbd 45%, #468ccf 55%, #7ab8f5 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
}

.credit {
  position: fixed;
  bottom: 20px;
  left: 20px;
  font-size: 12px;
  color: #bbb;
  text-decoration: none;
  z-index: 1;
}
.credit:hover { text-decoration: underline; }

.about-link {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 12px;
  color: #bbb;
  text-decoration: none;
  z-index: 1;
}
.about-link:hover { text-decoration: underline; }

/* Intro popup */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.intro-card {
  position: relative;
  background: #f2f0ec;
  max-width: 480px;
  width: 90%;
  padding: 48px 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transform: rotate(-1.5deg);
}

.intro-tape {
  position: absolute;
  width: 80px;
  height: 28px;
  background: rgba(180,175,165,0.5);
  z-index: 1;
}
.intro-tape-tl { top: -10px; left: -16px; transform: rotate(-35deg); }
.intro-tape-tr { top: -10px; right: -16px; transform: rotate(35deg); }
.intro-tape-bl { bottom: -10px; left: -16px; transform: rotate(35deg); }
.intro-tape-br { bottom: -10px; right: -16px; transform: rotate(-35deg); }

.intro-card h1 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #111;
  margin-bottom: 12px;
}

.intro-card p {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 24px;
}

.intro-sub {
  font-size: 13px !important;
  color: #888 !important;
  margin-bottom: 20px !important;
}

.intro-boxes {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 24px;
}

.intro-box-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.intro-box-item img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 8px;
}

.intro-box-item strong {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #111;
  margin-bottom: 4px;
}

.intro-box-item span {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 11px;
  color: #888;
}

.intro-disclaimer {
  font-size: 10px !important;
  color: #aaa !important;
  margin-bottom: 16px !important;
}

.intro-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: linear-gradient(180deg, #7ab8f5 0%, #468ccf 45%, #3a7bbd 55%, #2e6aaa 100%);
  color: white;
  border: 1px solid #2a5d94;
  border-radius: 8px;
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 -1px 1px rgba(0,0,0,0.3);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 1px 0 rgba(255,255,255,0.3) inset;
  transition: all 0.1s;
}
.intro-btn:hover {
  background: linear-gradient(180deg, #8ac4ff 0%, #5098d8 45%, #448bc8 55%, #3876b5 100%);
}
.intro-btn:active {
  background: linear-gradient(180deg, #2e6aaa 0%, #3a7bbd 45%, #468ccf 55%, #7ab8f5 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
}

/* Mobile */
@media (max-width: 600px) {
  .intro-card { padding: 36px 24px 28px; }
  .intro-card h1 { font-size: 22px; }
  .intro-card p { font-size: 13px; }
  .intro-box-item img { width: 70px; height: 70px; }
  .intro-boxes { gap: 16px; }

  .happy-meal-container img {
    width: 200px;
  }

  .click-hint {
    font-size: 15px;
  }

  .wrapper-overlay {
    width: 92vw;
    height: 70vh;
    transform: translate(-50%, -50%) rotate(-2deg);
  }

  .wrapped-toy {
    width: 130px;
    height: 130px;
  }

  .wrapped-toy img {
    width: 130px;
    height: 130px;
  }

  .food-item img {
    width: 220px;
    height: 220px;
  }

  .wrapper-hint {
    font-size: 16px;
    top: calc(50% - 42vh);
  }

  .set-label {
    bottom: calc(50% - 42vh);
    font-size: 12px;
  }

  .toy-label {
    bottom: calc(50% - 40vh);
    font-size: 18px;
  }

  .reset-btn {
    bottom: 30px;
    font-size: 13px;
    padding: 8px 24px;
  }

  .nav-link {
    font-size: 12px;
    top: 10px;
  }
  .nav-link.right { right: 10px; }
  .nav-link.left { left: 10px; }
}
