@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap');

:root {
    --brand-indigo: #6366f1;
    --brand-purple: #a855f7;
    --brand-pink: #ec4899;
    --brand-teal: #06b6d4;
    --dark-bg: #03001e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #030014;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Atmospheric glowing background circles */
.bg-glow-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}
.bg-glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Realistic Smartphone Device Bezel for Desktop */
.device-wrapper {
    position: relative;
    width: 420px;
    height: 760px;
    background-color: #0d0e12;
    border-radius: 40px;
    padding: 10px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 
                0 0 0 4px #1f2937, 
                0 0 40px rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Interactive Device Screen Boundary */
.game-screen-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #020205;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Game Canvas styling */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #050508;
    cursor: crosshair;
}

/* Overlay Base Structure (Glassmorphism design) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 7, 28, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    z-index: 10;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Header & Titles styling */
.brand-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--brand-teal);
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.game-title {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff 20%, #cbd5e1 50%, var(--brand-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
}

/* Glowing primary buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-indigo) 0%, var(--brand-purple) 50%, var(--brand-pink) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 14px 28px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4), 
                inset 0 -3px 0 rgba(0,0,0,0.2);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(99, 102, 241, 0.5), 
                inset 0 -3px 0 rgba(0,0,0,0.2), 
                0 0 20px rgba(168, 85, 247, 0.4);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 16px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

/* Rules list box */
.rules-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 18px;
    width: 100%;
    margin-bottom: 25px;
}

.rules-box h3 {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rule-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: #cbd5e1;
}

.rule-item:last-child {
    margin-bottom: 0;
}

.rule-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Sound/Mute Toggle */
.mute-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
}

.mute-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Game Over scoreboard card */
.score-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(129, 140, 248, 0.15);
    border-radius: 24px;
    padding: 22px;
    width: 100%;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.score-num {
    font-size: 48px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-top: 4px;
    background: linear-gradient(to right, #ffffff, var(--brand-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highscore-lbl {
    font-size: 12px;
    color: #64748b;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.highscore-num {
    font-weight: bold;
    color: var(--brand-pink);
}

/* Interactive Coupon Scratch Modal Container */
.scratch-modal-content {
    background: #0b0a1a;
    border: 1px solid rgba(236, 72, 153, 0.25);
    border-radius: 28px;
    padding: 25px;
    width: 100%;
    max-width: 350px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(236, 72, 153, 0.15);
}

/* The physical Scratch Ticket Box */
#scratch-card-container {
    position: relative;
    width: 100%;
    height: 160px;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0c0a21 100%);
    border: 2px dashed rgba(236, 72, 153, 0.4);
    border-radius: 18px;
    overflow: hidden;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hidden Reward content revealed under scratch canvas */
.reward-reveal-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    z-index: 1;
}

.reward-title-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--brand-pink);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.coupon-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
    margin-bottom: 5px;
}

.coupon-sub {
    font-size: 11px;
    color: #64748b;
}

/* Floating canvas on top of reward to be scratched off */
#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>'), auto;
}

/* Confetti styling for scratch completion celebration */
.confetti {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    border-radius: 2px;
}

/* Mobile Responsive Optimization overrides */
@media (max-width: 480px), (max-height: 760px) {
    body {
        padding: 0;
    }
    .device-wrapper {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }
    .game-screen-container {
        border-radius: 0;
    }
}
