/* === GLOBAL STYLES & RESET === */
:root {
    --color-bg: #04101a;
    --color-primary: #00bfff;
    --color-secondary: #a0d4ff;
    --color-accent: #ffd700;
    --color-text: #d0f0ff;
    --color-glass-overlay: rgba(0, 0, 0, 0.6);
    --border-radius-card: 16px;
    --border-radius-button: 50px;
    --transition-speed: 0.3s;
    --shadow-card: 0 20px 40px rgba(0,0,0,0.4);
}

html, body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Georgia, 'Times New Roman', serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px; /* Base font size */
}

main {
    flex: 1;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
    max-width: 100vw;
}

img, canvas, iframe, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    box-sizing: border-box;
}

/* === LAYOUT HELPERS === */
.cpf5bv-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cpf5bv-content-section {
    padding: 80px 20px;
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: justify; /* Default text alignment for content sections */
}

/* === HEADER & NAVIGATION === */
.cpf5bv-header {
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-speed) ease;
}

.cpf5bv-header .cpf5bv-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cpf5bv-logo {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-accent);
    gap: 10px;
    margin: 0 20px; /* Ensure some spacing around logo */
}

.cpf5bv-logo svg {
    width: 40px;
    height: 40px;
    vertical-align: middle;
}

.cpf5bv-desktop-nav ul {
    display: flex;
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
}

.cpf5bv-desktop-nav a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 8px 12px;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
    border-radius: 8px;
}

.cpf5bv-desktop-nav a:hover {
    color: var(--color-accent);
    background-color: rgba(255, 255, 255, 0.1);
}

.cpf5bv-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cpf5bv-age-flag {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 25px;
    display: flex;
    align-items: center;
}

.cpf5bv-age-flag img {
    width: 20px;
    margin-right: 6px;
    border-radius: 3px;
}

/* Mobile Menu */
.cpf5bv-hamburger {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--color-secondary);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.4rem;
    color: var(--color-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.cpf5bv-hamburger:hover {
    background-color: rgba(0, 191, 255, 0.2);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.cpf5bv-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cpf5bv-mobile-menu .cpf5bv-close-menu {
    position: absolute;
    top: 20px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: transform var(--transition-speed) ease;
}

.cpf5bv-mobile-menu .cpf5bv-close-menu:hover {
    transform: rotate(180deg);
}

.cpf5bv-mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cpf5bv-mobile-menu a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 600;
    transition: color var(--transition-speed) ease;
}

.cpf5bv-mobile-menu a:hover {
    color: var(--color-accent);
}

/* === DISCLOSURE BAR === */
#cpf5bv-disclosure-bar {
    background: #1a0800;
    color: #ffd700;
    text-align: center;
    padding: 7px 16px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #e65c00;
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    top: 60px; /* Adjust based on header height */
    z-index: 999;
}

/* === HERO SECTION === */
.cpf5bv-hero {
    position: relative;
    min-height: 85vh;
    padding: 160px 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    background-image: url('bg-34983xt9s81jsa8.png'); /* Placeholder, will be replaced by specific image */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

.cpf5bv-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

.cpf5bv-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    color: #fff;
}

.cpf5bv-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.cpf5bv-hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
    text-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.cpf5bv-hero-cta .cpf5bv-btn {
    font-size: 1.1rem;
    padding: 15px 35px;
    box-shadow: 0 8px 25px rgba(0, 215, 255, 0.4); /* Accent glow */
}

.cpf5bv-hero-cta .cpf5bv-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 215, 255, 0.6);
}

/* === GAME GRID === */
.cpf5bv-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 60px auto;
    max-width: 1400px;
    padding: 0 20px;
}

.cpf5bv-game-card {
    border-radius: var(--border-radius-card);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    background-color: rgba(0, 0, 0, 0.3); /* Subtle background for card */
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cpf5bv-game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-card);
}

.cpf5bv-game-card-image-wrapper {
    width: 100%;
    height: 200px; /* Fixed height for all images */
    overflow: hidden;
    position: relative;
}

.cpf5bv-game-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform var(--transition-speed) ease;
}

.cpf5bv-game-card:hover .cpf5bv-game-card-image-wrapper img {
    transform: scale(1.05);
}

.cpf5bv-game-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    backdrop-filter: blur(15px);
    background: var(--color-glass-overlay);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cpf5bv-game-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-accent);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.cpf5bv-game-card-description {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.cpf5bv-game-card-play-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--color-primary);
    color: var(--color-bg);
    border-radius: var(--border-radius-button);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.3);
}

.cpf5bv-game-card-play-btn:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

/* === BUTTON STYLES === */
.cpf5bv-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius-button);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all var(--transition-speed) ease;
    border: none;
    cursor: pointer;
    background: linear-gradient(100deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-bg); /* Dark text on bright button */
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.3);
}

.cpf5bv-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 191, 255, 0.5);
    background: linear-gradient(100deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    color: var(--color-text);
}

/* === FOOTER === */
.cpf5bv-footer {
    padding: 50px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    margin-top: auto; /* Pushes footer to bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden; /* Ensure no overflow from background */
}

.cpf5bv-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('bg-34983xt9s81jsa8.png') center/cover no-repeat;
    opacity: 0.3;
    filter: blur(1px);
}

.cpf5bv-footer .cpf5bv-container {
    position: relative; /* For z-index to work */
    z-index: 1;
    max-width: 900px;
    opacity: 0.85;
}

.cpf5bv-footer h3 {
    margin-bottom: 20px;
    opacity: 0.8;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-accent);
}

.cpf5bv-footer ul {
    display: flex;
    gap: 25px;
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
    padding-bottom: 20px;
}

.cpf5bv-footer a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.cpf5bv-footer a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.cpf5bv-footer-contact {
    margin-top: 15px;
    font-size: 0.9em;
    text-align: left;
    opacity: 0.9;
}

.cpf5bv-footer-contact p {
    margin-bottom: 8px;
}

.cpf5bv-footer-contact strong {
    color: var(--color-accent);
}

.cpf5bv-footer > div > div:nth-of-type(2) { /* Styles for the middle block */
    padding: 20px 0;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.2);
    border-top: 2px dashed rgba(255, 255, 255, 0.2);
}

.cpf5bv-footer h4 {
    margin: 0 0 8px 0;
    color: var(--color-accent);
    font-size: 1.2em;
    font-weight: 700;
}

.cpf5bv-footer > div > div:nth-of-type(2) p {
    margin: 0;
    opacity: 0.9;
    font-size: 1em;
}

.cpf5bv-footer p {
    margin-bottom: 10px;
    font-size: 0.9em;
    text-align: justify;
    opacity: 0.9;
}

.cpf5bv-footer strong {
    color: var(--color-accent);
    font-weight: 700;
}

.cpf5bv-footer a[href*="gambleaware.org"] {
    color: var(--color-secondary);
    text-decoration: underline;
}

.cpf5bv-footer a[href*="gambleaware.org"]:hover {
    color: var(--color-accent);
}

.cpf5bv-footer > div > div:nth-of-type(3) { /* Styles for the regulatory info */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 12px;
    font-size: 0.78em;
    opacity: 0.75;
    line-height: 1.55;
    text-align: left;
}

.cpf5bv-footer > div > div:nth-of-type(3) strong {
    display: block;
    margin-bottom: 4px;
    opacity: 0.9;
    color: var(--color-text);
}

.cpf5bv-footer .cpf5bv-copyright {
    margin-top: 15px;
    text-align: center;
    font-size: 0.85em;
    opacity: 0.8;
}

/* === ACCESSIBILITY & UTILITIES === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === MEDIA QUERIES === */

/* === TABLET (≤1024px) === */
@media (max-width: 1024px) {
    .cpf5bv-hero {
        grid-template-columns: 1fr !important;
        flex-direction: column !important;
        padding: 80px 5% 60px !important;
        gap: 40px !important;
        min-height: unset !important;
        background-attachment: scroll !important;
    }
    .cpf5bv-hero h1 {
        font-size: clamp(1.8rem, 5vw, 3rem) !important;
    }
    .cpf5bv-hero-image {
        display: none !important;
    }
    .cpf5bv-game-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    }
    .cpf5bv-footer ul {
        gap: 15px !important;
    }
}

/* === MOBILE (≤768px) === */
@media (max-width: 768px) {
    html, body {
        font-size: 15px;
        overflow-x: hidden;
    }
    .cpf5bv-header {
        padding: 12px 16px !important;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .cpf5bv-desktop-nav {
        display: none !important;
    }
    .cpf5bv-hamburger {
        display: flex !important; /* Show hamburger on mobile */
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 2px solid var(--color-secondary);
        border-radius: 8px;
        padding: 6px 10px;
        font-size: 1.4rem;
        color: var(--color-secondary);
        cursor: pointer;
        transition: all var(--transition-speed) ease;
    }
    .cpf5bv-logo {
        margin: 0 auto !important; /* Center logo on mobile */
        flex-grow: 1; /* Allow logo to take space */
        justify-content: center;
    }
    .cpf5bv-header-right {
        margin-left: 10px; /* Space between logo and age flag/menu */
    }

    .cpf5bv-hero {
        grid-template-columns: 1fr !important;
        flex-direction: column !important;
        padding: 60px 16px 40px !important;
        text-align: center !important;
        gap: 24px !important;
        min-height: unset !important;
        background-attachment: scroll !important;
    }
    .cpf5bv-hero h1, .cpf5bv-hero-content h1 {
        font-size: clamp(1.6rem, 7vw, 2.4rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 16px !important;
    }
    .cpf5bv-hero p, .cpf5bv-hero-content p {
        font-size: 1rem !important;
        margin-bottom: 24px !important;
    }
    .cpf5bv-hero-cta .cpf5bv-btn {
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
    }
    .cpf5bv-hero-image {
        display: none !important;
    }
    .cpf5bv-game-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 12px !important;
        margin: 40px auto !important;
    }
    .cpf5bv-game-card {
        border-radius: 12px !important;
    }
    .cpf5bv-game-card-image-wrapper {
        height: 140px !important;
    }
    .cpf5bv-game-card-info {
        padding: 15px !important;
    }
    .cpf5bv-game-card-title {
        font-size: 1.1rem !important;
    }
    .cpf5bv-game-card-description {
        font-size: 0.9rem !important;
    }
    .cpf5bv-game-card-play-btn {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }
    .cpf5bv-content-section {
        padding: 40px 16px !important;
        font-size: 1rem !important;
    }
    .cpf5bv-footer {
        padding: 30px 16px !important;
        font-size: 0.85rem !important;
    }
    .cpf5bv-footer ul {
        flex-direction: column !important;
        gap: 10px !important;
        padding-bottom: 15px !important;
    }
    .cpf5bv-footer h3 {
        font-size: 1.5rem !important;
    }
    .cpf5bv-footer > div > div:nth-of-type(2) {
        padding: 15px 0 !important;
    }
    .cpf5bv-footer > div > div:nth-of-type(3) {
        text-align: center !important;
    }
    .cpf5bv-copyright {
        font-size: 0.8rem !important;
    }
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    img, video, iframe {
        max-width: 100% !important;
    }
}

/* === SMALL MOBILE (≤480px) === */
@media (max-width: 480px) {
    .cpf5bv-hero h1, .cpf5bv-hero-content h1 {
        font-size: clamp(1.4rem, 8vw, 2rem) !important;
    }
    .cpf5bv-game-grid {
        grid-template-columns: 1fr !important;
    }
    .cpf5bv-game-card-image-wrapper {
        height: 180px !important;
    }
    .cpf5bv-logo {
        flex-grow: 0 !important; /* Revert flex-grow on smallest screens if needed */
        margin: 0 !important;
    }
    .cpf5bv-header .cpf5bv-container {
        justify-content: center; /* Center everything if no space */
    }
}

/* === DESKTOP ONLY: Hide hamburger === */
@media (min-width: 769px) {
    .cpf5bv-hamburger {
        display: none !important;
    }
    .cpf5bv-desktop-nav {
        display: flex !important; /* Show desktop nav */
    }
    .cpf5bv-mobile-menu {
        display: none !important; /* Ensure mobile menu is hidden on desktop */
    }
    .cpf5bv-logo {
        margin: 0 20px; /* Ensure spacing again */
    }
}