/* ==========================================================================
   COMPONENTS (Buttons, Inputs, Widgets, Overlays)
   ========================================================================== */

/* --- NAVIGATION & BUTTONS --- */
.back-button {
    padding: 10px 15px;
    font-size: 0.9em;
    color: #fff;
    background-color: var(--link-color);
    border: none;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    margin-top: 0;
    border-radius: 10px 0 0 10px;
    height: 52px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.back-button:hover {
    background-color: var(--link-hover-color);
}

button {
    padding: 12px 18px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 5px;
    border: 1px solid var(--button-border-color);
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, transform 0.15s ease-out, box-shadow 0.2s;
}
button:hover {
    background-color: var(--button-hover-bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
button:disabled {
    background-color: var(--button-bg-color) !important;
    color: var(--text-color) !important;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Special Button States */
button.btn-correct {
    background-color: var(--feedback-correct-color) !important;
    color: white !important;
    border-color: var(--feedback-correct-color) !important;
    box-shadow: 0 0 10px var(--feedback-correct-color) !important;
    opacity: 1 !important;
}
button.btn-incorrect {
    background-color: var(--feedback-incorrect-color) !important;
    color: white !important;
    border-color: var(--feedback-incorrect-color) !important;
    opacity: 0.6 !important;
}
button.btn-correct > div, 
button.btn-incorrect > div {
    border-color: transparent !important;
    background: transparent !important;
}

/* Submit Button */
#submit-button {
    background-color: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
    font-size: 1.5em;
    font-weight: 600;
    padding: 12px 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 -2px 2px rgba(0,0,0,0.2);
    margin-top: 0;
}
#submit-button:active {
    background-color: var(--link-hover-color);
    border-color: var(--link-hover-color);
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Nav Square Buttons (Theme, Numpad, etc) */
.nav-square-btn,
#theme-toggle.nav-square-btn,
#numpad-toggle,
#settings-menu-btn { 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 52px !important;      
    min-width: 52px !important;  
    height: 52px !important;     
    flex-shrink: 0 !important;   
    background-color: var(--link-color);
    color: #fff;
    border: none;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    transition: background-color 0.2s, transform 0.15s;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
.nav-square-btn:hover,
#theme-toggle.nav-square-btn:hover,
#numpad-toggle:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
}
/* Left Buttons Rounded on Left */
.header-navigation-row .nav-square-btn:first-child, 
#back-to-levels-from-practice {
    border-radius: 12px 0 0 12px !important; 
    margin: 0 !important;
}
/* Right Buttons Rounded on Right */
.header-navigation-row .nav-square-btn:last-child, 
#theme-toggle, 
#numpad-toggle,
#settings-menu-btn {
    border-radius: 0 12px 12px 0 !important; 
    margin: 0 !important;
}

/* Helper Icons */
#hint-lightbulb-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    width: 40px;
    height: 40px;
    font-size: 1.3em;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--button-border-color);
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    transition: background-color 0.2s, box-shadow 0.2s;
}
#hint-lightbulb-icon:hover {
    background-color: var(--button-hover-bg-color);
}
#hint-lightbulb-icon.active {
    box-shadow: 0 0 0 3px var(--link-color);
}
#tts-button {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 15px;
    margin: 0;
    font-size: 1.5em;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}
#tts-button:hover {
    opacity: 1;
    transform: scale(1.1);
    background: transparent;
}

/* --- INPUTS --- */
input[type="text"]#answer-input,
input[type="number"]#answer-input,
.partial-product-inputs input[type="number"],
#sci-notation-mantissa-input,
#sci-notation-exponent-input,
.mixed-numeral-part,
.dual-input-field {
    padding: 12px;
    font-size: 1.8em;
    text-align: center;
    border: 2px solid var(--input-border-color);
    background-color: var(--input-bg-color);
    color: var(--text-color);
    border-radius: 5px;
    font-weight: 600;
}
input[type="text"]#answer-input,
input[type="number"]#answer-input {
     width: 220px;
     margin-right: 0 !important;
}
input[type="text"]#answer-input:focus,
input[type="number"]#answer-input:focus,
.partial-product-inputs input[type="number"]:focus,
#sci-notation-mantissa-input:focus,
#sci-notation-exponent-input:focus,
.dual-input-field:focus {
    border-color: var(--input-focus-border-color);
    outline: none;
}
/* Specific Input Groups */
#answer-input-group {
    display: flex;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}
#scientific-notation-input-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}
#sci-notation-mantissa-input { width: 150px; }
#sci-notation-exponent-input { width: 70px; font-size: 1.2em; position: relative; top: -0.7em; padding: 6px; }
.sci-notation-x, .sci-notation-10 { font-size: 2em; font-weight: 600; color: var(--text-color); }
.sci-notation-10 { margin-right: -4px; }
#mixed-numeral-input-area { display: flex; align-items: center; gap: 8px; margin-top: 15px; }
#mixed-numeral-whole-input { width: 80px; }
#mixed-numeral-num-input, #mixed-numeral-den-input, #improper-num-input, #improper-den-input { width: 70px; font-size: 1.4em; }
#dual-input-area { display: flex; justify-content: center; align-items: flex-start; gap: 25px; margin-top: 15px; margin-bottom: 10px; }
.dual-input-group { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.dual-input-field { width: 100px; }
.dual-input-label { font-size: 1em; color: var(--text-color-secondary); font-weight: 500; }
.adjust-btn { width: 40px; height: 40px; padding: 0; font-size: 1.5em; font-weight: bold; line-height: 1; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin-top: 0; }
#algebra-scaffold-input-area input { font-size: 0.8em !important; padding: 5px !important; height: 50px !important; border-width: 2px; background-color: var(--input-bg-color); }

/* --- NUMPAD --- */
#number-pad-container {
    margin-top: 20px;
    max-width: 320px;
    width: 100%;
    display: none; 
}
.numpad-layout-standard, .numpad-layout-index {
    display: none;
    gap: 5px;
    width: 100%;
}
.numpad-layout-standard.numpad-visible { display: grid; grid-template-columns: repeat(3, 1fr); }
.numpad-layout-index.numpad-visible { display: grid; grid-template-columns: repeat(4, 1fr); }
.num-pad-btn { margin-top: 0; }
.numpad-op-btn { display: none; background-color: #6c757d; color: white; font-weight: bold; }
.numpad-op-btn:hover { background-color: #5a6268; }
html.dark-mode .numpad-op-btn { background-color: #5a5a5a; }
html.dark-mode .numpad-op-btn:hover { background-color: #6a6a6a; }

/* --- LIST ITEMS & LEVELS --- */
.level-item {
    background-color: transparent;
    backdrop-filter: none;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--button-border-color);
    padding: 15px 20px !important;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, border-left-color 0.2s;
}
.level-item:hover {
    background-color: var(--level-list-item-hover-bg);
    border-left-color: var(--link-color);
    transform: none;
    box-shadow: none;
}
.level-title {
    font-weight: 600;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color-headings);
    flex-grow: 0;
    flex-shrink: 0;
    white-space: nowrap;
}
.level-description {
    font-size: 0.9em;
    color: var(--text-color-secondary);
    padding-left: 15px;
    font-style: italic;
    text-align: right;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.level-description.truncated-description {
    cursor: help;
    text-decoration: underline dotted 1px;
    text-decoration-color: var(--text-color-secondary);
}
.level-tooltip {
    position: absolute;
    background-color: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: left;
    line-height: 1.4;
    max-width: 280px;
}
.level-tooltip.visible { display: block; opacity: 1; }

/* Summary Boxes (Gems) */
.summary-box {
    width: 100%;
    height: 40px;
    border: 2px solid var(--button-border-color);
    border-radius: 6px;
    background-color: var(--input-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    position: relative;
    overflow: hidden;
    color: var(--text-color-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-out;
}
.summary-box:hover {
    border-color: var(--link-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.summary-box[data-achievement]::after {
    content: attr(data-achievement);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    opacity: 0.9;
}
.summary-item-wrapper {
    flex-basis: 45px;
    flex-shrink: 0;
    text-align: center;
}

/* --- OVERLAYS & MODALS --- */
/* Splash Screen */
#splash-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--splash-overlay-color); 
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    display: flex; 
}
#splash-screen-card {
    background-color: var(--splash-card-bg);
    color: var(--splash-text-color);
    padding: 10px 20px; 
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px; 
    border: var(--splash-border);
}
.splash-header-logo {
    width: 300px;
    height: 80px; 
    margin: 0 auto 5px auto;
    background-image: var(--logo-url);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}
#splash-medal-container { margin-bottom: 5px; flex-shrink: 0; }
#splash-medal-container img { height: 130px !important; width: auto; display: block; margin: 0 auto; }
#splash-screen-card p { font-size: 1.2em; margin: 2px 0; line-height: 1.1; }
#splash-previous-best, #splash-motivation {
    color: var(--text-color-secondary);
    font-style: italic;
    font-size: 1.1em !important;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}
.splash-buttons-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 500px;
    align-self: center;
}
#splash-screen-card .splash-buttons-grid button { flex: 1; margin: 0; padding: 10px 0; font-size: 1.2em; }
#splash-retry-level {
    background-color: var(--link-color);
    color: #fff;
    border: 1px solid var(--link-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
#splash-retry-level:hover {
    background-color: var(--link-hover-color);
    border-color: var(--link-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}
#splash-change-level.secondary {
    background-color: transparent;
    border: 2px solid var(--button-border-color);
    color: var(--splash-text-color);
    box-shadow: none;
}
#splash-change-level.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-color);
    transform: translateY(-1px);
}
#splash-footer-logo-container {
    width: 100%;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--button-border-color);
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.03);
    border-radius: 4px;
    flex-shrink: 0;
}
.ad-placeholder-text {
    color: var(--text-color-secondary);
    font-size: 0.9em;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.92) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1000000 !important;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: opacity 0.6s ease-out;
    margin: 0 !important;
    padding: 0 !important;
}
.celebration-overlay.fade-out { opacity: 0 !important; pointer-events: none !important; }
.celebration-emoji {
    font-size: clamp(120px, 20vh, 200px) !important;
    line-height: 1 !important;
    margin-bottom: 20px !important;
    animation: celebrate-pop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.celebration-text {
    color: white !important;
    font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 20px !important;
    line-height: 1.2 !important;
}
.celebration-subtext { 
    color: #ffffff !important; 
    opacity: 0.6 !important;
    margin-top: 30px !important; 
    font-style: italic !important; 
    font-size: 1.1em !important;
}
@keyframes celebrate-pop {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Error Overlay */
.error-overlay-popup {
    position: absolute;
    background-color: var(--feedback-incorrect-color);
    color: white;
    font-weight: 600;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    padding: 10px 20px;
    box-sizing: border-box;
    line-height: 1.2;
    opacity: 0;
    animation: pop-in-overlay 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes pop-in-overlay {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Countdown Overlay */
#countdown-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--countdown-overlay-bg);
    color: var(--countdown-overlay-text);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-size: 20vw;
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
#countdown-overlay.hidden { opacity: 0; pointer-events: none; }

/* Hint Tooltip */
#hint-tooltip {
    position: fixed !important; 
    top: 110px; 
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 10000 !important;
    background-color: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--button-border-color);
    max-width: 450px;
    width: 90%;
    text-align: left;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    pointer-events: none;
}
#hint-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
    pointer-events: auto;
}

/* --- SETTINGS MENU --- */
.settings-menu-container {
    position: relative;
    display: inline-block;
    z-index: 1001;
}
.settings-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    width: 260px;
    background-color: var(--card-bg);
    border: 1px solid var(--button-border-color);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    z-index: 5000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column;
}
.settings-dropdown.active {
    display: flex;
    animation: menu-slide-in 0.2s ease-out;
}
@keyframes menu-slide-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Left/Right Positioning */
#left-menu-dropdown { left: 0; right: auto; }
.settings-dropdown:not(#left-menu-dropdown) { right: 0; left: auto; }

/* Menu Items */
.dropdown-item, .mastery-replay-item, .settings-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 12px;
    transition: background 0.2s;
    gap: 15px;
    cursor: pointer;
    border: none;
    background: transparent;
}
.dropdown-item:hover, .mastery-replay-item:hover { background: rgba(255, 255, 255, 0.1); }
.settings-item { justify-content: space-between; font-weight: 500; font-size: 1.1em; }

/* --- Fix for Menu Item Layout --- */

/* 1. The Container for the text (Name + Subtext) */
.dropdown-item .text {
    flex-grow: 1;      /* Pushes the toggle switch to the far right */
    text-align: left;
    line-height: 1.2;  /* Tighter line spacing */
}

/* 2. The Main Label (e.g. "Dark Mode") */
.dropdown-item .text strong {
    display: block;    /* Forces it to its own line */
    font-size: 1em;
    color: var(--text-color);
}

/* 3. The Sub-label (e.g. "Toggle theme") */
.dropdown-item .text small {
    display: block;    /* Forces it to the line below */
    font-size: 0.8em;
    color: var(--text-color-secondary);
    font-weight: normal;
}

/* 4. The Icon (e.g. Moon emoji) */
.dropdown-item .icon {
    font-size: 1.4em;
    line-height: 1;
    width: 24px;       /* Fixed width ensures alignment */
    text-align: center;
}

.settings-divider { height: 1px; background-color: var(--button-border-color); margin: 8px 0; width: 100%; }
.settings-section-title {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-color-secondary);
    margin: 4px 0 8px 5px;
    font-weight: 700;
    letter-spacing: 1px;
}
.mastery-replay-item {
    /* Layout Overrides */
    display: flex;
    align-items: center;
    gap: 10px;
    
    /* Smaller Padding = Smaller Buttons */
    padding: 8px 10px !important; 
    
    /* visual styles */
    background-color: var(--button-bg-color);
    border: 1px solid var(--button-border-color);
    border-radius: 8px;
    margin-bottom: 6px;
    
    /* Ensure text color is correct */
    color: var(--text-color);
    text-decoration: none;
}

.mastery-replay-item:hover {
    background-color: var(--button-hover-bg-color);
    border-color: var(--link-color);
    transform: translateX(3px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.hamburger-icon { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 24px; height: 24px; }
.hamburger-line { width: 22px; height: 2px; background-color: #fff; border-radius: 2px; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--button-border-color); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--link-color); }
input:checked + .slider:before { transform: translateX(22px); }

/* Bigger Achievement Emojis */
.mastery-replay-icon {
    font-size: 2.2em !important; /* Increased from 1.4em */
    line-height: 1;
    margin-right: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); /* Nice depth */
}

/* Adjust text size if needed to match the new big icon */
.mastery-replay-text {
    font-size: 1.1em;
    font-weight: 600;
}

/* --- GAME WIDGETS --- */

/* Timer Options */
.timer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background-color: var(--button-bg-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.timer-options input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.timer-options label {
    flex-grow: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-color-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    user-select: none;
}
.timer-options input[type="radio"]:not(:checked) + label:hover { color: var(--text-color); }
.timer-options input[type="radio"]:checked + label {
    background-color: var(--link-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
    transform: scale(1.02);
}
html.dark-mode .timer-options { background-color: #2c2c34; }

/* Choral Timer */
.choral-timer-display {
    font-size: 3.5rem !important; 
    font-weight: 800 !important;
    text-align: center;
    width: 100%;
    display: block;
    margin: 0 !important; 
    line-height: 1.2;
    color: var(--text-color);
    transition: color 0.2s;
    padding: 0;
}
.choral-timer-display.call-out-phase {
    font-size: 2.5rem !important; 
    color: var(--feedback-correct-color) !important;
    margin-bottom: 5px !important;
}
.empty-blank-box {
    display: inline-block;
    min-width: 1.8ch;
    height: 1.1em;
    background-color: rgba(106, 90, 205, 0.1);
    border-bottom: 3px solid var(--link-color);
    margin: 0 4px;
    vertical-align: middle;
    border-radius: 4px 4px 2px 2px;
    position: relative;
    top: -2px;
}
html.dark-mode .empty-blank-box { background-color: rgba(147, 112, 219, 0.2); border-bottom-color: var(--link-color); }

/* Fractions */
.fraction-stack {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    align-items: center;
    line-height: 1;
    margin: 0 2px;
}
.fraction-stack .numerator, .fraction-stack .denominator { padding: 2px 0; font-size: 0.9em; }
.fraction-line { width: 100%; height: 2px; background-color: var(--text-color); margin: 1px 0; display: block; }
.fraction-whole-number { font-size: 1.2em; font-weight: bold; margin-right: 4px; }
.fraction-bar { width: 70px; height: 3px; background-color: var(--text-color); border-radius: 2px; }
.fraction-bar-container { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* Draggable Fractions */
.draggable-fraction-f6 {
   display: inline-block;
   padding: 6px 8px;
   border: 1px solid var(--button-border-color);
   background-color: var(--button-bg-color);
   color: var(--text-color);
   border-radius: 4px;
   cursor: grab;
   margin: 5px;
   font-size: 1.0em;
   user-select: none;
   transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}
.draggable-fraction-f6.selected-for-placement-f6 {
    outline: 2px solid var(--link-color);
    box-shadow: 0 0 8px var(--link-color);
    transform: scale(1.05);
    cursor: grabbing;
}
.number-line-display-f6 { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 450px; margin: 0 auto; }
.number-line-graphic-f6 { display: flex; align-items: flex-end; position: relative; padding-bottom: 5px; margin-bottom: 15px; width: 100%; }
.number-line-graphic-f6::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background-color: var(--text-color); z-index: 0; }
.number-line-label-f6 { font-size: 1.3em; font-weight: bold; margin: 0 5px; padding-bottom: 22px; position: relative; z-index: 1; color: var(--text-color); }
.number-line-label-f6::before { content: ''; position: absolute; bottom: 0px; left: 50%; transform: translateX(-50%); width: 3px; height: 18px; background-color: var(--text-color); }
.fraction-slots-wrapper-f6 { display: flex; align-items: center; flex-grow: 1; justify-content: space-evenly; z-index: 1; height: 40px; }
.fraction-slot-f6 {
    width: 50px;
    height: 40px;
    border: 2px dashed var(--input-border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
    background-color: rgba(0,0,0,0.02);
    position: relative;
    border-radius: 3px;
    transition: border-color 0.2s, background-color 0.2s;
    flex-shrink: 0;
}
.fraction-slot-f6::before { content: ''; position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); width: 2px; height: 12px; background-color: var(--text-color); }
.fraction-slot-f6:hover { border-color: var(--link-hover-color); background-color: rgba(0,0,0,0.05); }

/* FDP / Ordering */
.fdp-container { padding: 10px; border-radius: 5px; min-height: 50px; }
.fdp-item-to-place, .fdp-item-in-slot, .pv-number-item-to-place, .pv-number-item-in-slot {
    padding: 5px;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: 1px solid var(--button-border-color);
    border-radius: 5px;
    cursor: grab;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.fdp-item-to-place { min-width: 75px; min-height: 75px; }
.fdp-item-to-place:hover, .pv-number-item-to-place:hover { background-color: var(--button-hover-bg-color); }
.fdp-item-to-place.selected-for-placement-fdp, .selected-for-placement-pv-num {
    background-color: var(--link-color);
    color: white;
    transform: scale(1.05);
    cursor: grabbing;
    border-color: var(--link-color);
}
.fdp-ordering-slot {
    width: 120px;
    height: 70px;
    border: 2px dashed var(--input-border-color);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--input-bg-color);
    transition: background-color 0.2s;
}
.fdp-ordering-slot.empty-slot::after { content: "Place here"; color: var(--text-color-secondary); font-style: italic; font-size: 0.9em; }
.pv-number-item-to-place { min-width: 90px; max-width: 110px; width: auto; flex-grow: 1; box-sizing: border-box; line-height: 1.3; font-size: 1.1em; padding: 8px 5px; margin: 5px; }

/* Custom Choice Buttons */
.custom-button-wrapper { display: flex; justify-content: center; gap: 15px; margin: 15px 0; flex-wrap: wrap; }
.custom-choice-btn { padding: 12px 25px; font-size: 1.2em; min-width: 120px; }
.emoji-choice-btn {
    padding: 15px 10px;
    min-width: 150px;
    background-color: var(--button-bg-color);
    border: 2px solid var(--button-border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.emoji-choice-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.2); border-color: var(--link-color); }
.emoji-choice-btn .emoji-part { font-size: 3em; line-height: 1; }
.emoji-choice-btn .text-part { font-size: 1em; font-weight: 600; color: var(--button-text-color); }

/* Coin Selector */
.coin-option-wrapper { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; align-items: center; }
#coin-selector-total-display {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--text-color-headings);
    background-color: var(--input-bg-color);
    padding: 10px 25px;
    border-radius: 8px;
    border: 2px solid var(--input-border-color);
    min-width: 200px;
    text-align: center;
}
.coin-selector-btn {
    position: relative;
    border: 3px solid transparent;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    background-color: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: none;
}
.coin-selector-btn:hover { transform: scale(1.05); box-shadow: none; }
.coin-selector-btn.selected { border-color: var(--link-color); box-shadow: 0 0 15px var(--link-color); }
.coin-selector-btn .coin-click-count {
    position: absolute;
    top: -5px; right: -5px;
    background-color: var(--feedback-incorrect-color);
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 50%;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s, transform 0.2s;
}
.coin-selector-btn.selected .coin-click-count { opacity: 1; transform: scale(1); }
.coin-selector-btn.note-btn { border-radius: 5px; padding: 5px; background-color: var(--button-bg-color); }

/* Feedback & Notices */
.feedback-notice {
    background-color: var(--feedback-info-color);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.95em;
    border: 1px solid var(--input-border-color);
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
html.dark-mode .feedback-notice { background-color: var(--feedback-info-color); color: #111; border-color: #777; }

/* Visual Components */
.iso-wrapper { width: 100%; min-height: 250px; perspective: 1000px; }
.iso-scene { position: relative; transform-style: preserve-3d; width: 200px; height: 200px; margin: 40px auto; transform: rotateX(-35.264deg) rotateY(-45deg); }
.iso-cube { width: 30px; height: 30px; position: absolute; transform-style: preserve-3d; top: 50%; left: 50%; }
.iso-cube-face { position: absolute; width: 30px; height: 30px; border: 1px solid rgba(0,0,0,0.5); box-sizing: border-box; }
.iso-front  { transform: translateZ(15px); background: #BDBDBD; }
.iso-back   { transform: translateZ(-15px); background: #BDBDBD; }
.iso-right  { transform: rotateY(90deg) translateZ(15px); background: #8D8D8D; }
.iso-left   { transform: rotateY(-90deg) translateZ(15px); background: #8D8D8D; }
.iso-top    { transform: rotateX(90deg) translateZ(15px); background: #FFFFFF; }
.iso-bottom { transform: rotateX(-90deg) translateZ(15px); background: #616161; }

#live-mascot-container { cursor: pointer !important; z-index: 100; flex: 0 0 auto; position: relative; width: 90px; height: 90px; display: flex; align-items: center; justify-content: center; }
#live-mascot-container img { height: 120px; width: auto; -webkit-user-drag: none; user-select: none; max-width: 100px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); position: relative; top: 12px; }

/* Year Level Buttons (Review Page) */
#year-buttons label {
    background-color: var(--button-bg-color); 
    color: var(--button-text-color);
    border: 1px solid var(--button-border-color);
    border-radius: 6px; 
    font-weight: 600;   
    margin: 0; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
#year-buttons input[type="radio"]:not(:checked) + label:hover { background-color: var(--button-hover-bg-color); transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
#year-buttons input[type="radio"]:checked + label { background-color: var(--link-color) !important; color: white !important; border-color: var(--link-color); box-shadow: 0 2px 5px rgba(0,0,0,0.2); transform: scale(1.02); }
.y-short { display: none; } 
.y-full  { display: inline; }

/* Checkboxes */
.review-item-label input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 24px; height: 24px;
    border: 2px solid var(--button-border-color);
    border-radius: 6px;
    background-color: var(--input-bg-color);
    margin-right: 15px; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.review-item-label input[type="checkbox"]:checked { background-color: var(--link-color); border-color: var(--link-color); }
.review-item-label input[type="checkbox"]:checked::after { content: '✔'; font-size: 16px; color: white; font-weight: bold; }
.review-item-label input[type="checkbox"]:indeterminate { background-color: var(--button-border-color); }
.review-item-label input[type="checkbox"]:indeterminate::after { content: '−'; font-size: 20px; color: var(--text-color); font-weight: bold; }