@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

/* ─── Reset ───────────────────────────────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ─── Base ────────────────────────────────────────────────────────────────── */

body {
  font-family: 'Fredoka', sans-serif;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, #ffd6ea 0%, #ffdceb 35%, #ffeef6 70%, #ffffff 100%);
}

.hidden {
  display: none !important;
}

/* ─── Decorative Floaters ─────────────────────────────────────────────────── */

body::before {
  content: "💌 🍓 🍱 ✨";
  position: fixed;
  top: 18px;
  left: 20px;
  font-size: 28px;
  opacity: 0.45;
  pointer-events: none;
}

body::after {
  content: "💖 🍙 🌷";
  position: fixed;
  bottom: 18px;
  right: 20px;
  font-size: 28px;
  opacity: 0.45;
  pointer-events: none;
}

/* ─── Opening & Loading Screen ────────────────────────────────────────────── */

#opening-screen,
#loading-screen {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.opening-card,
.loading-box {
  width: 380px;
  background: linear-gradient(180deg, #ffffff, #fff4f9);
  border: 5px solid #41549a;
  border-radius: 35px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(65, 84, 154, 0.18);
}

.opening-img {
  width: 100%;
  border-radius: 24px;
  margin-bottom: 18px;
}

.opening-card h1,
.loading-box h1 {
  color: #41549a;
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: 10px;
}

.opening-card p,
.loading-box p {
  color: #41549a;
  line-height: 1.5;
}

/* ─── Start Button ────────────────────────────────────────────────────────── */

#start-btn {
  margin-top: 20px;
  border: none;
  background: linear-gradient(180deg, #5d72c7, #41549a);
  color: white;
  padding: 16px 36px;
  border-radius: 999px;
  font-size: 18px;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  transition: transform 0.25s;
  box-shadow: 0 8px 18px rgba(65, 84, 154, 0.25);
}

#start-btn:hover {
  transform: scale(1.08) rotate(-2deg);
}

/* ─── Loading Animation ───────────────────────────────────────────────────── */

.loading-emoji {
  font-size: 55px;
  margin-bottom: 15px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* ─── Main Screen ─────────────────────────────────────────────────────────── */

#main-screen {
  height: 100vh;
  overflow: hidden;
}

.top-area {
  text-align: center;
  padding-top: 18px;
}

.title {
  color: #41549a;
  font-size: 42px;
}

.subtitle {
  color: #41549a;
  margin-top: 6px;
}

/* ─── Layout Container ────────────────────────────────────────────────────── */

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
}

/* ─── Food Panel ──────────────────────────────────────────────────────────── */

.food-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.food-item {
  width: 150px;
  background: linear-gradient(180deg, #ffffff, #fff4f9);
  border: 4px solid #41549a;
  border-radius: 28px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.25s, background 0.25s;
  box-shadow: 0 6px 15px rgba(65, 84, 154, 0.14);
}

.food-item:hover {
  transform: translateY(-8px) rotate(-2deg) scale(1.03);
  background: #fff0f6;
}

.food-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.food-item p {
  text-align: center;
  margin-top: 8px;
  color: #41549a;
  font-weight: 600;
}

/* ─── Bento Area ──────────────────────────────────────────────────────────── */

#bento-area {
  width: 560px;
  height: 560px;
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  flex-shrink: 0;
}

.bento-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ─── Added Food Items ────────────────────────────────────────────────────── */

.added-food {
  width: 160px;
  height: auto;
  object-fit: contain;
  position: absolute;
  z-index: 5;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.18));
}

.added-food:active {
  transform: scale(1.05) rotate(4deg);
  transition: transform 0.08s;
}

/* ─── Bottom Text ─────────────────────────────────────────────────────────── */

.bottom-text {
  text-align: center;
  margin-top: 12px;
  color: #41549a;
  font-weight: 600;
}

/* ─── Bawa Pulang Button ──────────────────────────────────────────────────── */

.bawa-pulang-wrap {
  text-align: center;
  margin-top: 16px;
  padding-bottom: 20px;
}

#bawa-pulang-btn {
  border: none;
  background: linear-gradient(180deg, #ff85b3, #e05c8a);
  color: white;
  padding: 14px 40px;
  border-radius: 999px;
  font-size: 20px;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  transition: transform 0.25s;
  box-shadow: 0 8px 20px rgba(224, 92, 138, 0.35);
}

#bawa-pulang-btn:hover {
  transform: scale(1.08) rotate(-2deg);
}

/* ─── Popup Overlay ───────────────────────────────────────────────────────── */

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(65, 84, 154, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

/* ─── Popup Card ──────────────────────────────────────────────────────────── */

.popup-card {
  width: 360px;
  background: linear-gradient(180deg, #ffffff, #fff4f9);
  border: 5px solid #41549a;
  border-radius: 35px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(65, 84, 154, 0.25);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.popup-photos {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.popup-photo {
  width: 220px;
  border-radius: 24px;
  border: 4px solid #41549a;
  object-fit: cover;
}

.popup-heart {
  font-size: 36px;
  margin-bottom: 8px;
}

.popup-title {
  color: #41549a;
  font-size: 28px;
  margin-bottom: 10px;
}

.popup-msg {
  color: #41549a;
  line-height: 1.7;
  font-size: 16px;
  margin-bottom: 14px;
}

.popup-tags {
  font-size: 17px;
  font-weight: 700;
  color: #e05c8a;
  margin-bottom: 18px;
}

.popup-tags span {
  background: #fff0f6;
  border: 2px solid #e05c8a;
  border-radius: 999px;
  padding: 2px 12px;
}

/* ─── Close Popup Button ──────────────────────────────────────────────────── */

#close-popup-btn {
  border: none;
  background: linear-gradient(180deg, #5d72c7, #41549a);
  color: white;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 17px;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 6px 16px rgba(65, 84, 154, 0.25);
}

#close-popup-btn:hover {
  transform: scale(1.07);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  body {
    overflow: auto;
  }

  #main-screen {
    height: auto;
    overflow: visible;
  }

  .container {
    flex-direction: column;
    padding-bottom: 40px;
  }

  .food-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .food-item {
    width: 120px;
  }

  #bento-area {
    width: 360px;
    height: 360px;
  }

  .title {
    font-size: 30px;
  }

  .added-food {
    width: 110px;
    height: auto;
    object-fit: contain;
  }
}