* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #403832;
  font-family: "Courier New", monospace;

  background-image: url("https://doostuff.neocities.org/images/bag/sheet.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  overflow-x: hidden;
}

/* ===== BACK BUTTON ===== */

.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 20;

  padding: 9px 14px;
  color: #403832;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(64, 56, 50, 0.35);
  border-radius: 5px;

  font-size: 13px;
  text-decoration: none;
  box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease, transform 0.2s ease;
}

.back-button:hover {
  background: white;
  transform: translateY(-2px);
}

/* ===== PAGE HEADING ===== */

.bag-page {
  width: 100%;
  min-height: 100vh;
  padding: 20px 20px 30px;
  text-align: center;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 36px);
  font-weight: normal;
  color: #403832;
  text-shadow: 0 1px 5px rgba(255, 255, 255, 0.8);
}

.page-heading p {
  margin: 8px 0 12px;
  font-size: 16px;
}

.instruction {
  position: relative;
  z-index: 5;
  margin: 0;
  font-size: 16px;
}

/* ===== BAG SCENE ===== */

.bag-scene {
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: 650px;
  margin: 0 auto;
}

/* Center bag */

.bag-button {
  position: absolute;
  z-index: 2;
  width: 750px;
  max-width: 90%;
  padding: 0;
  border: none;
  background: transparent;
  left: 46%;
  top: 53%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: filter 0.25s ease;
}

.bag-button img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, 0.12));
}

.bag-button:hover img {
  filter: drop-shadow(3px 7px 7px rgba(0, 0, 0, 0.18));
}

/* ===== ITEMS ===== */

.bag-items {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.item {
  position: absolute;
  display: block;
  width: 155px;
  opacity: 0;
  pointer-events: none;

  transform: translateY(20px) scale(0.65) rotate(-12deg);
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

.item img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(2px 5px 4px rgba(0, 0, 0, 0.16));
}

.bag-items.visible .item {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1) rotate(0deg);
}

.item:hover img {
  transform: scale(1.08) rotate(3deg);
}

/* ===== ITEM POSITIONS ===== */

.journal {
  width: 185px;
  top: 9%;
  left: 12%;
  rotate: -10deg;
}

.trinket {
  width: 47px;
  top: 35%;
  right: 32%;
  rotate: 9deg;
}

.camera {
  width: 160px;
  top: 34%;
  left: 3%;
  rotate: -8deg;
}

.ipod {
  width: 265px;
  top: 9%;
  right: 3%;
  rotate: 8deg;
}

.wallet {
  width: 220px;
  bottom: 4%;
  left: 13%;
  rotate: 7deg;
}

.book {
  width: 165px;
  bottom: 3%;
  right: 10%;
  rotate: -7deg;
}

/* ===== MOBILE ===== */

@media (max-width: 600px) {
  body {
    background-attachment: scroll;
  }

  .back-button {
    top: 12px;
    left: 12px;
    font-size: 12px;
  }

  .bag-page {
    padding: 65px 8px 20px;
  }

  .bag-scene {
    height: 500px;
  }

  .bag-button {
    width: 380px;
    max-width: 85%;
  }

  .item {
    width: 105px;
  }

  .journal {
    top: 5%;
    left: 2%;
  }

  .trinket {
    top: 5%;
    right: 2%;
  }

  .camera {
    top: 33%;
    left: 0;
  }

  .ipod {
    top: 33%;
    right: 0;
  }

  .wallet {
    bottom: 3%;
    left: 4%;
  }

  .book {
    bottom: 3%;
    right: 4%;
  }
}