/* Prevent body scroll when modal is active */
body.scratch-modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* MODAL BACKDROP - Completely covers website content */
#scratch-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95) !important; /* Dark overlay to hide website */
    z-index: 1000000 !important; /* Above navigation but behind modal content */
}

/* Professional Scratch Card Modal - Matching Wheel System */
#scratch-modal {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    justify-content: center;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform: translateY(-100px);
    transition: all 150ms ease-in-out;
    width: 100dvw;
    z-index: 99999999999 !important; /* Even higher than backdrop (100 billion) */
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-modal {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

#scratch-modal.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Professional Modal Wrapper - Large Like Wheel System */
#scratch-modal-wrapper-new {
    display: flex;
    flex-direction: column;
    height: 100%;
    left: 0;
    max-height: 500px;
    max-width: 500px;
    position: relative;
    top: 0;
    width: 100%;
    z-index: 2;
    transition: opacity 250ms;
    order: 1;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-modal-wrapper-new {
        max-height: 768px;
        max-width: 768px;
        order: 0;
    }
}

#scratch-modal-wrapper-new.disabled {
    opacity: 0.05;
}

/* Professional Scratch Card Structure */
.scratch-card-professional {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Professional Top Prize Display */
.scratch-top-prize {
    color: #d0bd0c;
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: inherit;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    .scratch-top-prize {
        font-size: 48px;
        margin-bottom: 30px;
    }
}

/* Side-by-Side Layout - Large Scratch Card with Compact Table */
#scratch-main-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    max-width: 950px;
    margin: 0 auto;
    padding: 15px;
    flex-wrap: wrap;
    min-height: 650px;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-main-content {
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 15px;
        max-width: 1000px;
        min-height: 800px;
        padding: 150px 20px 20px 20px;
    }
}

/* Scratch card side - main focal point */
#scratch-card-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-card-side {
        order: 1;
    }
}

/* Results side - compact */
#scratch-results-side {
    flex: 0 0 280px;
    background: transparent !important;
    border-radius: 0px;
    padding: 0 !important;
    color: #ffffff;
    box-shadow:none !important;
    border: none !important;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto !important;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-results-side {
        flex: 0 0 392px;
        order: 2;
    }
}

/* Large Professional Scratch Card Container - Clean Square Format */
#scratch-card-container {
    position: relative;
    width: 600px;
    max-width: 600px;
    height: 450px;
    margin: 20px auto;
    /* Clean professional background for the new box design */
    background: #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-bottom: 60px; /* Space for buttons and instructions */
    transform: none;
    transition: all 0.3s ease;
    border: 4px solid #d4af37; /* Gold border to match modal */
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-card-container {
        width: 600px;
        max-width: 600px;
        height: 600px;
        margin-bottom: 80px;
        border-radius: 20px;
        border: 5px solid #d4af37; /* Consistent gold border */
    }
}

#scratch-card-container.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Enhanced scratch card revealed area */
#scratch-revealed {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0a0a0a 100%);
    color: #f7ef8a;
    z-index: 1;
    font-size: 26px;
    font-weight: 700;
    padding: 20px;
    box-sizing: border-box;
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    border-radius: 10px;
}

#scratch-result {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Enhanced Wolf Symbols Container matching the design */
.wolf-symbols-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    padding: 0 20px;
}

.wolf-symbol {
    width: 80px;
    height: 80px;
    margin: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    background-color: #fff;
    padding: 5px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 3px solid #FFD700;
    position: relative;
}

.wolf-symbol.win {
    animation: winPulse 1.2s infinite;
    border-color: #32CD32;
    box-shadow: 
        0 4px 15px rgba(50, 205, 50, 0.6),
        0 0 20px rgba(50, 205, 50, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.wolf-symbol.lose {
    opacity: 0.6;
    border-color: #DC143C;
}

.x-symbol {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 56px;
    font-weight: bold;
    color: #DC143C;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 3px solid #DC143C;
    margin: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes winPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(50, 205, 50, 0.6), 0 0 20px rgba(50, 205, 50, 0.4); }
    50% { transform: scale(1.08); box-shadow: 0 6px 20px rgba(50, 205, 50, 0.8), 0 0 30px rgba(50, 205, 50, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(50, 205, 50, 0.6), 0 0 20px rgba(50, 205, 50, 0.4); }
}

/* Enhanced result text styling */
.scratch-result-text {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    font-size: 36px;
    color: #FFD700;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
    padding: 12px 25px;
    border-radius: 15px;
    display: inline-block;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

/* Large Professional scratch canvas */
#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 2;
    cursor: crosshair !important;
    border-radius: 12px;
    margin: 0 !important;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-canvas {
        width: 100% !important;
        height: 100% !important;
        cursor: crosshair !important;
        border-radius: 16px;
        margin: 0 !important;
    }
}

/* Match Three to Win instruction */
.match-three-instruction {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    text-align: center;
    width: 100%;
    letter-spacing: 1px;
    z-index: 10;
}

.match-three-instruction::before {
    content: "▲▲ ";
    color: #FFD700;
}

.match-three-instruction::after {
    content: " ▲▲";
    color: #FFD700;
}

#scratch-message {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
    padding: 10px 0;
    z-index: 10;
}

/* Add a more prominent scratch instruction */
.scratch-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #FFD700;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 5;
    pointer-events: none; /* Don't block scratching */
    animation: pulse 2s infinite;
}

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

/* Enhanced gold surface effects - NO hover scaling to prevent canvas jumping */
#scratch-card-container:hover {
    /* Remove scaling that causes canvas to jump - keep container stable for precise scratching */
    /* Only add subtle glow effect without any transform */
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Prize icon styling for revealed boxes */
.scratch-prize-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scratch-prize-icon.wolf {
    background: linear-gradient(135deg, #FFD700, #DAA520);
    color: #8B0000;
}

.scratch-prize-icon.coin {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    color: #fff;
}

.scratch-prize-icon.star {
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    color: #fff;
}

.scratch-prize-icon.gem {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: #fff;
}

.scratch-prize-icon.diamond {
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    color: #fff;
}

/* Enhanced result text positioning */
#scratch-result-text {
    animation: resultFadeIn 0.5s ease-in-out;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Progress indicator styling */
.card-progress {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #FFD700;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    z-index: 100;
}

/* Animated gold shine effect */
#scratch-card-container:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    z-index: 3;
    animation: goldShineEffect 4s infinite;
}

@keyframes goldShineEffect {
    0% { left: -100%; }
    25% { left: 100%; }
    100% { left: 100%; }
}

/* Enhanced premium styled buttons */
#scratch-card-container .skip-button,
#scratch-card-container .wolf-button {
    background: linear-gradient(to bottom, #1a1a1a, #2a2a2a);
    color: #FFD700;
    font-weight: bold;
    font-size: 18px;
    padding: 14px 28px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin: 10px auto;
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 200px;
    z-index: 20;
}

#scratch-card-container .skip-button:hover,
#scratch-card-container .wolf-button:hover {
    background: linear-gradient(to bottom, #2a2a2a, #3a3a3a);
    box-shadow: 
        0 6px 18px rgba(0,0,0,0.5),
        0 0 15px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateX(-50%) translateY(-3px);
    border-color: #fff;
    color: #fff;
}

#scratch-card-container .skip-button:active,
#scratch-card-container .wolf-button:active {
    transform: translateX(-50%) translateY(1px);
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Compact Modal List - Smaller for Large Scratch Card */
#scratch-modal-list, #scratch-modal-prelist {
  background: rgba(0,0,0,0.6);
  max-width: 300px;
  padding: 1rem;
  position: relative;
  text-align: center;
  z-index: 2;
  order: 2;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  border-radius: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  cursor: default;
}

@media screen and ((min-height: 1024px) or (min-width: 1024px)) {
    #scratch-modal-list, #scratch-modal-prelist {
        order: 1;
        max-width: 320px;
        padding: 1.5rem;
        /* Larger max height on desktop */
        max-height: 500px;
        /* Better scroll capture on desktop */
        overscroll-behavior: contain;
    }
}

#scratch-modal-list table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent !important;
    border: none !important;
    margin-bottom: 2rem;
    /* Ensure table doesn't interfere with scroll */
    pointer-events: none;
}

/* Re-enable pointer events for table content */
#scratch-modal-list th,
#scratch-modal-list td {
    pointer-events: auto;
}

/* Enhanced scrollbar styling with better visibility */
#scratch-modal-list::-webkit-scrollbar {
    width: 10px;
}

#scratch-modal-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    margin: 5px 0;
}

#scratch-modal-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d0bd0c 0%, #b8a50a 100%);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#scratch-modal-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #e6d017 0%, #c9b50b 100%);
}

#scratch-modal-list::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #f0da1a 0%, #d4b80d 100%);
}

/* Add a subtle shadow when content is scrollable */
#scratch-modal-list:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 10px;
    height: 2px;
    background: linear-gradient(to bottom, rgba(208, 189, 12, 0.3), transparent);
    pointer-events: none;
    z-index: 10;
    display: none;
}

#scratch-modal-list:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 10px;
    height: 2px;
    background: none !important;
    z-index: 10;
    display: none;
}

#scratch-modal-list th,
#scratch-modal-list td {
    padding: 0.3rem;
    text-align: left;
    border-color: #d0bd0c;
    border-bottom: none !important;
    font-weight: 500;
    color: #FFF;
    font-size: 14px;
}

#scratch-modal-list th {
    font-weight: bold;
    background:  transparent !important;
    color: #FFF;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#scratch-middle {
    text-align: center;
    margin-top: 15px;
    color: #d0bd0c;
    font-weight: bold;
    font-size: 18px;
}

/* Progressive table styling matching wheel system */
#scratch-modal-list tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #fff;
}

#scratch-modal-list tr.spun {
    background:  transparent !important;
}

#scratch-modal-list tr.win {
    background:  transparent !important;
}

#scratch-modal-list tr.win td {
    font-weight: bold;
    color: #fff;
    padding: 15px 0;
}

#scratch-modal-list tr.lose {
    background:  transparent !important;
}

#scratch-modal-list tr.lose td {
    color: #fff;
}

#scratch-modal-list .text-gold {
    color: #fff !important;
    font-weight: bold;
}

/* Enhanced consent modal with perfect centering */
#scratch-consent-modal {
    position: fixed;
    z-index: 1060;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Enhanced background with diagonal stripes like the main scratch modal */
    background: #000;
    background-image: 
        linear-gradient(45deg, transparent 25%, rgba(255,215,0,0.05) 25%, rgba(255,215,0,0.05) 50%, transparent 50%, transparent 75%, rgba(255,215,0,0.05) 75%),
        linear-gradient(-45deg, transparent 25%, rgba(255,215,0,0.03) 25%, rgba(255,215,0,0.03) 50%, transparent 50%, transparent 75%, rgba(255,215,0,0.03) 75%);
    background-size: 40px 40px, 40px 40px;
    display: none;
    justify-content: center;
    align-items: center;
}

/* Critical: Use .show class for proper flexbox centering */
#scratch-consent-modal.show {
    display: flex !important;
}

#scratch-consent-modal-inner {
    /* Enhanced gold theming to match scratch card */
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    color: #fff;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Add animated gold shine effect to match scratch card */
#scratch-consent-modal-inner:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 215, 0, 0) 0%,
        rgba(255, 215, 0, 0.2) 50%,
        rgba(255, 215, 0, 0) 100%
    );
    transform: skewX(-25deg);
    z-index: 1;
    animation: consentGoldShine 6s infinite;
}

@keyframes consentGoldShine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

/* Ensure content appears above shine effect */
#scratch-consent-modal-inner > * {
    position: relative;
    z-index: 2;
}


/* Enhanced paragraph styling */
#scratch-consent-modal p {
    font-size: 18px !important;
    line-height: 1.6 !important;
    margin-bottom: 30px !important;
    color: #f0f0f0 !important;
}

/* Button container styling */
#scratch-consent-modal div {
    display: block !important;
    text-align: center !important;
    margin-top: 20px !important;
}

#scratch-consent-modal button {
    display: inline-block !important;
    margin: 15px 10px !important;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: #000 !important;
    border: 3px solid #FFD700 !important;
    padding: 15px 30px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    box-shadow: 
        0 6px 20px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999996 !important; /* Above modal backdrop */
}

#scratch-consent-modal button:hover {
    background: linear-gradient(135deg, #FFF700 0%, #FFB500 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.5),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.4);
    border-color: #FFF700;
}

#scratch-consent-modal button:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Theme variations */
#scratch-modal.scratch_christmas {
    background-color: rgba(0, 50, 0, 0.9);
}

#scratch-modal.scratch_christmas #scratch-revealed {
    background: linear-gradient(135deg, #D42426, #2F8A2F);
}

#scratch-modal.scratch_halloween {
    background-color: rgba(30, 0, 30, 0.9);
}

#scratch-modal.scratch_halloween #scratch-revealed {
    background: linear-gradient(135deg, #FF6B00, #7209B7);
}

.skip-reveal, .reveal-all {
    position: absolute !important;
    bottom: -50px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
    background-color: #c39836 !important;
    color: white !important;
    font-weight: bold !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 16px !important;
}

/* LARGE TABLET AND SMALL DESKTOP (1025px-1200px) */
@media (max-width: 1200px) and (min-width: 1025px) {
    #scratch-main-content {
        max-width: 90%;
        gap: 12px;
        padding: 12px;
        flex-direction: row; /* Ensure side-by-side */
        flex-wrap: nowrap;
        align-items: flex-start;
        min-height: 720px; /* Between tablet and desktop */
        padding-top: 75px;
    }
    
    #scratch-card-side {
        flex: 1;
        order: 1;
    }
    
    #scratch-card-container {
        width: 520px; /* Smaller than desktop but larger than tablet */
        height: 360px;
        margin: 0 auto;
        display: block !important;
        position: relative !important;
        z-index: 1000001 !important;
    }
    
    #scratch-results-side {
        flex: 0 0 280px; /* Narrower than desktop sidebar */
        order: 2;
        position: relative !important;
        right: auto !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        z-index: auto !important;
    }
    
    /* Compact statistics for this breakpoint */
    .stats-grid-2x2 {
        grid-template-columns: 1fr 1fr !important; /* 2x2 grid */
        gap: 10px !important;
    }
    
    .stat-box {
        padding: 12px !important;
        font-size: 15px !important;
    }
    
    .stat-box .stat-number {
        font-size: 22px !important; /* Medium size between tablet and desktop */
    }
    
    .stat-box .stat-label {
        font-size: 13px !important;
    }
    
    .mobile-sidebar-toggle {
        display: none !important;
    }
}

/* MOBILE VIEW - Everything below 1024px */
@media (max-width: 1023px) {
    #scratch-modal {
        padding: 2px;
    }
    
    #scratch-main-content {
        flex-direction: column;
        min-height: calc(100vh - 10px);
        padding: 5px;
        gap: 0;
        position: relative;
    }
    
    /* MOBILE: Hide sidebar, use slide-out toggle */
    #scratch-results-side {
        position: fixed !important;
        top: 0 !important;
        right: -320px !important; /* Hidden off-screen */
        width: 300px !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.95) !important;
        z-index: 9999998 !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
        padding: 20px !important;
        order: 999 !important;
        border-radius: 0 !important;
        flex: none !important; /* Override any flex settings */
        max-height: none !important; /* Override any height restrictions */
    }
    
    /* CRITICAL: Allow sidebar to slide in when opened */
    #scratch-results-side.sidebar-open {
        right: 0 !important;
    }
    
    /* Mobile sidebar toggle button */
    .mobile-sidebar-toggle {
        display: none !important;
        position: fixed !important;
        top: 65px !important;
        right: 10px !important;
        z-index: 999999999998 !important;
        width: 44px !important;
        height: 44px !important;
        background: linear-gradient(135deg, #c39836, #d4af37) !important;
        color: white !important;
        border: 2px solid #fff !important;
        border-radius: 50% !important;
        font-size: 16px !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: bold !important;
        text-decoration: none !important;
        user-select: none !important;
        pointer-events: auto !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    }
    
    .mobile-sidebar-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
    
    /* MOBILE: Scratch card fills most of viewport */
    #scratch-card-side {
        flex: 1;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: calc(100vh - 120px) !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #scratch-card-container {
        width: 90vw !important;
        max-width: 650px !important;
        height: calc(75vh) !important;
        min-height: 400px !important;
        max-height: 550px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border: 4px solid #d4af37 !important;
        display: block !important;
        position: relative !important;
        z-index: 1000001 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }
    
    /* Mobile stats grid in sidebar */
    .stats-grid-2x2 {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .stat-box {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    /* FORCE PERFECT CENTERING */
    #scratch-card-side {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    #scratch-card-container {
        margin: 0 auto !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Active States */
#scratch-modal.active {
    display: flex !important;
}

/* Animated reveal effects */
@keyframes reveal-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

#scratch-result strong {
    animation: reveal-fade 0.5s ease-in-out;
    font-size: 24px;
}

/* Stable cursor for scratching - no changes */
#scratch-canvas:active {
    cursor: crosshair !important;
}

/* Make sure the canvas is always visible and fully interactive */
canvas#scratch-canvas {
    display: block !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    left: 0 !important;
    top: 0 !important;
}

/* Professional responsive adjustments */
@media (max-width: 600px) {
    /* ENSURE BODY AND HTML ALLOW FULL VIEWPORT */
    html, body {
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* SCRATCH MODAL TAKES FULL SCREEN ON MOBILE */
    #scratch-modal {
        width: 100vw !important;
        height: 100vh !important;
        padding: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 999999 !important;
    }
    
    /* MOBILE CONTAINER ADJUSTMENTS */
    .scratch-modal-container {
        width: 100% !important;
        height: 100% !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* SCRATCH CARD RESPONSIVE SIZING FOR SMALL SCREENS */
    #scratch-card-container {
        width: calc(100vw - 20px) !important;
        height: calc(55vh) !important;
        min-height: 280px !important;
        max-height: 400px !important;
        margin: 10px auto !important;
        position: relative !important;
    }
    
    /* ENSURE CANVAS IS ALWAYS VISIBLE */
    #scratch-card-container canvas,
    canvas#scratch-canvas {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: auto !important;
        z-index: 10 !important;
        border-radius: inherit !important;
    }
    
    /* MOBILE LOADING SCREEN */
    #scratch-loading {
        background: rgba(0, 0, 0, 0.9) !important;
        color: #d4af37 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 9999995 !important; /* Above modal backdrop */
    }
    
    .loading-content {
        text-align: center !important;
        color: #d4af37 !important;
    }
    
    .wolf-logo-large {
        font-size: 48px !important;
        margin-bottom: 10px !important;
    }
    
    /* HIDE DESKTOP ELEMENTS ON MOBILE */
    .scratch-top-prize {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }
    
    #scratch-modal-list {
        padding: 1rem !important;
        max-width: 350px !important;
    }
    
    .wolf-symbol,
    .x-symbol {
        width: 40px !important;
        height: 40px !important;
        margin: 3px !important;
        font-size: 24px !important;
    }
    
    /* MOBILE SIDEBAR HIDDEN BY DEFAULT */
    .mobile-sidebar-toggle {
        display: none !important;
    }
}

#scratch-cards {
    background-color: #C39836 !important;
    margin: 0 0 2rem !important;
    padding: 1rem !important;
    text-align: center !important;
}

/* CRITICAL: Override JavaScript cursor setting before modal opens */
canvas[id*="scratch"],
#scratch-canvas,
.scratch-card-container canvas {
    cursor: default !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    left: 0 !important;
    top: 0 !important;
    position: absolute !important;
}

/* Make sure the scratch cards section itself has default cursor */
#scratch-cards {
    cursor: default !important;
}

/* Hide the original scratch cards section when modal is active */
#scratch-modal.active ~ * #scratch-cards,
#scratch-modal.show ~ * #scratch-cards,
#scratch-consent-modal.show ~ * #scratch-cards,
body.modal-open #scratch-cards,
#scratch-cards.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure any floating buttons in modal are properly positioned */
#scratch-modal .skip-reveal,
#scratch-modal .wolf-button[id="force-message"] {
    position: absolute !important;
    bottom: -60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999994 !important; /* Above modal backdrop */
}

/* Hide problematic overlapping buttons when modal is active */
#scratch-modal.active .wolf-button:not(.skip-reveal):not(#force-message):not(#scratch-consent-continue):not(#scratch-consent-allow-video) {
    display: none !important;
}

/* Hide any stray floating buttons when scratch modal is open */
body.scratch-modal-open .wolf-button:not(#scratch-modal .wolf-button):not(#scratch-consent-modal .wolf-button) {
    display: none !important;
}

/* Ensure scratch card elements ALWAYS have proper z-index and positioning */
#scratch-cards .wolf-button,
#scratch-cards button,
#scratch-modal .wolf-button,
#scratch-modal button,
#scratch-modal canvas,
#scratch-card-container,
#scratch-card-container *,
#scratch-main-content,
#scratch-game-section,
#scratch-results-side,
.scratch-card-content,
#scratch-consent-modal .wolf-button,
#scratch-consent-modal button {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 1000001 !important; /* Just above backdrop (1 million + 1) */
    position: relative !important;
    margin: auto;
}

/* When modal is open, force navigation and website elements to stay hidden behind backdrop */
body.scratch-modal-open nav:not(#scratch-modal nav),
body.scratch-modal-open header:not(#scratch-modal header),
body.scratch-modal-open .site-header,
body.scratch-modal-open .main-navigation,
body.scratch-modal-open .header-navigation,
body.scratch-modal-open .top-nav {
    z-index: 1 !important; /* Very low z-index to stay behind backdrop */
    visibility: hidden !important; /* Extra insurance to hide navigation */
}

/* Hide result text that appears as background behind scratch card */
.result-text-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Ensure table results don't leak behind scratch interface */
#scratch-modal-list table {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

#scratch-card-container {
    position: relative;
    z-index: 10;
    background: #e8e8e8 !important;
}

/* Hide any rogue text elements that might appear */
#scratch-modal *:not(table):not(th):not(td) {
    text-shadow: none !important;
}

/* Specifically target table cells with result text */
#scratch-modal-list td .result-text-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Ensure scratch area completely covers any background text */
#scratch-canvas {
    background: rgba(0, 0, 0, 0.9) !important;
    position: relative !important;
    z-index: 15 !important;
}

/* Complete background text elimination */
#scratch-card-container * {
    text-shadow: none !important;
}

/* Re-enable visibility for numbered boxes and prize icons only */
.prize-box,
.scratch-box,
.scratch-prize-icon {
    color: inherit !important;
}

/* Hide any remaining background elements */
#scratch-revealed *:not(.scratch-prize-icon):not(.prize-box):not(.scratch-box) {
    display: none !important;
    visibility: hidden !important;
}

/* DESKTOP: Hide mobile toggle */
@media (min-width: 1024px) {
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    #scratch-results-side {
        position: relative !important;
        right: auto !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        z-index: auto !important;
    }
}

/* VERY SMALL MOBILE SCREENS */
@media (max-width: 480px) {
    #scratch-modal {
        padding: 2px;
    }
    
    #scratch-main-content {
        padding: 2px;
        min-height: calc(100vh - 10px);
    }
    
    #scratch-card-container {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(55vh) !important; /* Slightly smaller on very small screens */
        min-height: 280px !important;
        max-height: 400px !important;
    }
    
    .mobile-sidebar-toggle {
        top: 55px !important;
        right: 5px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
    
    .scratch-modal-close {
        top: 5px !important;
        right: 5px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
}

/* STATISTICS GRID - Better organized */
.stats-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    flex: 1;
}

.stat-box {
    background: linear-gradient(135deg, #2a5016, #1a4d1a);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.stat-icon {
    font-size: 20px;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-number {
    font-size: 18px;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.stat-text {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* CRITICAL MOBILE OVERRIDE - Force mobile layout when width < 1024px regardless of height */
@media (max-width: 1023px) {
    #scratch-results-side {
        position: fixed !important;
        top: 0 !important;
        right: -320px !important;
        width: 300px !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.95) !important;
        z-index: 9999998 !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
        padding: 20px !important;
        order: 999 !important;
        border-radius: 0 !important;
        flex: none !important;
        max-height: none !important;
    }
    
    /* CRITICAL: Allow sidebar to slide in when opened */
    #scratch-results-side.sidebar-open {
        right: 0 !important;
    }
    
    .mobile-sidebar-toggle {
        display: none !important;
        position: fixed !important;
        top: 65px !important;
        right: 10px !important;
        z-index: 999999999998 !important;
        width: 44px !important;
        height: 44px !important;
        background: linear-gradient(135deg, #c39836, #d4af37) !important;
        color: white !important;
        border: 2px solid #fff !important;
        border-radius: 50% !important;
        font-size: 16px !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: bold !important;
        text-decoration: none !important;
        user-select: none !important;
        pointer-events: auto !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    }
    
    /* FORCE PERFECT CENTERING */
    #scratch-card-side {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    #scratch-card-container {
        margin: 0 auto !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* ULTIMATE MOBILE TOGGLE FIX - Maximum CSS Specificity */
@media (max-width: 1023px) {
    body #scratch-modal .mobile-sidebar-toggle.mobile-sidebar-toggle {
        display: none !important;
        position: fixed !important;
        top: 65px !important;
        right: 10px !important;
        z-index: 999999999999 !important;
        width: 44px !important;
        height: 44px !important;
        background: linear-gradient(135deg, #c39836, #d4af37) !important;
        color: white !important;
        border: 2px solid #fff !important;
        border-radius: 50% !important;
        font-size: 16px !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: bold !important;
        text-decoration: none !important;
        user-select: none !important;
        pointer-events: auto !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        left: auto !important;
        bottom: auto !important;
    }
}

.needsclick {
    display: none !important;
}

#scratch-consent-modal-inner {
  background: rgba(40, 39, 39, 0.9) !important;
  border: 1px solid #B98323 !important;
  border-radius: 0;
  padding: 15px 40px !important;
  text-align: center;
  color: #ffffff;
  max-width: 500px;
  margin: 20px 20px;
    margin-top: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.woocommerce-order-received #header-logo, .woocommerce-order-received #header-nav-mobile {  
    z-index: 1;
}

body .woocommerce {
    margin: 0;
    padding: 30px 0;
}

#scratch-consent-modal h3 {
  line-height: 30px;
  font-weight: bold;
  margin: 20px 0 0px;
  background-color: #C39836;
  background-image: radial-gradient(#d7b76f,#B98323);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 20px;
  text-shadow: none !important;
  color: #ffffff;
  font-family: "Kumbh Sans",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol" !important;
}

/* Result overlay animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.reveal-all-game-btn {
    
}

.scratch-result-overlay {
    background-image: url('/wp-content/themes/wolf-competitions/assets/images/bg-scratch.webp') !important;
}
