﻿/* --- THE CHALKBOARD CONTAINER --- */
#blackboard {
    background: #1e272e !important;
    border: 10px solid #8b5a2b; /* Wood Board Trim Frame */
    border-radius: 16px;
    min-height: 240px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 8px 16px rgba(0,0,0,0.3);
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* 🌟 CHANGED: Allow elements to show cleanly while keeping layout structural alignments tight */
    overflow: visible;
}

#spwritenum {
    color: #fffa65; /* Solar Neon Yellow */
    font-size: 3.4rem;
    font-weight: 800;
    display: inline-block;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 250, 101, 0.4);
}

/* --- DYNAMIC TYPED OUTPUT CONTAINER --- */
#spnumword {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* Keep letters unified on one single row line */
    align-items: center;
    justify-content: center;
    gap: 4px; /* Clean tracking space gaps */
    width: 100%;
    max-width: 100%;
    min-height: 65px;
    box-sizing: border-box;
}

.word-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

/* --- DYNAMIC RECTANGULAR NEON TYPED LETTER BOX --- */
.user-typed-box {
    background: linear-gradient(180deg, rgba(24, 220, 255, 0.2) 0%, rgba(0, 216, 214, 0.05) 100%);
    border: 2px solid #00d8d6; /* Cyberpunk Neon Cyan */
    color: #fff;
    font-weight: bold;
    /* 🌟 FIXED DIMENSIONS: Give them comfortable landscape rectangular sizing targets */
    width: 27px;
    height: 40px;
    font-size: 1.4rem;
    /* 🌟 THE REAL FIX: Tell the boxes how to shrink proportionally rather than breaking or hiding */
    flex-shrink: 1;
    min-width: 18px; /* Absolute floor bounds boundary safety check */

    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(0, 216, 214, 0.3);
    box-sizing: border-box;
    margin: 0;
    animation: boxPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes boxPop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Phone overrides to cleanly adjust content flow down */
@media (max-width: 420px) {
    #spwritenum {
        font-size: 2.6rem !important;
    }

    #blackboard {
        min-height: 200px;
        padding: 1rem 0.25rem;
    }

    .user-typed-box {
        font-size: 1.1rem;
        height: 40px;
        border-width: 1.5px;
    }
}
