
/* ==========================================
   DREAMBIG KIDS — CARTOON ARCADE
   ========================================== */

:root {
    --arcade-ink: #25234d;
    --arcade-purple: #7955e8;
    --arcade-pink: #ff6594;
    --arcade-yellow: #ffda57;
    --arcade-blue: #59c9f5;
    --arcade-green: #70dda9;
    --arcade-orange: #ff9d58;
    --arcade-paper: #fffaf0;
    --arcade-white: #ffffff;
}

.games-page {
    min-height: 100vh;
    color: var(--arcade-ink);
    background:
        radial-gradient(circle at 8% 15%, #ffe5f0 0 70px, transparent 72px),
        radial-gradient(circle at 92% 35%, #dff7ff 0 95px, transparent 97px),
        var(--arcade-paper);
    font-family: "Trebuchet MS", "Comic Sans MS", sans-serif;
}

.games-page *,
.games-player *,
.game-screen * {
    box-sizing: border-box;
}

.games-hero {
    position: relative;
    overflow: hidden;
    margin: 28px auto;
    width: min(1180px, calc(100% - 32px));
    padding: clamp(30px, 6vw, 68px) 24px;
    text-align: center;
    border: 4px solid var(--arcade-ink);
    border-radius: 36px;
    background: linear-gradient(135deg, #ffda57 0%, #ffb7d0 52%, #b9eaff 100%);
    box-shadow: 0 10px 0 var(--arcade-ink);
}

.games-hero::before,
.games-hero::after {
    position: absolute;
    font-size: clamp(35px, 6vw, 66px);
    pointer-events: none;
}

.games-hero::before {
    content: "⭐";
    left: 7%;
    top: 13%;
    transform: rotate(-15deg);
}

.games-hero::after {
    content: "🌈";
    right: 7%;
    bottom: 10%;
    transform: rotate(10deg);
}

.games-hero .eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 8px 16px;
    border: 2px solid var(--arcade-ink);
    border-radius: 999px;
    background: white;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.games-hero h1 {
    margin: 0;
    color: var(--arcade-ink);
    font-size: clamp(42px, 8vw, 78px);
    font-weight: 1000;
    line-height: 1.02;
    letter-spacing: -2px;
    text-shadow: 3px 4px 0 white, 6px 7px 0 rgba(37, 35, 77, 0.12);
}

.games-hero p {
    max-width: 570px;
    margin: 20px auto 0;
    font-size: clamp(15px, 2vw, 19px);
    font-weight: 700;
    line-height: 1.7;
}

.games-library {
    width: min(1180px, calc(100% - 32px));
    margin: 44px auto 72px;
}

.games-section-heading {
    margin: 0 0 24px;
    text-align: center;
}

.games-section-heading h2 {
    margin: 0;
    font-size: clamp(27px, 4vw, 40px);
    font-weight: 1000;
}

.games-section-heading p {
    margin: 9px 0 0;
    color: #696781;
    font-weight: 700;
}

.games-grid,
.game-library-grid,
#game-library .games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.game-card {
    --card-color: #ffda57;
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
    overflow: hidden;
    border: 3px solid var(--arcade-ink);
    border-radius: 27px;
    background: var(--card-color);
    box-shadow: 0 7px 0 var(--arcade-ink);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.game-card:nth-child(6n + 2) {
    --card-color: #b9eaff;
}

.game-card:nth-child(6n + 3) {
    --card-color: #ffc4d8;
}

.game-card:nth-child(6n + 4) {
    --card-color: #c8f5d9;
}

.game-card:nth-child(6n + 5) {
    --card-color: #e0d1ff;
}

.game-card:nth-child(6n) {
    --card-color: #ffd4ae;
}

.game-card:hover {
    transform: translateY(-5px) rotate(-0.5deg);
    box-shadow: 0 12px 0 var(--arcade-ink);
}

.game-card-icon,
.game-icon,
.game-card .game-emoji {
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    margin: 0 auto 17px;
    border: 3px solid var(--arcade-ink);
    border-radius: 27px;
    background: white;
    font-size: 48px;
    box-shadow: 0 5px 0 var(--arcade-ink);
}

.game-card h3,
.game-card h2 {
    margin: 0 0 9px;
    text-align: center;
    font-size: 21px;
    font-weight: 1000;
    line-height: 1.25;
}

.game-card p {
    flex: 1;
    margin: 0 0 19px;
    color: #494767;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.game-card button,
.game-card [data-game],
.arcade-button,
.game-button,
.game-choice,
.game-answer,
.game-back-button,
.game-next-button,
.game-restart-button {
    min-height: 46px;
    border: 3px solid var(--arcade-ink);
    border-radius: 15px;
    background: white;
    color: var(--arcade-ink);
    font: inherit;
    font-weight: 1000;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--arcade-ink);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.game-card button:hover,
.game-card [data-game]:hover,
.arcade-button:hover,
.game-button:hover,
.game-choice:hover,
.game-answer:hover,
.game-back-button:hover,
.game-next-button:hover,
.game-restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--arcade-ink);
}

.game-card button:active,
.game-card [data-game]:active,
.arcade-button:active,
.game-button:active,
.game-choice:active,
.game-answer:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--arcade-ink);
}

.game-card button,
.game-card [data-game] {
    width: 100%;
    padding: 12px;
    background: var(--arcade-yellow);
    font-size: 15px;
}

.games-player {
    width: min(1000px, calc(100% - 32px));
    margin: 36px auto 76px;
}

.games-player[hidden],
[hidden] {
    display: none !important;
}

.game-screen {
    padding: clamp(18px, 4vw, 38px);
    border: 4px solid var(--arcade-ink);
    border-radius: 32px;
    background: white;
    box-shadow: 0 9px 0 var(--arcade-ink);
}

.game-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.game-back-button {
    padding: 10px 16px;
    background: #e8e0ff;
}

.game-score {
    padding: 10px 16px;
    border: 3px solid var(--arcade-ink);
    border-radius: 999px;
    background: var(--arcade-yellow);
    font-size: 15px;
    font-weight: 1000;
}

.game-title {
    margin: 8px 0;
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 1000;
    line-height: 1.15;
    text-align: center;
}

.game-instructions {
    margin: 0 auto 24px;
    max-width: 620px;
    color: #6b6984;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
}

.game-question-card {
    max-width: 700px;
    margin: 0 auto 22px;
    padding: 22px;
    border: 3px dashed #aaa0e6;
    border-radius: 24px;
    background: #f6f2ff;
    text-align: center;
}

.game-question-emoji {
    display: block;
    margin-bottom: 10px;
    font-size: clamp(60px, 10vw, 90px);
    line-height: 1.2;
}

.game-question-text {
    margin: 0;
    font-size: clamp(19px, 3vw, 25px);
    font-weight: 1000;
    line-height: 1.4;
}

.game-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 700px;
    margin: 22px auto;
}

.game-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 76px;
    padding: 15px;
    background: #fff0b6;
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.game-choice:nth-child(4n + 2) {
    background: #d8f4ff;
}

.game-choice:nth-child(4n + 3) {
    background: #ffe0ec;
}

.game-choice:nth-child(4n) {
    background: #d8f9e6;
}

.game-choice:disabled,
.game-answer:disabled {
    cursor: default;
    opacity: 1;
}

.game-choice.is-correct {
    background: #8be9b5;
    border-color: #168752;
}

.game-choice.is-wrong {
    background: #ffb4bd;
    border-color: #d53b55;
}

.game-feedback {
    min-height: 54px;
    margin: 18px auto;
    padding: 13px 18px;
    max-width: 700px;
    border: 3px solid var(--arcade-ink);
    border-radius: 18px;
    background: #fff3bd;
    text-align: center;
    font-size: 16px;
    font-weight: 1000;
    line-height: 1.5;
}

.game-feedback:empty {
    display: none;
}

.game-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.game-next-button,
.game-restart-button {
    padding: 13px 22px;
    background: var(--arcade-purple);
    color: white;
}

.game-restart-button {
    background: var(--arcade-pink);
}

.game-progress {
    width: 100%;
    max-width: 700px;
    height: 16px;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 3px solid var(--arcade-ink);
    border-radius: 999px;
    background: #eeeafa;
}

.game-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff6594, #ffda57, #70dda9);
    transition: width 220ms ease;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 650px;
    margin: 25px auto;
}

.memory-card {
    display: grid;
    aspect-ratio: 1 / 1;
    min-width: 0;
    place-items: center;
    padding: 5px;
    border: 3px solid var(--arcade-ink);
    border-radius: 20px;
    background: #9b82f4;
    color: white;
    font-size: clamp(27px, 5vw, 43px);
    font-weight: 1000;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--arcade-ink);
    transition: transform 140ms ease, background 140ms ease;
}

.memory-card:hover {
    transform: translateY(-3px) rotate(-2deg);
}

.memory-card.is-revealed {
    background: #fff0b6;
    color: var(--arcade-ink);
}

.memory-card.is-matched {
    background: #bdf4d2;
    cursor: default;
    box-shadow: 0 2px 0 var(--arcade-ink);
    transform: scale(0.97);
}

.word-tiles {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    min-height: 65px;
    margin: 20px 0;
}

.word-tile {
    display: grid;
    width: 48px;
    height: 52px;
    place-items: center;
    border: 3px solid var(--arcade-ink);
    border-radius: 13px;
    background: var(--arcade-yellow);
    color: var(--arcade-ink);
    font-size: 22px;
    font-weight: 1000;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--arcade-ink);
}

.word-tile:disabled {
    opacity: 0.35;
    cursor: default;
}

.word-answer-slot {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 66px;
    margin: 18px 0;
    padding: 10px;
    border: 3px dashed #b7a8f5;
    border-radius: 18px;
    background: #f6f2ff;
}

.word-answer-letter {
    display: grid;
    width: 42px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    background: white;
    border: 2px solid #c6baf4;
    font-size: 20px;
    font-weight: 1000;
    cursor: pointer;
}

.game-finish {
    padding: 25px 12px;
    text-align: center;
}

.game-finish-emoji {
    display: block;
    font-size: clamp(70px, 12vw, 105px);
}

.game-finish h2 {
    margin: 12px 0;
    font-size: clamp(29px, 5vw, 44px);
    font-weight: 1000;
}

.game-finish p {
    color: #696781;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.7;
}

@media (max-width: 850px) {
    .games-grid,
    .game-library-grid,
    #game-library .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .game-card {
        padding: 17px;
    }
}

@media (max-width: 560px) {
    .games-hero {
        margin-top: 18px;
        border-radius: 25px;
        box-shadow: 0 7px 0 var(--arcade-ink);
    }

    .games-hero::before {
        left: 4%;
        top: 5%;
    }

    .games-hero::after {
        right: 4%;
        bottom: 4%;
    }

    .games-grid,
    .game-library-grid,
    #game-library .games-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        padding: 22px;
    }

    .game-choice-grid {
        grid-template-columns: 1fr;
    }

    .memory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .game-screen {
        padding: 16px;
        border-radius: 24px;
    }

    .game-topbar {
        align-items: stretch;
    }

    .game-back-button,
    .game-score {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-card,
    .game-choice,
    .memory-card,
    .game-progress-fill {
        transition: none;
    }
}

/* ==========================================
   DREAMBIG KIDS — STRUCTURED FOOTER
   ========================================== */

.dreambig-footer {
    position: relative;
    margin-top: 70px;
    padding: 48px max(24px, calc((100% - 1180px) / 2)) 0;
    overflow: hidden;
    border-top: 4px solid #25234d;
    background: #b9eaff;
    color: #25234d;
    font-family: "Trebuchet MS", "Comic Sans MS", sans-serif;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 34px;
    align-items: start;
    padding-bottom: 38px;
}

.footer-brand,
.footer-links,
.footer-fun {
    min-width: 0;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #25234d;
    font-size: 26px;
    font-weight: 1000;
    text-decoration: none;
}

.footer-logo-icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    border: 3px solid #25234d;
    border-radius: 14px;
    background: #ffda57;
    box-shadow: 0 4px 0 #25234d;
}

.footer-highlight {
    color: #7955e8;
}

.footer-brand > p,
.footer-fun > p {
    margin: 17px 0;
    color: #494767;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
}

.footer-mascots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.footer-mascots span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 2px solid #25234d;
    border-radius: 14px;
    background: white;
    font-size: 23px;
    box-shadow: 0 3px 0 #25234d;
}

.footer-links h3,
.footer-fun h3 {
    margin: 6px 0 18px;
    font-size: 18px;
    font-weight: 1000;
}

.footer-links a {
    display: block;
    width: fit-content;
    margin: 12px 0;
    color: #494767;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: none;
    transition: color 150ms ease, transform 150ms ease;
}

.footer-links a:hover {
    color: #7955e8;
    transform: translateX(4px);
}

.footer-fun {
    padding: 21px;
    border: 3px solid #25234d;
    border-radius: 24px;
    background: #ffda57;
    box-shadow: 0 6px 0 #25234d;
}

.footer-star {
    display: inline-block;
    margin-bottom: 5px;
    font-size: 34px;
}

.footer-fun h3 {
    margin: 0;
    line-height: 1.4;
}

.footer-fun > p {
    margin: 10px 0 18px;
}

.footer-play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 45px;
    padding: 11px 14px;
    border: 3px solid #25234d;
    border-radius: 14px;
    background: #ff6594;
    color: #25234d;
    font-size: 14px;
    font-weight: 1000;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 0 #25234d;
    transition: transform 150ms ease;
}

.footer-play-button:hover {
    transform: translateY(-3px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding: 19px 0;
    border-top: 2px dashed rgba(37, 35, 77, 0.35);
}

.footer-bottom p {
    margin: 0;
    color: #494767;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px;
    }
}

@media (max-width: 540px) {
    .dreambig-footer {
        margin-top: 45px;
        padding: 35px 22px 0;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 27px;
    }

    .footer-brand {
        max-width: 360px;
    }

    .footer-fun {
        max-width: 400px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}
