@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 500;
  src: url('popp_feinkost_website/files/popp-feinkost/fonts/yanone-kaffeesatz-v24-latin-500.woff2') format('woff2'),
       url('popp_feinkost_website/files/popp-feinkost/fonts/yanone-kaffeesatz-v24-latin-500.woff') format('woff'),
       url('popp_feinkost_website/files/popp-feinkost/fonts/yanone-kaffeesatz-v24-latin-500.ttf') format('truetype');
  font-display: swap;
}

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

html, body {
  height: 100%;
  background: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  width: 100vw;
  aspect-ratio: 596 / 478;
  background-image: url("background.webp");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  --speed: 350ms;
}

.stage.won {
  background-image: url("success_background.webp");
}

/* ---------------- Tubs ---------------- */

.tub-slot {
  position: absolute;
  bottom: 4%;
  width: 22%;
  transform: translateX(-50%);
  cursor: pointer;
  transition: left var(--speed) cubic-bezier(0.45, 0.05, 0.55, 0.95);
  z-index: 2;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.tub-slot.pickable:hover .tub {
  transform: translateY(-6%);
}

.tub-slot.over { z-index: 5; }
.tub-slot.under { z-index: 1; }

.tub-slot.over .tub  { animation: arc-over  var(--speed) ease-in-out; }
.tub-slot.under .tub { animation: arc-under var(--speed) ease-in-out; }

@keyframes arc-over {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-55%); }
  100% { transform: translateY(0); }
}

@keyframes arc-under {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(10%); }
  100% { transform: translateY(0); }
}

.tub {
  width: 100%;
  aspect-ratio: 596 / 491;
  background-image: url("tub.webp");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  transition: transform 200ms ease-out;
  pointer-events: none; /* clicks handled by slot */
}

.tub-slot.open .tub {
  background-image: url("tub_opened.webp");
  aspect-ratio: 596 / 495;
}

.tub-slot.open .tub {
  /* lift slightly so the open lid fits in the same footprint */
  transform: translateY(-2%);
}

/* ---------------- Diamond ---------------- */

.diamond {
  position: absolute;
  width: 7%;
  aspect-ratio: 1 / 1;
  bottom: 60%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(180, 240, 255, 0.95))
          drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
}

.diamond svg {
  width: 100%;
  height: 100%;
  animation: diamond-shine 1.6s ease-in-out infinite;
}

.diamond.falling {
  transition: bottom 800ms cubic-bezier(0.45, 0.0, 0.7, 1.0),
              left   800ms ease-in-out,
              transform 800ms ease-in-out;
}

.diamond.fading {
  transition: opacity 300ms ease-out;
  opacity: 0;
}

.diamond-sparkle {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.7) 0 1.5px, transparent 2.5px);
  animation: sparkle 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes diamond-shine {
  0%, 100% { filter: brightness(1)   contrast(1); transform: rotate(-2deg); }
  50%      { filter: brightness(1.4) contrast(1.1); transform: rotate(2deg); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ---------------- Prompt ---------------- */

.prompt {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translateX(-50%);
  color: #c8102e;
  background: #fff;
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, Verdana, sans-serif;
  font-size: clamp(26px, 6vmin, 48px);
  font-weight: 800;
  letter-spacing: 0;
  padding: 0.4em 1em;
  border-radius: 9999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 250ms ease;
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
}

.prompt.visible { opacity: 1; }

.pointer-hand {
  position: absolute;
  top: 68%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6.6vw;
  line-height: 1;
  z-index: 19;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
  filter: brightness(0) invert(1)
          drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.pointer-hand.visible {
  opacity: 1;
  animation: pointer-bounce 900ms ease-in-out infinite;
}

@keyframes pointer-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(20%); }
}

/* ---------------- Win screen ---------------- */

.win-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  z-index: 50;
}

.win-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.win-card {
  background: linear-gradient(180deg, #fff 0%, #ffe9d9 100%);
  color: #2c1810;
  padding: 4% 6%;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-width: 80%;
  animation: pop-in 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.coupon {
  display: inline-block;
  font-family: "Courier New", monospace;
  font-size: clamp(16px, 2.6vmin, 26px);
  font-weight: 700;
  letter-spacing: 0.12em;
  background: #fff;
  border: 2px dashed #c8102e;
  padding: 0.6em 1.2em;
  border-radius: 8px;
  color: #c8102e;
  margin-bottom: 1.2em;
}

.play-again {
  display: block;
  margin: 0 auto;
  background: #c8102e;
  color: #fff;
  border: none;
  padding: 0.8em 2em;
  font-size: clamp(13px, 2vmin, 18px);
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 150ms ease, background 150ms ease;
}

.play-again:hover {
  background: #a00d24;
  transform: scale(1.05);
}
