:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --accent-color: #3b82f6;
    --text-color: #f8fafc;
    --gap: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Maximize space, no scroll if possible */
}

.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-grid {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    grid-template-columns: repeat(7, 1fr);
    gap: var(--gap);
    flex: 1;
    /* Take all available space */
    margin-bottom: 10px;
}

.card-slot {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    perspective: 1000px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.card-back {
    background-color: #fff;
    border: 5px solid #d4af37;
    /* Elegant Gold border */
    /* Image will be set by JS or inline style if needed, default to reverso */
    /* Image is set by JS from ASSETS */
}

.card-front {
    background-color: #fff;
    transform: rotateY(180deg);
    border: 5px solid #d4af37;
    /* Elegant Gold border */
}

.controls {
    height: 60px;
    /* Fixed height for controls */
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.8);
    padding: 0 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.status-message {
    font-size: 1.1rem;
    font-weight: 500;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    filter: brightness(1.1);
}

/* Overlay for instructions */
.overlay {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.overlay.hidden,
.overlay-fullscreen.hidden,
.transition-overlay.hidden,
.btn.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* Force layout removal for buttons */
}

/* Hide reset button globally as requested */
#btn-reset {
    display: none !important;
}

.message-box {
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    text-align: center;
}

@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        /* Allow scroll if content is too tall */
    }

    .game-container {
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .card-grid {
        gap: 4px;
        flex: 0 0 auto;
        /* Don't stretch to fill height */
        grid-template-rows: repeat(3, auto);
        /* Let height be determined by width + aspect ratio */
        margin-bottom: 20px;
    }

    .card {
        /* Force card shape */
        aspect-ratio: 2/3;
    }

    .card-front,
    .card-back {
        border-width: 2px !important;
    }

    .controls {
        padding: 10px;
        flex-wrap: wrap;
        height: auto;
        gap: 10px;
        justify-content: center;
        background: rgba(30, 41, 59, 0.95);
        margin-bottom: 20px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        flex: 1;
        /* Make buttons touch-friendly */
        text-align: center;
    }

    .status-message {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
}

/* 1x7 Grid Modifier */
/* 1x7 Grid Modifier */
.card-grid.grid-1x7 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    margin: auto;
    width: 100%;
    padding: 10px;
    background: transparent;
    /* Clean overrides */
}

.split-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.split-row .card-slot {
    width: 13%;
    /* Approx width to fit 4 comfortably with gaps */
    aspect-ratio: 2/3;
    max-width: 120px;
}

/* Mobile override for 1x7: Ensure they fit in screen */
@media (max-width: 768px) {
    .split-row {
        gap: 8px;
    }

    .split-row .card-slot {
        width: 22%;
        /* Slightly larger on mobile relative to screen */
    }
}

/* Overlay for instructions */
/* ... existing overlay styles ... */
.overlay-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.95);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

/* Semi-transparent dark overlay to improve legibility on top of background images */
.overlay-fullscreen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.gallery-content {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.gallery-content h2 {
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--accent-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    border: 4px solid #d4af37;
    /* Elegant Gold border */
}

.gallery-item span {
    font-size: 0.9rem;
    color: #94a3b8;
}

.btn-large {
    padding: 12px 32px;

    font-size: 1.2rem;
}

/* Registration Box Styles */
.registration-box {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 24px;
    width: 95%;
    max-width: 800px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .registration-box {
        padding: 30px 15px;
        width: 98%;
        max-width: 98%;
    }
}

@media (max-width: 480px) {
    .registration-box {
        padding: 20px 10px;
    }
}

.registration-box h2 {
    color: #5fa8d3 !important;
    font-size: 2rem;
    margin-bottom: 5px;
}

.registration-box p {
    color: #cbd5e1;
    margin-bottom: 15px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #334155;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #1e293b;
}

.error-msg {
    color: #ef4444;
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Instructions Content Styles */
.instructions-content {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 24px;
    width: 95%;
    max-width: 900px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .instructions-content {
        padding: 30px 15px;
        width: 98%;
        max-width: 98%;
    }
}

@media (max-width: 480px) {
    .instructions-content {
        padding: 20px 10px;
    }

    .instructions-content h2 {
        font-size: 1.8rem !important;
    }

    .instructions-content p {
        font-size: 1rem !important;
    }
}

/* Dynamic Text Styles */
.intro-title {
    font-size: 2rem;
    font-weight: 700;
    color: #5fa8d3 !important;
    margin-top: 20px;
    margin-bottom: 20px;
    line-height: 1.2;
}

#intro-text {
    font-size: 1.25rem;
    color: #dceed1 !important;
    margin-bottom: 10px;
    line-height: 1.6;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.instructions-text {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 25px;
    line-height: 1.8;
}

/* Transition Overlay */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    display: none;
    /* Hide by default */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease;
}

.transition-overlay.visible {
    display: flex;
    /* Show only when active */
}

.transition-text {
    font-size: 2rem;
    color: #5fa8d3 !important;
    font-weight: 700;
    text-align: center;
    max-width: 80%;
    animation: pulse 2s infinite;
}

.gallery-content.hidden {
    display: none;
}

#referral-container.hidden,
#discount-code-container.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.highlight-next {
    animation: highlight-pulse 1s infinite;
    z-index: 10;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0px 0px rgba(255, 255, 255, 0.8);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px 10px rgba(255, 255, 255, 1);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0px 0px rgba(255, 255, 255, 0.8);
        transform: scale(1);
    }
}

/* Utility & Semantic Classes for Simplification */
.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.hidden {
    display: none !important;
}

.z-999 {
    z-index: 999 !important;
}

.z-998 {
    z-index: 998 !important;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mr-10 {
    margin-right: 10px;
}

.mb-5 {
    margin-bottom: 5px;
}

.text-sm-muted {
    font-size: 0.9rem;
    color: #94a3b8;
}

.text-orange {
    color: #f97316 !important;
}

.registration-prompt {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4ade80 !important;
    margin-bottom: 10px;
    text-align: center;
}

.input-container-small {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.info-text-highlight {
    font-size: 1.1rem;
    color: #38bdf8;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 500;
    text-align: center;
}

.heading-secondary {
    color: #5fa8d3 !important;
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.instructions-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    line-height: 1.8;
}

.textarea-container {
    margin: 10px auto;
    max-width: 600px;
}

.textarea-styled {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
}

.btn-green-gradient {
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%) !important;
    /* Vivid leaf green */
    box-shadow: 0 4px 14px 0 rgba(74, 222, 128, 0.39);
}

.btn-orange-gradient {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    box-shadow: 0 4px 14px 0 rgba(249, 115, 22, 0.39);
}

.btn-blue-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.btn-green {
    background-color: #10b981 !important;
}

.btn-purple {
    background-color: #8b5cf6 !important;
}

.payment-info-box {
    margin: 25px auto;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.flex-gap-10 {
    display: flex;
    gap: 10px;
}

.input-dark {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    text-transform: uppercase;
}

.btn-dark {
    padding: 10px 20px;
    font-size: 0.9rem;
    background: #334155 !important;
}

.status-message-small {
    margin-top: 10px;
    font-size: 0.85rem;
    height: 1.2rem;
}

.secondary-action-text {
    margin-top: 20px;
    color: #94a3b8;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
}

.success-heading {
    color: #10b981;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.failure-heading {
    color: #ef4444;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.status-body-text {
    font-size: 1.3rem;
    margin-bottom: 40px;
    color: #e2e8f0;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 450px;
    margin: 0 auto;
}

.referral-box {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.referral-prompt-text {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #cbd5e1;
}

.referral-template {
    padding: 15px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
}

.discount-code-box {
    margin-top: 35px;
    padding: 25px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    border: 2px solid #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    animation: fadeInUp 0.5s ease-out;
}

.discount-code-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 10px;
}

.discount-code-text {
    font-size: 2rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: 2px;
}

/* Main Buttons Container */
.main-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    width: 95%;
    max-width: 420px;
    /* Increased slightly to prevent wrapping */
    margin-left: auto;
    margin-right: auto;
    align-items: center;
}

.btn-secondary {
    background: #f97316 !important;
    /* Orange (orange-500) */
    border: 1px solid #ea580c !important;
    color: white !important;
    padding: 8px 16px;
    font-size: 0.95rem;
    margin-top: 5px;
}

/* Regional Pricing Styles */
.price-cop-sub {
    font-size: 0.9rem;
    color: #a7f3d0;
    margin-left: 5px;
    font-weight: normal;
}

.price-conversion-note {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 10px;
    margin-bottom: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}

/* Info Page Styles */
.info-content-container {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(15px);
    padding: 40px 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    color: var(--text-color);
    position: relative;
}

.info-section {
    max-width: 800px;
    margin: 0 auto 40px auto;
    text-align: left;
}

.pricing-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    padding: 50px 20px 20px 20px;
    border-radius: 12px;
    border-left: 4px solid #d4af37;
    /* Removed overflow: hidden to allow sticker to breathe if needed, 
       but we'll adjust the sticker to fit better inside. */
}

.launch-sticker {
    position: absolute;
    top: -20px;
    right: 15px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
    animation: badge-pulse 2s infinite;
    text-align: center;
    line-height: 1.2;
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(234, 88, 12, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

.price-item {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.price-item span {
    color: #d4af37;
    font-weight: 700;
}

.faq-item {
    margin-bottom: 25px;
}

.faq-item h3 {
    color: #f59e0b;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.faq-item div {
    color: #cbd5e1;
    line-height: 1.6;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    font-style: italic;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.testimonial-card span {
    display: block;
    margin-top: 10px;
    font-weight: 700;
    color: #d4af37;
    font-style: normal;
}

.btn-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .registration-box {
        padding: 15px 10px;
        width: 98%;
        max-width: 98%;
    }

    .registration-box h2 {
        font-size: 1.6rem !important;
        /* Reduced from 2rem */
    }

    .registration-prompt {
        font-size: 1rem !important;
        /* Reduced from 1.2rem */
    }

    .info-text-highlight {
        font-size: 0.95rem !important;
        /* Reduced from 1.1rem */
    }

    #intro-text {
        font-size: 1.1rem !important;
        /* Reduced from 1.25rem */
    }

    .main-buttons-container {
        gap: 8px;
        margin-top: 10px;
    }

    .btn-large {
        padding: 12px 10px;
        font-size: 0.95rem;
        /* Reduced from 1rem */
    }

    .info-content-container {
        padding: 60px 8px 30px 8px;
        /* Reduced side padding from 15px to 8px */
    }

    .testimonial-card {
        padding: 15px 10px;
        /* Reduced side padding from 20px to 10px */
    }

    .pricing-card {
        padding: 50px 12px 20px 12px;
        /* Reduced side padding */
    }

    .heading-secondary {
        font-size: 1.6rem;
    }
}

/* SEO Utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}