body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
}

header {
    text-align: center;
    padding: 20px;
    background-color: #007bff;
    color: white;
}

header h1 {
    margin: 0 0 10px 0; /* Add space below h1 */
    font-size: 2em;
}

header h2 {
    margin: 0;
    font-size: 1.5em;
}

.container {
    display: flex;
    flex-wrap: wrap;
    position: relative; /* Allows absolute positioning for overlays like characters */
    min-height: 80vh; /* Kept: Ensures baseline height */
}

.section {
    flex: 1 1 33.3%;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    min-width: 300px;
    position: relative; /* For positioning effects within sections */
}

.chess {
    background-color: #ffffff; /* White */
    border-right: 5px solid #333; /* Full thick divider between left and center */
}

.game {
    background-color: #ffffff; /* Changed to white */
    border-right: none; /* Remove full border for partial effect between center and right */
}

.game::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 55%; /* Only top 55%, no line below */
    background: #333;
    z-index: 0;
}

.books {
    background-color: #ffffff; /* White */
}

h2 { color: #333; }

h3 {
    font-size: 1.2em;
    margin: 10px 0;
}

.chess p {
    text-align: left;
    font-size: 1em;
    line-height: 1.5;
    margin: 10px 0;
}

.chess .caption {
    text-align: center;
}

.chess .lessons-text {
    text-align: left;
    margin: 10px 0;
}

.logo-image {
    width: 33%;
    height: auto;
    margin: 10px auto;
    display: block;
}

.top-image {
    max-width: 100%;
    height: auto;
    margin: 10px auto;
    display: block;
}

.ct-image {
    max-width: 100%;
    height: auto;
    margin: 30px auto 10px; /* Increased space above the image */
    display: block;
}

.ce-image {
    width: 400px; /* Example twice the button size; adjust based on your button width */
    height: auto;
    margin: 50px auto 10px; /* Increased space above for more lines */
    display: block;
}

/* Specific sizes for each section's top image */
.chess .top-image {
    /* Keep full width unless specified; adjust if needed after it loads */
    max-width: 100%;
}

.game .top-image {
    width: 30%; /* Increased by 50% from 20% */
}

.game-video {
    width: 100%;
    height: auto;
    margin: 10px auto;
    display: block;
}

/* === NEW: overlay links for the split image (Option A) === */
.cta-split { position: relative; display: inline-block; }
.cta-split img { display: block; max-width: 100%; height: auto; }
.cta-split a {
    position: absolute;
    top: 0;
    bottom: 0;
    cursor: pointer;
    /* make the whole half clickable without showing a visible element */
    text-indent: -9999px; 
    overflow: hidden;
}
.cta-left  { left: 0;  width: 50%; }
.cta-right { right: 0; width: 50%; }
/* ======================================================== */

.books .top-image {
    width: 50%; /* 50% smaller than full width */
}

.book-row {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.book-col {
    flex: 1;
    max-width: 50%;
    text-align: center;
}

.book-image {
    width: 80%; /* Adjusted for side-by-side */
    height: auto;
    margin: 10px auto;
    display: block;
}

.elliot-image {
    max-width: 60%; /* Reduced by 40% from 100% */
    height: auto;
    margin: 20px 0 10px -20px; /* Shift left to touch the center section */
    display: block;
}

.additional-book-image {
    max-width: 100%;
    height: auto;
    margin: 10px auto;
    display: block;
}

.scene02-image {
    position: absolute;
    bottom: 20px;
    right: 0;
    max-width: 100%; /* Ensures it stays within the section */
    height: auto;
    z-index: 1; /* Behind button if overlapping */
}

.game .btn {
    position: relative;
    z-index: 2; /* Bring button to front */
}

img {
    height: auto;
    margin: 10px 0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff; /* Unified dark blue color */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}

.btn:hover {
    background-color: #0069d9; /* Unified hover */
}

.book-row:last-child .book-col:first-child .btn {
    position: relative;
    left: 120px; /* Move Book 3 right by 2x button length (~60px each) */
}

.book-row:last-child .book-col:last-child .btn {
    position: relative;
    left: 60px; /* Move Book 4 right by 1x button length */
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: white;
}

.characters-bottom {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
}

.left-characters img, .middle-characters img {
    width: 80px; /* Example size for wandering characters */
    position: absolute;
    bottom: 0;
}

/* Example positioning for characters in left/middle (adjust left/right values) */
.left-characters img {
    left: 20%;
}

.middle-characters img {
    right: 30%;
}

/* Mobile responsiveness: Stack sections, hide dividers/effects if needed */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .chess { border-right: none; border-bottom: 5px solid #333; }
    .game::before { display: none; } /* Hide partial dividers on mobile */
    .characters-bottom { position: relative; } /* Simplify on mobile */
    .chess p { text-align: center; } /* Optional: Center text on mobile for better readability */
    .elliot-image { margin-left: 0; } /* Reset shift on mobile */
    .book-row { flex-direction: column; }
    .book-col { max-width: 100%; }
    .book-row:last-child .book-col:first-child .btn, .book-row:last-child .book-col:last-child .btn { left: 0; }
    .scene02-image { position: relative; right: auto; width: 100%; max-width: 100%; bottom: auto; }
}
