/* Pony Optuigen — responsieve spelweergave van 641 × 358. */

:root { --scale: 1; }

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

html, body {
  height: 100%;
  width: 100%;
  background: #75b845;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  font-family: system-ui, sans-serif;
}

.app {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: #75b845;
}
.app::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: url('assets/bg-clean.png?v=4') center / cover no-repeat;
  filter: blur(18px) brightness(0.72) saturate(0.9);
  transform: scale(1.06);
}

.stage {
  position: relative;
  width: 641px; height: 358px;
  transform: scale(var(--scale));
  transform-origin: center center;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 1;
  touch-action: manipulation;
}

.scene { position: absolute; inset: 0; }
.scene.hidden { display: none; }

/* Beeld-lagen: pixel-exact op stagecoördinaten geplaatst (via JS top/left).
   Bronnen zijn op 4× gerenderd en worden hier scherp gedownschaald. */
.layer {
  position: absolute;
  image-rendering: auto;
}
.layer.bg { left: 0; top: 0; width: 641px; height: 358px; }
.layer.pony { pointer-events: none; }
.layer.thumb { pointer-events: none; }

.pony-group {
  position: absolute;
  inset: 0;
  transform-origin: 353px 180px;
  transform: translateX(12px) scale(1.35);
  pointer-events: none;
}

.fullscreen-btn {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 12px;
  color: #fff;
  background: rgba(63, 130, 45, 0.78);
  font: 700 25px/1 system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
}
.fullscreen-btn:hover { background: rgba(45, 112, 31, 0.92); }
.fullscreen-btn:active { transform: scale(0.94); }
.fullscreen-btn.unsupported { display: none; }

/* Transparante klik-hotspots over de ingebakken knoppen */
.hot {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  touch-action: manipulation;
}
.hot:focus-visible { outline: 2px solid rgba(255,255,255,0.6); }
.hot:active { transform: scale(0.92); }

/* Nederlandstalig label voor de actieknop. */
.translated-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Comic Sans MS', system-ui, sans-serif;
  font-weight: 700;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 1px 1px rgba(120, 0, 80, 0.25);
}
.done-label {
  background: #e99ae3;
  border: 2px solid #f8c9f3;
  border-radius: 50%;
  font-size: 18px;
}

/* Klaar-overlay: pony blijft zichtbaar, rest licht gedimd */
.result-dim { position: absolute; inset: 0; background: rgba(60,20,50,0.28); }

/* Klaar-kaart bovenaan, zodat de aangeklede pony eronder zichtbaar blijft */
.result-card {
  position: absolute;
  left: 50%; top: 14px;
  transform: translateX(-50%);
  background: rgba(255, 235, 247, 0.97);
  border: 4px solid #fff;
  border-radius: 22px;
  padding: 18px 26px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(120,40,90,0.4);
  font-family: 'Comic Sans MS', system-ui, sans-serif;
}
.result-card h1 { color: #E2247E; font-size: 30px; margin-bottom: 4px; }
.result-card p  { color: #7a3a5e; font-size: 15px; margin-bottom: 14px; font-weight: 600; }
.rbtn {
  font-family: inherit; font-weight: 800; font-size: 16px;
  color: #fff; background: #E2247E; border: none;
  border-radius: 16px; padding: 10px 22px; cursor: pointer;
  box-shadow: 0 4px 0 #b01560;
  touch-action: manipulation;
}
.rbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b01560; }

/* Grotere onzichtbare raakvlakken rondom de kleine pijlen op touchscreens. */
@media (pointer: coarse) {
  .hot:not(.done-label)::before {
    content: '';
    position: absolute;
    inset: -7px -3px;
  }
  .fullscreen-btn { width: 48px; height: 48px; }
}
