/* Cheetos Rich Media Ad Unit (300x600 IAB Half-Page) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background-color: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Impact', 'Arial Black', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  touch-action: none;
}

/* 300x600 Fixed Container */
.ad-unit {
  position: relative;
  width: 300px;
  height: 600px;
  max-width: 300px;
  max-height: 600px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  cursor: default;
}

/* Hidden video element used purely as compositor source */
#chester-video {
  display: none;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Background Themes & Gradients
   ========================================================================== */
.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: background 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.theme-pack1 .bg-layer {
  background: linear-gradient(165deg, #FF9900 0%, #FFD000 100%);
}

.theme-pack2 .bg-layer {
  background: linear-gradient(165deg, #D91E18 0%, #FF5722 100%);
}

.theme-pack3 .bg-layer {
  background: linear-gradient(165deg, #1A1A1A 0%, #8E2800 100%);
}

.theme-pack4 .bg-layer {
  background: linear-gradient(165deg, #6E3514 0%, #D97B29 100%);
}

/* Subtle Cheetos energy burst rays overlay */
.bg-burst {
  position: absolute;
  inset: -50px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
  mix-blend-mode: overlay;
  animation: burst-rotate 30s linear infinite;
}

@keyframes burst-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 15%, transparent 16%);
  background-size: 14px 14px;
  pointer-events: none;
}

/* ==========================================================================
   Chester Aura (Glow behind Chester when dragging over drop zone)
   ========================================================================== */
.chester-aura {
  position: absolute;
  top: 170px;
  left: 45px;
  width: 210px;
  height: 290px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 50, 0.85) 0%, rgba(255, 150, 0, 0.45) 55%, transparent 75%);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 2;
  filter: blur(12px);
}

.aura-active .chester-aura {
  opacity: 1;
  transform: scale(1.18);
  animation: aura-pulse 1s infinite alternate ease-in-out;
}

@keyframes aura-pulse {
  0% { transform: scale(1.12); filter: blur(10px); }
  100% { transform: scale(1.28); filter: blur(16px); }
}

/* ==========================================================================
   Compositor Canvas
   ========================================================================== */
.chester-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 600px;
  z-index: 3;
  pointer-events: none;
  transform-origin: 50% 58%;
  transform: scale(0.86);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.aura-active .chester-canvas {
  filter: drop-shadow(0 0 16px rgba(255, 230, 0, 0.85)) drop-shadow(0 0 30px rgba(255, 130, 0, 0.65));
  transform: scale(0.88);
}

/* ==========================================================================
   Chester Feeding Drop Zone
   ========================================================================== */
.drop-zone {
  position: absolute;
  top: 180px;
  left: 45px;
  width: 210px;
  height: 240px;
  z-index: 4;
  border-radius: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.drop-target-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  top: 40px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0);
  transform: scale(0.8);
  transition: all 0.3s ease;
  pointer-events: none;
}

.aura-active .drop-target-ring {
  border-color: rgba(255, 255, 255, 0.95);
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(255, 240, 0, 0.8), inset 0 0 20px rgba(255, 240, 0, 0.5);
  animation: ring-spin 4s linear infinite;
}

@keyframes ring-spin {
  0% { transform: rotate(0deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1.1); }
}

/* ==========================================================================
   Header UI & Flavor Badge
   ========================================================================== */
.ad-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  padding: 8px 14px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.brand-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.cheetos-logo-img {
  height: 50px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  display: block;
}

.mute-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #FFF;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.mute-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.65);
  border-color: #FFF;
}

.sound-icon {
  width: 18px;
  height: 18px;
}

.icon-hidden {
  display: none;
}

.main-headline {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 19px;
  line-height: 1.05;
  color: #FFFFFF;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 2px;
  text-shadow: 
    -1.5px -1.5px 0 #000,  
     1.5px -1.5px 0 #000,
    -1.5px  1.5px 0 #000,
     1.5px  1.5px 0 #000,
     0 3px 0 #000,
     0 6px 10px rgba(0, 0, 0, 0.5);
  animation: headline-bob 2.4s ease-in-out infinite;
}

@keyframes headline-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.flavor-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background-color: #FFD000;
  box-shadow: 0 0 6px #FFD000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-pack1 .badge-dot { background-color: #FFD000; box-shadow: 0 0 8px #FFD000; }
.theme-pack2 .badge-dot { background-color: #FF5722; box-shadow: 0 0 8px #FF5722; }
.theme-pack3 .badge-dot { background-color: #FF8A00; box-shadow: 0 0 8px #FF8A00; }
.theme-pack4 .badge-dot { background-color: #FFA726; box-shadow: 0 0 8px #FFA726; }

.flavor-name {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.8px;
  color: #FFF;
  text-transform: uppercase;
}

/* ==========================================================================
   Prompt Guidance
   ========================================================================== */
.prompt-container {
  position: absolute;
  top: 100px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.prompt-text {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #FFF;
  background: rgba(0, 0, 0, 0.75);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  animation: prompt-pulse 1.6s infinite ease-in-out;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  max-width: 275px;
  text-align: center;
  white-space: nowrap;
}

.prompt-arrow {
  font-size: 11px;
  color: #FFF;
  margin-top: 1px;
  animation: arrow-bounce 1s infinite alternate ease-in-out;
  text-shadow: 0 1px 3px #000;
}

@keyframes prompt-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 14px rgba(255, 255, 255, 0.8); }
}

@keyframes arrow-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* ==========================================================================
   Packs Container (2 UP & 2 DOWN, Increased Size)
   ========================================================================== */
.packs-container {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.pack-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: grab;
  cursor: -webkit-grab;
  touch-action: none;
  pointer-events: auto;
  width: 76px;
}

/* 2 UP */
.pack-up-left {
  top: 135px;
  left: 8px;
}

.pack-up-right {
  top: 135px;
  right: 8px;
}

/* 2 DOWN */
.pack-down-left {
  top: 360px;
  left: 8px;
}

.pack-down-right {
  top: 360px;
  right: 8px;
}

.pack-slot:active {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

.pack-wrapper {
  position: relative;
  width: 100%;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: bottom center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pack-slot:hover .pack-wrapper {
  transform: scale(1.12) translateY(-4px);
}

.pack-img {
  max-width: 76px;
  max-height: 90px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
  transition: filter 0.2s ease;
}

.pack-slot:hover .pack-img {
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.65)) brightness(1.08);
}

.pack-label {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 10px;
  letter-spacing: 0.4px;
  color: #FFF;
  background: rgba(0, 0, 0, 0.6);
  padding: 1.5px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px #000;
  margin-top: 3px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

/* Bobbing animation for packs in tray */
.bobbing {
  animation: pack-bob 2.2s infinite ease-in-out;
}

.delay-0 { animation-delay: 0.0s; }
.delay-1 { animation-delay: 0.35s; }
.delay-2 { animation-delay: 0.7s; }
.delay-3 { animation-delay: 1.05s; }

@keyframes pack-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ==========================================================================
   Dragging Ghost / Clone
   ========================================================================== */
.drag-ghost {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100;
  display: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 15px 20px rgba(0, 0, 0, 0.55)) brightness(1.1);
  will-change: transform, left, top;
}

.drag-ghost img {
  width: 90px;
  height: 108px;
  object-fit: contain;
  transform: rotate(8deg) scale(1.12);
}

.pack-slot.is-dragging .pack-wrapper {
  opacity: 0.25;
}

/* ==========================================================================
   Footer & CTA Button
   ========================================================================== */
.ad-footer {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
  padding: 0 14px;
}

.cta-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 40px;
  background: linear-gradient(180deg, #FFED4A 0%, #FF9900 60%, #E66A00 100%);
  border: 2px solid #FFFFFF;
  border-radius: 20px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(255, 200, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  animation: cta-pulse 1.8s infinite ease-in-out;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cta-btn:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.cta-btn:active {
  transform: scale(0.97);
}

.cta-text {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 18px;
  letter-spacing: 1.2px;
  color: #7A2800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  z-index: 2;
}

.cta-shine {
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.85) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: cta-sweep 2.8s infinite;
  z-index: 1;
}

@keyframes cta-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 200, 0, 0.4);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 220, 0, 0.85);
  }
}

@keyframes cta-sweep {
  0% { left: -60%; }
  35% { left: 140%; }
  100% { left: 140%; }
}
