@import url(https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&display=swap);
@import url(https://fonts.googleapis.com/css2?family=Heebo:wght@400;700&family=Rubik:wght@400;600;700&display=swap);
@import url(https://fonts.googleapis.com/css2?family=VT323&display=swap);
/* Preview Banner Styles */
.preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #4285f4;
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.preview-banner-text {
    font-weight: bold;
    font-size: 14px;
}

.preview-banner-button {
    background-color: white;
    color: #4285f4;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.preview-banner-button:hover {
    background-color: #f5f5f5;
}

.preview-banner-button:active {
    background-color: #e5e5e5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Add padding to body when banner is active */
body.has-preview-banner {
    padding-top: 40px !important;
} 
/* ===========================
   Modern Scratch Card UI 2024
   =========================== */

/* !!! IMPORTANT - DO NOT REMOVE THESE COMMENTS !!! 
 * -----------------------------------------------
 * STYLING SCOPE WARNING:
 * 1. All styles in this file MUST be scoped under .scratch-card-root
 * 2. NEVER add global styles (html, body, :root) here
 * 3. This file is for the scratch card component ONLY
 * 4. Changes here should NEVER affect the admin panel
 * 5. If you need global styles, create a separate global.css file
 * -----------------------------------------------
 * Example of correct scoping:
 * .scratch-card-root .some-class { ... }
 * 
 * Example of what NOT to do:
 * body { ... }
 * :root { ... }
 * html { ... }
 * -----------------------------------------------
 */

/* Import banner styles */

/* Scratch Card Main Component */
.scratch-card-root {
  position: relative;
  width: 100%;
  height: 100%;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
  overflow: auto; /* Change from 'hidden' to 'auto' to allow scrolling */
  min-height: 100vh; /* Ensure full height */
}

/* Virtual Canvas Wrapper - container for scaled canvas */
.virtual-canvas-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: auto; /* Allow scrolling if needed */
}

/* Virtual Canvas Container - exact match with studio */
.virtual-canvas-container {
  position: relative;
  width: 100%;
  max-width: 1280px; /* VIRTUAL_CANVAS width */
  height: auto;
  aspect-ratio: 16 / 9; /* Based on 1280x720 dimensions */
  box-sizing: border-box;
  overflow: visible !important; /* Allow elements to overflow container boundaries */
  margin: 0 auto; /* Center the container */
}

/* Studio elements - both text and other elements */
.virtual-canvas-container .studio-element {
  position: absolute;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Text element specific styles */
.virtual-canvas-container .studio-element.text {
  font-family: 'Inter', sans-serif !important;
  line-height: 1.2 !important;
  white-space: pre-wrap !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  /* Remove any potential inherited properties that might affect font size */
  font-size: inherit !important; /* Allow inline styles to control font size */
  text-transform: none !important; /* Default value, can be overridden by inline styles */
  letter-spacing: normal !important; /* Default value, can be overridden by inline styles */
}

/* Force "ONLY AVAILABLE TODAY" to be single line */
#text-1743227359760 {
  white-space: nowrap !important;
}

/* Loading State */
.scratch-card-root.loading {
  cursor: wait;
}

/* Error message display */
.scratch-card-error {
  color: #d32f2f;
  padding: 20px;
  text-align: center;
  font-family: sans-serif;
}

/* Scratch area styling */
.studio-scratch-area {
  position: absolute;
  overflow: visible !important;
}

/* 
 * Basic properties only - main styling is in shared-renderer.css
 * DO NOT add cover design styles here!
 */
.studio-scratch-cover {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Preview mode border */
.virtual-canvas-container.preview-mode {
  border: none !important;
}

/* Loading State */
.scratch-card-root.loading {
  cursor: wait;
}

.scratch-card-root .loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  overflow: hidden;
}

.scratch-card-root .loading-overlay::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: radial-gradient(
    circle at center,
    rgba(100, 200, 255, 0.03) 0%,
    rgba(100, 200, 255, 0) 60%
  );
  animation: bgPulse 8s ease-in-out infinite;
  z-index: -1;
}

@keyframes bgPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

.scratch-card-root .loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.scratch-card-root .loading-logo-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scratch-card-root .loading-logo {
  max-width: 100px;
  height: auto;
  z-index: 2;
  opacity: 0.95;
  animation: loadingPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(100, 200, 255, 0.5));
}

.scratch-card-root .loading-ring {
  position: absolute;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-accent);
  animation: loadingSpin 1.4s linear infinite;
}

.scratch-card-root .loading-ring::before,
.scratch-card-root .loading-ring::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 1px solid rgba(200, 230, 255, 0.15);
  border-radius: 50%;
  animation: loadingRipple 3s ease-out infinite;
}

.scratch-card-root .loading-ring::after {
  animation-delay: 1.5s;
}

@keyframes loadingRipple {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  80%, 100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.scratch-card-root .loading-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.5px;
  animation: loadingTextPulse 1.5s ease-in-out infinite;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loadingPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes loadingTextPulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Content Animation */
.scratch-card-root .app-wrapper {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  visibility: hidden;
}

.scratch-card-root.content-loaded .app-wrapper {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Element-specific animations */
.scratch-card-root .campaign-container > * {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scratch-card-root.content-loaded .campaign-container > * {
  opacity: 1;
  transform: translateY(0);
}

.scratch-card-root .campaign-title {
  transition-delay: 0.1s;
}

.scratch-card-root .campaign-description {
  transition-delay: 0.2s;
}

.scratch-card-root .campaign-logo-container {
  transition-delay: 0.05s;
}

.scratch-card-root .card-wrapper {
  transition-delay: 0.3s;
}

.scratch-card-root .replay-logo {
  transition-delay: 0.4s;
}

/* Skeleton Loader */
.scratch-card-root .skeleton {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.scratch-card-root .skeleton-title {
  height: 38px;
  width: 80%;
  margin: 0 auto var(--space-sm) auto;
}

.scratch-card-root .skeleton-description {
  height: 18px;
  width: 90%;
  margin: 0 auto var(--space-md) auto;
}

.scratch-card-root .skeleton-description:after {
  content: '';
  display: block;
  height: 18px;
  width: 70%;
  margin: 10px auto 0;
  background: inherit;
  border-radius: inherit;
}

.scratch-card-root .skeleton-card {
  width: 100%;
  aspect-ratio: 4/3;
  margin: 0 auto;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Base Variables */
.scratch-card-root {
  /* Colors */
  --color-primary: #1a1f2c;
  --color-secondary: #0a0c10;
  --color-white: #ffffff;
  --color-error: #FFD700;
  --color-accent: #4a90e2;
  --color-success: #50E3C2;
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.95);
  
  /* Gradients */
  --gradient-bg: radial-gradient(circle at 50% -20%, var(--color-primary), var(--color-secondary));
  --gradient-container: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  --gradient-text: linear-gradient(135deg, #ffffff 0%, #ffffff 50%, rgba(255, 255, 255, 0.98) 100%);
  
  /* Shadows */
  --shadow-text: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-container: 
    0 0 80px rgba(0, 123, 255, 0.12),
    0 0 160px rgba(0, 123, 255, 0.08),
    inset 0 2px 15px rgba(255, 255, 255, 0.06);
  
  /* Borders */
  --border-light: 1px solid rgba(255, 255, 255, 0.1);
  --border-radius: clamp(12px, 2vw, 24px);
  
  /* Spacing */
  --space-xs: clamp(8px, 1vw, 12px);
  --space-sm: clamp(12px, 2vw, 20px);
  --space-md: clamp(15px, 3vw, 25px);
  --space-lg: clamp(20px, 4vw, 30px);
  
  /* Typography */
  --font-size-sm: clamp(15px, 2.2vw, 17px);
  --font-size-lg: clamp(24px, 4.5vw, 32px);
  --line-height-text: 1.8;
  
  /* Animations */
  --transition-hover: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --float-animation: cardFloat 12s ease-in-out infinite;
  
  /* Scrolling */
  scroll-behavior: smooth;
}

/* Root Container - ensure adequate space for full-size canvas */
.scratch-card-root {
  background: var(--gradient-bg);
  min-height: 100vh;
  display: flex;
  align-items: flex-start; /* Change from center to allow scrolling from top */
  justify-content: center;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
  padding-bottom: 30px;
  padding-top: 30px; /* Add top padding */
}

/* Layout Components */
.app-wrapper {
  width: min(100% - 40px, 800px);
  margin: 20px auto;
  position: relative;
  z-index: 2;
}

.campaign-container {
  background: var(--gradient-container);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-container);
  border: var(--border-light);
  display: grid;
  gap: var(--space-sm);
  grid-template-rows: auto auto 1fr;
  max-height: none;
}

/* Typography */
.campaign-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform-origin: center;
  transition: transform var(--transition-hover);
  cursor: default;
}

.campaign-title:hover {
  transform: scale(1.02) translateY(-2px);
}

.campaign-description {
  font-size: var(--font-size-sm);
  font-weight: 500;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff;
  line-height: var(--line-height-text);
  margin-bottom: var(--space-md);
  padding: 0 var(--space-sm);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: pre-line;
  transform-origin: center;
  transition: transform var(--transition-hover);
  cursor: default;
}

.campaign-description:hover {
  transform: scale(1.01) translateY(-2px);
}

/* Campaign Logo */
.campaign-logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-md);
  padding: 0 var(--space-sm);
}

.campaign-logo {
  max-width: 140px;
  max-height: 50px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform var(--transition-hover);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  margin-bottom: 10px;
}

.campaign-logo:hover {
  transform: scale(1.03) translateY(-1px);
}

/* Responsive adjustments for the logo */
@media (min-width: 768px) {
  .campaign-logo {
    max-width: 160px;
    max-height: 60px;
  }
}

@media (max-width: 420px) {
  .campaign-logo {
    max-width: 120px;
    max-height: 45px;
  }
}

/* Card Components */
.card-wrapper {
  width: 100%;
  max-width: min(500px, 85vw);
  margin: 0 auto;
  padding: 0;
  position: relative;
  animation: var(--float-animation);
  will-change: transform;
}

#js--sc--container {
  width: 100% !important;
  aspect-ratio: 4/3;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

#js--sc--container img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: inherit;
  z-index: 1;
}

/* Win Message */
.win-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-bounce);
  z-index: 10;
  box-shadow: 
    0 0 100px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(74, 144, 226, 0.15);
  text-align: center;
  min-width: min(280px, 80%);
  max-width: 90%;
  margin: auto;
}

.win-message.revealed {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  animation: 
    prizeReveal 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
    prizeGlow 2s ease-in-out infinite;
}

.win-message p {
  font-size: clamp(24px, 4vw, 32px);
  margin: 0;
  padding: var(--space-sm);
  color: #ffffff;
  line-height: 1.4;
  font-weight: 800;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.02em;
  animation: prizeTextReveal 0.8s ease-out 0.4s forwards;
  opacity: 0;
  transform: translateY(10px);
  position: relative;
}

.win-message p::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, 
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  filter: blur(30px);
  z-index: -1;
  opacity: 0;
  animation: glowPulse 2s ease-in-out infinite;
}

/* Enhanced Animations */
@keyframes prizeReveal {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
    filter: blur(10px);
  }
  40% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.9;
    filter: blur(0);
  }
  60% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes prizeTextReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    filter: blur(8px);
  }
  60% {
    opacity: 0.8;
    transform: translateY(-5px) scale(1.05);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes prizeGlow {
  0%, 100% {
    box-shadow: 
      0 0 100px rgba(0, 0, 0, 0.3),
      0 0 60px rgba(74, 144, 226, 0.15);
  }
  50% {
    box-shadow: 
      0 0 120px rgba(0, 0, 0, 0.4),
      0 0 80px rgba(74, 144, 226, 0.2);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.15;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.02);
  }
}

/* Error Message */
.error-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.85);
  color: var(--color-text-primary);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.error-message h3 {
  color: var(--color-error);
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  text-shadow: var(--shadow-text);
}

.error-message p {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  max-width: 80%;
  opacity: 0.95;
  text-shadow: var(--shadow-text);
}

/* Particles Background */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: screen;
}

/* Animations */
@keyframes cardFloat {
  0%, 100% { 
    transform: translateY(0);
  }
  50% { 
    transform: translateY(-12px);
  }
}

/* Error Animation */
@keyframes errorIconPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 64, 129, 0.2));
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 64, 129, 0.5);
    filter: drop-shadow(0 0 15px rgba(255, 64, 129, 0.35));
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 64, 129, 0.2));
  }
}

/* Error Screen Styles */
.error-screen-animated {
  animation: fadeIn 0.5s ease-out;
}

.error-screen-animated .error-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 64, 129, 0.4) 0%, rgba(255, 64, 129, 0) 70%);
  border-radius: 50%;
  filter: blur(15px);
  animation: glowPulse 3s ease-in-out infinite;
  z-index: -1;
}

@keyframes glowPulse {
  0% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media Queries */
@media (max-width: 768px) {
  .scratch-card-root {
    --font-size-lg: clamp(22px, 4vw, 28px);
    --font-size-sm: clamp(14px, 2vw, 16px);
    --space-lg: clamp(15px, 3vw, 25px);
  }

  .campaign-container {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .app-wrapper {
    width: min(100% - 24px, 450px);
  }

  .campaign-container {
    padding: var(--space-sm);
  }

  .card-wrapper {
    max-width: min(450px, 80vw);
  }
}

/* Small phones (Galaxy S8, etc) */
@media (max-width: 360px) {
  .app-wrapper {
    width: min(100% - 16px, 400px);
  }

  .campaign-container {
    padding: var(--space-xs);
  }

  .card-wrapper {
    max-width: min(400px, 75vw);
  }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
  .scratch-card-root {
    height: auto;
    min-height: 100vh;
    padding: var(--space-sm) 0;
    display: block;
    overflow-y: auto;
  }

  .app-wrapper {
    margin: 20px auto;
  }

  .card-wrapper {
    max-width: min(450px, 50vw);
    margin-bottom: 20px;
  }
}

/* RTL Support */
[dir="rtl"] .campaign-container,
[dir="rtl"] .campaign-title,
[dir="rtl"] .campaign-description,
[dir="rtl"] .win-message,
[dir="rtl"] .win-message p {
  font-family: 'Rubik', sans-serif;
  direction: rtl;
  text-align: center;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .campaign-title,
  .campaign-description,
  .card-wrapper {
    animation: none;
    transform: none;
    transition: none;
  }
}

/* Replay Logo */
.scratch-card-root .replay-logo {
  display: block;
  text-align: center;
  margin: 20px auto 15px;
  opacity: 0;
  transition: opacity 0.6s ease;
  position: relative;
  visibility: hidden;
}

.scratch-card-root.content-loaded .replay-logo {
  opacity: 0.5;
  visibility: visible;
}

.scratch-card-root .replay-logo:hover {
  opacity: 0.7;
}

.scratch-card-root .replay-logo img {
  height: 18px;
  width: auto;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.2));
}

@media (max-width: 768px) {
  .scratch-card-root .replay-logo img {
    height: 16px;
  }
}

/* Additional loader improvements */
.loading-text {
  margin-top: 15px;
  font-size: 16px;
  letter-spacing: 0.5px;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ensure error content is properly displayed */
.error-screen-animated h2,
.error-screen-animated p,
.error-screen-animated button {
  animation: fadeSlideUp 0.6s ease-out forwards;
  opacity: 0;
}

.error-screen-animated h2 {
  animation-delay: 0.1s;
}

.error-screen-animated p {
  animation-delay: 0.3s;
}

.error-screen-animated button {
  animation-delay: 0.5s;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Add a subtle shimmer to button on hover */
@keyframes buttonShimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* RTL Language Support */
[dir="rtl"] {
  text-align: right;
  font-family: "Segoe UI", "David", "Heebo", "Rubik", "Assistant", Arial, sans-serif;
}

[dir="rtl"] .loading-text {
  font-family: "Segoe UI", "David", "Heebo", "Rubik", "Assistant", Arial, sans-serif;
  font-weight: bold;
}

[dir="rtl"] .win-message, 
[dir="rtl"] .campaign-title, 
[dir="rtl"] .campaign-description {
  font-family: "Segoe UI", "David", "Heebo", "Rubik", "Assistant", Arial, sans-serif;
}

/* Media Queries for full-size canvas - enhanced responsiveness */
@media (max-width: 1300px) {
  .virtual-canvas-container {
    max-width: 95%; /* Slightly smaller on medium screens */
  }
}

@media (max-width: 992px) {
  .virtual-canvas-container {
    max-width: 90%; /* Smaller on tablet screens */
  }
  
  .virtual-canvas-wrapper {
    padding: 10px;
  }
}

@media (max-width: 768px) {
  .virtual-canvas-container {
    max-width: 100%; /* Full width on mobile */
  }
  
  .virtual-canvas-wrapper {
    padding: 5px;
    justify-content: center; /* Keep canvas centered on smaller screens */
  }
  
  .scratch-card-root {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
}



.money-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    overflow: hidden;
    z-index: -1;
    will-change: transform;
}

.light-rays {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 215, 0, 0.15) 0%,
        rgba(255, 215, 0, 0.1) 20%,
        rgba(255, 215, 0, 0.05) 40%,
        transparent 70%);
    animation: rayRotate 60s linear infinite;
    will-change: transform;
}

.money-symbol {
    position: absolute;
    color: #ffd700;
    opacity: 0;
    animation: moneyFloat 7s linear infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    will-change: transform, opacity;
    pointer-events: none;
}

.money-content-container {
    position: relative;
    z-index: 1;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin: 0 auto;
    padding: 2.5rem;
    width: 90%;
    max-width: 950px;
    min-height: 400px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.2),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    left: 0;
    right: 0;
}

.money-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(32px, 5vw, 48px);
    color: #ffd700;
    margin: 0 0 1.5rem;
    text-align: center;
    width: 100%;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: shimmer 3s ease-in-out infinite;
}

.money-title-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0 1rem;
}

.money-word {
    display: inline-flex;
    white-space: nowrap;
}

.money-char {
    display: inline-block;
    opacity: 0;
    animation: letterReveal 0.5s ease-out forwards;
}

.money-space {
    display: inline-block;
    opacity: 0;
    animation: letterReveal 0.5s ease-out forwards;
    width: 0.25em;
}

.money-text {
    font-family: 'Cinzel', serif;
    font-size: clamp(18px, 2.5vw, 24px);
    color: #ffd700;
    margin: 0 0 2rem;
    line-height: 1.6;
    width: 100%;
    max-width: 600px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

.scratch-card {
    position: relative !important;
    width: 100% !important;
    max-width: 550px !important;
    aspect-ratio: 4/3;
    margin: 2rem auto;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
}

.scratch-card::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 2px solid #ffd700;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    pointer-events: none;
    z-index: 0;
}

/* Hebrew-specific styles */
[dir="rtl"] .money-content-container {
    direction: rtl;
}

[dir="rtl"] .money-title {
    font-family: 'Rubik', 'Heebo', serif;
}

[dir="rtl"] .money-title-wrapper {
    direction: rtl;
}

[dir="rtl"] .money-word {
    direction: rtl;
}

[dir="rtl"] .money-text {
    font-family: 'Heebo', serif;
}

/* Animations */
@keyframes moneyFloat {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }
    15% {
        opacity: 0.8;
    }
    85% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

@keyframes rayRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0%, 100% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
    }
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .money-content-container {
        padding: 1.5rem;
        min-height: 350px;
        margin: 1rem auto;
        width: 95%;
    }

    .scratch-card {
        max-width: 450px;
        margin: 1rem auto;
    }

    .money-title {
        font-size: clamp(24px, 4vw, 32px);
        margin-bottom: 1rem;
    }
    
    .money-title-wrapper {
        padding: 0 0.5rem;
    }
    
    .money-text {
        margin-bottom: 1rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .money-content-container {
        padding: 1rem;
        width: 92%;
        margin: 0.5rem auto;
        left: 0;
        right: 0;
        transform: translateX(0);
    }
    
    .scratch-card {
        max-width: 100%;
        margin: 0.5rem auto;
        width: 100% !important;
    }
}

.money-win-message {
    display: none;
}

.scratch-card .win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-lg);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-bounce);
    z-index: 10;
    box-shadow: 
        0 0 100px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(74, 144, 226, 0.15);
    text-align: center;
    min-width: min(280px, 80%);
    max-width: 90%;
    margin: auto;
}

.scratch-card .win-message.revealed {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    animation: 
        prizeReveal 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
        prizeGlow 2s ease-in-out infinite;
}

.scratch-card .win-message p {
    font-size: clamp(24px, 4vw, 32px);
    margin: 0;
    padding: var(--space-sm);
    color: #ffffff;
    line-height: 1.4;
    font-weight: 800;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.02em;
    animation: prizeTextReveal 0.8s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(10px);
    position: relative;
}

.scratch-card .win-message p::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.1) 100%
    );
    filter: blur(30px);
    z-index: -1;
    opacity: 0;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes prizeReveal {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
        filter: blur(10px);
    }
    40% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
        filter: blur(0);
    }
    60% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes prizeTextReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
        filter: blur(8px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.05);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes prizeGlow {
    0%, 100% {
        box-shadow: 
            0 0 100px rgba(0, 0, 0, 0.3),
            0 0 60px rgba(74, 144, 226, 0.15);
    }
    50% {
        box-shadow: 
            0 0 120px rgba(0, 0, 0, 0.4),
            0 0 80px rgba(74, 144, 226, 0.2);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.15;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.02);
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .scratch-card .win-message {
        width: min(92%, 260px);
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .scratch-card .win-message {
        width: min(95%, 240px);
        padding: 1rem;
        gap: 0.5rem;
    }
}

/* Add RTL support for win message */
[dir="rtl"] .scratch-card .win-message {
    font-family: 'Rubik', 'Heebo', serif;
}

@keyframes moneyWinMessageAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hide particles in money theme */
#particles {
    display: none !important;
}

/* Replay Logo */
.replay-logo {
    position: relative;
    display: block;
    margin: 30px auto 0;
    text-align: center;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    clear: both;
    width: 100%;
}

.replay-logo:hover {
    opacity: 0.7;
}

.replay-logo img {
    height: 18px;
    width: auto;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.2));
}

/* Ensure the theme container properly contains the logo and centers all content */
.theme-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
    margin: 0 auto;
    left: 0;
    right: 0;
} 
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    z-index: -1;
    opacity: 0.8;
}

.matrix-column {
    position: absolute;
    top: -100%;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 32px;
    line-height: 1.5;
    text-align: center;
    will-change: transform;
    transform: translateZ(0);
}

.matrix-char {
    display: block;
    opacity: 0;
    animation: fadeInOut 1.5s ease-out infinite;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
    transform: translateZ(0);
}

.code-content-container {
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    margin: 0 auto;
    padding: 2.5rem;
    width: 90%;
    max-width: 950px;
    min-height: 400px;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.15);
    border: 1px solid rgba(0, 255, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    left: 0;
    right: 0;
}

.matrix-title {
    font-family: 'VT323', monospace;
    font-size: clamp(32px, 5vw, 48px);
    color: #0f0;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    margin: 0 0 1.5rem;
    letter-spacing: 3px;
    animation: titleGlitch 2s infinite;
    width: 100%;
    text-align: center;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.matrix-text {
    font-family: 'VT323', monospace;
    font-size: clamp(18px, 2.5vw, 24px);
    color: #0f0;
    margin: 0 0 2rem;
    line-height: 1.6;
    text-shadow: 0 0 10px #0f0;
    letter-spacing: 1px;
    width: 100%;
    max-width: 600px;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    white-space: pre-line;
}

.scratch-card {
    position: relative !important;
    width: 100% !important;
    max-width: 550px !important;
    aspect-ratio: 4/3;
    margin: 1rem auto;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
}

.scratch-card::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 2px solid #0f0;
    animation: pulse 2s infinite;
    pointer-events: none;
    border-radius: 8px;
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes titleGlitch {
    0%, 100% { 
        transform: none;
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    }
    98% {
        transform: skew(-0.5deg);
        text-shadow: -2px 0 #0ff, 2px 2px #f0f;
    }
    99% {
        transform: none;
        text-shadow: 2px -1px #0ff, -2px 1px #f0f;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px #0f0;
    }
    50% {
        box-shadow: 0 0 20px #0f0;
    }
    100% {
        box-shadow: 0 0 10px #0f0;
    }
}

@keyframes fadeInOut {
    0% { 
        opacity: 0;
        text-shadow: 0 0 4px rgba(0, 255, 0, 0.2);
    }
    20% { 
        opacity: 0.8;
        text-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
    }
    80% { 
        opacity: 0.8;
        text-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
    }
    100% { 
        opacity: 0;
        text-shadow: 0 0 4px rgba(0, 255, 0, 0.2);
    }
}

/* Add performance optimizations */
.matrix-column, .matrix-char {
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .code-content-container {
        padding: 1.5rem;
        min-height: 350px;
        margin: 1rem auto;
        width: 95%;
    }

    .matrix-title {
        margin-bottom: 1rem;
        font-size: clamp(24px, 4vw, 32px);
    }

    .matrix-text {
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }

    .scratch-card {
        max-width: 450px;
        margin: 1rem auto;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .code-content-container {
        padding: 1rem;
        width: 92%;
        margin: 0.5rem auto;
        left: 0;
        right: 0;
        transform: translateX(0);
    }
    
    .scratch-card {
        max-width: 100%;
        margin: 0.5rem auto;
        width: 100% !important;
    }
    
    /* Update theme container to ensure perfect centering */
    .theme-container {
        padding: 0;
        margin: 0 auto;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Add smooth transitions */
.code-content-container, .matrix-title, .matrix-text {
    transition: all 0.3s ease-out;
}

.matrix-win-message {
    display: none;
}

.scratch-card .win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-lg);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-bounce);
    z-index: 10;
    box-shadow: 
        0 0 100px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(74, 144, 226, 0.15);
    text-align: center;
    min-width: min(280px, 80%);
    max-width: 90%;
    margin: auto;
}

.scratch-card .win-message.revealed {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    animation: 
        prizeReveal 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
        prizeGlow 2s ease-in-out infinite;
}

.scratch-card .win-message p {
    font-size: clamp(24px, 4vw, 32px);
    margin: 0;
    padding: var(--space-sm);
    color: #ffffff;
    line-height: 1.4;
    font-weight: 800;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.02em;
    animation: prizeTextReveal 0.8s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(10px);
    position: relative;
}

.scratch-card .win-message p::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.1) 100%
    );
    filter: blur(30px);
    z-index: -1;
    opacity: 0;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes prizeReveal {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
        filter: blur(10px);
    }
    40% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
        filter: blur(0);
    }
    60% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes prizeTextReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
        filter: blur(8px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.05);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes prizeGlow {
    0%, 100% {
        box-shadow: 
            0 0 100px rgba(0, 0, 0, 0.3),
            0 0 60px rgba(74, 144, 226, 0.15);
    }
    50% {
        box-shadow: 
            0 0 120px rgba(0, 0, 0, 0.4),
            0 0 80px rgba(74, 144, 226, 0.2);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.15;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.02);
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .scratch-card .win-message {
        width: min(92%, 260px);
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .scratch-card .win-message {
        width: min(95%, 240px);
        padding: 1rem;
        gap: 0.5rem;
    }
}

/* Add RTL support for win message */
[dir="rtl"] .scratch-card .win-message {
    font-family: 'Rubik', 'Heebo', monospace;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hide particles in code theme */
#particles {
    display: none !important;
}

/* Replay Logo */
.replay-logo {
    position: relative;
    display: block;
    margin: 30px auto 0;
    text-align: center;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    clear: both;
    width: 100%;
}

.replay-logo:hover {
    opacity: 0.7;
}

.replay-logo img {
    height: 18px;
    width: auto;
    filter: drop-shadow(0 0 3px rgba(0, 255, 170, 0.2));
}

/* Ensure the theme container properly contains the logo and centers all content */
.theme-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
    margin: 0;
    left: 0;
    right: 0;
} 
