﻿#blueboard {
    background: #1e272e !important;
    border: 10px solid #8b5a2b; /* Wood Blackboard Frame */
    border-radius: 16px;
    min-height: 230px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 8px 16px rgba(0,0,0,0.3);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#spnum {
    color: #51e2f5;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(81,226,245,0.5);
    display: inline-block;
    white-space: nowrap;
}

/* --- THE DYNAMIC WORD CONTAINER --- */
#spnumword {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 95%; /* Keep clear of the wood board borders */
    margin-top: 15px;
    box-sizing: border-box;
    margin-left: 7px;
}

.word-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
}

/* --- DYNAMIC INTERACTIVE LETTER BOXES --- */
.letter-box {
    max-width: 48px;
    min-width: 18px;
    aspect-ratio: 1 / 1.1;
    background-color: #2f3542;
    border: 2px solid #57606f;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: transparent;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.2s ease-in-out;
    transform: scale(0.9);
    box-sizing: border-box;
    padding: 4px;
    height: 35px;
}

    /* Triggered via Audio Loop Promises to instantly reveal characters */
    .letter-box.reveal {
        color: #ffffff !important;
        background-color: #747d8c;
        transform: scale(1);
    }

    /* Active letter highlight glow tracking during localized TTS file run times */
    .letter-box.active-speaking {
        background-color: #ff9f43 !important;
        color: #ffffff !important;
        border-color: #ff9f43 !important;
        box-shadow: 0 0 12px #ff9f43;
        transform: scale(1.06);
        z-index: 10;
    }

/* --- 2-TAB SEGMENTATION BUTTON STYLING --- */
.nav-tabs-custom {
    border-bottom: none;
    margin-bottom: 15px;
}

    .nav-tabs-custom .nav-link {
        font-size: 1.2rem;
        font-weight: bold;
        color: #747d8c;
        background-color: #f1f2f6;
        border: 2px solid #ced6e0;
        border-bottom: none;
        border-radius: 12px 12px 0 0;
        padding: 10px 25px;
        margin-right: 5px;
        transition: all 0.2s ease-in-out;
    }

        .nav-tabs-custom .nav-link.active-tab1 {
            color: #fff !important;
            background-color: #2ed573 !important;
            border-color: #2ed573 !important;
            box-shadow: 0 -4px 10px rgba(46, 213, 115, 0.3);
        }

        .nav-tabs-custom .nav-link.active-tab2 {
            color: #fff !important;
            background-color: #1e90ff !important;
            border-color: #1e90ff !important;
            box-shadow: 0 -4px 10px rgba(30, 144, 255, 0.3);
        }

        .nav-tabs-custom .nav-link:hover:not(.active) {
            background-color: #e4e7eb;
            color: #2f3542;
        }

@media only screen and (max-width: 394px) {
    #spnum {
        font-size: 2.2rem;
    }
    .letter-box {
        width: calc(65% / var(--total-letters, 10));
    }
}

@media only screen and (min-width: 395px) and (max-width: 744px) and (max-height: 935px) {
    #spnum {
        font-size: 2.2rem;
    }
    .letter-box {
        width: calc(82% / var(--total-letters, 10));
        font-size: 1.6rem;
    }
}

@media (min-width: 745px) and (max-width: 1024px) {
    #spnum {
        font-size: 2.4rem;

    }
    .letter-box {
        width: calc(82% / var(--total-letters, 10));
        font-size: 1.6rem;
    }
}

@media (min-width: 1024px) and (max-width: 1365px) {
    #spnum {
        font-size: 2.5rem;
    }
    .letter-box {
        width: calc(82% / var(--total-letters, 10));
        font-size: 1.6rem;
    }
}

@media (min-width: 1366px) and (max-width: 1440px) {
    #spnum {
        font-size: 2.5rem;
    }
    .letter-box {
        width: calc(82% / var(--total-letters, 10));
        font-size: 1.7rem;
    }
}

@media (min-width: 1440px) {
    #spnum {
        font-size: 2.8rem;
    }
    .letter-box {
        width: calc(82% / var(--total-letters, 10));
        font-size: 1.9rem;
    }
}
