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

body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  background: #f3e9d8;
  background-image: radial-gradient(circle, #00000008 1px, transparent 1px);
  background-size: 18px 18px;
  color: #3a2a1a;
  overflow-x: hidden;
}

.mem-header { text-align: center; padding: 40px 20px 10px; position: relative; }

.back-btn {
  position: absolute; top: 20px; left: 20px; color: #3a2a1a; text-decoration: none;
  font-weight: 600; background: #fff; padding: 8px 16px; border-radius: 6px;
  box-shadow: 2px 2px 0 #00000030; transition: transform 0.2s;
}
.back-btn:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 #00000030; }

.mem-title { font-family: 'Caveat', cursive; font-size: 48px; font-weight: 700; color: #b23a5e; }
.mem-sub { font-family: 'Caveat', cursive; font-size: 20px; opacity: 0.8; }

.board {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 30px;
  padding: 40px; max-width: 1100px; margin: 0 auto;
}

.polaroid {
  background: #fff; padding: 12px 12px 40px; width: 240px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25); position: relative; opacity: 0;
  animation: dropIn 0.6s ease forwards; transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.polaroid:nth-child(1) { animation-delay: 0.1s; }
.polaroid:nth-child(2) { animation-delay: 0.3s; }
.polaroid:nth-child(3) { animation-delay: 0.5s; }
.polaroid:nth-child(4) { animation-delay: 0.7s; }
.polaroid:nth-child(5) { animation-delay: 0.9s; }
.polaroid:nth-child(6) { animation-delay: 1.1s; }

.tilt-l { --rot: -4deg; transform: rotate(-4deg); }
.tilt-r { --rot: 4deg; transform: rotate(4deg); }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-60px) rotate(0deg) scale(0.8); }
  to { opacity: 1; transform: translateY(0) rotate(var(--rot,0deg)) scale(1); }
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.06) translateY(-6px) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.35); z-index: 5;
}

.polaroid img { width: 100%; height: 190px; object-fit: cover; display: block; filter: sepia(0.15) contrast(1.05); }
.polaroid .cap { font-family: 'Caveat', cursive; font-size: 20px; text-align: center; margin-top: 10px; color: #3a2a1a; }

.tape {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 60px; height: 22px; background: rgba(255,236,150,0.75); box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lightbox {
  position: fixed; inset: 0; background: rgba(20,10,5,0.92); display: none;
  align-items: center; justify-content: center; z-index: 999;
}
.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90%; max-height: 85%; border: 10px solid #fff;
  box-shadow: 0 0 30px rgba(0,0,0,0.6); animation: popIn 0.3s ease;
}

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

.lb-close { position: absolute; top: 24px; right: 32px; font-size: 40px; color: #fff; cursor: pointer; }
.mem-footer { text-align: center; padding: 24px; font-family: 'Caveat', cursive; font-size: 18px; opacity: 0.7; }

/* ===== XBOX PANEL ===== */
.xbox-panel { max-width: 1100px; margin: 40px auto 60px; padding: 0 40px; }
.xbox-title { font-family: 'Caveat', cursive; font-size: 34px; color: #107c10; text-align: center; }
.xbox-sub { text-align: center; font-size: 13px; opacity: 0.7; margin-bottom: 24px; }
.xbox-loading, .xbox-error { text-align: center; padding: 20px; font-size: 14px; opacity: 0.7; }
.xbox-error { color: #c0392b; }
.xbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }

.xbox-card {
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  opacity: 0; transform: translateY(20px); animation: xboxIn 0.5s ease forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.xbox-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 12px 24px rgba(16,124,16,0.3); }
@keyframes xboxIn { to { opacity: 1; transform: translateY(0); } }

.xbox-card img { width: 100%; height: 120px; object-fit: cover; display: block; background: #eee; }
.xbox-card-body { padding: 10px 12px 14px; }
.xbox-game-name { font-weight: 700; font-size: 13px; color: #222; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xbox-last-played { font-size: 11px; color: #107c10; font-weight: 600; }

@media (max-width: 480px) {
  .polaroid { width: 42vw; }
  .mem-title { font-size: 34px; }
  .xbox-panel { padding: 0 16px; }
  .xbox-grid { grid-template-columns: repeat(2, 1fr); }
}