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

body {
  font-family: 'Fira Sans Condensed', sans-serif;
  background: url("bg.png") center/cover no-repeat;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mode-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 60px;
  cursor: pointer;
  z-index: 1000;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 15px;
  width: min(90vw, 600px);
  perspective: 1200px;
  z-index: 10;
}

.door {
  position: relative;
  width: 100%;
  padding-top: 100%;
}

.inside {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
}

.inside img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.door-front {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #7b3fbf, #a570ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .8s ease;
  box-shadow: 0 8px 15px rgba(0,0,0,.4);
}

.door-front::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(to right, rgba(0,0,0,.5), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity .8s ease;
}

.door.open .door-front {
  transform: rotateY(-110deg);
}

.door.open .door-front::after {
  opacity: 1;
}

.doodle {
  position: fixed;
  pointer-events: none;
  animation: wiggle .3s infinite alternate;
  z-index: 5;
}

@keyframes wiggle {
  from { transform: translate(-1px,-1px) rotate(-1deg); }
  to   { transform: translate(1px,1px) rotate(1deg); }
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.popup-content {
  background: #fff;
  color: #222;
  padding: 25px;
  border-radius: 15px;
  max-width: 350px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

#close {
  position: absolute;
  top: 8px;
  right: 12px;
  cursor: pointer;
  font-size: 1.4rem;
}

.popup-content button {
  background: linear-gradient(135deg, #7b3fbf, #a570ff);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-family: 'Fira Sans Condensed', sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  margin: 15px auto 0;
  display: block;
  box-shadow: 0 5px 10px rgba(0,0,0,.2);
  transition: all .2s ease;
}

.popup-content button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0,0,0,.3);
}

.popup-content button:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #a570ff, #7b3fbf);
}

.hidden {
  display: none;
}
