/* Black Friday Coupon Rush - Styles */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #ffffff;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Advanced Coupons Header Bar */
.header-bar {
  background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
  padding: 8px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 20px;
}

.acfw-logo {
  height: 24px;
  width: auto;
  transition: transform 0.2s ease;
}

.acfw-logo:hover {
  transform: scale(1.1);
}

.header-content a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.header-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game Container */
.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 60px);
}

/* Logo Section */
.logo-section {
  margin-bottom: 10px;
  text-align: center;
}

.game-logo {
  max-width: 80px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Game Area */
.game-area {
  width: 100%;
  max-width: 800px;
  background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.play-area {
  width: 100%;
  height: calc(100vh - 180px); /* Full viewport minus header (~40px) + logo (~40px) + padding (~100px) */
  min-height: 400px; /* Minimum height for small screens */
  position: relative;
  background: linear-gradient(180deg, #87ceeb 0%, #e0f6ff 50%, #f8f8f8 100%);
  overflow: hidden;
}

/* Savings Display */
.savings-display {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffd700;
  padding: 10px 15px;
  border-radius: 10px;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.savings-label {
  margin-right: 8px;
}

.savings-value {
  font-weight: bold;
  color: #ff6b35;
}

/* Timer Display */
.timer-display {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 10px;
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  min-width: 80px;
  text-align: center;
}

.timer-display.warning {
  background: rgba(255, 0, 0, 0.9);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Character */
.character {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  z-index: 50;
  transition: left 0.1s ease-out;
}

.character-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.character.catching .character-sprite {
  transform: scale(1.1);
  animation: bounce 0.3s ease;
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1.1) translateY(0);
  }
  50% {
    transform: scale(1.2) translateY(-5px);
  }
}

/* Coupons */
.coupons-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.coupon {
  position: absolute;
  width: 120px;
  height: 120px;
  z-index: 30;
  animation: fall linear;
  transition: transform 0.1s ease;
}

.coupon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.coupon.caught {
  animation: catch 0.3s ease-out forwards;
  z-index: 60;
}

@keyframes fall {
  from {
    transform: translateY(-100px) rotate(0deg);
  }
  to {
    transform: translateY(700px) rotate(360deg);
  }
}

@keyframes catch {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* Countdown Overlay */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(5px);
}

.countdown-overlay.hidden {
  display: none;
}

.countdown-text {
  font-family: 'Fredoka One', cursive;
  font-size: 120px;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.3) rotate(-10deg);
    opacity: 0;
    color: #ff6b35;
  }
  30% {
    transform: scale(1.3) rotate(5deg);
    opacity: 1;
    color: #ffd700;
  }
  60% {
    transform: scale(0.9) rotate(-2deg);
    opacity: 1;
    color: #ffd700;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    color: #ffd700;
  }
}

/* Touch Controls (Mobile) */
.touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  z-index: 40;
  display: none;
}

.touch-indicator {
  position: absolute;
  bottom: 30px;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.8) 0%, rgba(255, 107, 53, 0.3) 100%);
  border: 3px solid #ff6b35;
  border-radius: 50%;
  display: none;
  z-index: 45;
  transform: translateX(-50%);
  animation: touchPulse 1s ease-in-out infinite;
}

@keyframes touchPulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
  }
}

/* Audio Controls */
.audio-controls {
  position: fixed;
  top: 100px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000; /* Higher than all modals and screens to ensure always visible */
}

.audio-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.audio-btn:hover {
  background: rgba(255, 107, 53, 0.8);
  transform: scale(1.1);
}

.audio-btn.disabled {
  opacity: 0.5;
  color: #999;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(10px);
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  color: #333;
  position: relative;
}

.modal-logo {
  text-align: center;
  margin-bottom: 0;
  padding: 30px 20px 10px 20px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  border-radius: 20px 20px 0 0;
}

.modal-game-logo {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.modal-header {
  background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
  color: #ffffff;
  padding: 15px 20px 20px 20px;
  text-align: center;
  border-radius: 0;
}

.modal-header h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 28px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-start-button {
  padding: 30px 30px 0px 30px;
  text-align: center;
}

.instructions {
  margin-top: -10px;
}

.modal-content {
  padding: 20px 30px 20px 30px;
}

.modal-footer {
  padding: 15px 30px 40px;
  text-align: center;
}

.play-again-section {
  text-align: center;
  margin: 10px 0;
  padding: 15px 20px;
}

.brought-to-you {
  margin-top: 15px;
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.brought-to-you a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.inline-acfw-logo {
  height: 19px;
  width: auto;
  transition: transform 0.2s ease;
}

.inline-acfw-logo:hover {
  transform: scale(1.1);
}

/* Instructions Modal */
.instructions h3 {
  color: #ff6b35;
  font-family: 'Fredoka One', cursive;
  margin: 20px 0 10px;
  font-size: 20px;
}

.instructions p {
  margin-bottom: 15px;
  line-height: 1.6;
  font-size: 16px;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 15px 0;
}

.control-item {
  background: #f0f0f0;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.control-item strong {
  display: block;
  color: #ff6b35;
  margin-bottom: 8px;
  font-size: 14px;
}

.control-item p {
  margin: 0;
  color: #666;
  font-size: 12px;
}

.coupon-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 15px 0 10px 0;
}

/* First three items fill the top row */
.coupon-values .coupon-item:nth-child(-n + 3) {
  flex: 0 0 auto;
}

/* Last two items on bottom row, centered together */
.coupon-values .coupon-item:nth-child(n + 4) {
  flex: 0 0 auto;
}

.coupon-item {
  text-align: center;
}

.coupon-item img {
  width: 150px;
  height: 100px;
  margin-bottom: 5px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.coupon-item span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

/* Game Over Screen */
.game-over-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  z-index: 2000;
  overflow-y: auto;
  display: none;
}

.game-over-screen.visible {
  display: block;
}

.game-over-content {
  max-width: 600px;
  width: 90%;
  margin: 30px auto;
  padding: 0;
  color: #333;
  background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.game-over-logo {
  text-align: center;
  margin-bottom: 18px;
  padding: 30px 20px 20px 20px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  border-radius: 20px 20px 0 0;
}

.game-over-game-logo {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Remove dark background contrast override since we now have white background */

.final-savings {
  text-align: center;
  margin-bottom: 10px;
  padding: 0 20px;
}

.final-savings h3 {
  color: #ff6b35;
  font-family: 'Fredoka One', cursive;
  margin-bottom: 5px;
  font-size: 24px;
}

.savings-big {
  font-family: 'Fredoka One', cursive;
  font-size: 60px;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin-bottom: 10px;
}

/* Name Input Section */
.name-input-section {
  text-align: center;
  margin: 0 20px 30px 20px;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  padding: 20px;
  border-radius: 15px;
  border: 2px solid #ffd700;
}

.name-input-section h4 {
  color: #f7931e;
  font-family: 'Fredoka One', cursive;
  margin-bottom: 10px;
  font-size: 20px;
}

.name-input-section p {
  margin-bottom: 15px;
  color: #666;
}

#playerNameInput {
  width: 100%;
  max-width: 300px;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  margin-bottom: 15px;
  transition: border-color 0.2s ease;
}

#playerNameInput:focus {
  outline: none;
  border-color: #ff6b35;
}

/* Brought to You By Section */
.brought-to-you-section {
  text-align: center;
  margin: 0 20px 30px 20px;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  padding: 20px;
  border-radius: 15px;
  border: 2px solid #ffd700;
}

.brought-to-you-logo {
  margin-bottom: 20px;
}

.brought-to-you-acfw-logo {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brought-to-you-content {
  margin-bottom: 0;
}

.brought-to-you-main {
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 15px;
  font-weight: normal;
}

.brought-to-you-cta {
  color: #333;
  font-size: 16px;
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 20px;
}

.brought-to-you-cta strong {
  font-weight: 600;
}

.brought-to-you-btn {
  background: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.brought-to-you-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

/* Leaderboard */
.leaderboard-section {
  padding: 0 20px 20px 20px;
}

.leaderboard-section h4 {
  color: #ff6b35;
  font-family: 'Fredoka One', cursive;
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
}

.leaderboard {
  background: #f8f8f8;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-item:nth-child(1) {
  background: linear-gradient(90deg, #ffd700 0%, #fff8dc 100%);
  font-weight: bold;
}

.leaderboard-item:nth-child(2) {
  background: linear-gradient(90deg, #c0c0c0 0%, #f5f5f5 100%);
  font-weight: bold;
}

.leaderboard-item:nth-child(3) {
  background: linear-gradient(90deg, #cd7f32 0%, #faebd7 100%);
  font-weight: bold;
}

.leaderboard-item.highlight {
  animation: highlight 2s ease-in-out;
  font-weight: bold;
}

/* Ensure gold/silver/bronze backgrounds override highlight background */
.leaderboard-item.highlight:nth-child(1) {
  background: linear-gradient(90deg, #ffd700 0%, #fff8dc 100%);
}

.leaderboard-item.highlight:nth-child(2) {
  background: linear-gradient(90deg, #c0c0c0 0%, #f5f5f5 100%);
}

.leaderboard-item.highlight:nth-child(3) {
  background: linear-gradient(90deg, #cd7f32 0%, #faebd7 100%);
}

/* For highlighted entries not in top 3 */
.leaderboard-item.highlight:nth-child(n + 4) {
  background: linear-gradient(90deg, #ff6b35 0%, #ffe0d6 100%);
}

@keyframes highlight {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.leaderboard-rank {
  font-weight: bold;
  color: #666;
  min-width: 30px;
}

.leaderboard-name {
  flex-grow: 1;
  margin-left: 15px;
  font-weight: 600;
}

.leaderboard-savings {
  font-family: 'Fredoka One', cursive;
  color: #ff6b35;
  font-weight: bold;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

/* Buttons */
.btn {
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  min-width: 150px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
  background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
  color: #ffffff;
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .header-text {
    font-size: 12px;
  }

  .acfw-logo {
    height: 20px;
  }

  .game-container {
    padding: 10px;
  }

  .game-logo {
    max-width: 70px;
  }

  .play-area {
    height: calc(100vh - 160px); /* Adjust for smaller mobile header/logo */
    min-height: 350px;
  }

  .modal-game-logo {
    width: 100px;
    height: auto;
  }

  .modal-logo {
    padding: 25px 15px 15px 15px;
  }

  .savings-display,
  .timer-display {
    font-size: 14px;
    padding: 8px 12px;
  }

  .timer-display {
    font-size: 20px;
    min-width: 60px;
  }

  .character {
    width: 140px;
    height: 140px;
  }

  .coupon {
    width: 105px;
    height: 105px;
  }

  .countdown-text {
    font-size: 80px;
  }

  .touch-controls {
    display: block;
  }

  .audio-controls {
    top: 80px;
    right: 10px;
    z-index: 3000; /* Ensure consistent z-index on mobile */
  }

  .audio-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .modal {
    width: 95%;
  }

  .modal-content {
    padding: 20px 20px 15px 20px;
  }

  .modal-footer {
    padding: 10px 20px 30px;
  }

  .game-over-content {
    padding: 20px 15px;
  }

  .game-over-game-logo {
    width: 80px;
  }

  .brought-to-you {
    font-size: 11px;
    gap: 4px;
  }

  .inline-acfw-logo {
    height: 17px;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .coupon-values {
    gap: 15px;
  }

  .coupon-item img {
    width: 120px;
    height: 120px;
  }

  .savings-big {
    font-size: 40px;
  }

  .btn {
    font-size: 16px;
    padding: 12px 25px;
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  .game-logo {
    max-width: 65px;
  }

  .play-area {
    height: calc(100vh - 150px); /* Further adjust for smaller screens */
    min-height: 300px;
  }

  .character {
    width: 130px;
    height: 130px;
  }

  .coupon {
    width: 95px;
    height: 95px;
  }

  .countdown-text {
    font-size: 60px;
  }

  .coupon-values {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 200px;
    margin: 15px auto 10px auto;
  }

  .coupon-item img {
    width: 100px;
    height: 100px;
  }

  .game-over-content {
    margin: 10px auto;
    width: 95%;
  }

  .game-over-logo {
    padding: 20px 15px 15px 15px;
  }

  .final-savings,
  .play-again-section,
  .leaderboard-section {
    padding-left: 15px;
    padding-right: 15px;
  }

  .name-input-section,
  .brought-to-you-section {
    margin-left: 15px;
    margin-right: 15px;
  }

  .game-over-game-logo {
    width: 70px;
  }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .game-container {
    padding: 5px;
  }

  .logo-section {
    margin-bottom: 5px;
  }

  .game-logo {
    max-width: 60px;
  }

  .play-area {
    height: calc(100vh - 140px); /* Maximum screen usage for very small devices */
    min-height: 250px;
  }

  .modal-game-logo {
    width: 100px;
    height: auto;
  }

  .modal-logo {
    padding: 20px 15px 12px 15px;
  }

  .character {
    width: 110px;
    height: 110px;
  }

  .coupon {
    width: 90px;
    height: 90px;
  }

  .game-over-content {
    padding: 15px 10px;
    justify-content: flex-start;
    min-height: auto;
    padding-top: 20px;
  }

  .game-over-logo {
    margin-bottom: 20px;
  }

  .game-over-game-logo {
    width: 70px;
  }
}

/* Particle Effects */
.particle {
  position: absolute;
  pointer-events: none;
  z-index: 70;
  border-radius: 50%;
  animation: particleFloat linear forwards;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(0);
    opacity: 0;
  }
}

.particle.star {
  background: radial-gradient(circle, #ffd700 0%, #ff6b35 100%);
  width: 6px;
  height: 6px;
}

.particle.sparkle {
  background: linear-gradient(45deg, #fff 0%, #ffd700 50%, #fff 100%);
  width: 4px;
  height: 4px;
  animation-duration: 0.8s;
}

.particle.burst {
  background: radial-gradient(circle, #ff6b35 0%, transparent 70%);
  width: 12px;
  height: 12px;
  animation-duration: 1.2s;
}

/* Screen shake effect */
@keyframes screenShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(2px);
  }
}

.game-area.shake {
  animation: screenShake 0.5s ease-in-out;
}

/* Savings pop animation */
.savings-pop {
  animation: savingsPop 0.3s ease-out;
}

@keyframes savingsPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Coupon glow effect for rare coupons */
.coupon.rare {
  animation: rareGlow 2s ease-in-out infinite;
}

@keyframes rareGlow {
  0%,
  100% {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  }
  50% {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
  }
}

/* Background animation */
.play-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  animation: backgroundShift 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes backgroundShift {
  0%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-10px);
  }
}
