/* Reset and base styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Nunito', sans-serif;
            line-height: 1.6;
            color: #333;
            padding-top: 70px; /* Add padding for fixed nav */
font-size: 16px; 
letter-spacing: 0.66px;
        }

        /* Navigation */
        nav {
            background: #2c5530;
            padding: 1rem;
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
        }

        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: white;
            text-decoration: none;
        }

        .logo img {
            width: 40px;
            height: 40px;
        }

        .logo span {
            font-size: 1.5rem;
            font-weight: bold;
        }

        nav ul {
            display: flex;
            list-style: none;
            gap: 0.5rem;
        }

        nav a {
            color: white;
            text-decoration: none;
            font-weight: bold;
            transition: all 0.3s;
            padding: 0.5rem 1rem;
            border-radius: 8px 0 8px 0;
white-space: nowrap;
        }

        nav a:hover {
            color: #8bc34a;
        }

        nav a.active {
            background: #8bc34a;
            color: #2c5530;
        }

        /* Sections */
        section {
            padding: 4rem 2rem;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        h2 {
            font-size: 2.5rem;
            margin-bottom: 2rem;
            color: #2c5530;
        }

        /* Welcome Section */
        #welcome {
            background: linear-gradient(rgba(75,43,81,0.21), rgba(255,255,255,0.25)), url('/images/little-sprout-bg.png');
            background-size: cover;
background-repeat: no-repeat;
background-position: top center;
            color: white;
            text-align: center;
        }

        #welcome h1 {
            font-size: 4rem;
            margin-bottom: 1rem;
        }

        .cta-button {
            padding: 1rem 2rem;
            font-size: 1.21rem;
            background: #8bc34a;
            color: white;
            border: none;
            border-radius: 18px 0 18px 0;
            cursor: pointer;
            margin-top: 2rem;
            transition: background 0.66s;
text-decoration: none;
        }

        .cta-button:hover {
            background: #7cb342;
        }

        /* Game Section */
        #game {
            background: #f9f9f9;
        }

        .game-features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
            max-width: 1200px;
            width: 100%;
        }

        .feature {
            padding: 2rem;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            text-align: center;
        }

        /* Rules Section */
        #rules {
            background: #ffffff;
        }

        .rules-container {
            max-width: 800px;
            width: 100%;
        }

        .rules-content h3 {
            margin: 1.5rem 0 0.5rem;
            color: #2c5530;
        }

        /* Cards Section */
        #cards {
            background: #000000;
background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.1)), url('/images/board-game-little-sprout.png');
            background-size: cover;
background-repeat: no-repeat;
background-position: center center;
        }

        .search-filter {
            margin-bottom: 2rem;
            width: 100%;
            max-width: 600px;
        }

        .search-filter input {
            width: 100%;
            padding: 0.5rem;
            font-size: 1.1rem;
            border: 2px solid #2c5530;
            border-radius: 4px;
        }

        .cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
            width: 100%;
            max-width: 1200px;
        }

        .card {
            background: white;
            border-radius: 20px;
            padding: 1rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: transform 0.3s;
        }

        .card:hover {
            transform: translateY(-5px);
        }

        /* Shop Section */
        #shop {
            background: #ffffff;
        }

        /* Shop Section */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* Two columns */
    gap: 4rem;
    width: 100%;
    max-width: 1200px;
}

.product.full-width {
    grid-column: 1 / -1;  /* Make this product span the full grid width */
}

        .product {
            background: #f9f9f9;
            border-radius: 8px;
            padding: 1rem;
            text-align: center;
        }

        .product img {
            width: 100%;
            max-width: 420px;
            height: auto;
            margin: -2rem auto 1.5rem;
        }

        .product button {
            padding: 0.75rem 1.25rem;
            background: #2c5530;
            color: white;
            border: none;
            border-radius: 8px 0;
            cursor: pointer;
            margin-top: 1rem;
            transition: background 0.3s;
        }

        .product button:hover {
            background: #1e3c22;
        }

        /* Footer */
        footer {
            background: #2c5530;
            color: white;
            padding: 2rem;
            text-align: center;
        }

        .footer-links {
            margin-top: 1rem;
        }

        .footer-links a {
            color: white;
            text-decoration: none;
            margin: 0 1rem;
        }
.game-dot1 {
background: white;
padding: 20px;
font-size: 24px;
border-radius: 500px;
margin: 10px auto;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.125);
max-width: 80px;}
.game-dot2 {
background: black;
padding: 20px;
color: white;
font-size: 24px;
border-radius: 500px;
margin: 10px auto;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.125);
max-width: 80px;}
.game-content {text-align: left;
padding: 10px 5px;}
.tcenter {text-align: center;}
.small, .category {font-size: 16px; font-weight: 400;}
.category {display: flex; align-items:center; justify-content: space-between;}
/* Captivating product image styling */
.product-img {
  display: block;
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px; /* Softer, more modern corners */
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle depth */
}
.product-img-card {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px; /* Softer, more modern corners */
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  
}
.product-img2 {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: 25px; /* Softer, more modern corners */
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle depth */
}

.product-img:hover, .product-img2:hover {
  transform: scale(1.05); /* Slight zoom effect */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}
.mt-5 {margin-top: 50px;}
.mt-3 {margin-top: 30px;}
.card-img {width: 40px;}
.card-category {width: 24px; margin-right: 5px;}

.language-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(0,0,0,0.23);
padding: 5px;
border-radius:8px 0 8px 0;
}

.language-switcher a {
    color: #fff;
    text-decoration: none;
    padding: 0 5px;
    font-size: 0.9em;
font-weight: 400;
}

.language-switcher a.active2 {
    font-weight: bold;
color: #8bc34a;
    text-decoration: none;
}

.language-switcher .divider {
    color: rgba(255, 255, 255, 0.4);
    margin: -4px 3px 0;
}

@media (max-width: 768px) {
    .language-switcher {
        margin-left: 10px;
    }
}

@media (max-width: 768px) {
    .language-selector {
        margin-left: 10px;
    }
}


        /* Responsive Design */
        @media (max-width: 768px) {
            .nav-container {
                flex-direction: column;
                gap: 1rem;
            }

            nav ul {
                flex-direction: column;
                align-items: center;
display: none;
            }

            #welcome h1 {
                font-size: 2.5rem;
            }

            section {
                padding: 2rem 1rem;
            }
.product {
    grid-column: 1 / -1;
	}
}
nav a.logo.active {
    background-color: transparent;
color: white;
}
/* 0. BASE STYLES (INCLUDING Z-INDEX FIX) */
    nav {
        z-index: 1000; /* Ensures nav is below popups */
    }
    /* 1. STYLES FOR INTEGRATION */
    #welcome {
        position: relative;
        height: 100vh;
        padding: 0;
        overflow: hidden;
        background-color: #F8F5F2; /* Base background for the new light theme */
    }
    .welcome-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        background-image: url('https://littlesprout.ro/images/littlesprout-bg.png');
        background-size: cover;
        background-position: center;
        transition: opacity 0.66s ease-out;text-shadow: 0px 2px 6px rgba(0, 0, 0, 0.2);
    }
    .welcome-overlay.fade-out {
        opacity: 0;
        pointer-events: none;
    }
    #integrated-game-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        opacity: 0; /* Hide by default */
        visibility: hidden; /* Hide by default */
        transition: opacity 0.66s ease-in; /* Smooth fade-in effect */
    }
    #integrated-game-container.visible {
        opacity: 1;
        visibility: visible;
    }

    /* 2. UPDATED & NON-OVERLAPPING GAME STYLES */
    :root {
        --font-main: 'Nunito', sans-serif;
        --color-background: #F8F5F2;
        --color-primary: #3D553D;
        --color-secondary: #FFFFFF;
        --color-accent: #7FAF64;
        --glow-color: #FFFFFF;
        --board-size: min(100%, 500px);
        --color-winner-glow: #feca57;
    }

    #integrated-game-container * { box-sizing: border-box; }
    #integrated-game-container { color: #222; }

    #main-container {
        font-family: var(--font-main);
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    #sidebar {
        width: 280px;
        height: 100%;
        padding: 20px;
        display: flex;
        flex-direction: column;
        background: var(--color-primary);
        color: var(--glow-color);
        z-index: 1111;
        flex-shrink: 0;
    }

    #setup-controls { display: flex; flex-direction: column; align-items: center; gap: 20px; flex-grow: 1; }
    #sidebar h2 { font-weight: 700; font-size: 1.8rem; color: var(--glow-color); text-align: center; margin-bottom: 0; }
    #steps-list { list-style: none; padding: 0; width: 100%; text-align: left; counter-reset: steps; margin-bottom: 0; }
    #steps-list li { font-size: 1.1rem; margin-bottom: 10px; color: #ccc; font-weight: 700; transition: all 0.3s ease; }
    #steps-list li::before { counter-increment: steps; content: counter(steps) ". "; color: var(--color-accent); margin-right: 10px; }
    #steps-list li.step-active { color: var(--glow-color); transform: scale(1.05); }
    #interactive-controls-container { min-height: 70px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 15px; width: 100%; }
    #dice-container { display: flex; gap: 15px; cursor: pointer; transition: opacity 0.5s, transform 0.3s ease; opacity: 0; pointer-events: none; }
    #dice-container.visible { opacity: 1; pointer-events: auto; }
    #dice-container.selectable { transform: scale(1.05); }
    .dice { width: 45px; height: 45px; background-color: var(--color-secondary); border-radius: 8px; padding: 6px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); box-shadow: 0 2px 5px rgba(0,0,0,0.1); border: 1px solid #ddd; }
    .dot { width: 8px; height: 8px; background-color: var(--color-primary); border-radius: 50%; align-self: center; justify-self: center; }
    .dice[data-value="1"] .dot:nth-child(1){grid-area:2/2}.dice[data-value="2"] .dot:nth-child(1){grid-area:1/1}.dice[data-value="2"] .dot:nth-child(2){grid-area:3/3}.dice[data-value="3"] .dot:nth-child(1){grid-area:1/1}.dice[data-value="3"] .dot:nth-child(2){grid-area:2/2}.dice[data-value="3"] .dot:nth-child(3){grid-area:3/3}.dice[data-value="4"] .dot:nth-child(1){grid-area:1/1}.dice[data-value="4"] .dot:nth-child(2){grid-area:1/3}.dice[data-value="4"] .dot:nth-child(3){grid-area:3/1}.dice[data-value="4"] .dot:nth-child(4){grid-area:3/3}.dice[data-value="5"] .dot:nth-child(1){grid-area:1/1}.dice[data-value="5"] .dot:nth-child(2){grid-area:1/3}.dice[data-value="5"] .dot:nth-child(3){grid-area:2/2}.dice[data-value="5"] .dot:nth-child(4){grid-area:3/1}.dice[data-value="5"] .dot:nth-child(5){grid-area:3/3}.dice[data-value="6"] .dot:nth-child(1),.dice[data-value="6"] .dot:nth-child(2){grid-row:1}.dice[data-value="6"] .dot:nth-child(3),.dice[data-value="6"] .dot:nth-child(4){grid-row:2}.dice[data-value="6"] .dot:nth-child(5),.dice[data-value="6"] .dot:nth-child(6){grid-row:3}.dice[data-value="6"] .dot:nth-child(1),.dice[data-value="6"] .dot:nth-child(3),.dice[data-value="6"] .dot:nth-child(5){grid-column:1}.dice[data-value="6"] .dot:nth-child(2),.dice[data-value="6"] .dot:nth-child(4),.dice[data-value="6"] .dot:nth-child(6){grid-column:3}
    .rolling { animation: subtleRoll 0.5s ease-out; }
    @keyframes subtleRoll { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }
    #color-palette { display: flex; justify-content: center; gap: 0px; transition: opacity 0.5s, transform 0.5s; opacity: 0; transform: scale(0.8); pointer-events: none; }
    #color-palette.visible { opacity: 1; transform: scale(1); pointer-events: auto; }
    .color-swatch { width: 45px; height: 45px; border-radius: 0; border: none; background-color: transparent; cursor: pointer; transition: transform 0.2s; padding: 2px; }
    .color-swatch svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2)); }
    .color-swatch:hover { transform: scale(1.15); }
    #narration-box { width: 100%; margin-top: auto; padding: 15px; text-align: center; }
    #narration-text { font-size: 1rem; line-height: 1.2; color: var(--glow-color); text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

    #game-container {
        flex: 1;
        height: 100%;
        background-image: url(https://littlesprout.ro/images/board-game-little-sprout.png);
        position: relative; /* Crucial for absolute positioning of child elements */
        background-position: bottom;
        background-size: cover;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    #game-title { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: clamp(1rem, 2vmin, 1.5rem); color: white; z-index: 45; white-space: nowrap; }

    #game-board-wrapper {
        flex: 1;
        min-height: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    #game-board-frame { display: block; position: absolute; width: calc(var(--board-size) + 20px); height: calc(var(--board-size) + 20px); margin-top: 100px; background-color: #D2B48C; background-image: url(https://littlesprout.ro/images/board-game-little-sprout.png?q=80&w=2074&auto=format&fit=crop); border: 1px solid #D8D3CA; border-radius: 15px; z-index: 5; }
    
    #game-board {
        position: relative;
        width: var(--board-size);
        aspect-ratio: 1 / 1;
        border-radius: 50%;
        background: #EFEBE6;
        transform: none;
        transition: width 0.3s ease, height 0.3s ease;
        z-index: 10;
        overflow: hidden;
        margin-top: 100px;
    }
    
    #game-board::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url(https://littlesprout.ro/images/little-sprout-bg.png?q=80&w=2074&auto=format&fit=crop); background-size: cover; background-position: center; border-radius: 50%; opacity: 0.55; z-index: -1; }
    #spots-container { position: absolute; top: 50%; left: 50%; width: 1px; height: 1px; }
    .spot { position: absolute; width: 4vmin; height: 4vmin; min-width: 20px; min-height: 20px; max-width: 30px; max-height: 30px; top: calc(-2vmin); left: calc(-2vmin); border-radius: 50%; cursor: pointer; transition: box-shadow 0.3s ease, background-color 0.3s; display: flex; justify-content: center; align-items: center; background-color: #ffffff; color: var(--color-primary); font-size: clamp(0.6rem, 2vmin, 1rem); font-weight: 700; }
    #center-spot { background-color: #ffffff !important; pointer-events: none; }
    .sprout-pawn { position: absolute; top: calc(-1.75vmin); left: calc(-1.75vmin); width: 3.5vmin; height: 3.5vmin; min-width: 16px; min-height: 16px; max-width: 26px; max-height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.3); z-index: 50; opacity: 0; transform: scale(0); transition: transform 1s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s; }
    #opponent-sprout { background-color: #8E44AD; }
    .glowing { animation: pulse-glow 1.5s infinite; }
    @keyframes pulse-glow { 0% { box-shadow: 0 0 5px 2px rgba(127, 175, 100, 0.7), 0 0 15px 5px rgba(127, 175, 100, 0.5); } 50% { box-shadow: 0 0 10px 4px rgba(127, 175, 100, 1), 0 0 25px 10px rgba(127, 175, 100, 0.7); } 100% { box-shadow: 0 0 5px 2px rgba(127, 175, 100, 0.7), 0 0 15px 5px rgba(127, 175, 100, 0.5); } }
    .winning-pawn { animation: winning-glow 2.5s ease-in-out; z-index: 100 !important; }
    @keyframes winning-glow { 0% { transform: translate(var(--translateX, 0), var(--translateY, 0)) scale(1.2); box-shadow: 0 0 20px 10px #fff, 0 0 30px 15px var(--color-winner-glow); border-color: var(--color-winner-glow); } 50% { transform: translate(var(--translateX, 0), var(--translateY, 0)) scale(1.5); box-shadow: 0 0 40px 20px #fff, 0 0 50px 25px var(--color-winner-glow); border-color: #fff; } 100% { transform: translate(var(--translateX, 0), var(--translateY, 0)) scale(1.2); box-shadow: 0 0 20px 10px #fff, 0 0 30px 15px var(--color-winner-glow); border-color: var(--color-winner-glow); } }
    .winner-text { position: absolute; left: 0; top: 0; transform: translate(-50%, -150%); font-family: var(--font-main); font-size: 2.5rem; font-weight: 700; color: #DAA520; text-shadow: 0 0 5px white, 0 0 15px #DAA520; z-index: 101; pointer-events: none; white-space: nowrap; animation: fade-in-scale 1s ease-out forwards; }
    @keyframes fade-in-scale { from { opacity: 0; transform: translate(-50%, -150%) scale(0.5); } to { opacity: 1; transform: translate(-50%, -150%) scale(1); } }
    
    /* Player hand (bottom) - remains in the flex layout */
    #card-hand {
        flex-shrink: 0;
        width: 95%;
        max-width: 1100px;
        display: flex;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s;
        transform: translateY(50px);
    }

    /* Opponent hand (top) is absolutely positioned to create the "peeking" effect */
    #opponent-card-hand {
        position: absolute; /* Take out of flex flow */
        z-index: 1; /* Ensure it's above the board */
        top: -300px; /* Initial hidden position */
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
        max-width: 1100px;
        display: flex;
        justify-content: center;
        transition: top 0.5s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s;
    }

    #card-hand.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    #opponent-card-hand.visible {
        top: -100px; /* Half-visible position */
        opacity: 0.3;
        pointer-events: auto;
    }
    
    #opponent-card-hand.active { opacity: 1; }
    .hand-active { z-index: 15; }
    
    #card-hand .card, #opponent-card-hand .opponent-card {
        width: clamp(85px, 11vw, 140px);
        height: clamp(130px, 17vw, 200px);
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: clamp(5px, 1vw, 10px);
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        --rotation: 0deg;
        transform: rotate(var(--rotation));
        transition: transform 0.3s ease, opacity 0.3s ease;
        flex-shrink: 0;
    }
    #card-hand .card { background-color: var(--color-secondary); border: 2px solid var(--color-accent); }
    #opponent-card-hand .opponent-card { background: var(--color-primary); border: 2px solid var(--color-accent); }
    #card-hand .card:not(:first-child), #opponent-card-hand .opponent-card:not(:first-child) {
        margin-left: -25px; /* Adjust overlap */
    }
    #card-hand .card:not(.inactive):hover {
        transform: rotate(var(--rotation)) translateY(-10px);
        z-index: 10;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
    #card-hand .card.inactive { opacity: 0.5; transform: rotate(var(--rotation)) scale(0.95); pointer-events: none; }
    #card-hand .card-title { font-size: clamp(0.4rem, 1.2vw, 0.55rem); font-weight: 700; color: var(--color-primary); text-align: center; width: 100%; margin-bottom: 0px; }
    #card-hand .card-actions { width: 100%; display: flex; flex-direction: row; justify-content: space-around; align-items: center; margin-bottom: 5px; }
    #card-hand .card-image-placeholder { width: 100%; flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 5px; overflow: hidden; }
    #card-hand .card-image-placeholder img { width: 100%; height: 100%; object-fit: contain; }
    .action-dot { width: clamp(20px, 3vw, 30px); height: clamp(20px, 3vw, 30px); font-size: clamp(0.7rem, 1vw, 0.9rem); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; position: relative; pointer-events: none; transition: box-shadow 0.3s, opacity 0.3s; }
    .action-dot.white { background-color: #fff; color: #333; border: 1px solid #ccc; }
.action-dot.white:hover { background-color: #eee; color: #333; border: 1px solid #ccc; }
    .action-dot.black { background-color: #333; color: #fff; border: 1px solid #ccc;}
.action-dot.black:hover { background-color: #444; color: #fff; border: 1px solid #ccc;}
    .hand-interactable .action-dot { pointer-events: auto; }
    .action-dot::after { content: attr(data-tooltip); position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%); background-color: #333; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
    .action-dot:hover::after { opacity: 1; }
    .glowing-action { animation: pulse-glow-action 1.5s infinite; }
    @keyframes pulse-glow-action { 0% { box-shadow: 0 0 4px 1px rgba(127, 175, 100, 0.7), 0 0 12px 3px rgba(127, 175, 100, 0.5); } 50% { box-shadow: 0 0 8px 3px rgba(127, 175, 100, 1), 0 0 20px 6px rgba(127, 175, 100, 0.7); } 100% { box-shadow: 0 0 4px 1px rgba(127, 175, 100, 0.7), 0 0 12px 3px rgba(127, 175, 100, 0.5); } }
    .floating-text { position: fixed; font-size: 1.5rem; font-weight: bold; color: #ffca28; text-shadow: 0 0 5px black; pointer-events: none; animation: float-up 1s ease-out forwards; z-index: 9999; }
    @keyframes float-up { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }
    
    /* --- REVEAL & MODAL STYLES (THEME ALIGNED) --- */
    #reveal-section { position: fixed; top:0; left:0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s 1s; z-index: 10001; background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); padding: 40px 0; }
    #reveal-section.visible { opacity: 1; visibility: visible; transition-delay: 0s, 0s; }
    #reveal-title { font-weight:700; font-size: 2rem; margin-top: 30px; margin-bottom: 30px; text-shadow: 0 0 20px var(--glow-color); padding-bottom: 10px; text-align: center; color: var(--glow-color); }
    #product-container { display: flex; justify-content: center; align-items: flex-start; gap: 40px; width: 100%; max-width: 900px; margin: 0 auto; padding: 20px 0; }
    .product-box { width: 260px; text-align: center; cursor: pointer; transition: transform 0.3s ease; flex-shrink: 0; padding-bottom: 20px; }
    .product-box:hover { transform: scale(1.05); }
    .product-box img { width: 100%; margin-bottom: 15px; height: 250px; object-fit: cover; border-radius: 8px; }
    .product-box h3 { font-weight: 700; font-size: 1.2rem; color: var(--glow-color); }
    .product-box p { font-size: 0.9rem; color: #ccc; max-width: 220px; margin: 10px auto; }
    .product-box button, #replay-button, .subscribe-form button { font-weight: 700; font-size: 1rem; padding: 12px 24px; border-radius: 50px; border: none; cursor: pointer; transition: all 0.3s ease; text-transform: capitalize; }
    .product-box button, .subscribe-form button { background: var(--color-accent); color: var(--glow-color); box-shadow: 0 4px 15px rgba(127, 175, 100, 0.4); }
    .product-box button:hover, .subscribe-form button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(127, 175, 100, 0.6); background: #94c379; }
    #replay-button { background: var(--glow-color); color: var(--color-primary); border: 2px solid var(--glow-color); }
    #replay-button:hover { background: #e0e0e0; border-color: #e0e0e0; }
    #reveal-footer { display: flex; justify-content: center; align-items: center; gap: 20px; width: 100%; margin-top: 20px; }
    .subscribe-form { display: flex; gap: 10px; align-items: center; display: none!important;}
    .subscribe-form input { padding: 12px 20px; border-radius: 50px; border: 2px solid var(--color-accent); background-color: rgba(255,255,255,0.1); color: var(--glow-color); font-size: 1rem; }
    .subscribe-form input::placeholder { color: #ccc; }
    #subscription-alert { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background-color: var(--color-accent); color: white; padding: 12px 24px; border-radius: 50px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 10001; display: flex; align-items: center; gap: 10px; opacity: 0; visibility: hidden; transition: opacity 0.5s, transform 0.5s, visibility 0.5s; }
    #subscription-alert.visible { opacity: 1; visibility: visible; transform: translate(-50%, 10px); }
    .modal { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s; }
    .modal.visible { opacity: 1; visibility: visible; transition-delay: 0s, 0s; }
    .modal-overlay { position: absolute; inset: 0; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }
    .modal-content { position: relative; background-color: var(--color-primary); border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 100%; max-width: 500px; color: #eee; transform: scale(0.95); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
    .modal.visible .modal-content { transform: scale(1); opacity: 1; }
    .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .modal-header h3 { font-size: 1.5rem; color: var(--glow-color); }
    .modal-close-btn { background: none; border: none; color: #eee; font-size: 1.5rem; cursor: pointer; line-height: 1; }
    .modal-body { padding: 1.5rem; }
    .modal-body .form-group { margin-bottom: 1rem; }
    .modal-body label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: #ccc; }
    .modal-body input, .modal-body textarea { width: 100%; padding: 0.75rem; border-radius: 8px; border: 2px solid var(--color-accent); background-color: rgba(0,0,0,0.2); color: #fff; font-size: 1rem; }
    .modal-body button { width: 100%; font-weight: 700; font-size: 1.1rem; padding: 1rem; border-radius: 8px; border: none; cursor: pointer; transition: all 0.3s ease; background: var(--color-accent); color: var(--glow-color); box-shadow: 0 4px 15px rgba(127, 175, 100, 0.4); }
    .modal-body button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(127, 175, 100, 0.6); background: #94c379; }
    #confirmation-message { display: none; text-align: center; padding: 2rem; }
    #confirmation-message svg { margin: 0 auto 1rem; }
    
    /* === EXACT STYLES FOR INFORMATIONAL CARDS === */
    #cards .cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
    #cards .card { background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 16px; max-width: 380px; margin: 0 auto; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); padding: 1rem; display: flex; flex-direction: column; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
    #cards .card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
    #cards .card h3 { color: #333; font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.4; min-height: 45px; }
    #cards .card h3 .small { display: block; font-size: 0.85rem; color: #666; font-weight: 500; margin-top: 2px; }
    #cards .card .product-img-card { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; margin: 0.75rem 0; }
    #cards .card .category { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; color: #555; margin: 0 0 1rem 0; padding-top: 10px; font-weight: 700; }
    #cards .card .category .card-category { width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; }
    #cards .card .category .card-img { width: 20px; height: 20px; }
    #cards .card p:not(.category) { font-size: 0.85rem; line-height: 1.5; color: #555; text-align: left; margin: 0;}
    
    /* === RESPONSIVE MEDIA QUERIES === */
    
    /* LAPTOP & TABLET */
    @media (max-width: 1200px) {
        :root {
            --board-size: min(100%, 420px); /* UPDATED: Set board size for tablets (20% > mobile) */
        }
        #main-container { flex-direction: column; position: relative; }
        #sidebar {
            width: 100%;
            height: auto;
            min-height: 110px;
            max-height: 110px;
            flex-shrink: 0;
            flex-direction: column;
            border-right: none;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding: 10px;
            z-index: 1001; /* Fix for Safari: Ensures game controls are above the nav bar */
            background: rgba(61, 85, 61, 0.9);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
position:fixed;
        }
        #sidebar h2, #steps-list { display: none; }
        #setup-controls { flex-direction: column; gap: 15px; width: 100%; }
        #narration-box { margin-top: 0; width: 100%; order: -1; padding: 25px 0px 5px; }
        #interactive-controls-container { min-height: auto; }
        #game-container {
            width: 100%;
            flex: 1; /* Makes game container fill remaining height */
            gap: 0.5rem;
            padding: 0.5rem 0;
        }
        #game-title { display: none; }
        #card-hand, #opponent-card-hand { width: 95vw; }
        #card-hand .card:not(:first-child), #opponent-card-hand .opponent-card:not(:first-child) {
            margin-left: -35px; /* Increase overlap */
        }
#opponent-card-hand.visible {top: -40px;}
    }
    
    /* MOBILE */
    @media (max-width: 768px) {
        :root {
             --board-size: min(100%, 350px); /* Adjust board size for mobile */
        }
        #opponent-card-hand.visible {
             top: 0px; /* Adjust for smaller cards */
        }
        #card-hand .card, #opponent-card-hand .opponent-card {
            width: clamp(80px, 20vw, 100px);
            height: clamp(110px, 28vw, 140px);
        }
        #opponent-card-hand .opponent-card:not(:first-child) {
            margin-left: -45px; /* More overlap for opponent cards */
        }
        #card-hand .card:not(:first-child) {
            margin-left: -15px; /* Was -25px, reduced overlap for better visibility */
        }
        #game-board-frame, #game-board {margin-top: 0px;}
        /* Reveal section adjustments for mobile */
        #reveal-section { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 120px 20px; display: block; height: 100%; box-sizing: border-box; justify-content: flex-start; }
        #reveal-title { font-size: 2rem; margin-top: 0px; margin-bottom: 40px; padding-bottom: 0; text-align: center; }
        #product-container { display: flex; flex-direction: column; align-items: center; gap: 30px; padding: 0; margin: 0; overflow: visible; }
        .product-box { width: 100%; max-width: 350px; padding-bottom: 0; scroll-snap-align: none; }
        .product-expansion, .product-collector { display: none; }
        #reveal-footer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 50px; padding: 0; }
        #replay-button { position: static; transform: none; width: 100%; max-width: 350px; }
        .subscribe-form { display: flex; flex-direction: column; gap: 15px; align-items: center; width: 100%; max-width: 350px; padding: 20px; border-radius: 15px; background: rgba(0, 0, 0, 0.1); display: none;}
        .subscribe-form input, .subscribe-form button { width: 100%; }
    }

    /* LANDSCAPE MOBILE - very short height */
    @media (orientation: landscape) and (max-height: 500px) {
        nav {
            height: 70px;  /* Hide main nav to make game controls visible */
        }
        #sidebar {
            min-height: 60px; /* Make game control bar more compact */
            max-height: 60px;
            padding: 5px 10px;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }
        #setup-controls {
            flex-direction: row;
            align-items: center;
            gap: 10px;
        }
        #narration-box {
            padding: 0;
            text-align: left;
            flex-grow: 1;
            order: 1;
        }
        #narration-text {
            font-size: 0.8rem;
        }
        #interactive-controls-container {
            order: 2;
            flex-shrink: 0;
        }
        :root {
             --board-size: min(100%, 220px); /* Make board smaller for landscape */
        }
        #opponent-card-hand.visible {
            top: -60px; /* Adjust for landscape cards */
        }
        #card-hand .card, #opponent-card-hand .opponent-card {
            width: 90px;
            height: 120px;
        }
        #card-hand .card:not(:first-child), #opponent-card-hand .opponent-card:not(:first-child) {
            margin-left: -50px; /* Max overlap */
        }
        #game-board-frame, #game-board {margin-top: 20px;}
    }