/* MemoDuck - Bizarre Cartoon / High-Velocity Styles */
:root {
  --bg-main: #1A2130;
  --bg-card: #222A3B;
  --duck-yellow: #FFD166;
  --acid-green: #06D6A0;
  --fire-orange: #FF6B6B;
  --neon-cyan: #4ECDC4;
  --neon-pink: #FF007F;
  --neon-purple: #A855F7;
}

body {
  background-color: var(--bg-main);
  color: #F8FAFC;
  font-family: 'Fredoka', -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* Glass Card */
.card-glass {
  background: rgba(34, 42, 59, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* 3D Tactile Buttons */
.btn-tactile {
  border-radius: 18px;
  font-weight: 800;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 5px 0 0 #0F172A, 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(0);
}

.btn-tactile:active {
  transform: translateY(3px) scale(0.97);
  box-shadow: 0 2px 0 0 #0F172A, 0 4px 8px rgba(0, 0, 0, 0.25);
}

/* ========================================== */
/* DUCK TILE (3x3 MATRIX, ZERO TEXT)          */
/* ========================================== */
.duck-tile {
  background-color: var(--bg-card);
  border: 2.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: 0 6px 0 0 #121722, 0 10px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s, box-shadow 0.15s;
}

.duck-tile:active {
  transform: translateY(3px) scale(0.93);
  box-shadow: 0 2px 0 0 #121722, 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Tactical Shuffle Animation (Flip & Bounce) */
@keyframes tileFlipBounce {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.65) rotate(14deg); opacity: 0.3; filter: blur(2px); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; filter: blur(0); }
}

.tile-shuffling {
  animation: tileFlipBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Tile Lighting Pulses (300ms) */
.duck-tile.tile-lit {
  border-color: var(--duck-yellow);
  box-shadow: 0 0 30px var(--duck-yellow), inset 0 0 20px rgba(255, 209, 102, 0.5);
  transform: scale(1.08);
  background-color: rgba(255, 209, 102, 0.25);
}

.duck-tile.tile-hit {
  border-color: var(--acid-green);
  box-shadow: 0 0 35px var(--acid-green), inset 0 0 20px rgba(6, 214, 160, 0.5);
  transform: scale(1.1);
  background-color: rgba(6, 214, 160, 0.25);
}

.duck-tile.tile-miss {
  border-color: var(--fire-orange);
  box-shadow: 0 0 35px var(--fire-orange), inset 0 0 20px rgba(239, 71, 111, 0.5);
  animation: shakeError 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeError {
  10%, 90% { transform: translate3d(-3px, 0, 0) rotate(-2deg); }
  20%, 80% { transform: translate3d(5px, 0, 0) rotate(2deg); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0) rotate(-3deg); }
  40%, 60% { transform: translate3d(7px, 0, 0) rotate(3deg); }
}

/* ========================================== */
/* 7-SECOND PATIENCE BAR                      */
/* ========================================== */
.patience-bar-container {
  width: 100%;
  height: 9px;
  background: #0F172A;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.patience-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  transition: width 0.05s linear;
}

/* Timeout Alarm Shake */
@keyframes timeoutAlert {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.04); filter: brightness(1.6) drop-shadow(0 0 14px rgba(239, 71, 111, 0.9)); }
}

.patience-timeout-flash {
  animation: timeoutAlert 0.4s ease-in-out;
}

/* ========================================== */
/* FLOATING SCORE BURST ("+150 PTS!", "BRAIN") */
/* ========================================== */
.floating-burst {
  position: fixed;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 900;
  color: #FFD166;
  text-shadow: 0 0 20px rgba(255, 209, 102, 0.9), 0 0 40px rgba(255, 107, 107, 0.8), 3px 3px 0 #0F172A;
  pointer-events: none;
  z-index: 100;
  animation: floatPop 0.75s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  white-space: nowrap;
}

@keyframes floatPop {
  0% { opacity: 0; transform: translate(-50%, 20%) scale(0.4); }
  30% { opacity: 1; transform: translate(-50%, -40%) scale(1.25); }
  70% { opacity: 1; transform: translate(-50%, -70%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.85); }
}

/* Dynamic Shift Flash Notification */
.dynamic-shift-alert {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(6, 214, 160, 0.92);
  color: #0F172A;
  font-size: 1.3rem;
  font-weight: 900;
  padding: 10px 22px;
  border-radius: 9999px;
  box-shadow: 0 0 40px rgba(6, 214, 160, 0.8);
  pointer-events: none;
  z-index: 90;
  animation: shiftBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes shiftBounce {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.8); }
}

/* Tap to play pulsating text */
@keyframes tapPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 15px rgba(255, 209, 102, 0.8); }
}

.tap-to-play-text {
  animation: tapPulse 1.4s infinite ease-in-out;
}

/* Combo flame glow */
@keyframes comboGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.6)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(255, 209, 102, 1)); }
}

.combo-flame {
  animation: comboGlow 0.9s infinite ease-in-out;
}

/* Sticky Ad Banner (320x50) */
#ad-banner-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
