*, *::before, *::after { box-sizing: border-box; }

:root{
    --page-bg: #0097b2;
    --accent:  #00513b;
    --chalk:   #e9e6db;
    --faded:   #ffffff60;
    --chalkboard-title: #f7aa19;
    --chalkboard-bg: #00513b;
    --chalkboard-border: #d5a865;
    --chalkboard-border-w: 10px;
    --desktop-w: 980px;
}

body{
    font-family: Arial, sans-serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
    background-color: var(--page-bg);
}

h3 {
    font-family: 'Patrick Hand', sans-serif;
    letter-spacing: 1.5px;
}

/* ===== LAYOUT ===== */
/* Mobile-first: stacked */
#desktop-layout{
    width: 100%;
    display: block;
    padding-top: 30px;
    padding-bottom: 30px;
}

/* Left column (wheel + button) */
#left-col{ flex: 0 0 auto; }

/* Right column (chalkboard) */
#right-col{ flex: 1 1 auto; min-width: 320px; }

/* ===== WHEEL BLOCK ===== */
#wheel-block{
    width: min(90vw, 500px);
    margin: 20px auto 0;
}

#wheel-area{
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

#wheel{
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0,0,0,0.25);
    transform-origin: 50% 50%;
    will-change: transform;
}

#pointer {
    position: absolute;
    top: 50%;
    right: -60px;
    transform: translateY(-50%);
    width: 80px;
    height: auto;
    z-index: 10;
    pointer-events: none;
}

#action-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#spin-button {
    padding: 0.5em 2em;
    font-size: 2.0em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    letter-spacing: 2px;
}

#spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== CHALKBOARD RESULTS ===== */
#result {
    margin-top: 25px;
    width: 90%;
    max-width: 800px;
    /*height: 450px;*/

    background-color: var(--chalkboard-bg);
    background-image:
            radial-gradient(circle at 20% 15%, rgba(255,255,255,0.05), transparent 45%),
            radial-gradient(circle at 80% 25%, rgba(255,255,255,0.04), transparent 50%),
            radial-gradient(circle at 50% 70%, rgba(0,0,0,0.15), transparent 55%);

    border: var(--chalkboard-border-w) solid var(--chalkboard-border);
    border-radius: 5px;

    box-shadow:
            inset 0 0 0 2px rgba(255,255,255,0.05),
            0 8px 20px rgba(0,0,0,0.35);

    overflow: hidden;
}

#chalkboard {
    margin: 1px 40px;
    font-family: 'Patrick Hand', sans-serif;
    color: #fff;
    letter-spacing: 1.5px;
    /*overflow: auto;*/
    -webkit-overflow-scrolling: touch;
    display: none;
}

#selected-label{
    font-weight: bold;
    color: var(--chalkboard-title);
    font-size: 32px;
}

#selected-intro {
    max-height: 200px;
    /*overflow: auto;*/
    padding-right: 6px;
    font-size: 30px;
    line-height: 1.0em;
    margin-bottom: 40px;
    /*-webkit-overflow-scrolling: touch;*/
}

#selected-intro p {
    font-size: 23px;
    line-height: 1.2;
    color: var(--chalk);
}

#selected-intro a {
    color: var(--chalk);
    text-decoration: underline;
    white-space: nowrap;
}

#selected-topic {
    font-size: 30px;
    margin-top: 10px;
    margin-bottom: 20px;
    line-height: 1.2em;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

#selected-thumbnail {
    display: flex;
    justify-content: center; /* Centers horizontally */
    align-items: center;     /* Centers vertically */
    height: 190px;           /* Define a height for the container */
    valign: bottom;
    border: none;
    margin-top: 20px;
    margin-bottom: 20px;
}
#selected-thumbnail-image {
    height: 170px;
}
#dyk-div {
    height: 40px;
    margin-top: 15px;
    margin-bottom: 10px;
    display: none;
}
#dyk-img {
    margin-top: 10px;
    max-height: 38px;
    width: auto;
}
#selected-footer {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 23px;
    line-height: 1.2;
    text-align: left;
    color: var(--chalk);
}
#selected-footer-text {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 23px;
    line-height: 1.2;
    text-align: left;
    color: var(--chalk);
}
#what-can {
    font-size: 25px;
    font-weight: 500;
    color: var(--chalk);
}
#chalkboard-cta {
    display: block;
}
#chalkboard-cta-img {
    max-width: 100%;
    height: auto;
}
#spin-to-learn-div {
    display: flex;
    justify-content: center; /* Horizontal alignment */
    align-items: center;     /* Vertical alignment */
    height: 30px;
    margin-top: 20px;
    margin-bottom: 30px;
}
#spin-to-learn-img {
    max-width: 90%;
}
#lightbulb-img {
    height: 50px;
    padding-right: 10px;
}

/* ===== DESKTOP: two columns + center chalkboard to wheel/clapper ===== */
@media (min-width: 900px) {
    #desktop-layout{
        width: min(var(--desktop-w), 100%);
        display: flex;
        gap: 28px;
        align-items: flex-start;  /* keep columns top-aligned overall */
        justify-content: center;
        padding-top: 30px;
        padding-bottom: 30px;
    }

    /* Keep wheel size on desktop */
    #wheel-block{
        width: 500px;
        margin: 20px 0 0;
    }

    /* Right column centers chalkboard to the wheel/clapper (wheel-area is 500px tall) */
    #right-col{
        display: flex;
        align-items: center;
        min-height: 500px;
    }

    /* Chalkboard is right-column width and slightly narrower to avoid pointer overlap */
    #result{
        width: calc(100% - 30px);
        max-width: none;
        margin-top: 20px;
    }
}

/* ===== MOBILE / COARSE POINTER ===== */
@media (hover: none) and (pointer: coarse),
(max-width: 600px) {
    #wheel-block{ width: min(72vw, 504px); margin-top: 0;}
    #pointer{ right: -48px; width: 72px; }
    #spin-button{ font-size: 1.7em; padding: 0.5em 2em; }

    #result {
        /*height: 290px;*/
        font-size: 18px;
        border-width: 8px;
        margin-left: auto;
        margin-right: auto;
    }

    #chalkboard {
        margin: 10px 18px;
    }

    #selected-intro {
        font-size: 25px;
        line-height: 1.0;
        margin-bottom: 20px;
    }
    #selected-topic {
        font-size: 25px;
    }
    #selected-thumbnail {
        margin-top: 0;
        margin-bottom: 0;
        height: 140px;
    }
    #selected-label { font-size: 24px; }
    #selected-thumbnail-image { height: 120px; }

    #selected-footer {
        font-size: 18px;
        line-height: 1.2;
    }
    #what-can {
        font-size: 20px;
        font-weight: 500;
        color: var(--chalk);
    }
    #spin-to-learn-div {
        margin-bottom: 20px;
    }
    #spin-to-learn-img {
        max-width: 95%;
    }
}

@media (min-width: 900px) {
    #right-col{
        display: flex;
        align-items: center;
        min-height: 500px;
        padding-left: 50px;   /* ← PUSH RIGHT */
    }
}

/* ===== VIMEO MODAL ===== */
#vimeo-modal{
    position: fixed;
    inset: 0;
    display: none;
    z-index: 100000; /* above confetti */
}
#vimeo-modal.is-open{ display: block; }

#vimeo-modal .backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
}

#vimeo-modal .panel {
    position: absolute;
    width: min(600px, calc(100vw - 24px));
    aspect-ratio: var(--video-ratio, 16 / 9);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#vimeo-modal .panel iframe {
    width: 100%;
    height: 100%;
    display: block;
}

#vimeo-modal .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;

    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}
</style>
