*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0e0a06; /* dark surround for letterbox gaps */
  font-family: Verdana, Arial, sans-serif;
}

/* === Back link — floats over top-left of image === */
.back-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  color: #e8c97a;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.35);
  padding: 4px 10px;
  border-radius: 3px;
}

.back-link:hover {
  color: #fff;
  background: rgba(0,0,0,0.6);
}

/* === Scene: the full background image === */
.board-scene {
  position: relative;
  width: 100%;
  /* Maintain image aspect ratio (1536 × 1024 = 3:2) */
  line-height: 0;
}

.board-bg {
  display: block;
  width: 100%;
  height: auto;
}

/* === Cork area: maps exactly to the cork surface in the image ===
   Image size: 1536 × 1024
   Cork inner bounds (% of image dimensions):
     left:  22%   right: 79%   → width: 57%
     top:   21%   bottom: 73%  → height: 52%
*/
.cork-area {
  position: absolute;
  left: 22%;
  top: 21%;
  width: 57%;
  height: 52%;
  /* Uncomment to debug cork bounds:
  outline: 2px dashed red; */
}

/* === Poster wrapper ===
   --x / --y: position of poster's top-left corner as % of .cork-area
   --rot:     rotation in degrees
*/
.poster-wrap {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: rotate(var(--rot));
  transform-origin: top center;
  filter: drop-shadow(3px 5px 14px rgba(0, 0, 0, 0.6));
  z-index: 1;
  transition: transform 0.15s ease, filter 0.15s ease;
  cursor: pointer;
}

.poster-wrap.behind {
  z-index: 0;
}

.poster-wrap:hover {
  z-index: 10;
  transform: rotate(var(--rot)) scale(1.05);
  filter: drop-shadow(6px 10px 24px rgba(0, 0, 0, 0.8));
}

.poster-img {
  display: block;
  /* ~25% of the cork area width (cork = 56vw), so ≈ 14vw.
     At 1536px display → ~215px. Scales with viewport. */
  width: 14vw;
  min-width: 120px;
  max-width: 240px;
  height: auto;
  border: 6px solid #f0ece0;
  outline: 1px solid #c8b898;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.9);
  cursor: default;
  /* Subtle entrance scale */
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
  padding: 4px 8px;
}

.lightbox-close:hover {
  opacity: 1;
}


/* === Pushpin === */
.pushpin {
  display: block;
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff9a9a, #cc2200 55%, #7a1200);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.55),
    inset 0 -2px 3px rgba(0, 0, 0, 0.25),
    inset 1px 1px 2px rgba(255, 255, 255, 0.2);
}

.pushpin::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 12px;
  background: linear-gradient(to bottom, #bbb 0%, #666 100%);
  border-radius: 0 0 2px 2px;
}
