/* === CINEMAFREAK RETRO POSTER PUZZLE — Copy & Play === */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* === BASIS LAYOUT === */
.poster-puzzle-wrapper {
  max-width: 420px;
  margin: 2em auto;
  text-align: center;
  font-family: 'VT323', monospace;
  color: #F59C2D;
  position: relative;
  /*background: radial-gradient(ellipse at center, #000 0%, #111 100%);
  box-shadow: 0 0 25px rgba(242, 211, 107, 0.25);
  border: 2px solid #F59C2D;
  padding: 1em;*/
  overflow: hidden;
  opacity: 0;
  animation: puzzleFadeIn 2s ease forwards 2s;
}

@keyframes puzzleFadeIn {
  from { opacity: 0; filter: blur(3px); }
  to { opacity: 1; filter: blur(0); }
}

/* Header */
.poster-puzzle-header {
  margin-bottom: 0.5em;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-shadow: 0 0 2px #F59C2D;
}



.poster-puzzle-controls{
    margin-bottom: 10px;
}

/* === GRID === */
.poster-puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 5;
  background: #5C0000;
  margin: 0 auto;
  border: 3px solid #f59c2d;
  box-shadow: 0 0 15px #000;
  filter: contrast(1.1) saturate(1.2);
}


.tile.empty {
 background-image: url("https://www.cinemafreak.nl/wp-content/uploads/elementor/thumbs/cinemafreak-logo-pie74d8dfph4gmg1tvmfbz18e1h2bs16v6sqcjl57a.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.tile.empty:hover {
  opacity: 1;
}

.poster-puzzle-tile.empty {
  width: 100%;
  height: 100%;
  min-width: 80px;   /* of pas aan aan je puzzelgrootte */
  min-height: 80px;
  background-color: transparent;
  display: block;
     z-index: 10;
  position: relative;
}

.poster-puzzle-tile.empty {
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}


.giallo-btn{
    margin-top: 20px;
}

/* Tiles */
.poster-puzzle-tile {
  width: 100%;
  height: 100%;
  background-size: 400% 500%;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 200, 100, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  filter: drop-shadow(1px 1px 2px rgba(255,0,0,0.4))
          drop-shadow(-1px -1px 2px rgba(0,255,255,0.4));
}
.poster-puzzle-tile:hover {
  transform: scale(1.03);
  filter: brightness(1.2);
}

.poster-puzzle-tile.empty {
  cursor: default;
  pointer-events: none !important;
}

.poster-puzzle-tile.empty,
.tile.empty {
  background-image: url("https://www.cinemafreak.nl/wp-content/uploads/elementor/thumbs/cinemafreak-logo-pie74d8dfph4gmg1tvmfbz18e1h2bs16v6sqcjl57a.png") !important;
  background-size: 80% !important;
    background-color: rgba(5, 5, 5, 0.81)!important;
  background-position: center !important;
  background-repeat: no-repeat !important;
    background-blend-mode: overlay;
  opacity: 0.8!important;
  z-index: 10;
}




/* === SOLVED MELDING === */
.poster-puzzle-complete {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  color: #ffcc00;
  text-shadow: 0 0 10px #000;
  animation:
    solvedGlow 1s ease-in-out infinite alternate,
    glitch 0.4s steps(2, end) 1,
    fadeOut 6s forwards 4s,
    vhsFlicker 0.2s infinite alternate;
}

@keyframes solvedGlow {
  from { text-shadow: 0 0 10px #ffcc00; }
  to   { text-shadow: 0 0 25px #ff6600; }
}
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes glitch {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  20% { transform: translate(-2px, 2px); filter: hue-rotate(30deg); }
  40% { transform: translate(2px, -2px); filter: hue-rotate(-30deg); }
  60% { transform: translate(-1px, 1px); }
  80% { transform: translate(1px, -1px); }
  100% { transform: translate(0); filter: none; }
}

/* === VHS EFFECTEN === */
.poster-puzzle-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 2px,
    transparent 3px
  );
  opacity: 0.2;
  mix-blend-mode: multiply;
  animation: vhsMove 0.2s linear infinite;
}
@keyframes vhsMove {
  from { background-position: 0 0; }
  to { background-position: 0 4px; }
}
.poster-puzzle-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255, 0, 50, 0.15), transparent 70%),
              radial-gradient(circle at 70% 70%, rgba(0, 200, 255, 0.15), transparent 70%);
  mix-blend-mode: screen;
}
@keyframes vhsFlicker {
  from { opacity: 0.9; filter: brightness(1); }
  to { opacity: 1; filter: brightness(1.2) saturate(1.3); }
}

/* === VHS INTRO === */
.vhs-intro {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  animation: tapeFadeOut 5s ease forwards 4s;
}
.vhs-overlay { position: relative; width: 100%; height: 100%; overflow: hidden; }
.vhs-noise {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0.04) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: screen;
  opacity: 0.25;
  animation: vhsNoise 0.12s infinite;
}

h3{
    font-size: 1.2rem;
}


.vhs-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  color: #F59C2D;
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-shadow: 0 0 5px #ff6600;
  animation: tapeFlash 0.5s steps(2, start) infinite;
}
@keyframes vhsNoise { from { background-position: 0 0; } to { background-position: 0 5px; } }
@keyframes tapeFlash { 0%,100% { opacity: 0.8; } 50% { opacity: 0.2; } }
@keyframes tapeFadeOut { to { opacity: 0; visibility: hidden; } }

.vhs-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.5), transparent 70%);
  mix-blend-mode: overlay;
  opacity: 0;
  animation: flashPop 1s ease-in-out 2s forwards;
}
@keyframes flashPop {
  0% { opacity: 0; }
  10% { opacity: 1; }
  100% { opacity: 0; }
}

/* === PLAY OVERLAY === */
.vhs-play::after {
  content: "PLAY ▶";
  position: absolute;
  top: 1em;
  left: 1em;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 0 4px #00ffcc;
  opacity: 0.7;
  animation: blinkPlay 1.2s steps(2, start) infinite;
}
@keyframes blinkPlay { 0%,100% { opacity: 0.7; } 50% { opacity: 0.2; } }

.vhs-play::before {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.4);
  animation: trackingLine 2.5s linear infinite;
}
@keyframes trackingLine {
  0% { top: -10%; opacity: 0; }
  10% { opacity: 0.4; }
  50% { opacity: 0.6; }
  100% { top: 110%; opacity: 0; }
}

/* === COPY & PLAY BUTTON === */
.play-tape-btn {
  display: inline-block;
  margin-top: 1em;
  padding: 0.6em 1.4em;
  background: #111;
  color: #F59C2D;
  border: 2px solid #F59C2D;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow: 0 0 4px #ff6600;
  transition: all 0.2s ease;
}
.play-tape-btn:hover {
  background: #F59C2D;
  color: #111;
  text-shadow: 0 0 6px #ff6600;
  box-shadow: 0 0 10px #F59C2D;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .poster-puzzle-wrapper { padding: 0.5em; }
  .poster-puzzle-grid { max-width: 90vw; border-width: 2px; }
  .poster-puzzle-complete { font-size: 1rem; }
}
