* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 115px;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Comic Sans MS", Arial, sans-serif;
    background: #fff7e6;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #4a6cf7;
    font-weight: bold;
}

/* TOP PARTNER BAR */
.top-partner-bar {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: #111;
    color: #fff;
    text-align: center;
    padding: 7px 10px;
    font-size: 14px;
}

.top-partner-bar span {
    opacity: 0.8;
    margin-right: 8px;
}

.top-partner-bar a {
    color: #fff;
    text-decoration: none;
    margin: 0 7px;
    font-weight: bold;
}

.top-partner-bar a:hover {
    text-decoration: underline;
}

/* MAIN STICKY SITE MENU */
.site-header {
    position: sticky;
    top: 34px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.site-header-inner {
    max-width: 1150px;
    margin: 0 auto;
    padding: 11px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.site-logo {
    font-size: 24px;
    font-weight: bold;
    color: #5b4fd6;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover {
    background: #f4edff;
    color: #5b4fd6;
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    border: none;
    background: #5b4fd6;
    color: #fff;
    font-size: 22px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

/* HERO */
.hero {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 30%),
        linear-gradient(135deg, #ff9a9e, #fad0c4, #fbc2eb, #a18cd1);
    padding: 70px 20px;
    text-align: center;
    color: #fff;
    border-bottom-left-radius: 36px;
    border-bottom-right-radius: 36px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.hero-inner {
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 46px;
    margin: 0 0 12px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.hero p {
    font-size: 21px;
    max-width: 760px;
    margin: 0 auto 24px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-buttons a {
    display: inline-block;
    background: rgba(255, 255, 255, 0.88);
    color: #5b4fd6;
    padding: 11px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, background 0.2s ease;
}

.hero-buttons a:hover {
    background: #fff;
    transform: translateY(-2px);
}

/* MAIN */
main {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 20px;
}

.intro,
.content-box {
    width: 100%;
    max-width: 1150px;
    margin: 40px auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.74);
    padding: 28px;
    border-radius: 24px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09);
}

.intro h2,
.content-box h2,
.section-heading h2 {
    margin-top: 0;
    color: #5b4fd6;
}

.section-heading {
    text-align: center;
    margin: 50px auto 20px;
}

.section-heading p {
    color: #555;
    margin-top: -8px;
}

/* BOOK GRID */
.book-grid {
    display: grid;
    gap: 28px;
    padding: 20px 0 35px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.book-card {
    background: #fff;
    border-radius: 26px;
    overflow: hidden;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.book-card img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

.book-card-content {
    padding: 20px;
}

.book-card h3 {
    margin: 0 0 10px;
    color: #5b4fd6;
    font-size: 24px;
}

.book-card p {
    margin: 0 0 18px;
    color: #555;
}

.card-button {
    display: inline-block;
    background: #4a6cf7;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: bold;
    text-decoration: none;
}

/* MINI CARDS */
.mini-grid,
.steps-grid,
.partner-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.mini-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.steps-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.mini-card,
.step-card {
    background: #fff;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.09);
}

.mini-card h3,
.step-card h3 {
    margin-top: 0;
    color: #5b4fd6;
}

.step-card span {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    background: #ff66cc;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    margin-bottom: 8px;
}

/* KIDS ACTIVITY TOOLS */
.kids-tools-box {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 34%),
        linear-gradient(135deg, #fff, #fff0fa, #f4edff);
}

.mini-games-box {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 34%),
        linear-gradient(135deg, #fff7d6, #fff0fa, #f4edff);
}

.tool-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 11px 24px rgba(0, 0, 0, 0.15);
}

.tool-card p {
    margin-bottom: 16px;
}

/* PARTNER RESOURCE CARDS */
.partner-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.partner-grid a {
    display: block;
    background: linear-gradient(135deg, #fff, #f4edff);
    border-radius: 18px;
    padding: 16px 18px;
    text-decoration: none;
    color: #4a3fd1;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-grid a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.coming-soon {
    background: linear-gradient(135deg, #fff, #fff0fa);
}

/* BUTTONS */
.btn-amazon,
.btn-download {
    display: inline-block;
    background: #4a6cf7;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.btn-amazon:hover,
.btn-download:hover {
    transform: scale(1.05);
}

.amazon-top,
.amazon-bottom {
    text-align: center;
    margin: 20px 0;
}

/* PAGE VIEWER */
.viewer {
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    text-align: center;
    overflow: hidden;
}

.viewer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.viewer-controls button {
    background: #a18cd1;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.viewer-frame {
    width: 100%;
    max-width: 760px;
    background: #fff;
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    margin: 0 auto 20px;
    overflow: hidden;
}

.viewer-frame img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.viewer-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    align-items: center;
}

/* FLOATING SHARE BUTTON */
.floating-share {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #ff66cc, #6699ff);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

/* SHARE MENU */
.share-menu {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: linear-gradient(135deg, #ff4f9a, #4a90e2);
    padding: 10px;
    border-radius: 14px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
    z-index: 999;
}

.share-menu.open {
    display: flex;
}

.share-menu a {
    text-decoration: none;
    display: block;
}

.share-icon {
    width: 32px;
    height: 32px;
    display: block;
}

/* BACK TO TOP */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #a18cd1, #ff66cc);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 34px 20px;
    color: #777;
    font-size: 14px;
}

footer a {
    margin: 0 8px;
    text-decoration: none;
}

/* SHARED TOWNTUNE NAV + SEARCH */
:root {
    --partner-bar-height: 34px;
}

.site-header[data-include] {
    top: var(--partner-bar-height);
}

.main-nav .nav-search {
    position: relative;
    flex: 0 0 220px;
    width: 220px;
}

.main-nav .nav-search input {
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 8px 13px;
    border: 2px solid #eadcff;
    border-radius: 999px;
    outline: none;
    background: #fff;
    color: #333;
    font: inherit;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.main-nav .nav-search input::placeholder {
    color: #8b7fa8;
}

.main-nav .nav-search input:focus {
    border-color: #a18cd1;
    box-shadow: 0 0 0 3px rgba(161, 140, 209, 0.18);
}

.site-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1200;
    display: none;
    width: 290px;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    text-align: left;
}

.site-search-results.open {
    display: block;
}

.main-nav .site-search-results a {
    display: block;
    margin: 0;
    padding: 12px 15px;
    border-bottom: 1px solid #f0e8fa;
    border-radius: 0;
    background: #fff;
    color: #4a3fd1;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
    transform: none;
}

.main-nav .site-search-results a:last-child {
    border-bottom: 0;
}

.main-nav .site-search-results a:hover {
    background: #fff0fa;
    color: #5b4fd6;
    transform: none;
}

.site-search-message {
    padding: 13px 15px;
    color: #666;
    font-size: 14px;
    font-weight: bold;
}

/* FEATURED COLOURING BOOKS SECTION */
.books-box {
    margin: 36px auto;
    padding: 34px 26px;
    background: linear-gradient(135deg, #fff5da, #fff0fa, #f3ecff);
    border-radius: 28px;
    box-shadow: 0 10px 24px rgba(86, 67, 180, 0.12);
}

.books-box h2,
.books-box > p {
    text-align: center;
}

/* TABLET */
@media (max-width: 900px) {
    main {
        padding: 0 16px;
    }

    .viewer {
        padding: 16px 0;
    }

    .viewer-frame {
        max-width: 100%;
        padding: 12px;
    }

    .scene-wrap {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 520px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        gap: 14px !important;
    }

    .scene-box {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* MOBILE MENU */
@media (max-width: 760px) {
    html {
        scroll-padding-top: 105px;
    }

    .top-partner-bar {
        font-size: 14px;
        padding: 6px;
        line-height: 1.4;
    }

    .top-partner-bar span {
        margin-right: 4px;
    }

    .top-partner-bar a {
        margin: 0 4px;
    }

    .site-header {
        top: 30px;
    }

    .site-header-inner {
        padding: 10px 14px;
    }

    .site-logo {
        font-size: 22px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 62px;
        left: 12px;
        right: 12px;
        background: #fff;
        border-radius: 22px;
        padding: 14px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        background: linear-gradient(135deg, #fff7e6, #f4edff);
        text-align: center;
        padding: 12px;
    }

    .main-nav .nav-search {
        width: 100%;
        flex: 1 1 100%;
    }

    .main-nav .nav-search input {
        width: 100%;
        min-height: 42px;
        text-align: left;
    }

    .site-search-results {
        position: static;
        width: 100%;
        max-height: 260px;
        margin-top: 8px;
    }

    .tool-page-hero {
        padding: 34px 16px;
    }

    .tool-page-hero h1 {
        font-size: 30px;
        margin-bottom: 8px;
    }

    .tool-page-hero p {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .game-box {
        margin: 18px auto;
        padding: 18px 14px;
    }

    .game-label {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .game-status {
        gap: 7px;
        margin: 8px 0 12px;
    }

    .status-pill {
        padding: 6px 10px;
        font-size: 14px;
    }

    .category-pills {
        margin: 12px 0 8px;
        gap: 6px;
    }

    .category-pills button {
        padding: 7px 9px;
        font-size: 13px;
    }

    .game-card {
        margin: 12px 0;
        padding: 16px 12px;
    }

    .target-letter-box {
        margin-bottom: 14px;
        padding: 13px 10px;
        font-size: 17px;
    }

    .target-letter {
        min-width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .letter-grid {
        max-width: 430px;
        gap: 7px;
    }

    .letter-card {
        min-height: 54px;
        font-size: 26px;
        border-radius: 14px;
    }

    .feedback-box {
        min-height: 54px;
        margin-top: 14px;
        padding: 13px;
        font-size: 16px;
    }

    .generator-buttons {
        margin-top: 14px;
        gap: 8px;
    }

    .generator-buttons button {
        padding: 9px 13px;
        font-size: 14px;
    }

    .scene-wrap {
        max-width: 100% !important;
        gap: 12px !important;
    }

    .scene-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .scene-cell {
        min-width: 0 !important;
        min-height: 46px !important;
        font-size: 24px !important;
    }

    .answer-options {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .answer-option {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 58px;
        padding: 12px;
        font-size: 16px;
    }
}

/* MOBILE */
@media (max-width: 600px) {
    .hero {
        padding: 50px 14px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero p {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .hero-buttons {
        gap: 7px;
        flex-wrap: nowrap;
    }

    .hero-buttons a {
        padding: 8px 9px;
        font-size: 13px;
        white-space: nowrap;
    }

    main {
        padding: 0 14px;
    }

    .intro,
    .content-box {
        padding: 22px;
        margin: 28px auto;
    }

    .book-grid {
        padding: 10px 0 25px;
    }

    .book-card img {
        height: 330px;
    }

    .viewer {
        margin: 22px auto;
        padding: 12px 0;
    }

    .viewer-controls {
        gap: 8px;
        font-size: 14px;
    }

    .viewer-controls button {
        padding: 7px 10px;
        font-size: 16px;
    }

    .viewer-frame {
        padding: 8px;
        border-radius: 16px;
    }

    .viewer-frame img {
        border-radius: 10px;
    }

    .btn-amazon,
    .btn-download {
        font-size: 16px;
        padding: 11px 16px;
        max-width: 300px;
    }
}

@media (max-width: 380px) {
    .hero-buttons a {
        padding: 7px;
        font-size: 12px;
    }

    .site-logo {
        font-size: 20px;
    }

    .viewer-controls {
        gap: 6px;
    }

    .viewer-controls button {
        padding: 6px 9px;
        font-size: 15px;
    }
}

/* REWARD CHART: PRINT ONLY THE CHART */
@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body * {
        visibility: hidden !important;
    }

    .chart-preview-wrap,
    .chart-preview-wrap * {
        visibility: visible !important;
    }

    .chart-preview-wrap {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .reward-chart {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 14px !important;
        box-shadow: none !important;
        border: 3px solid #8b7cff !important;
        page-break-inside: avoid !important;
    }

    .chart-title {
        font-size: 27px !important;
        margin-bottom: 5px !important;
    }

    .chart-subtitle {
        margin-bottom: 12px !important;
    }

    .reward-table th,
    .reward-table td {
        padding: 7px 5px !important;
        font-size: 13px !important;
    }

    .star-cell {
        font-size: 20px !important;
    }

    .reward-box {
        margin-top: 12px !important;
        padding: 11px !important;
        font-size: 16px !important;
    }
}

.task-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 12px;
}

.task-buttons button {
    border: none;
    background: #f4edff;
    color: #5b4fd6;
    padding: 9px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.task-buttons button:hover {
    background: #e7dcff;
}