/* ============================================================
   KBC Style Master Quiz - Premium Classroom Design
   ============================================================ */

:root {
    --bg-dark: #020819;
    --bg-deep: #051336;
    --bg-accent: #0c255e;
    --gold-primary: #f5b041;
    --gold-glow: #ffd54f;
    --gold-dark: #b78103;
    --cyan-accent: #00d2ff;
    --green-correct: #00e676;
    --green-glow: #69f0ae;
    --red-urgent: #ff1744;
    --text-light: #ffffff;
    --text-dim: #90caf9;
    --font-main: 'Microsoft New Tai Lue', 'Segoe UI', sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    font-family: var(--font-main);
}

button, input, select, textarea, option, optgroup {
    font-family: var(--font-main);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden !important;
    position: fixed;
    top: 0;
    left: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(12, 37, 94, 0.8) 0%, rgba(5, 19, 54, 0.95) 50%, #020819 100%),
        repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 40px, rgba(0, 210, 255, 0.03) 40px, rgba(0, 210, 255, 0.03) 41px);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* App Container */
.app-container {
    height: 100vh;
    max-height: 100vh;
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding: clamp(4px, 0.8vh, 8px) clamp(8px, 1.2vw, 18px);
    box-sizing: border-box;
    overflow: hidden;
}

/* Header Area */
.header-bar {
    position: relative;
    z-index: 100000 !important;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-bottom: clamp(3px, 0.5vh, 6px);
    border-bottom: 1px solid transparent;
    gap: clamp(2px, 0.4vw, 8px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.header-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
        rgba(245, 176, 65, 0.25) 0,
        rgba(245, 176, 65, 0.25) var(--header-cut-left, 0px),
        transparent var(--header-cut-left, 0px),
        transparent var(--header-cut-right, 0px),
        rgba(245, 176, 65, 0.25) var(--header-cut-right, 0px),
        rgba(245, 176, 65, 0.25) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.kbc-branding {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.6vw, 10px);
    flex-shrink: 0;
}

.header-branding-separator {
    width: 1px;
    height: 22px;
    background: rgba(245, 176, 65, 0.35);
    margin: 0 clamp(4px, 0.5vw, 8px);
    flex-shrink: 0;
    align-self: center;
}

.header-laptop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-right: clamp(24px, 2.5vw, 40px);
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
    cursor: default;
    line-height: 1;
}

.header-laptop-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.host-mode-badge {
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(0, 229, 255, 0.5);
    border-radius: 6px;
    padding: 3px 8px;
    color: #38bdf8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-left: 2px;
    margin-right: clamp(10px, 0.9vw, 18px);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
    cursor: default;
    white-space: nowrap;
}

.kbc-logo-badge {
    width: clamp(34px, 2.4vw, 42px) !important;
    height: clamp(34px, 2.4vw, 42px) !important;
    min-width: clamp(34px, 2.4vw, 42px) !important;
    max-width: clamp(34px, 2.4vw, 42px) !important;
    min-height: clamp(34px, 2.4vw, 42px) !important;
    max-height: clamp(34px, 2.4vw, 42px) !important;
    aspect-ratio: 1 / 1 !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, #ffd54f 10%, #d49000 60%, #4a2c00 100%);
    border: 2px solid #fff;
    box-shadow: 0 0 16px rgba(255, 213, 79, 0.6);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 900;
    font-size: clamp(12px, 0.95vw, 15px);
    color: #051336;
    letter-spacing: 0.5px;
    box-sizing: border-box !important;
}

.kbc-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kbc-title h1 {
    font-size: clamp(14px, 1.25vw, 20px);
    font-weight: 900;
    letter-spacing: clamp(0.5px, 0.1vw, 1.5px);
    background: linear-gradient(90deg, #ffd54f, #ffffff, #ffd54f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.15;
    margin: 0;
}

.kbc-title p {
    font-size: clamp(11.5px, 0.82vw, 13px);
    font-weight: 600;
    color: #90caf9;
    letter-spacing: clamp(0.2px, 0.03vw, 0.5px);
    white-space: nowrap;
    line-height: 1.25;
    margin: 2px 0 0 0;
    padding: 0;
    display: block;
}

/* Chapter & Class Selector Header */
.chapter-selector-bar {
    display: flex;
    align-items: center;
    gap: clamp(2px, 0.35vw, 6px);
    background: transparent !important;
    border: none !important;
    padding: 3px clamp(1px, 0.25vw, 6px);
    border-radius: 0;
    box-shadow: none !important;
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible !important;
}

.chapter-selector-bar .host-btn {
    flex: 0 1 auto !important;
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
    min-width: 0 !important;
}

.class-label,
.subject-label,
.book-label,
.chapter-label,
.type-label {
    display: none !important;
}

.chapter-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: linear-gradient(180deg, #0e204a 0%, #06112c 100%);
    background-repeat: no-repeat;
    background-position: right clamp(4px, 0.5vw, 8px) center;
    background-size: 10px 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23f5b041' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    color: #ffffff;
    border: 1px solid rgba(245, 176, 65, 0.38) !important;
    background-clip: padding-box !important;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.16), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 4px clamp(14px, 1.2vw, 20px) 4px clamp(4px, 0.45vw, 8px);
    font-size: clamp(11px, 0.85vw, 12.5px);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    min-width: 0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    min-height: clamp(34px, 4.2vh, 40px);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.chapter-dropdown:hover,
.chapter-dropdown:focus {
    border: 1px solid rgba(255, 213, 79, 0.75) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 8px rgba(245, 176, 65, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.class-label .lbl-txt,
.subject-label .lbl-txt,
.book-label .lbl-txt,
.chapter-label .lbl-txt,
.type-label .lbl-txt {
    display: none;
}

.header-bar .host-btn .lbl-txt {
    display: inline-block !important;
    vertical-align: middle;
}

.class-dropdown {
    width: clamp(65px, 6.6vw, 132px);
    min-width: 65px !important;
    max-width: 132px;
    flex: 1 1 132px;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    box-shadow: inset 0 1px 1px rgba(186, 230, 253, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    color: #a7f3d0 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.class-dropdown:hover,
.class-dropdown:focus {
    border: 1px solid rgba(56, 189, 248, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(56, 189, 248, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.class-dropdown option {
    color: #ffffff;
    background: #051336;
}

.subject-dropdown {
    width: clamp(65px, 6.6vw, 132px);
    min-width: 65px !important;
    max-width: 132px;
    flex: 1 1 132px;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    box-shadow: inset 0 1px 1px rgba(186, 230, 253, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    color: #bae6fd !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.subject-dropdown:hover,
.subject-dropdown:focus {
    border: 1px solid rgba(56, 189, 248, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(56, 189, 248, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.subject-dropdown option {
    color: #ffffff;
    background: #051336;
}

/* Dropdown Empty Warning State (Yellow) */
.chapter-dropdown.dropdown-empty-warning,
.class-dropdown.dropdown-empty-warning,
.subject-dropdown.dropdown-empty-warning,
.chapter-dropdown option.opt-warning,
.class-dropdown option.opt-warning,
.subject-dropdown option.opt-warning,
select.chapter-dropdown option[value=""],
select.class-dropdown option[value=""],
select.subject-dropdown option[value=""] {
    color: #ffd54f !important;
    font-weight: 700 !important;
}


.book-dropdown {
    width: clamp(100px, 6.6vw, 132px);
    min-width: clamp(100px, 6.6vw, 132px) !important;
    max-width: clamp(100px, 6.6vw, 132px);
    flex: 0 0 clamp(100px, 6.6vw, 132px);
    border: 1px solid rgba(192, 132, 252, 0.42) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    box-shadow: inset 0 1px 1px rgba(243, 232, 255, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    color: #e9d5ff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23c084fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.book-dropdown:hover,
.book-dropdown:focus {
    border: 1px solid rgba(192, 132, 252, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(192, 132, 252, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.book-dropdown option {
    color: #ffffff;
    background: #051336;
}

.chapter-dropdown#chapterSelect {
    width: clamp(70px, 7.5vw, 148px);
    min-width: 70px !important;
    max-width: 148px;
    flex: 1.2 1 148px;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    box-shadow: inset 0 1px 1px rgba(186, 230, 253, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    color: #ffd54f !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.chapter-dropdown#chapterSelect:hover,
.chapter-dropdown#chapterSelect:focus {
    border: 1px solid rgba(56, 189, 248, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(56, 189, 248, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.type-dropdown {
    width: clamp(110px, 7.0vw, 136px);
    min-width: clamp(110px, 7.0vw, 136px) !important;
    max-width: clamp(110px, 7.0vw, 136px);
    flex: 0 0 clamp(110px, 7.0vw, 136px);
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    box-shadow: inset 0 1px 1px rgba(186, 230, 253, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    color: #bae6fd !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2300d2ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.type-dropdown option {
    background: #051336;
    color: #ffffff;
}

/* Custom Multi-Select Dropdown for Question Types */
.custom-multiselect-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: clamp(65px, 7.0vw, 136px);
    min-width: 65px !important;
    max-width: 136px;
    flex: 1 1 136px;
    box-sizing: border-box;
}

.type-dropdown-btn {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100%;
    box-sizing: border-box;
    min-height: clamp(34px, 4.2vh, 40px);
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    background-clip: padding-box !important;
    box-shadow: inset 0 1px 1px rgba(186, 230, 253, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    color: #bae6fd !important;
    background: linear-gradient(180deg, #0e204a 0%, #06112c 100%);
    border-radius: 10px;
    font-size: clamp(11px, 0.85vw, 13px);
    font-weight: 700;
    padding: 4px clamp(5px, 0.6vw, 10px);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.type-dropdown-btn #typeDropdownLabel {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.type-dropdown-btn:hover {
    border: 1px solid rgba(56, 189, 248, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(56, 189, 248, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
}

.type-dropdown-btn .dropdown-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 7px;
    color: #00d2ff;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-right: 2px;
}

.type-dropdown-btn .dropdown-caret svg {
    display: block;
    width: 11px;
    height: 7px;
}

.type-dropdown-btn.active .dropdown-caret {
    transform: rotate(180deg);
}

/* ============================================================
   Global Luxury Floating Dropdowns (Curtain Unroll & Roll-Up)
   ============================================================ */
.custom-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 275px;
    background: linear-gradient(180deg, #091a42 0%, #040e28 100%);
    border: 1px solid rgba(0, 210, 255, 0.42) !important;
    background-clip: padding-box !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 1px rgba(224, 247, 250, 0.18), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 210, 255, 0.15);
    padding: 8px;
    z-index: 100005 !important;
    backdrop-filter: blur(14px);
    transform-origin: top center;
    opacity: 0;
    transform: translateY(-8px) scaleY(0.7) translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, visibility 0.24s;
    box-sizing: border-box;
}

.custom-dropdown-panel.open {
    opacity: 1;
    transform: translateY(0) scaleY(1) translateZ(0);
    pointer-events: auto;
    visibility: visible;
}

/* Universal Floating Dropdown for Class, Subject, Book, Chapter & Timer */
.custom-select-floating-menu {
    position: fixed;
    background: linear-gradient(180deg, #091a42 0%, #040e28 100%);
    border: 1px solid rgba(245, 176, 65, 0.45) !important;
    background-clip: padding-box !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.18), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.4);
    padding: 6px 6px 0 6px;
    z-index: 100005 !important;
    backdrop-filter: blur(14px);
    transform-origin: top center;
    opacity: 0;
    transform: translateY(-8px) scaleY(0.7) translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, visibility 0.24s;
    max-height: 340px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.custom-select-scroll-area {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-bottom: 2px;
}

.custom-select-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.custom-select-scroll-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.custom-select-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 65, 0.4);
    border-radius: 4px;
}

.custom-select-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 176, 65, 0.7);
}

.custom-select-resize-handle {
    flex: 0 0 16px;
    height: 16px;
    width: calc(100% + 12px);
    margin-left: -6px;
    margin-right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize !important;
    cursor: row-resize !important;
    touch-action: none;
    user-select: none;
    border-top: 1px solid rgba(245, 176, 65, 0.22);
    margin-top: 3px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
    transition: background 0.15s ease;
}

.custom-select-resize-handle:hover,
.custom-select-resize-handle.active {
    background: rgba(245, 176, 65, 0.15);
}

.resize-grip-pill {
    width: 42px;
    height: 4px;
    background: rgba(245, 176, 65, 0.55);
    border-radius: 3px;
    transition: all 0.18s ease;
    box-shadow: 0 0 4px rgba(245, 176, 65, 0.3);
}

.custom-select-resize-handle:hover .resize-grip-pill,
.custom-select-resize-handle.active .resize-grip-pill {
    background: #ffd54f;
    width: 58px;
    box-shadow: 0 0 8px rgba(255, 213, 79, 0.8);
}

.custom-select-floating-menu.open {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    pointer-events: auto;
    visibility: visible;
}

.custom-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #f1f5f9;
    letter-spacing: 0.25px;
    user-select: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    box-sizing: border-box;
}

.custom-select-item:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.custom-select-item.selected {
    background: linear-gradient(90deg, rgba(245, 176, 65, 0.25) 0%, rgba(245, 176, 65, 0.08) 100%);
    color: #ffd54f;
    font-weight: 600;
}

/* Color Themed Floating Dropdown Panels */
.custom-select-floating-menu.menu-class {
    border-color: rgba(0, 230, 118, 0.75);
    border-top-color: #b9f6ca;
    border-bottom-color: #00a152;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(0, 230, 118, 0.3);
}
.custom-select-floating-menu.menu-class .custom-select-item.selected {
    background: linear-gradient(90deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 230, 118, 0.08) 100%);
    color: #a7f3d0;
    font-weight: 600;
}

.custom-select-floating-menu.menu-subject {
    border-color: rgba(56, 189, 248, 0.75);
    border-top-color: #bae6fd;
    border-bottom-color: #0284c7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(56, 189, 248, 0.3);
}
.custom-select-floating-menu.menu-subject .custom-select-item.selected {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.25) 0%, rgba(56, 189, 248, 0.08) 100%);
    color: #bae6fd;
    font-weight: 600;
}

.custom-select-floating-menu.menu-book {
    border-color: rgba(192, 132, 252, 0.75);
    border-top-color: #f3e8ff;
    border-bottom-color: #7e22ce;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(192, 132, 252, 0.3);
}
.custom-select-floating-menu.menu-book .custom-select-item.selected {
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.25) 0%, rgba(192, 132, 252, 0.08) 100%);
    color: #e9d5ff;
    font-weight: 600;
}

.custom-select-floating-menu.menu-chapter {
    border-color: rgba(245, 176, 65, 0.85);
    border-top-color: #fff2a3;
    border-bottom-color: #b28704;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(245, 176, 65, 0.3);
}
.custom-select-floating-menu.menu-chapter .custom-select-item.selected {
    background: linear-gradient(90deg, rgba(245, 176, 65, 0.25) 0%, rgba(245, 176, 65, 0.08) 100%);
    color: #ffd54f;
    font-weight: 600;
}

.custom-select-floating-menu.menu-timer {
    border-color: rgba(0, 210, 255, 0.75);
    border-top-color: #e0f7fa;
    border-bottom-color: #00838f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(0, 210, 255, 0.3);
    min-width: 88px !important;
}
.custom-select-floating-menu.menu-timer .custom-select-item {
    display: flex;
    align-items: center;
    gap: 0 !important;
    padding: 5px 10px;
    font-size: 12px;
}
.custom-select-floating-menu.menu-timer .timer-btn-icon {
    width: 18px;
    min-width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 7px;
    color: #ffd54f;
}
.custom-select-floating-menu.menu-timer .timer-val-num {
    width: 25px;
    min-width: 25px;
    max-width: 25px;
    text-align: right;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
}
.custom-select-floating-menu.menu-timer .timer-val-unit {
    margin-left: 2px;
    width: 10px;
    display: inline-block;
    text-align: left;
}
.custom-select-floating-menu.menu-timer .timer-val-infinity {
    width: 37px;
    min-width: 37px;
    max-width: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.custom-select-floating-menu.menu-timer .custom-select-item.selected {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 210, 255, 0.08) 100%);
    color: #bae6fd;
    font-weight: 600;
}

.custom-select-floating-menu::-webkit-scrollbar,
.custom-dropdown-panel::-webkit-scrollbar {
    width: 6px;
}
.custom-select-floating-menu::-webkit-scrollbar-track,
.custom-dropdown-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
.custom-select-floating-menu::-webkit-scrollbar-thumb,
.custom-dropdown-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 213, 79, 0.4);
    border-radius: 4px;
}
.custom-select-floating-menu::-webkit-scrollbar-thumb:hover,
.custom-dropdown-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 213, 79, 0.8);
}

.dropdown-panel-header {
    font-size: 11px;
    font-weight: 800;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 6px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.dropdown-panel-header-purple {
    color: #c084fc !important;
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
    text-align: center !important;
}



.dropdown-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #f1f5f9;
    user-select: none;
    transition: background 0.15s ease;
}

.dropdown-check-item:hover {
    background: rgba(0, 210, 255, 0.15);
}

.dropdown-check-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #00d2ff;
    cursor: pointer;
    flex-shrink: 0;
}

.dropdown-check-item .chk-label {
    flex: 1;
    white-space: nowrap;
}

.dropdown-check-item .type-count-badge {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}

#countTypeStar {
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.45);
    background: rgba(255, 215, 0, 0.12);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 4px 0;
}

.dropdown-check-item.shuffle-item {
    background: rgba(56, 189, 248, 0.08);
    border: 1px dashed rgba(56, 189, 248, 0.35);
    margin-top: 4px;
}

.dropdown-check-item.shuffle-item:hover {
    background: rgba(56, 189, 248, 0.2);
}

.dropdown-check-item.unasked-item {
    background: rgba(74, 222, 128, 0.08);
    border: 1px dashed rgba(74, 222, 128, 0.35);
    margin-top: 4px;
}

.dropdown-check-item.unasked-item:hover {
    background: rgba(74, 222, 128, 0.18);
}

.dropdown-reset-tab {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    background: rgba(74, 222, 128, 0.08);
    border: 1px dashed rgba(74, 222, 128, 0.35);
    border-radius: 6px;
    color: #4ade80;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.dropdown-reset-tab:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.65);
    color: #86efac;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.25);
}

.dropdown-reset-tab:active {
    transform: scale(0.98);
}

.chapter-dropdown option {
    background: #051336;
    color: #ffffff;
}

/* Timer Selector in Header (No background outline) */
.timer-selector-bar {
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.35vw, 6px);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.timer-label {
    font-size: clamp(11.5px, 1.05vw, 13.5px);
    font-weight: 600;
    color: var(--gold-glow);
    white-space: nowrap;
    flex-shrink: 0;
}

#btnTimerMode,
button.timer-dropdown,
.timer-dropdown:not(select) {
    width: clamp(70px, 5.5vw, 80px);
    min-width: 68px;
    max-width: 84px;
    flex: 0 0 auto;
    border: 1px solid rgba(245, 176, 65, 0.45) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    box-shadow: inset 0 1px 1px rgba(255, 242, 163, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23ffd54f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right clamp(4px, 0.45vw, 6px) center;
    background-size: 9px 5.5px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: clamp(5px, 0.45vw, 7px) !important;
    padding-right: clamp(14px, 1.1vw, 17px) !important;
    height: clamp(36px, 4.4vh, 40px);
    min-height: clamp(36px, 4.4vh, 40px);
    max-height: clamp(36px, 4.4vh, 40px);
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    line-height: normal !important;
    white-space: nowrap;
    text-align: left;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

#timerModeSelect,
select.timer-dropdown {
    display: none !important;
}

.timer-dropdown:hover,
.timer-dropdown:focus,
.timer-dropdown.active {
    border: 1px solid rgba(255, 213, 79, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(245, 176, 65, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

/* Timer Value Typography: Golden Digits & Cyan 's' */
.timer-val-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    color: #ffd54f !important;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255, 213, 79, 0.4);
    letter-spacing: 0.2px;
    font-variant-numeric: tabular-nums;
    vertical-align: middle !important;
    align-self: center !important;
}

.timer-val-unit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    color: #38bdf8 !important;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.45);
    margin-left: 1.5px !important;
    vertical-align: middle !important;
    align-self: center !important;
}

.timer-val-infinity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    color: #38bdf8 !important;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.45));
    vertical-align: middle !important;
    align-self: center !important;
}

.timer-val-infinity svg {
    stroke: #38bdf8 !important;
    display: block !important;
    margin: 0 !important;
}

.timer-btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 15px !important;
    height: 15px !important;
    margin-right: 5px !important;
    color: #ffd54f !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    align-self: center !important;
    transform: translateY(-1.5px) !important;
    filter: drop-shadow(0 0 4px rgba(255, 213, 79, 0.25));
}

.timer-btn-icon svg {
    display: block !important;
    width: 15px !important;
    height: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Question Tracker & Score */
.quiz-meta-info {
    display: flex;
    align-items: center;
    gap: clamp(2px, 0.35vw, 6px);
    margin-left: auto;
    flex-shrink: 0;
    box-sizing: border-box;
    padding-right: 2px;
}

.quiz-meta-info > * {
    flex-shrink: 0 !important;
}

.q-counter-box {
    background: linear-gradient(180deg, #102656 0%, #081636 100%);
    border: 1px solid rgba(245, 176, 65, 0.42) !important;
    background-clip: padding-box !important;
    padding: 0 4px !important;
    border-radius: 10px;
    font-size: clamp(11px, 0.88vw, 12.5px);
    font-weight: 700;
    color: var(--gold-glow);
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    flex: 0 1 auto !important;
    width: clamp(84px, 6.2vw, 104px) !important;
    min-width: 82px !important;
    max-width: 106px !important;
    flex-shrink: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: clamp(36px, 4.4vh, 40px);
    min-height: clamp(36px, 4.4vh, 40px);
    max-height: clamp(36px, 4.4vh, 40px);
    box-sizing: border-box !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.q-counter-box:hover {
    border: 1px solid rgba(255, 213, 79, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(245, 176, 65, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.q-counter-box .q-counter-slash {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    opacity: 0.65 !important;
    margin: 0 1.5px !important;
    display: inline-block !important;
    user-select: none !important;
}

/* Jump to Question Input - Clean, compact number box without arrows */
.jump-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 clamp(44px, 3.2vw, 48px) !important;
    width: clamp(44px, 3.2vw, 48px) !important;
    min-width: clamp(44px, 3.2vw, 48px) !important;
    max-width: clamp(44px, 3.2vw, 48px) !important;
    flex-shrink: 0 !important;
    position: relative;
}

/* SmartBoard Button Wrap & Prominent Under-Header Star Badge */
.smartboard-btn-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#jumpStarBadge,
.header-star-badge {
    position: absolute;
    top: calc(100% + clamp(20px, 2.3vh, 26px));
    left: 50%;
    transform: translateX(-50%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, 2.4vw, 34px);
    height: clamp(28px, 2.4vw, 34px);
    font-size: clamp(26px, 2.2vw, 32px);
    line-height: 1;
    color: #ffd700;
    cursor: pointer;
    user-select: none;
    z-index: 60;
    text-shadow: 0 0 14px rgba(255, 215, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.9);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.65)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    animation: starGentleGlow 2.8s infinite alternate ease-in-out;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

#jumpStarBadge:hover,
.header-star-badge:hover {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)) drop-shadow(0 0 30px rgba(255, 193, 7, 0.9)) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
}

#jumpStarBadge:active,
.header-star-badge:active {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
}

@keyframes starGentleGlow {
    0% {
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
        opacity: 0.92;
    }
    100% {
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95)) drop-shadow(0 0 24px rgba(245, 176, 65, 0.6)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
        opacity: 1;
    }
}

.jump-input {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    background: linear-gradient(180deg, #0e204a 0%, #06112c 100%);
    border: 1px solid rgba(245, 176, 65, 0.40) !important;
    background-clip: padding-box !important;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    color: #ffd54f !important;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255, 213, 79, 0.7);
    padding: 0 !important;
    font-size: clamp(12px, 0.95vw, 13.5px);
    min-height: clamp(36px, 4.4vh, 40px) !important;
    height: clamp(36px, 4.4vh, 40px) !important;
    max-height: clamp(36px, 4.4vh, 40px) !important;
    line-height: clamp(36px, 4.4vh, 40px) !important;
    text-align: center !important;
    box-sizing: border-box !important;
    outline: none;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.jump-input::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

/* Completely remove/hide Up and Down Stepper Arrows */
.jump-input::-webkit-inner-spin-button,
.jump-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: none !important;
    margin: 0 !important;
}

.jump-input:focus {
    border: 1px solid rgba(0, 210, 255, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(0, 210, 255, 0.35) !important;
}

/* Header Utility Buttons (Square Icons: Help, Audio Mute, Fullscreen, SmartBoard) */
.btn-help-header {
    background: linear-gradient(180deg, #16367c 0%, #0c204d 100%);
    border: 1px solid rgba(245, 176, 65, 0.40) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    width: clamp(36px, 4.4vh, 40px) !important;
    height: clamp(36px, 4.4vh, 40px) !important;
    min-width: clamp(36px, 4.4vh, 40px) !important;
    max-width: clamp(36px, 4.4vh, 40px) !important;
    min-height: clamp(36px, 4.4vh, 40px) !important;
    max-height: clamp(36px, 4.4vh, 40px) !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 600;
    color: var(--gold-glow);
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    white-space: nowrap;
    outline: none !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.btn-help-header:hover {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%);
    border: 1px solid rgba(255, 213, 79, 0.8) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(245, 176, 65, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    transform: translateZ(0);
}

.btn-help-header:active {
    transform: translateY(1.5px) scale(0.985) translateZ(0) !important;
    border-color: rgba(245, 176, 65, 0.85) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

.btn-help-header .key-tag,
.btn-help-header .lbl-txt {
    display: none !important;
}

#btnSettings {
    margin-left: clamp(8px, 0.8vw, 16px) !important;
}

#btnSettings .settings-icon-svg {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#btnSettings:hover .settings-icon-svg {
    transform: rotate(45deg) scale(1.08);
}

/* Smart Board Header Button - Cyan Accent matching Laptop badge (#38bdf8) */
#btnSmartBoard {
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.55) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 0 8px rgba(56, 189, 248, 0.25), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
}

#btnSmartBoard:hover {
    color: #7dd3fc !important;
    border: 1px solid #38bdf8 !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 12px rgba(56, 189, 248, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

#btnSmartBoard svg {
    stroke: currentColor;
    transition: transform 0.12s ease;
}

#btnSmartBoard:hover svg {
    transform: scale(1.05);
}

/* Audio Mute/Unmute Header Button & Crisp SVG */
#btnAudioToggle {
    position: relative;
}

#btnAudioToggle .audio-icon-svg {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.12s ease;
}

#btnAudioToggle:hover .audio-icon-svg {
    transform: scale(1.08);
}

#btnAudioToggle .audio-slash-line {
    stroke: #ff2d55 !important;
    stroke-width: 2.8px !important;
    filter: drop-shadow(0 0 5px rgba(255, 45, 85, 0.95)) drop-shadow(0 0 2px #ff2d55);
}

#btnAudioToggle.is-muted {
    border-color: rgba(255, 45, 85, 0.65) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 0 10px rgba(255, 45, 85, 0.4), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
}

#btnAudioToggle.is-muted:hover {
    border-color: #ff2d55 !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 14px rgba(255, 45, 85, 0.65), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

/* Fullscreen Header Button & Crisp SVG */
#btnFullscreen .fullscreen-icon-svg {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#btnFullscreen:hover .fullscreen-icon-svg {
    transform: scale(1.1);
}

/* Center Stage (Timer + Arena) */
.stage-center {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    z-index: 5;
    max-width: clamp(900px, 78vw, 1120px);
    width: 100%;
    margin: 0 auto;
    padding-top: clamp(30px, 4.8vh, 52px);
    padding-left: clamp(10px, 1.2vw, 18px);
    padding-right: clamp(10px, 1.2vw, 18px);
    box-sizing: border-box;
    gap: clamp(6px, 1vh, 12px);
}

/* Timer & Top Contest Wings Stage Row */
.timer-stage-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    gap: clamp(10px, 1.6vw, 22px);
    margin-bottom: calc(clamp(14px, 2vh, 22px) - 7px);
    box-sizing: border-box;
}

/* In Top View, stage-center retains exact same max-width and padding as standard mode,
   so question-wrap and options-grid remain 100% frozen with zero size fluctuation.
   timer-stage-row uses a strict 3-column mathematical grid (1fr auto 1fr) so the
   Timer is guaranteed to remain 100% dead-center in the window at all times, while
   wings shrink symmetrically from both left and right sides without pushing the timer. */
body.contest-top-view-active .stage-center {
    max-width: 100% !important;
    width: 100% !important;
}

body.contest-top-view-active .timer-stage-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto calc(clamp(14px, 2vh, 22px) - 7px) auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    gap: clamp(6px, 1.2vw, 18px) !important;
}

body.contest-top-view-active .question-wrap,
body.contest-top-view-active .options-grid:not(.two-options-mode) {
    max-width: calc(clamp(900px, 78vw, 1120px) - (2 * clamp(10px, 1.2vw, 18px))) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Wings flanking the Timer (Left: 12 students, Right: 12 students in 3x4 grid) */
.timer-wing {
    flex: 1 1 0;
    width: 100%;
    max-width: 720px;
    min-width: 0 !important;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, 35px);
    gap: clamp(4px, 0.6vw, 8px);
    height: 168px;
    max-height: 168px;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 2px 0px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 176, 65, 0.4) transparent;
    transform: translateY(-28px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.timer-wing.wing-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.timer-wing-left {
    justify-self: end;
}

.timer-wing-right {
    justify-self: start;
}

.timer-wing.wing-scrollable {
    overflow-y: auto !important; /* Only shows scrollbar when > 12 students in this wing */
    overflow-x: hidden !important;
}

.timer-wing::-webkit-scrollbar {
    width: 4px;
}
.timer-wing::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 65, 0.35);
    border-radius: 4px;
}

/* Symmetrical Student Card inside Wings */
.wing-student-card {
    height: 35px;
    min-height: 35px;
    max-height: 35px;
    box-sizing: border-box;
    background: rgba(7, 22, 60, 0.88);
    border: 1.2px solid rgba(245, 176, 65, 0.35);
    border-radius: 7px;
    padding: 2px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.wing-student-card:hover {
    background: rgba(18, 52, 128, 0.95);
    border-color: var(--gold-glow);
}

.wing-student-card.active-wing-card {
    background: rgba(18, 52, 128, 0.95) !important;
    border-color: var(--gold-glow) !important;
    box-shadow: none !important;
}

.wing-student-card.completed-wing-card {
    background: rgba(0, 77, 32, 0.75);
    border-color: rgba(105, 240, 174, 0.6);
}

.wing-card-avatar {
    width: 18px;
    min-width: 18px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #90caf9;
    flex-shrink: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.wing-card-name {
    font-size: clamp(11.5px, 0.9vw, 13px);
    font-weight: 700;
    color: #ffffff !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 3px;
}

.wing-card-qscore {
    width: auto;
    min-width: 32px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #ffd54f;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.wing-card-badges {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.wing-badge-mini {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 4.5px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 18px;
    box-sizing: border-box;
}

.wing-badge-mini .badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-style: normal;
}

.wing-badge-mini .badge-icon.icon-correct {
    font-size: 10.5px;
    font-weight: 900;
    margin-top: 0.5px;
}

.wing-badge-mini .badge-icon.icon-wrong {
    font-size: 9.5px;
    font-weight: 900;
    margin-top: 0.5px;
}

.wing-badge-mini .badge-num {
    display: inline-block;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
    font-weight: 700;
}

.wing-badge-correct {
    background: rgba(0, 230, 118, 0.2);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.4);
}

.wing-badge-wrong {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.4);
}

/* KBC Statement Timer (Ghadiyal Babu) */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    box-sizing: border-box;
    overflow: visible;
    grid-column: 2;
    justify-self: center;
    margin: 0 auto;
}

.timer-circle-wrap {
    position: relative;
    width: 154px;
    height: 154px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timer-svg {
    transform: rotate(-90deg);
    width: 154px;
    height: 154px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: block;
    overflow: visible;
}

.timer-dial-face {
    fill: #030d29;
    stroke: rgba(245, 176, 65, 0.3);
    stroke-width: 1.5;
}

.timer-bg-circle {
    fill: none;
    stroke: rgba(245, 176, 65, 0.15);
    stroke-width: 5.5;
}

.timer-progress-circle {
    fill: none;
    stroke: url(#timerGoldGrad);
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(245, 176, 65, 0.6));
}

.timer-digits {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    font-size: 64px; /* Scaled down for compact 154px clock */
    font-weight: 900;
    font-family: var(--font-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1.5px;
    color: #ffd54f;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 213, 79, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* Optical vertical centering: offset the font descender space so numerals sit dead-center */
    padding-top: 6px;
    text-align: center;
    user-select: none;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.timer-digits.small-text {
    font-size: 32px; /* Scaled for MM:SS and 100+ */
    letter-spacing: 0px;
    padding-top: 4px;
}

.timer-digits.infinity-symbol {
    font-size: 66px; /* Scaled infinity symbol */
    line-height: 1;
    /* Optical vertical centering: offset the high baseline of the infinity emoji */
    padding-top: 14px;
}

/* Urgent Timer (>10s remaining) */
.timer-urgent .timer-progress-circle {
    stroke: #ff1744 !important;
    filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.8)) !important;
}

.timer-urgent .timer-digits {
    color: #ff1744;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 0 14px rgba(255, 23, 68, 0.85);
}

/* Tick-Synchronized Heartbeat Pulse: Explosive Snappy Attack & Pure Continuous Ease-Out Landing */
.timer-digits.timer-urgent-tick-pop {
    animation: urgentTickPop 0.88s forwards !important;
    will-change: transform, text-shadow, filter;
    transform-origin: center center;
}

@keyframes urgentTickPop {
    0% {
        transform: scale(1.0) translateZ(0);
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 0 14px rgba(255, 23, 68, 0.85);
        filter: brightness(1.0);
        animation-timing-function: cubic-bezier(0.08, 0.9, 0.18, 1);
    }
    14% {
        /* झटके के साथ आगे निखरना (Peak Pop Outward) */
        transform: scale(1.28) translateZ(0);
        text-shadow: 0 0 32px rgba(255, 23, 68, 1), 0 0 52px rgba(255, 23, 68, 0.9), 0 4px 12px rgba(0, 0, 0, 0.95);
        filter: brightness(1.22);
        /* Completely continuous, uninterrupted ease-out curve directly to 1.0 — ZERO intermediate kinks/bumps */
        animation-timing-function: cubic-bezier(0.25, 1, 0.45, 1);
    }
    100% {
        /* सीधे अपनी मूल जगह (1.0) पर बिना किसी झटके के शांत विश्राम */
        transform: scale(1.0) translateZ(0);
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 0 14px rgba(255, 23, 68, 0.85);
        filter: brightness(1.0);
    }
}

/* Silky Smooth Timer Flash Animation (Calm, slow, unhurried ease-out decay) */
.timer-digits.timer-active-pop {
    will-change: transform, filter;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    animation: timerSmoothFlash 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes timerSmoothFlash {
    0% {
        transform: scale(1) translateZ(0);
        color: #ffd54f;
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 213, 79, 0.4);
        filter: brightness(1);
    }
    20% {
        transform: scale(1.15) translateZ(0);
        color: #ffffff;
        text-shadow: 0 0 26px rgba(255, 213, 79, 0.95), 0 0 40px rgba(0, 229, 255, 0.8), 0 0 10px #ffffff;
        filter: brightness(1.22);
    }
    100% {
        transform: scale(1) translateZ(0);
        color: #ffd54f;
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 213, 79, 0.4);
        filter: brightness(1);
    }
}

.timer-mode-badge {
    box-sizing: border-box;
    margin-top: 13px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1;
    color: var(--gold-glow);
    text-transform: uppercase;
    background: rgba(4, 16, 48, 0.92);
    border: 1px solid rgba(245, 176, 65, 0.45);
    padding: 3.5px 16px 1.5px 16px;
    height: 26px;
    min-height: 26px;
    border-radius: 9999px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1;
    flex-shrink: 0;
    white-space: nowrap;
    width: max-content;
    max-width: none;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Question Display Box - Normalized Rounded Pill Shape (Matching Option Boxes) */
.question-wrap {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kbc-cutout-box {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #0f2b6b 0%, #06153b 100%);
    border-radius: 30px;
    padding: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), 0 0 15px rgba(0, 210, 255, 0.25);
    transition: all 0.3s ease;
}

.kbc-border-effect {
    position: relative;
    border-radius: 30px;
    padding: 3px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: #b78103;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 213, 79, 0.45);
    animation: questionBoxGlow 3s infinite alternate ease-in-out;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

/* Top Border: Continuous Movement to the Right (→) */
.kbc-border-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52%;
    background: linear-gradient(90deg, 
        #b78103 0%, 
        #f5b041 12%, 
        #ffd54f 20%, 
        #fffde7 25%, 
        #ffffff 27%, 
        #fffde7 29%, 
        #ffd54f 34%, 
        #f5b041 42%, 
        #b78103 50%, 
        #f5b041 62%, 
        #ffd54f 70%, 
        #fffde7 75%, 
        #ffffff 77%, 
        #fffde7 79%, 
        #ffd54f 84%, 
        #f5b041 92%, 
        #b78103 100%
    );
    background-size: 200% 100%;
    animation: questionBorderTopRight 6s linear infinite;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Bottom Border: Continuous Movement in Opposite Direction to the Left (←) */
.kbc-border-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52%;
    background: linear-gradient(90deg, 
        #b78103 0%, 
        #f5b041 12%, 
        #ffd54f 20%, 
        #fffde7 25%, 
        #ffffff 27%, 
        #fffde7 29%, 
        #ffd54f 34%, 
        #f5b041 42%, 
        #b78103 50%, 
        #f5b041 62%, 
        #ffd54f 70%, 
        #fffde7 75%, 
        #ffffff 77%, 
        #fffde7 79%, 
        #ffd54f 84%, 
        #f5b041 92%, 
        #b78103 100%
    );
    background-size: 200% 100%;
    animation: questionBorderBottomLeft 6s linear infinite;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@keyframes questionBorderTopRight {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

@keyframes questionBorderBottomLeft {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: -200% 0%;
    }
}

@keyframes questionBoxGlow {
    from {
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 213, 79, 0.45);
    }
    to {
        box-shadow: 0 4px 22px rgba(0, 0, 0, 0.65), 0 0 24px rgba(255, 213, 79, 0.85), 0 0 35px rgba(245, 176, 65, 0.45);
    }
}

/* Question Border Hold / Pause State: Freezes moving top/bottom border and glowing halo in place */
.kbc-border-effect.border-animation-paused,
.kbc-border-effect.border-animation-paused::before,
.kbc-border-effect.border-animation-paused::after {
    animation-play-state: paused !important;
}

/* Question Press & Hold Lock Indicator */
.question-lock-hold-indicator {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.7);
    box-shadow: 0 4px 22px rgba(239, 68, 68, 0.45), 0 0 12px rgba(0, 0, 0, 0.85);
    border-radius: 20px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    z-index: 100;
    pointer-events: none;
    font-size: 12px;
    font-weight: 700;
    color: #fca5a5;
    animation: lockHoldFadeIn 0.2s ease-out;
}

.lock-hold-bar {
    width: 65px;
    height: 6px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    overflow: hidden;
}

.lock-hold-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.lock-hold-fill.filling {
    width: 100%;
}

@keyframes lockHoldFadeIn {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Question Box While Holding Lock */
.kbc-border-effect.question-holding-lock {
    background: #ef4444 !important;
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.8), inset 0 0 18px rgba(239, 68, 68, 0.4) !important;
    border-color: rgba(239, 68, 68, 0.9) !important;
}

.kbc-border-effect.question-holding-lock::before,
.kbc-border-effect.question-holding-lock::after {
    opacity: 0 !important;
}

/* ============================================================
   Stage Cleared State (Pure Cinematic Fade-Out of Question & Options)
   ============================================================ */
.kbc-border-effect.stage-cleared {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.45s ease-out !important;
}

.options-grid.stage-cleared {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.45s ease-out !important;
}

.options-grid.stage-cleared .option-box {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.45s ease-out !important;
}

/* ============================================================
   Cinematic Question Entrance Transition (Emerging smoothly from background with full glow)
   ============================================================ */
@keyframes questionCinematicEntrance {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.kbc-border-effect.question-cinematic-in {
    animation: questionCinematicEntrance 0.5s ease-out both;
}

@keyframes questionTextCinematicIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.kbc-border-effect.question-cinematic-in .question-text {
    animation: questionTextCinematicIn 0.45s ease-out 0.05s both;
}

/* ============================================================
   Clean Fade-In Timer Transition on Question Appearance (Pure Opacity, No Glow/Blur)
   ============================================================ */
@keyframes timerFadeInEntrance {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.timer-container.timer-fade-in .timer-progress-circle {
    animation: timerFadeInEntrance 0.95s ease-out both;
}

.timer-container.timer-fade-in .timer-digits {
    animation: timerFadeInEntrance 0.95s ease-out both;
}

.timer-container.timer-fade-in .timer-mode-badge {
    animation: timerFadeInEntrance 0.85s ease-out 0.08s both;
}


.kbc-inner-box {
    position: relative;
    z-index: 1;
    background: radial-gradient(ellipse at center, #0e2968 0%, #051336 75%, #020b22 100%);
    border-radius: 27px;
    padding: clamp(14px, 1.8vh, 18px) clamp(24px, 2.5vw, 36px);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.question-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.ar-label-highlight,
.roman-num-highlight {
    color: var(--cyan-accent);
    font-weight: 800;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
    display: inline-block;
}

.ar-question-block {
    display: inline-block;
    width: 100%;
    text-align: center;
}

.ar-reason-line {
    display: block;
    margin-top: 6px;
}


/* Options Arena - 2x2 Grid (Strict Equal Length for All 4 Options) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(6px, 1vh, 12px) 24px;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    margin-top: clamp(8px, 1.2vh, 14px);
    position: relative;
    align-items: stretch;
}

/* Options Hidden & Revealed States (Step-by-Step KBC Reveal) */
.options-grid.options-hidden .option-box {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.38s ease-out, transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.options-grid.options-visible .option-box {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.38s ease-out, transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.options-grid.options-visible .option-box.revealed {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity 0.38s ease-out, transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Pulsing highlight for Options Tab button */
.btn-highlight-pulse {
    animation: btnPulse 1.4s infinite alternate ease-in-out;
    border-color: #ffd54f !important;
    color: #ffd54f !important;
}

@keyframes btnPulse {
    from { box-shadow: 0 0 4px rgba(255, 213, 79, 0.4); }
    to { box-shadow: 0 0 16px rgba(255, 213, 79, 0.95); }
}

.option-box {
    position: relative;
    cursor: pointer;
    border-radius: 30px;
    will-change: transform;
    transition: transform 0.2s ease, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.option-box:hover:not(.eliminated):not(.correct) {
    transform: scale(1.015);
}

.option-border {
    background: linear-gradient(90deg, #996c02, #f5b041 30%, #ffffff 50%, #f5b041 70%, #996c02);
    border-radius: 30px;
    padding: 2.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.option-inner {
    background: radial-gradient(circle at 30% 50%, #0d2864 0%, #06163d 85%, #020a1f 100%);
    border-radius: 28px;
    padding: clamp(10px, 1.3vh, 13px) 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 50px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.opt-letter {
    font-weight: 800;
    font-size: 19px;
    color: var(--gold-glow);
    text-shadow: 0 0 8px rgba(255, 213, 79, 0.7);
    min-width: 34px;
    white-space: nowrap;
    flex-shrink: 0;
}

.opt-text {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.35;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============================================================
   True / False & 2-Option Custom Formatting
   Symmetrically centered beneath Question with equal side margins
   Both True & False boxes guaranteed 100% Equal Length (Width)
   ============================================================ */
.options-grid.two-options-mode {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: clamp(32px, 5vw, 68px);
    width: 100%;
    max-width: clamp(560px, 68vw, 760px);
    margin: clamp(16px, 2.4vh, 26px) auto 0 auto;
    box-sizing: border-box;
}

.options-grid.two-options-mode .option-box {
    flex: 1 1 0;
    width: 100%;
    max-width: 320px;
    min-width: 0;
    box-sizing: border-box;
    height: 100%;
}

.options-grid.two-options-mode .option-border {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.options-grid.two-options-mode .option-inner {
    justify-content: center;
    padding: clamp(10px, 1.4vh, 15px) clamp(20px, 2.5vw, 32px);
    min-height: 52px;
    height: 100%;
    gap: 16px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.options-grid.two-options-mode .opt-letter {
    display: none !important;
}

.options-grid.two-options-mode .opt-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    width: 100%;
}

/* ============================================================
   Option Dynamic States (Locked, Eliminated, Correct)
   ============================================================ */

/* 1. Locked State */
.option-box.locked .option-border {
    background: linear-gradient(90deg, #ff8f00, #ffca28, #ffffff, #ffca28, #ff8f00);
    box-shadow: 0 0 25px rgba(255, 179, 0, 0.85);
}

.option-box.locked .option-inner {
    background: radial-gradient(circle, #b86200 0%, #663300 85%, #331500 100%);
}

.option-box.locked .opt-letter {
    color: #ffffff;
}

/* 1b. WRONG ANSWER STATE (Reddish Border Flash & Warning Pulse - Perfectly Pill-Rounded) */
.option-box.wrong-answer {
    border-radius: 30px;
    animation: wrongShake 0.45s ease-in-out;
}

.option-box.wrong-answer .option-border {
    border-radius: 30px;
    background: linear-gradient(90deg, #b71c1c, #ff1744 30%, #ffffff 50%, #ff1744 70%, #b71c1c);
    box-shadow: 0 0 26px rgba(255, 23, 68, 0.9), inset 0 0 12px rgba(255, 23, 68, 0.5);
    animation: wrongBorderPulse 1.2s infinite alternate ease-in-out;
}

.option-box.wrong-answer .option-inner {
    border-radius: 28px;
    background: radial-gradient(circle at center, #7f0000 0%, #4a0000 70%, #200000 100%);
}

.option-box.wrong-answer .opt-letter {
    color: #ffffff;
    text-shadow: 0 0 12px #ff1744;
}

.option-box.wrong-answer .opt-text {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.7);
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    18% { transform: translateX(-8px); }
    36% { transform: translateX(8px); }
    54% { transform: translateX(-5px); }
    72% { transform: translateX(5px); }
    90% { transform: translateX(-2px); }
}

@keyframes wrongBorderPulse {
    from {
        box-shadow: 0 0 14px rgba(255, 23, 68, 0.5), inset 0 0 8px rgba(255, 23, 68, 0.3);
    }
    to {
        box-shadow: 0 0 32px rgba(255, 23, 68, 0.95), inset 0 0 16px rgba(255, 23, 68, 0.6);
    }
}

/* 2. ELIMINATION STATE (The 3 Wrong Options Disappear!) */
.option-box.eliminated {
    animation: vaporizeElimination 0.7s forwards cubic-bezier(0.55, 0.055, 0.675, 0.19);
    pointer-events: none;
}

@keyframes vaporizeElimination {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0px) brightness(1.2);
    }
    30% {
        transform: scale(1.05) translateY(-5px);
        filter: brightness(1.8) drop-shadow(0 0 15px rgba(255, 23, 68, 0.8));
    }
    60% {
        opacity: 0.5;
        transform: scale(0.9) translateY(10px);
        filter: blur(4px) grayscale(100%);
    }
    100% {
        opacity: 0;
        transform: scale(0.7) translateY(30px);
        filter: blur(10px);
        visibility: hidden;
    }
}

/* 3. CORRECT ANSWER STATE (The Sole Survivor - Glowing Green) */
.option-box.correct {
    animation: correctTriumph 0.8s ease forwards;
}

.option-box.correct .option-border {
    background: linear-gradient(90deg, #00b0ff, #00e676 25%, #ffffff 50%, #00e676 75%, #00b0ff);
    box-shadow: 0 0 35px rgba(0, 230, 118, 0.9), inset 0 0 15px rgba(0, 230, 118, 0.5);
}

.option-box.correct .option-inner {
    background: radial-gradient(circle at center, #007033 0%, #004d20 70%, #002910 100%);
}

.option-box.correct .opt-letter {
    color: #ffffff;
    text-shadow: 0 0 12px #69f0ae;
}

.option-box.correct .opt-text {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(105, 240, 174, 0.7);
}

@keyframes correctTriumph {
    0% { transform: scale(1); }
    35% { transform: scale(1.08); }
    65% { transform: scale(0.98); }
    100% { transform: scale(1.04); }
}

/* Host / Teacher Control Bar - 3-Column Mathematically Symmetrical Grid */
.host-controls-dock {
    position: relative;
    z-index: 100005 !important;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(10px, 1.2vw, 15px);
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    background: rgba(5, 19, 54, 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 176, 65, 0.35) !important;
    background-clip: padding-box !important;
    border-radius: 12px;
    padding: clamp(6px, 1.1vh, 10px) clamp(8px, 1vw, 16px);
    margin-top: clamp(4px, 0.8vh, 8px);
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.45), 0 -4px 20px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Left Group and Right Group are both strict 5-column grids with exact equal spacing */
.host-controls-dock .control-group:first-child,
.host-controls-dock .control-group:last-child {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(5px, 0.65vw, 8px);
    align-items: center;
    width: 100%;
}

/* Center group holds the eliminate button in exact 50% dead center */
.host-controls-dock .control-group:nth-child(2) {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    padding: 0;
}

/* All 5 buttons on the left AND all 5 buttons on the right have 100% equal width */
.host-controls-dock .control-group:first-child .host-btn,
.host-controls-dock .control-group:last-child .host-btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: clamp(38px, 5vh, 42px) !important;
    padding: clamp(5px, 0.9vh, 8px) clamp(5px, 0.6vw, 10px);
    font-size: clamp(11.5px, 0.95vw, 13px);
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden !important;
}

.host-btn {
    background: linear-gradient(180deg, #16367c 0%, #0c204d 100%);
    border: 1px solid rgba(245, 176, 65, 0.40) !important;
    background-clip: padding-box !important;
    color: #ffffff !important;
    padding: clamp(7px, 1.2vh, 11px) clamp(6px, 0.7vw, 12px);
    min-height: clamp(42px, 6vh, 52px);
    border-radius: 10px;
    font-size: clamp(12px, 1vw, 13.5px);
    font-weight: 700;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    font-family: var(--font-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.4vw, 5px);
    white-space: nowrap;
    outline: none !important;
    box-shadow: inset 0 1px 1px rgba(255, 240, 190, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.45), 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    overflow: hidden !important;
    text-overflow: ellipsis;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.header-bar .host-btn {
    min-height: clamp(36px, 4.4vh, 40px) !important;
    height: clamp(36px, 4.4vh, 40px);
    padding: 4px clamp(6px, 0.55vw, 10px);
    font-size: clamp(12px, 0.98vw, 13px);
    font-weight: 700;
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#btnManageChapters,
#btnImportOneNote {
    flex: 0 1 auto !important;
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
    width: auto !important;
    max-width: 96px !important;
    min-width: clamp(34px, 3.5vw, 55px) !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: clamp(11.5px, 0.9vw, 13px) !important;
    padding: 0 clamp(4px, 0.45vw, 8px) !important;
    height: clamp(36px, 4.4vh, 40px);
    min-height: clamp(36px, 4.4vh, 40px);
    max-height: clamp(36px, 4.4vh, 40px);
    border-radius: 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#btnMixChapters {
    gap: 4px !important;
    padding: 0 4px !important;
}

#btnManageChapters {
    margin-left: clamp(2px, 0.3vw, 6px) !important;
}

#btnManageChapters,
#btnImportOneNote {
    gap: 3px !important;
    padding: 0 4px 0 2px !important;
}

#btnMixChapters .btn-icon-svg,
#btnMixChapters svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

#btnManageChapters .btn-tab-icon,
#btnImportOneNote .btn-tab-icon,
#btnOpenTeachersHub .btn-tab-icon,
#btnOpenStudentsHub .btn-tab-icon,
#btnOpenTeachersHub .btn-icon-svg,
#btnOpenStudentsHub .btn-icon-svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin: 0 0 0 -1px !important;
    line-height: 1 !important;
    font-size: 13.5px !important;
    vertical-align: middle !important;
}

#btnMixChapters .lbl-txt,
#btnManageChapters .lbl-txt,
#btnImportOneNote .lbl-txt,
#btnOpenTeachersHub .lbl-txt,
#btnOpenStudentsHub .lbl-txt {
    display: inline-block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    text-align: left !important;
}

#btnOpenTeachersHub {
    margin-left: clamp(2px, 0.3vw, 6px) !important;
}

#btnOpenTeachersHub,
#btnOpenStudentsHub {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    flex: 0 1 auto !important;
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
    width: auto !important;
    max-width: 98px !important;
    min-width: clamp(34px, 3.5vw, 60px) !important;
    white-space: nowrap !important;
    font-size: clamp(11.5px, 0.9vw, 13px) !important;
    padding: 0 clamp(4px, 0.45vw, 8px) !important;
    height: clamp(36px, 4.4vh, 40px);
    min-height: clamp(36px, 4.4vh, 40px);
    max-height: clamp(36px, 4.4vh, 40px);
    border-radius: 10px !important;
    box-sizing: border-box !important;
    gap: 3px !important;
    overflow: hidden !important;
}

.header-bar .btn-help-header {
    width: clamp(36px, 4.4vh, 40px) !important;
    height: clamp(36px, 4.4vh, 40px) !important;
    min-width: clamp(36px, 4.4vh, 40px) !important;
    max-width: clamp(36px, 4.4vh, 40px) !important;
    min-height: clamp(36px, 4.4vh, 40px) !important;
    max-height: clamp(36px, 4.4vh, 40px) !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    font-size: clamp(13px, 1.05vw, 16px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
    flex-shrink: 0;
}

.host-btn.btn-contest-toggle.active {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 12px rgba(245, 176, 65, 0.5) !important;
    color: #ffffff !important;
}

.host-btn.btn-reset-bank {
    background: linear-gradient(180deg, #064e3b 0%, #065f46 100%) !important;
    border-color: #34d399 !important;
    color: #ecfdf5 !important;
}

.host-btn.btn-reset-bank:hover {
    background: linear-gradient(180deg, #047857 0%, #059669 100%) !important;
    border-color: #6ee7b7 !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6) !important;
}

.host-btn:focus,
.host-btn:focus-visible {
    outline: none !important;
}

.host-btn:hover {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%);
    border: 1px solid rgba(255, 213, 79, 0.8) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 0 10px rgba(245, 176, 65, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Subtle, uniform tactile haptic depression for all control buttons except static answer display */
.host-btn:not(.btn-answer-indicator):active {
    transform: translateY(1.5px) scale(0.985) translateZ(0) !important;
    border-color: rgba(245, 176, 65, 0.75) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

.host-btn.btn-eliminate {
    background: linear-gradient(180deg, #c2185b 0%, #880e4f 100%);
    border: 1px solid rgba(255, 64, 129, 0.65) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: clamp(13.2px, 1.3vw, 16.5px);
    font-weight: 800;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    padding: 0 clamp(10px, 1.2vw, 20px) !important;
    width: clamp(190px, 22vw, 320px);
    max-width: 330px;
    min-width: 0 !important;
    height: clamp(50px, 7.2vh, 58px) !important;
    min-height: clamp(50px, 7.2vh, 58px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    text-align: center;
    box-shadow: inset 0 1px 1px rgba(255, 180, 210, 0.25), inset 0 -1px 1px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 64, 129, 0.3);
    animation: pulseButton 2s infinite alternate;
    flex-shrink: 1;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden !important;
    box-sizing: border-box;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.host-btn.btn-eliminate .btn-icon-symbol,
.host-btn.btn-eliminate .btn-icon-svg,
.host-btn.btn-eliminate svg {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.28em;
    line-height: 1 !important;
    margin: 0 !important;
    vertical-align: middle !important;
    transform: scale(1.1);
    transform-origin: center;
}

.host-btn.btn-eliminate .btn-text-wrap {
    flex: 0 1 auto;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: center;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    position: relative;
    top: 1.5px;
}

.host-btn.btn-eliminate span {
    line-height: 1 !important;
    vertical-align: middle !important;
}

.reveal-opt-letter-cyan {
    color: #00f5ff !important;
    font-size: 1.22em !important;
    font-weight: 900 !important;
    text-shadow: 0 0 12px rgba(0, 245, 255, 0.85), 0 1px 3px rgba(0, 0, 0, 0.95);
    letter-spacing: 0.5px;
    display: inline !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
}

.host-btn.btn-eliminate:hover {
    background: linear-gradient(180deg, #e91e63 0%, #ad1457 100%);
    border: 1px solid rgba(255, 128, 171, 0.9) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 16px rgba(255, 64, 129, 0.6);
}

.host-btn.btn-eliminate:active {
    transform: translateY(1.2px) scale(0.993) translateZ(0) !important;
    border-color: #ff4081 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(255, 64, 129, 0.25) !important;
}

@keyframes pulseButton {
    from {
        box-shadow: 0 0 6px rgba(255, 64, 129, 0.3);
        border-color: rgba(255, 64, 129, 0.65);
    }
    to {
        box-shadow: 0 0 14px rgba(255, 64, 129, 0.65);
        border-color: rgba(255, 128, 171, 0.85);
    }
}

.key-tag {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 1px clamp(3px, 0.35vw, 5px);
    border-radius: 4px;
    font-size: clamp(9.5px, 0.8vw, 11px);
    font-family: var(--font-main);
    font-weight: 700;
    color: var(--gold-glow);
}

/* Answer Indicator Tab (Teacher Reference - Fully flexible & responsive) */
.host-btn.btn-answer-indicator {
    background: linear-gradient(180deg, #112d1c 0%, #081a10 100%);
    border: 1px solid rgba(0, 230, 118, 0.50) !important;
    background-clip: padding-box !important;
    border-radius: 10px;
    color: #a7f3d0;
    font-weight: 700;
    cursor: default;
    user-select: none;
    width: 100%;
    min-width: 0;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 1px 1px rgba(185, 246, 202, 0.18), 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.host-btn.btn-answer-indicator:hover,
.host-btn.btn-answer-indicator:active,
.host-btn.btn-answer-indicator:focus {
    transform: translateZ(0) !important;
    border: 1px solid rgba(105, 240, 174, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(0, 230, 118, 0.35) !important;
}

.ans-practical-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    pointer-events: none;
    user-select: none;
}

.ans-practical-badge svg {
    display: block;
    width: 16px;
    height: 16px;
}

.ans-key-svg {
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: #00e676;
    filter: drop-shadow(0 0 5px rgba(0, 230, 118, 0.65));
}

.btn-answer-indicator .ans-label {
    letter-spacing: 0.2px;
    margin-right: 6px;
}

.btn-answer-indicator .ans-badge {
    color: #00e676;
    font-size: 1.08em;
    font-weight: 900;
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.5);
    border-radius: 4px;
    padding: 1px 0;
    letter-spacing: 0.5px;
    text-shadow: 0 0 6px rgba(0, 230, 118, 0.6);
    display: inline-block;
    width: 1.6em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Universal Horizontal Overflow Containment for Dock Tabs
   ============================================================ */
.host-controls-dock .host-btn {
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-left: clamp(5px, 0.6vw, 10px) !important;
    padding-right: clamp(5px, 0.6vw, 10px) !important;
    font-size: clamp(12px, 0.98vw, 13.5px) !important;
    box-sizing: border-box !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
}

.host-controls-dock .host-btn .btn-icon-svg,
.host-controls-dock .host-btn svg,
.contest-action-btn .btn-icon-svg,
.contest-action-btn svg {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.host-controls-dock .host-btn .btn-text-wrap,
.host-controls-dock .host-btn span:not(.live-pulse-dot):not(.student-count-pill):not(.ans-practical-badge):not(.ans-badge) {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: inline-block;
    vertical-align: middle;
}

.host-controls-dock .host-btn .btn-icon-svg,
.host-controls-dock .host-btn svg {
    flex-shrink: 0;
}

/* Modals (Import OneNote, Shortcuts, Chapters) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 8, 25, 0.94);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active,
.modal-overlay.modal-open {
    opacity: 1;
    pointer-events: auto;
}

/* Teacher / Host Screen: Stage Area Presentation
   Keeps the bottom dock (.host-controls-dock) & Live Contest ribbon (.student-contest-bar) 
   completely uncovered, vibrant, active, and accessible at the bottom */
body:not(.smartboard-mode) .modal-overlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: var(--stage-top-offset, 48px) !important;
    padding-bottom: var(--stage-bottom-offset, 64px) !important;
    padding-left: clamp(10px, 1.5vw, 24px) !important;
    padding-right: clamp(10px, 1.5vw, 24px) !important;
    box-sizing: border-box !important;
}

body:not(.smartboard-mode) .modal-box {
    margin: 0 !important;
    max-height: calc(100vh - var(--stage-top-offset, 48px) - var(--stage-bottom-offset, 64px) - 20px) !important;
    overflow-y: auto !important;
}

/* Smart Board View (Second Monitor): Pure Cinematic Clean View - Zero Docks, Zero Controls */
body.smartboard-mode .modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
}

body.smartboard-mode .modal-box {
    max-height: 90vh !important;
    width: min(880px, 92vw) !important;
}

.modal-box {
    position: relative;
    z-index: 100000;
    background: linear-gradient(180deg, #091c49 0%, #051336 100%);
    border: 2px solid var(--gold-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 780px;
    padding: 24px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(245, 176, 65, 0.35);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 176, 65, 0.3);
    padding-bottom: 10px;
}

.modal-header h2 {
    font-size: 19px;
    color: var(--gold-glow);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   Universal Studio Coin Close Button (✕) for ALL Modals
   Ultra-Smooth, Professional-Grade Circular Button with Crisp Ruby Finish
   ============================================================ */
.modal-close,
#btnCloseStudentSetup,
#studentSetupModal .modal-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important; /* Perfect circular studio coin */
    align-self: flex-start !important;
    background: linear-gradient(180deg, #991b1b 0%, #691010 100%) !important;
    border: 1px solid rgba(248, 113, 113, 0.6) !important;
    background-clip: padding-box !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    user-select: none !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

.modal-close svg,
#btnCloseStudentSetup svg,
#studentSetupModal .modal-close svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    stroke: #ffffff !important;
    stroke-width: 2.6 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Hover: Refined Ruby Crimson Studio Gleam with Smooth 90-degree Micro-Twist */
.modal-close:hover,
#btnCloseStudentSetup:hover,
#studentSetupModal .modal-close:hover {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%) !important;
    border-color: #fca5a5 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    filter: brightness(1.08) !important;
}

.modal-close:hover svg,
#btnCloseStudentSetup:hover svg,
#studentSetupModal .modal-close:hover svg {
    transform: rotate(90deg) scale(1.08) !important;
}

/* Active Haptic Click: Physical 1.5px Tactile Depression */
.modal-close:active,
#btnCloseStudentSetup:active,
#studentSetupModal .modal-close:active {
    transform: translateY(1.5px) scale(0.92) !important;
    background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%) !important;
    border-color: #ef4444 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.75), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

.modal-close:active svg,
#btnCloseStudentSetup:active svg,
#studentSetupModal .modal-close:active svg {
    transform: rotate(90deg) scale(0.94) !important;
}

.import-tip {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid var(--gold-primary);
}

.import-textarea-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

.import-textarea {
    width: 100%;
    height: 220px;
    min-height: 140px;
    max-height: 380px;
    background: rgba(2, 8, 25, 0.9);
    border: 1px solid rgba(245, 176, 65, 0.4);
    border-radius: 8px;
    color: #ffffff;
    font-family: var(--font-main);
    font-size: 14px;
    padding: 12px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
    box-sizing: border-box;
}

.import-textarea:focus {
    border-color: var(--cyan-accent);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* 2-Way Resizable Reorder Modals with Stage Boundary Lock */
#classReorderModal .modal-box,
#subjectManagerModal .modal-box,
#bookManagerModal .modal-box,
#chapterReorderModal .modal-box {
    position: relative;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--stage-top-offset, 48px) - var(--stage-bottom-offset, 64px) - 20px) !important;
    overflow: visible;
}

#classReorderModal .modal-box[style*="width"],
#subjectManagerModal .modal-box[style*="width"],
#bookManagerModal .modal-box[style*="width"],
#chapterReorderModal .modal-box[style*="width"] {
    max-width: calc(100vw - 32px) !important;
}

#classReorderModal .modal-box[style*="height"],
#subjectManagerModal .modal-box[style*="height"],
#bookManagerModal .modal-box[style*="height"],
#chapterReorderModal .modal-box[style*="height"] {
    max-height: calc(100vh - var(--stage-top-offset, 48px) - var(--stage-bottom-offset, 64px) - 20px) !important;
}

#classReorderModal .modal-box[style*="height"] #classReorderListContainer,
#subjectManagerModal .modal-box[style*="height"] #subjectManagerListContainer,
#bookManagerModal .modal-box[style*="height"] #bookManagerListContainer,
#chapterReorderModal .modal-box[style*="height"] #chapterReorderListContainer {
    flex: 1 1 0px !important;
    max-height: none !important;
    min-height: 140px !important;
}

/* 2-Way Resizable Import Questions Modal with Stage Boundary Lock */
#importModal .modal-box {
    width: 90%;
    max-width: 860px;
    position: relative;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--stage-top-offset, 48px) - var(--stage-bottom-offset, 64px) - 20px) !important;
    overflow: visible;
}

#importModal .modal-box[style*="width"] {
    max-width: calc(100vw - 32px) !important;
}

#importModal .modal-box[style*="height"] {
    max-height: calc(100vh - var(--stage-top-offset, 48px) - var(--stage-bottom-offset, 64px) - 20px) !important;
}

#importModal .modal-box[style*="height"] .import-textarea-wrap {
    flex: 1 1 0px !important;
    min-height: 120px !important;
    display: flex !important;
    flex-direction: column !important;
}

#importModal .modal-box[style*="height"] .import-textarea {
    flex: 1 1 auto !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 100px !important;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-primary {
    background: linear-gradient(180deg, #f5b041 0%, #b78103 100%);
    color: #051336;
    font-weight: 800;
    font-size: 14px;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 0 #8c5d00, 0 6px 14px rgba(245, 176, 65, 0.4);
    transition: transform 0.08s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.08s ease, filter 0.08s ease;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffd54f 0%, #d49000 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #8c5d00, 0 8px 18px rgba(255, 213, 79, 0.6);
}

.btn-primary:active {
    transform: translateY(3px) scale(0.98) !important;
    box-shadow: 0 1px 0 #8c5d00, 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    filter: brightness(0.92);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 9px 15px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 0 #1b263b, 0 4px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.08s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.08s ease, filter 0.08s ease;
    user-select: none;
    -webkit-user-select: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #1b263b, 0 6px 14px rgba(0, 0, 0, 0.45);
}

.btn-secondary:active {
    transform: translateY(3px) scale(0.98) !important;
    box-shadow: 0 1px 0 #1b263b, 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    filter: brightness(0.9);
}

/* Specific Studio Beveled Buttons & Tactile Haptic Feel for Classroom Roster Modal (Crisp, Smoke-Free Studio Quality) */
#studentSetupModal .modal-footer {
    padding-top: 14px;
}

#btnStartContest {
    background: linear-gradient(180deg, #059669 0%, #064e3b 100%) !important;
    border: 1px solid #34d399 !important;
    border-top: 1px solid #a7f3d0 !important;
    border-bottom: 1px solid #047857 !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    padding: 8px 18px !important;
    min-height: 40px !important;
    line-height: 1.2 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.45) !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

#btnStartContest:hover {
    background: linear-gradient(180deg, #0ba360 0%, #046c36 100%) !important;
    border-color: #34d399 !important;
    border-top-color: #ffffff !important;
    border-bottom-color: #047857 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 10px rgba(0, 0, 0, 0.45) !important;
    filter: brightness(1.08) !important;
}

#btnStartContest:active {
    transform: translateY(1.5px) scale(0.985) !important;
    border-top-color: #047857 !important;
    border-bottom-color: #a7f3d0 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

#btnResetBatchScores {
    background: linear-gradient(180deg, #881337 0%, #4c0519 100%) !important;
    border: 1px solid #f43f5e !important;
    border-top: 1px solid #fecdd3 !important;
    border-bottom: 1px solid #9f1239 !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 8px 16px !important;
    min-height: 40px !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 5px rgba(0, 0, 0, 0.45) !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

#btnResetBatchScores .btn-icon-svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)) !important;
    transition: transform 0.12s ease;
}

#btnResetBatchScores:hover {
    background: linear-gradient(180deg, #9f1239 0%, #60071e 100%) !important;
    border-color: #f43f5e !important;
    border-top-color: #ffffff !important;
    border-bottom-color: #881337 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.45) !important;
    filter: brightness(1.08) !important;
}

#btnResetBatchScores:hover .btn-icon-svg {
    transform: scale(1.06);
}

#btnResetBatchScores:active {
    transform: translateY(1.5px) scale(0.985) !important;
    border-top-color: #4c0519 !important;
    border-bottom-color: #fecdd3 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

#btnResetBatchScores:active .btn-icon-svg {
    transform: scale(0.96);
}

#btnCancelStudentSetup {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.6) !important;
    border-top: 1px solid rgba(241, 245, 249, 0.8) !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.9) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 8px 18px !important;
    min-height: 40px !important;
    line-height: 1.2 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 5px rgba(0, 0, 0, 0.45) !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

#btnCancelStudentSetup:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
    border-color: #94a3b8 !important;
    border-top-color: #ffffff !important;
    border-bottom-color: #334155 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px rgba(0, 0, 0, 0.45) !important;
    filter: brightness(1.08) !important;
}

#btnCancelStudentSetup:active {
    transform: translateY(1.5px) scale(0.985) !important;
    border-top-color: #0f172a !important;
    border-bottom-color: #94a3b8 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

#btnAddStudents {
    background: linear-gradient(180deg, #d97706 0%, #92400e 100%) !important;
    border: 1px solid rgba(245, 176, 65, 0.9) !important;
    border-top: 1px solid #fff2a3 !important;
    border-bottom: 1px solid #78350f !important;
    border-radius: 9px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 20px !important;
    min-height: 36px !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.45) !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

#btnAddStudents:hover {
    background: linear-gradient(180deg, #ea580c 0%, #9a3412 100%) !important;
    border-color: #fb923c !important;
    border-top-color: #ffffff !important;
    border-bottom-color: #7c2d12 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 10px rgba(0, 0, 0, 0.45) !important;
    filter: brightness(1.08) !important;
}

#btnAddStudents:active {
    transform: translateY(1.5px) scale(0.985) !important;
    border-top-color: #78350f !important;
    border-bottom-color: #fff2a3 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

.btn-roster-action {
    border-radius: 7px !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75) !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

.btn-roster-action:active {
    transform: translateY(1.2px) scale(0.97) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

.btn-chapter-action {
    width: auto;
    min-width: 0;
    height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

/* Manage Classes / Manage Books buttons — dim by default, glow on hover */
.btn-manage {
    border-color: rgba(255, 255, 255, 0.3) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-manage:hover {
    border-color: #ffffff !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Chapter Manager Modal Items */
#chapterModal .modal-box {
    width: 90%;
    max-width: 840px;
    padding: 16px 24px 22px 24px !important;
    position: relative;
    box-sizing: border-box !important;
    max-height: calc(100vh - var(--stage-top-offset, 48px) - var(--stage-bottom-offset, 64px) - 20px) !important;
    overflow: visible;
}

#chapterModal .modal-box[style*="width"] {
    max-width: calc(100vw - 32px) !important;
}

#chapterModal .modal-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.chapter-list-wrap {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 176, 65, 0.25);
    border-radius: 8px;
    padding: 10px 14px 4px 14px;
    height: 220px;
    min-height: 140px;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    resize: vertical;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.chapter-resize-handle {
    height: 12px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    user-select: none;
    margin-top: 4px;
    padding: 2px 0;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.chapter-resize-handle:hover {
    background: rgba(245, 176, 65, 0.12);
}

.chapter-resize-handle .resize-handle-bar {
    width: 46px;
    height: 3.5px;
    border-radius: 2px;
    background: rgba(245, 176, 65, 0.45);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: background 0.2s ease, width 0.2s ease;
}

.chapter-resize-handle:hover .resize-handle-bar,
.chapter-resize-handle:active .resize-handle-bar {
    background: #ffd54f;
    width: 65px;
}

.chapter-list-header {
    font-size: 12px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 700;
    flex-shrink: 0;
}

#chapterListContainer {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 2px;
    border-radius: 8px;
}

/* White Vertical Scrollbar with Rounded Corners (Balanced Width & White/Grey Colors Maintained) */
#chapterListContainer::-webkit-scrollbar {
    width: 13px;
    background: #ffffff;
    border-radius: 6px;
}

#chapterListContainer::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 6px;
}

#chapterListContainer::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #ffffff;
}

#chapterListContainer::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#chapterListContainer::-webkit-scrollbar-button {
    background: #ffffff;
    border-radius: 6px;
    height: 13px;
}

.chapter-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    background: rgba(12, 37, 94, 0.45);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.chapter-item-row:hover {
    background: rgba(12, 37, 94, 0.85);
    border-color: rgba(245, 176, 65, 0.3);
}

.chapter-item-row.active {
    border-left: 4px solid var(--gold-glow);
    background: rgba(245, 176, 65, 0.15);
}

.chapter-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.chapter-item-badge {
    font-size: 12px;
    color: var(--gold-glow);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 700;
}

.chapter-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transition: all 0.15s ease;
    height: 28px;
    min-width: fit-content;
    white-space: nowrap;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
}

.btn-mini-danger {
    background: rgba(194, 24, 91, 0.2);
    border: 1px solid rgba(255, 64, 129, 0.4);
    color: #ff80ab;
}

.btn-mini-danger:hover {
    background: #c2185b;
    border-color: #ff4081;
    color: #ffffff;
}

.chapter-title-input {
    background: rgba(2, 8, 25, 0.9);
    border: 1px solid rgba(245, 176, 65, 0.4);
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}

.chapter-title-input:focus {
    border-color: var(--cyan-accent);
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

/* Multi-Chapter Selector Modal */
.multi-chapter-book-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(20, 24, 60, 0.6) 0%, rgba(10, 15, 38, 0.7) 100%);
    border: 1px solid rgba(192, 132, 252, 0.35);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.multi-chapter-book-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #e9d5ff;
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
}

.multi-chapter-book-label .book-icon {
    font-size: 17px;
}

.multi-source-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1;
    max-width: 380px;
    box-sizing: border-box;
}

.multi-source-btn {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100%;
    min-height: 38px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #f3e8ff !important;
    background: linear-gradient(180deg, #18133a 0%, #0c0924 100%);
    border: 1px solid rgba(192, 132, 252, 0.75) !important;
    border-top: 1px solid #f3e8ff !important;
    border-bottom: 1px solid #7e22ce !important;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 8px rgba(192, 132, 252, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.multi-source-btn:hover,
.multi-source-btn.active {
    border-color: #d8b4fe !important;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.multi-source-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 260px;
    max-height: 240px;
    overflow-y: auto;
    background: #0d0926;
    border: 1px solid rgba(192, 132, 252, 0.85);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 14px rgba(192, 132, 252, 0.35);
    padding: 6px;
    z-index: 120;
    display: none;
    flex-direction: column;
    gap: 3px;
}

.multi-source-panel.open {
    display: flex;
}

.multi-source-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.multi-source-option:hover {
    background: rgba(192, 132, 252, 0.22);
}

.multi-source-option-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #e9d5ff;
    cursor: pointer;
    width: 100%;
}

.multi-source-option.is-all .multi-source-option-left {
    color: #ffd54f;
}

.multi-chapter-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.multi-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    user-select: none;
}

.custom-chk {
    width: 17px;
    height: 17px;
    accent-color: var(--cyan-accent);
    cursor: pointer;
}

.multi-chapter-checklist {
    max-height: 290px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 176, 65, 0.5) transparent;
}

.multi-chapter-checklist::-webkit-scrollbar {
    width: 6px;
}
.multi-chapter-checklist::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 65, 0.4);
    border-radius: 4px;
}

.multi-chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(12, 37, 94, 0.65);
    border: 1px solid rgba(245, 176, 65, 0.25);
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.multi-chapter-item:hover {
    background: rgba(20, 55, 130, 0.85);
    border-color: var(--gold-glow);
}

.multi-chapter-item.selected {
    background: linear-gradient(90deg, rgba(0, 136, 204, 0.45) 0%, rgba(5, 19, 54, 0.85) 100%);
    border-color: var(--cyan-accent);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}

.multi-chapter-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.multi-chapter-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-chapter-item.selected .multi-chapter-title {
    color: #e0f7fa;
    font-weight: 700;
}

.multi-chapter-qcount-badge {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(245, 176, 65, 0.4);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--gold-glow);
    flex-shrink: 0;
}

.multi-chapter-summary-badge {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gold-glow);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(245, 176, 65, 0.35);
    padding: 6px 14px;
    border-radius: 8px;
}

/* Toast Notifications (Disabled per teacher preference to avoid popup distractions) */
.toast-msg {
    display: none !important;
    position: fixed;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(12, 37, 94, 0.95);
    border: 1px solid var(--gold-glow);
    color: #ffffff;
    padding: 9px 22px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    pointer-events: none;
}

.toast-msg.show {
    display: none !important;
    opacity: 0 !important;
}

/* ============================================================
   Fluid Responsive Layout (Prevents Horizontal Clipping)
   ============================================================ */

/* Large Laptops / Moderately Narrowed Windows (<= 1366px) */
@media (max-width: 1366px) {
    .app-container {
        padding-left: clamp(6px, 1vw, 14px);
        padding-right: clamp(6px, 1vw, 14px);
    }

    .kbc-title p {
        display: none; /* Hide subtitle to preserve horizontal space */
    }

    .header-bar {
        gap: clamp(3px, 0.4vw, 6px);
    }

    .class-label .lbl-txt,
    .subject-label .lbl-txt,
    .book-label .lbl-txt,
    .chapter-label .lbl-txt,
    .type-label .lbl-txt {
        display: none;
    }

    .header-bar .host-btn .lbl-txt {
        display: inline-block;
        vertical-align: middle;
    }

    .chapter-selector-bar, .timer-selector-bar {
        padding: 3px clamp(4px, 0.4vw, 7px);
        gap: clamp(2px, 0.3vw, 5px);
    }

    .class-dropdown {
        width: clamp(72px, 6.2vw, 110px);
        min-width: 72px !important;
        max-width: 110px;
        flex: 1 1 110px;
        font-size: 11px;
        padding: 0 14px 0 5px;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    .subject-dropdown {
        width: clamp(72px, 6.2vw, 110px);
        min-width: 72px !important;
        max-width: 110px;
        flex: 1 1 110px;
        font-size: 11px;
        padding: 0 14px 0 5px;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    .book-dropdown {
        width: clamp(72px, 6.2vw, 110px);
        min-width: 72px !important;
        max-width: 110px;
        flex: 1 1 110px;
        font-size: 11px;
        padding: 0 14px 0 5px;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    .chapter-dropdown#chapterSelect {
        width: clamp(76px, 6.8vw, 120px);
        min-width: 76px !important;
        max-width: 120px;
        flex: 1.2 1 120px;
        font-size: 11px;
        padding: 0 14px 0 5px;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    .type-dropdown,
    .custom-multiselect-wrap,
    .type-dropdown-btn {
        width: clamp(72px, 6.2vw, 110px);
        min-width: 72px !important;
        max-width: 110px;
        flex: 1 1 110px;
        font-size: 11px;
        padding: 0 5px;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    #btnTimerMode,
    .timer-dropdown {
        width: clamp(62px, 5.2vw, 72px);
        min-width: 60px !important;
        max-width: 76px;
        flex: 0 0 auto;
        font-size: 11px;
        padding: 0 14px 0 4px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    .header-bar .host-btn {
        font-size: 11px;
        padding: 4px 6px;
        min-height: 34px;
        min-width: 0 !important;
    }

    .q-counter-box {
        padding: 0 4px !important;
        font-size: 11px;
        flex: 0 0 94px !important;
        width: 94px !important;
        min-width: 94px !important;
        max-width: 94px !important;
        flex-shrink: 0 !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        box-sizing: border-box !important;
    }

    .jump-wrap {
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        flex-shrink: 0 !important;
    }

    .jump-input {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        font-size: 11px;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        line-height: 34px !important;
        box-sizing: border-box !important;
    }

    .btn-help-header,
    .header-bar .btn-help-header {
        font-size: 13px;
        padding: 0 !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        aspect-ratio: 1 / 1 !important;
        box-sizing: border-box !important;
    }

    #btnManageChapters,
    #btnImportOneNote,
    #btnOpenTeachersHub,
    #btnOpenStudentsHub {
        flex: 0 1 auto !important;
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        width: auto !important;
        min-width: clamp(32px, 3vw, 48px) !important;
        max-width: 88px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        font-size: 11px !important;
        padding: 0 clamp(2px, 0.35vw, 6px) !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #btnMixChapters {
        gap: 3px !important;
        padding: 0 3px !important;
    }

    #btnManageChapters,
    #btnImportOneNote {
        gap: 2px !important;
        padding: 0 3px 0 1px !important;
    }

    .host-controls-dock,
    .student-contest-bar,
    body.contest-top-view-active .student-contest-bar {
        padding: clamp(5px, 1vh, 8px) clamp(5px, 0.7vw, 12px) !important;
        gap: 5px;
    }

    .contest-badge,
    .contest-action-btn {
        min-height: clamp(38px, 4.8vh, 46px);
        padding: clamp(5px, 0.9vh, 8px) clamp(5px, 0.6vw, 9px) !important;
        font-size: clamp(11.5px, 0.95vw, 12.5px);
        min-width: 0 !important;
    }

    .control-group {
        gap: 4px;
    }

    .host-btn {
        padding: 7px clamp(4px, 0.6vw, 8px);
        min-height: 46px;
        font-size: 12px;
        gap: 3px;
    }

    .host-controls-dock .control-group:first-child .host-btn {
        min-width: clamp(74px, 5.8vw, 92px);
        padding: 7px clamp(4px, 0.6vw, 10px);
    }

    .header-bar .host-btn {
        min-height: 32px;
        padding: 4px 8px;
    }

    .host-btn.btn-eliminate {
        width: clamp(120px, 15vw, 200px);
        min-width: 0 !important;
        max-width: 200px;
        min-height: 46px;
        font-size: 12px;
        padding: 7px 8px;
    }
}

/* Width <= 1280px: Hide shortcut tags */
@media (max-width: 1280px) {
    .host-controls-dock .key-tag,
    .btn-help-header .key-tag {
        display: none;
    }
}

/* Medium Screens / Narrow Windows (<= 1150px): Graceful 2-Tier Header Wrap */
@media (max-width: 1150px) {
    .app-container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .kbc-branding {
        gap: clamp(4px, 0.5vw, 6px);
        order: 1;
        flex-shrink: 0 !important;
    }

    .kbc-logo-badge {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        font-size: 11.5px !important;
        border-radius: 50% !important;
        box-sizing: border-box !important;
    }

    .kbc-title h1 {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .header-bar {
        flex-wrap: wrap;
        row-gap: 4px;
        justify-content: space-between;
    }

    .quiz-meta-info {
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
        gap: 3px;
    }

    .chapter-selector-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 3px 2px;
        gap: clamp(4px, 0.6vw, 8px);
        margin-top: 2px;
    }

    .class-dropdown {
        width: clamp(75px, 8.5vw, 125px);
        min-width: 75px !important;
        max-width: 125px;
        flex: 1 1 120px;
        font-size: 11.5px;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 14px 0 6px;
        box-sizing: border-box !important;
    }

    .subject-dropdown {
        width: clamp(75px, 8.5vw, 125px);
        min-width: 75px !important;
        max-width: 125px;
        flex: 1 1 120px;
        font-size: 11.5px;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 14px 0 6px;
        box-sizing: border-box !important;
    }

    .book-dropdown {
        width: clamp(75px, 8.5vw, 125px);
        min-width: 75px !important;
        max-width: 125px;
        flex: 1 1 120px;
        font-size: 11.5px;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 14px 0 6px;
        box-sizing: border-box !important;
    }

    .chapter-dropdown#chapterSelect {
        width: clamp(85px, 10vw, 150px);
        min-width: 85px !important;
        max-width: 150px;
        flex: 1.3 1 145px;
        font-size: 11.5px;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 14px 0 6px;
        box-sizing: border-box !important;
    }

    .custom-multiselect-wrap {
        width: clamp(80px, 9.5vw, 138px);
        min-width: 80px !important;
        max-width: 138px;
        flex: 1.1 1 130px;
        box-sizing: border-box !important;
    }

    .type-dropdown-btn {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        font-size: 11.5px;
        padding: 0 8px !important;
        box-sizing: border-box !important;
    }

    #btnManageChapters,
    #btnImportOneNote,
    #btnOpenTeachersHub,
    #btnOpenStudentsHub {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 1 auto !important;
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        width: auto !important;
        min-width: max-content !important;
        max-width: 105px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        font-size: 11.5px !important;
        padding: 0 clamp(6px, 0.7vw, 10px) !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        gap: 4px !important;
        overflow: hidden !important;
    }

    .header-bar .host-btn .lbl-txt {
        display: inline-block !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    #btnTimerMode,
    .timer-dropdown {
        width: clamp(58px, 5vw, 68px);
        min-width: 56px !important;
        max-width: 70px;
        flex: 0 0 auto;
        font-size: 11px;
        padding: 0 12px 0 3px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        box-sizing: border-box !important;
    }

    .q-counter-box {
        padding: 0 3px !important;
        font-size: 10.5px;
        flex: 0 0 90px !important;
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        flex-shrink: 0 !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        box-sizing: border-box !important;
    }

    .jump-wrap {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        flex-shrink: 0 !important;
    }

    .jump-input {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        font-size: 11px;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 32px !important;
        box-sizing: border-box !important;
    }

    .btn-help-header,
    .header-bar .btn-help-header {
        padding: 0 !important;
        font-size: 12px;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
        box-sizing: border-box !important;
    }

    .question-text {
        font-size: 20px;
    }

    .kbc-inner-box {
        padding: 14px 28px;
        min-height: 65px;
    }

    .opt-letter {
        font-size: 16px;
        min-width: 30px;
    }

    .opt-text {
        font-size: 16px;
    }

    .option-inner {
        padding: 8px 16px;
        min-height: 44px;
    }
}

/* Very Narrow Windows / Mobile-like Width (<= 850px) */
@media (max-width: 850px) {
    .host-controls-dock {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 8px;
        padding: 6px 8px;
    }

    .host-controls-dock .control-group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        flex: initial;
    }

    .host-controls-dock .control-group:nth-child(2) {
        order: -1;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .host-btn.btn-eliminate {
        width: 100%;
        max-width: 320px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .student-contest-bar {
        padding: 5px 8px !important;
        bottom: calc(52px + 4px);
    }

    .contest-top-ribbon {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px 6px;
    }

    .contest-status-info {
        width: 100%;
        justify-content: center;
        flex: 1 1 100%;
        gap: 6px;
    }

    .contest-actions-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    .contest-action-btn {
        flex: 1 1 auto;
        min-width: 0 !important;
        padding: 5px 8px !important;
        font-size: 11.5px;
    }

    .header-bar {
        flex-wrap: wrap;
        row-gap: 3px;
        column-gap: 3px;
        padding-bottom: 2px;
    }

    .kbc-branding {
        gap: 3px;
        flex-shrink: 0 !important;
    }

    .kbc-logo-badge {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        aspect-ratio: 1 / 1 !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        font-size: 11px !important;
        border-radius: 50% !important;
        box-sizing: border-box !important;
    }

    .kbc-title h1 {
        font-size: 13px !important;
    }

    .chapter-selector-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        gap: 2px;
        padding: 2px 0;
    }

    .chapter-dropdown, .class-dropdown, .subject-dropdown, .book-dropdown, .type-dropdown, .custom-multiselect-wrap, .type-dropdown-btn {
        font-size: 10.5px !important;
        padding: 2px 14px 2px 3px !important;
        min-height: 30px !important;
        max-width: 100px;
    }

    .header-bar .host-btn {
        padding: 2px 4px !important;
        font-size: 10.5px !important;
        min-height: 30px !important;
    }

    .quiz-meta-info {
        order: 2;
        gap: 2px;
    }

    #btnTimerMode,
    .timer-dropdown {
        width: clamp(50px, 8vw, 68px) !important;
        font-size: 10.5px !important;
        padding: 0 12px 0 3px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        box-sizing: border-box !important;
    }

    .q-counter-box {
        padding: 0 2px !important;
        font-size: 10px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        flex: 0 0 84px !important;
        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    .jump-wrap {
        flex: 0 0 36px !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        flex-shrink: 0 !important;
    }

    .jump-input {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        font-size: 10.5px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        line-height: 30px !important;
        box-sizing: border-box !important;
    }

    .btn-help-header,
    .header-bar .btn-help-header {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        font-size: 12px !important;
        aspect-ratio: 1 / 1 !important;
        box-sizing: border-box !important;
    }
}

/* Extra Compact Screens / Mobile (<= 700px) */
@media (max-width: 700px) {
    .header-bar .host-btn .lbl-txt {
        display: none !important;
    }
    #btnManageChapters,
    #btnImportOneNote,
    #btnOpenTeachersHub,
    #btnOpenStudentsHub {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        padding: 0 !important;
    }
}

/* ============================================================
   Vertical Height Responsiveness (Laptops, Projectors, Split Screen)
   ============================================================ */
@media (max-height: 750px) {
    .stage-center {
        padding-top: clamp(24px, 5.5vh, 46px);
    }
    .host-controls-dock,
    .student-contest-bar,
    body.contest-top-view-active .student-contest-bar {
        padding: clamp(4px, 0.9vh, 8px) 14px !important;
        margin-top: clamp(2px, 0.5vh, 6px);
    }
    .host-btn,
    .contest-badge,
    .contest-action-btn {
        padding: 6px 10px;
        min-height: 45px;
        font-size: 12px;
    }
    .header-bar .host-btn,
    #btnManageChapters,
    #btnImportOneNote,
    #btnOpenTeachersHub,
    #btnOpenStudentsHub,
    .header-bar .chapter-dropdown,
    .header-bar .timer-dropdown,
    .header-bar .class-label,
    .header-bar .subject-label,
    .header-bar .chapter-label,
    .header-bar .type-label,
    .header-bar .timer-label,
    .header-bar .q-counter-box,
    .header-bar .jump-input,
    .header-bar .btn-help-header {
        font-size: 12px;
    }
    .header-bar .host-btn {
        min-height: 32px;
        padding: 4px 8px;
    }
    .host-btn.btn-eliminate {
        min-height: 45px;
        font-size: 13.8px;
        padding: 0 12px !important;
    }
    #btnTimerMode,
    .header-bar .timer-dropdown,
    .header-bar .q-counter-box {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: normal !important;
        box-sizing: border-box !important;
    }
    .header-bar .jump-input {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 32px !important;
        box-sizing: border-box !important;
    }
    .header-bar .btn-help-header {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
        box-sizing: border-box !important;
    }
}

@media (max-height: 620px) {
    .stage-center {
        padding-top: 4px;
    }
    .host-controls-dock,
    .student-contest-bar,
    body.contest-top-view-active .student-contest-bar {
        padding: 4px 8px !important;
        margin-top: 2px;
    }
    .host-btn,
    .contest-badge,
    .contest-action-btn {
        padding: 4px 8px;
        min-height: 40px;
        font-size: 11px;
    }
    .header-bar .host-btn,
    #btnManageChapters,
    #btnImportOneNote,
    #btnOpenTeachersHub,
    #btnOpenStudentsHub,
    .header-bar .chapter-dropdown,
    .header-bar .timer-dropdown,
    .header-bar .class-label,
    .header-bar .subject-label,
    .header-bar .chapter-label,
    .header-bar .type-label,
    .header-bar .timer-label,
    .header-bar .q-counter-box,
    .header-bar .jump-input,
    .header-bar .btn-help-header {
        font-size: 11px;
    }
    .header-bar .host-btn {
        min-height: 28px;
        padding: 3px 6px;
    }
    .host-btn.btn-eliminate {
        min-height: 40px;
        font-size: 12.7px;
        padding: 0 8px !important;
    }
    #btnTimerMode,
    .header-bar .timer-dropdown,
    .header-bar .q-counter-box {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        line-height: normal !important;
        box-sizing: border-box !important;
    }
    .header-bar .jump-input {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        line-height: 28px !important;
        box-sizing: border-box !important;
    }
    .header-bar .btn-help-header {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        aspect-ratio: 1 / 1 !important;
        box-sizing: border-box !important;
    }
}

/* ============================================================
   Classroom Student Contest & Live Leaderboard Mode Styles
   ============================================================ */

/* 1. Contest Bar Strip (Floating Overlay Docked Immediately Above Previous, Next & Timer Reset Dock) */
.student-contest-bar {
    position: absolute;
    bottom: calc(56px + clamp(6px, 1.1vh, 10px));
    left: clamp(8px, 1.2vw, 18px);
    right: clamp(8px, 1.2vw, 18px);
    width: auto;
    max-width: 100%;
    z-index: 100002 !important; /* Elevated above modal backdrops, sits cleanly behind host-controls-dock (z-index: 100005) */
    background: rgba(5, 19, 54, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 176, 65, 0.35) !important;
    background-clip: padding-box !important;
    border-radius: 12px;
    padding: clamp(6px, 1.1vh, 10px) clamp(8px, 1vw, 16px);
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.45), 0 -4px 20px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    transform: translateY(calc(100% + 8px)) translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
    will-change: transform, opacity;
}

.student-contest-bar.contest-bar-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

/* Ensure chips container in bottom bar is always hidden so ribbon height is 100% constant */
.student-contest-bar .student-chips-container {
    display: none !important;
}

/* Top View Mode: Bottom Contest Bar becomes a slim toolbar with clean unblocked options */
body.contest-top-view-active .student-chips-container {
    display: none !important;
}

body.contest-top-view-active .student-contest-bar {
    padding: clamp(6px, 1.1vh, 10px) clamp(8px, 1vw, 16px) !important;
    gap: 0;
    background: rgba(5, 19, 54, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(245, 176, 65, 0.35) !important;
    background-clip: padding-box !important;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.45), 0 -4px 20px rgba(0, 0, 0, 0.6) !important;
    z-index: 95 !important;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

body.contest-top-view-active .contest-top-ribbon {
    border-bottom: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
}

.btn-view-mode-toggle {
    background: linear-gradient(180deg, #1976d2 0%, #0d47a1 100%) !important;
    border-color: var(--cyan-accent) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.btn-view-mode-toggle:hover {
    background: linear-gradient(180deg, #2196f3 0%, #1565c0 100%) !important;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

.contest-top-ribbon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(4px, 0.7vw, 10px);
    border-bottom: none;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.contest-status-info {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.6vw, 10px);
    flex-wrap: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
}

.contest-badge {
    background: linear-gradient(180deg, #00c853 0%, #007e33 100%);
    border: 1px solid rgba(105, 240, 174, 0.50) !important;
    background-clip: padding-box !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: clamp(10.5px, 0.9vw, 13px);
    padding: clamp(5px, 0.9vh, 8px) clamp(5px, 0.55vw, 10px);
    min-height: clamp(36px, 4.8vh, 42px);
    border-radius: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: inset 0 1px 1px rgba(232, 245, 233, 0.18), 0 2px 5px rgba(0, 0, 0, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    flex: 0 1 auto;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.active-student-banner {
    color: var(--cyan-accent);
    font-size: clamp(12px, 1vw, 14.5px);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
    line-height: 1.2;
    display: inline-block;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.active-student-banner .active-student-name {
    color: #ffd54f;
    text-shadow: 0 0 10px rgba(255, 213, 79, 0.65);
    font-weight: 800;
}

.active-student-banner .active-student-stats {
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.active-student-banner .active-student-name,
.active-student-banner .active-student-stats,
.active-student-banner span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contest-actions-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(5px, 0.75vw, 9px);
    flex-wrap: nowrap;
    flex: 0 1 auto;
    min-width: 0;
}

.contest-action-btn {
    background: linear-gradient(180deg, #16367c 0%, #0c204d 100%);
    border: 1px solid rgba(245, 176, 65, 0.40) !important;
    background-clip: padding-box !important;
    color: #ffffff !important;
    min-height: clamp(36px, 4.8vh, 42px);
    padding: clamp(5px, 0.9vh, 8px) clamp(8px, 0.75vw, 13px) !important;
    border-radius: 10px;
    font-size: clamp(11.5px, 0.95vw, 13px);
    font-weight: 700;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    cursor: pointer;
    outline: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    gap: clamp(3px, 0.4vw, 6px);
    box-shadow: inset 0 1px 1px rgba(255, 240, 190, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-sizing: border-box;
    flex: 0 1 auto;
    width: auto;
    min-width: 0 !important;
    max-width: 100%;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.contest-action-btn span,
.contest-action-btn .btn-text-wrap {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: inline-block;
    vertical-align: middle;
}

.contest-action-btn .btn-icon-svg,
.contest-action-btn svg {
    flex-shrink: 0 !important;
}

.contest-action-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%);
    border: 1px solid #ffd54f !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 14px rgba(245, 176, 65, 0.55), 0 2px 6px rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

.contest-action-btn:active:not(:disabled) {
    transform: translateY(1.5px) scale(0.985) translateZ(0) !important;
    border-color: rgba(245, 176, 65, 0.85) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    outline: none !important;
}

.contest-action-btn.btn-podium-action {
    background: linear-gradient(180deg, #d49000 0%, #8a5800 100%);
    border: 1px solid #ffe082 !important;
    background-clip: padding-box !important;
    color: #ffffff;
    font-weight: 700;
    box-shadow: inset 0 1px 1px rgba(255, 248, 225, 0.35), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.45);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.contest-action-btn.btn-podium-action:hover:not(:disabled) {
    background: linear-gradient(180deg, #f5a623 0%, #a86b00 100%);
    border: 1px solid #ffffff !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 0 14px rgba(255, 213, 79, 0.7);
}

/* Roster Action Button in Live Contest Ribbon */
.contest-action-btn.btn-roster-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Friend's Help Action Button in Live Contest Ribbon */
.contest-action-btn.btn-friend-help {
    color: #ffffff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-left: clamp(8px, 0.9vw, 13px) !important;
    padding-right: clamp(8px, 0.9vw, 13px) !important;
}

/* 50-50 Lifeline Action Button in Live Contest Ribbon */
.contest-action-btn.btn-contest-50-50 {
    color: #ffd54f;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: clamp(8px, 0.9vw, 13px) !important;
    padding-right: clamp(8px, 0.9vw, 13px) !important;
}

.contest-action-btn.btn-contest-50-50.lifeline-used,
.contest-action-btn.btn-contest-50-50:disabled {
    background: rgba(40, 50, 70, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.contest-action-btn.btn-contest-50-50.lifeline-confirm-pulse,
.contest-action-btn.btn-friend-help.lifeline-confirm-pulse {
    background: linear-gradient(180deg, #d32f2f 0%, #8b0000 100%) !important;
    border-color: #ffd54f !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 6px rgba(255, 213, 79, 0.6), 0 0 6px rgba(255, 213, 79, 0.7), 0 0 8px rgba(239, 83, 80, 0.4) !important;
    animation: btn5050ConfirmPulse 0.9s infinite alternate;
    z-index: 2;
}

.contest-action-btn.btn-friend-help.lifeline-used,
.contest-action-btn.btn-friend-help:disabled {
    background: rgba(40, 50, 70, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.lifeline-5050-svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
}

.lifeline-used .lifeline-5050-svg {
    filter: grayscale(100%) opacity(0.45) !important;
}


.friend-help-btn-svg {
    width: 16px !important;
    height: 13px !important;
    filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.6));
    flex-shrink: 0;
}

.roster-top-svg {
    width: 16px !important;
    height: 13px !important;
    filter: drop-shadow(0 0 2px rgba(0, 230, 118, 0.5));
    flex-shrink: 0;
}

/* Universal Clean Transparent Vector Button Icons (Replaces default Emoji blue boxes) */
.btn-icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: none;
    transition: transform 0.12s ease;
}

.host-btn .btn-icon-svg,
.contest-action-btn .btn-icon-svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.host-btn:hover .btn-icon-svg,
.contest-action-btn:hover .btn-icon-svg {
    transform: scale(1.08);
}

.host-btn:active .btn-icon-svg,
.contest-action-btn:active .btn-icon-svg {
    transform: scale(0.96);
}

.btn-icon-svg.shuffle-svg {
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
}

.btn-icon-svg.next-track-svg {
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

.btn-icon-svg.reset-svg {
    filter: drop-shadow(0 0 3px rgba(255, 213, 79, 0.5));
}

.btn-icon-svg.timer-svg-icon {
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.5));
}

.btn-icon-svg.poll-svg {
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

/* In-Place Friend's Help Clock Aura (Pure Radiant Luminous Cyan Circle - Zero Black Margin) */
.timer-container.friend-help-timer-active {
    box-shadow: none !important;
    border: none !important;
}

.timer-container.friend-help-timer-active .timer-circle-wrap {
    border-radius: 50% !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Radiant Cyan Aura directly on the progress circle - exactly like the Golden Timer, 0 black margin! */
.timer-container.friend-help-timer-active .timer-progress-circle {
    stroke: url(#timerFriendHelpGrad) !important;
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.95)) drop-shadow(0 0 14px rgba(0, 229, 255, 0.6)) !important;
    transition: stroke 0.3s ease, stroke-dashoffset 1s linear;
}

.timer-container.friend-help-timer-active.timer-urgent .timer-progress-circle {
    stroke: url(#timerUrgentGrad) !important;
    filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.9)) !important;
}

/* Harmonize track guide and dial stroke with cyan */
.timer-container.friend-help-timer-active .timer-dial-face {
    stroke: rgba(0, 229, 255, 0.4) !important;
}

.timer-container.friend-help-timer-active .timer-bg-circle {
    stroke: rgba(0, 229, 255, 0.2) !important;
}

.timer-container.friend-help-timer-active .timer-mode-badge {
    border-color: #00e5ff !important;
    color: #00e5ff !important;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5) !important;
}

.timer-digits.friend-help-mode.timer-cyan {
    color: #00e5ff !important;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.9), 0 0 35px rgba(0, 229, 255, 0.6) !important;
}

.timer-digits.friend-help-mode.timer-gold {
    color: #ffd54f !important;
    text-shadow: 0 0 20px rgba(255, 213, 79, 0.9), 0 0 35px rgba(255, 213, 79, 0.6) !important;
}

.timer-digits.friend-help-mode.timer-red {
    color: #ff1744 !important;
    text-shadow: 0 0 24px rgba(255, 23, 68, 0.95), 0 0 40px rgba(255, 23, 68, 0.8) !important;
}

/* Active Done Discussion Button in Live Contest Ribbon */
.contest-action-btn.btn-friend-help.active-done {
    background: linear-gradient(135deg, #00c853 0%, #009624 100%) !important;
    border-color: #69f0ae !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.75) !important;
    animation: btnDonePulse 1.5s infinite ease-in-out;
}

@keyframes btnDonePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(0, 230, 118, 0.6); }
    50% { transform: scale(1.04); box-shadow: 0 0 22px rgba(0, 230, 118, 0.95); }
}

.friend-help-done-btn {
    background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%) !important;
    border: none !important;
    color: #041026 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    padding: 10px 24px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 18px rgba(0, 230, 118, 0.4) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.friend-help-done-btn:hover {
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 6px 22px rgba(0, 230, 118, 0.6) !important;
}

.friend-help-done-btn:active {
    transform: translateY(1px) scale(0.98) !important;
}

/* 2. Student Chips Container (2-Line Responsive Layout for Classroom Roster) */
.student-chips-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-height: 86px; /* Accommodates 2 roomy lines of student chips comfortably */
    overflow-y: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 176, 65, 0.5) transparent;
}

.student-chips-container::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
.student-chips-container::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 65, 0.4);
    border-radius: 4px;
}

/* 3. Student Chip */
.student-chip {
    background: rgba(12, 37, 94, 0.8);
    border: 1.5px solid rgba(245, 176, 65, 0.4);
    border-radius: 18px;
    min-height: 32px;
    padding: 4px 12px;
    color: #ffffff;
    font-size: clamp(12px, 0.95vw, 13.5px);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    transform: none !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    flex-shrink: 0;
    box-sizing: border-box;
}

.student-chip:hover {
    background: rgba(22, 60, 140, 0.9);
    border-color: var(--gold-glow);
    transform: none !important;
}

.student-chip.active-student-chip {
    background: rgba(22, 60, 140, 0.9) !important;
    border: 1.5px solid var(--gold-glow) !important;
    color: #ffffff;
    box-shadow: none !important;
    transform: none !important;
}

.student-chip.completed-student-chip {
    background: rgba(0, 77, 32, 0.6);
    border-color: rgba(105, 240, 174, 0.5);
}

.chip-progress-pill {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    color: var(--gold-glow);
    font-weight: 700;
}

.chip-score-pill {
    background: rgba(0, 230, 118, 0.25);
    border: 1px solid rgba(0, 230, 118, 0.5);
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 10.5px;
    color: #69f0ae;
    font-weight: 700;
}

/* 4. Roster Modal Uniform Grid & Aligned Cards */
.roster-list-wrap {
    background: rgba(4, 14, 38, 0.75);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.roster-sticky-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #0e275c 0%, #081a42 100%);
    border-bottom: 1px solid rgba(245, 176, 65, 0.35);
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    z-index: 5;
    box-sizing: border-box;
}

.roster-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.roster-batch-count-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
}

.roster-batch-count-label b {
    color: #ffffff;
    font-size: 13.5px;
    display: inline-block;
    min-width: 18px;
    font-variant-numeric: tabular-nums;
}

.roster-present-badge {
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 230, 118, 0.18);
    border: 1px solid rgba(0, 230, 118, 0.45);
    color: #69f0ae;
    padding: 0 10px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    border-radius: 12px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 104px;
    box-sizing: border-box !important;
    font-variant-numeric: tabular-nums;
    text-align: center !important;
    line-height: 1 !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.roster-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-roster-action {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    padding: 3px 9px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    box-sizing: border-box !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

#btnEditContestBatch {
    background: rgba(245, 176, 65, 0.18) !important;
    border: 1px solid rgba(245, 176, 65, 0.45) !important;
    color: var(--gold-glow) !important;
}

#btnEditContestBatch:hover {
    background: rgba(245, 176, 65, 0.35) !important;
    border-color: #ffd54f !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(245, 176, 65, 0.4) !important;
}

#btnRosterSelectAll {
    width: 102px !important;
    min-width: 102px !important;
    max-width: 102px !important;
    justify-content: center !important;
    background: rgba(0, 210, 255, 0.18) !important;
    border: 1px solid rgba(0, 210, 255, 0.45) !important;
    color: #00d2ff !important;
}

#btnRosterSelectAll:hover {
    background: rgba(0, 210, 255, 0.35) !important;
    border-color: #00d2ff !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.4) !important;
}

#btnRosterDeselectAll {
    width: 102px !important;
    min-width: 102px !important;
    max-width: 102px !important;
    justify-content: center !important;
    background: rgba(255, 82, 82, 0.18) !important;
    border: 1px solid rgba(255, 82, 82, 0.45) !important;
    color: #ff8a80 !important;
}

#btnRosterDeselectAll:hover {
    background: rgba(255, 82, 82, 0.35) !important;
    border-color: #ff5252 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.4) !important;
}

.roster-total-qs-pill {
    color: var(--gold-glow);
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 176, 65, 0.35);
    padding: 0 10px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    border-radius: 12px;
    margin-left: 2px;
    min-width: 152px;
    width: 152px;
    max-width: 152px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box !important;
    white-space: nowrap;
    flex-shrink: 0;
}

#contestCourseSelect,
#contestBatchSelect {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

#contestCourseSelect option,
#contestBatchSelect option {
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 6px 10px !important;
    background: #051336 !important;
    color: #ffffff !important;
}

.roster-grid-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
    min-height: 80px !important;
    max-height: 750px !important;
    height: 190px;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    width: 100% !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 176, 65, 0.4) transparent;
    resize: vertical;
}

.roster-grid-container::-webkit-scrollbar {
    width: 6px;
}

.roster-grid-container::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 65, 0.4);
    border-radius: 4px;
}

.roster-tag-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-radius: 7px !important;
    padding: 0 9px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    user-select: none !important;
    overflow: hidden !important;
}

.roster-tag-item.is-present {
    background: rgba(14, 43, 97, 0.75) !important;
    border: 1.5px solid rgba(0, 210, 255, 0.5) !important;
    color: #ffffff !important;
}

.roster-tag-item.is-present:hover {
    background: rgba(22, 60, 140, 0.95) !important;
    border-color: #00d2ff !important;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.35) !important;
}

.roster-tag-item.is-absent {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1.5px dashed rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

.roster-tag-item.is-absent:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.roster-student-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.roster-attendance-check {
    cursor: pointer !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    accent-color: #00d2ff !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.roster-student-num {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--gold-glow) !important;
    min-width: 24px !important;
    flex-shrink: 0 !important;
}

.roster-student-name {
    flex: 1 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
    line-height: 1.2 !important;
}

.roster-student-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.roster-qtarget-pill {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--gold-glow) !important;
    background: rgba(0, 0, 0, 0.45) !important;
    padding: 1px 7px !important;
    border-radius: 10px !important;
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
}

.btn-roster-del {
    background: none !important;
    border: none !important;
    color: #ff5252 !important;
    cursor: pointer !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    padding: 0 4px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

.btn-roster-del:hover {
    color: #ff1744 !important;
    background: rgba(255, 82, 82, 0.25) !important;
}

/* 5. Olympic 3D Winner Podium */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin: 16px 0 24px 0;
    padding: 10px;
    min-height: 220px;
}

.podium-pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
    text-align: center;
    transition: all 0.3s ease;
}

.podium-avatar {
    font-size: 38px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    margin-bottom: 4px;
}

.crown-icon {
    font-size: 32px;
    animation: floatCrown 1.8s infinite alternate ease-in-out;
    margin-bottom: -10px;
    filter: drop-shadow(0 0 8px #ffd700);
}

@keyframes floatCrown {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.podium-student-name {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 135px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.podium-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-glow);
    margin-bottom: 8px;
}

.podium-block {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
}

/* 1st Place - Center Tall Gold */
.podium-pillar.rank-1 .podium-block {
    height: 120px;
    background: linear-gradient(180deg, #ffd700 0%, #b8860b 60%, #5c4300 100%);
    border: 2px solid #fff59d;
    color: #3e2723;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

/* 2nd Place - Left Silver */
.podium-pillar.rank-2 .podium-block {
    height: 90px;
    background: linear-gradient(180deg, #e0e0e0 0%, #9e9e9e 60%, #424242 100%);
    border: 2px solid #f5f5f5;
    color: #212121;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(224, 224, 224, 0.4);
}

/* 3rd Place - Right Bronze */
.podium-pillar.rank-3 .podium-block {
    height: 68px;
    background: linear-gradient(180deg, #cd7f32 0%, #8b4513 60%, #3e1b00 100%);
    border: 2px solid #d7ccc8;
    color: #2e1200;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
}

/* 6. Scoreboard Table */
.scoreboard-table-wrap {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 176, 65, 0.4) transparent;
}

.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.scoreboard-table th {
    background: rgba(12, 37, 94, 0.9);
    color: var(--gold-glow);
    padding: 8px 12px;
    font-weight: 700;
    border-bottom: 2px solid rgba(245, 176, 65, 0.4);
    position: sticky;
    top: 0;
    z-index: 2;
}

.scoreboard-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.scoreboard-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.scoreboard-table tr:hover {
    background: rgba(0, 210, 255, 0.1);
}

.badge-rank-1 { color: #ffd700; font-weight: 800; }
.badge-rank-2 { color: #e0e0e0; font-weight: 800; }
.badge-rank-3 { color: #cd7f32; font-weight: 800; }

.status-badge-done {
    background: rgba(0, 230, 118, 0.2);
    border: 1px solid rgba(0, 230, 118, 0.5);
    color: #69f0ae;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.status-badge-pending {
    background: rgba(255, 167, 38, 0.2);
    border: 1px solid rgba(255, 167, 38, 0.5);
    color: #ffb74d;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

/* ============================================================
   Google Gemini Vision AI Scanned Textbook Extractor Styles
   ============================================================ */
.ai-dropzone:hover,
.ai-dropzone.dragover {
    border-color: var(--cyan-accent) !important;
    background: rgba(0, 40, 90, 0.55) !important;
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
}

#geminiKeyStatusBadge.active {
    background: rgba(0, 230, 118, 0.25) !important;
    color: #69f0ae !important;
    border: 1px solid rgba(0, 230, 118, 0.6) !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseExtract {
    0% { box-shadow: 0 0 10px rgba(0, 210, 255, 0.4); }
    100% { box-shadow: 0 0 24px rgba(0, 210, 255, 0.85); }
}

.ai-pulse-spinner {
    animation: spin 1s linear infinite, pulseExtract 1.5s ease-in-out infinite alternate;
}

/* ============================================================
   Class Re-ordering & Context Menu Styles
   ============================================================ */
.class-reorder-item {
    background: rgba(14, 30, 68, 0.85);
    border: 1px solid rgba(245, 176, 65, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.class-reorder-item:hover {
    border-color: var(--gold-glow);
    background: rgba(20, 45, 95, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.class-reorder-item.dragging {
    opacity: 0.45;
    border: 2px dashed var(--gold-glow);
    background: rgba(245, 176, 65, 0.15);
}

.class-reorder-item.drag-over {
    border-color: var(--cyan-accent);
    background: rgba(0, 210, 255, 0.22);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.5);
    transform: scale(1.01);
}

.class-reorder-handle {
    font-size: 18px;
    color: var(--gold-glow);
    margin-right: 10px;
    cursor: grab;
    display: inline-block;
    vertical-align: middle;
}

.class-reorder-index {
    font-size: 11px;
    font-weight: 800;
    color: var(--gold-glow);
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(245, 176, 65, 0.3);
    margin-right: 8px;
}

.class-reorder-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.class-reorder-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-context-menu {
    position: fixed;
    z-index: 100000;
    background: #0b1c3e;
    border: 1px solid rgba(245, 176, 65, 0.6);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    padding: 6px 0;
    min-width: 195px;
    animation: fadeIn 0.15s ease-out;
}

.context-menu-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s;
}

.context-menu-item:hover {
    background: rgba(0, 210, 255, 0.2);
    color: var(--gold-glow);
}

.context-menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 4px 0;
}

/* ============================================================
   Live Classroom / Cloud Clicker Extensions
   ============================================================ */
.live-room-btn {
    background: linear-gradient(180deg, #16367c 0%, #0c204d 100%) !important;
    border: 1px solid rgba(245, 176, 65, 0.40) !important;
    background-clip: padding-box !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: clamp(2px, 0.4vw, 5px);
    padding: clamp(8px, 1.3vh, 12px) clamp(5px, 0.5vw, 8px) !important;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(255, 240, 190, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    position: relative;
    box-sizing: border-box;
    overflow: hidden !important;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.live-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.live-room-btn:hover {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%) !important;
    border: 1px solid rgba(255, 213, 79, 0.8) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(245, 176, 65, 0.35) !important;
}

.live-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 8px #00e676;
    animation: livePulse 1.5s infinite;
    flex-shrink: 0;
}

@keyframes livePulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.student-count-pill,
.host-controls-dock .host-btn .student-count-pill,
#liveStudentCountBadge {
    width: 19px !important;
    height: 19px !important;
    min-width: 19px !important;
    min-height: 19px !important;
    max-width: 19px !important;
    max-height: 19px !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
    background: #00d2ff !important;
    color: #800000 !important; /* Premium Maroon */
    font-size: 11px !important;
    font-weight: 900 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-variant-numeric: tabular-nums lining-nums !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    text-align: center !important;
    line-height: 1 !important;
    text-shadow: none !important; /* Removes inherited blur/halo */
    filter: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
    padding: 0 !important;
    margin: 0 0 0 3px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.btn-poll-toggle {
    background: linear-gradient(180deg, #16367c 0%, #0c204d 100%) !important;
    border: 1px solid rgba(245, 176, 65, 0.40) !important;
    background-clip: padding-box !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(255, 240, 190, 0.18), inset 0 -1px 1px rgba(0, 0, 0, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center !important;
    width: 100%;
    min-width: 0;
    gap: clamp(3px, 0.4vw, 5px);
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
    box-sizing: border-box;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.btn-poll-toggle:hover {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%) !important;
    border: 1px solid rgba(255, 213, 79, 0.8) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(245, 176, 65, 0.35) !important;
    color: #ffffff !important;
}

.btn-poll-toggle.active {
    background: linear-gradient(180deg, #0088cc 0%, #005580 100%) !important;
    border: 1px solid rgba(0, 210, 255, 0.65) !important;
    background-clip: padding-box !important;
    box-shadow: inset 0 1px 1px rgba(224, 247, 250, 0.25), 0 0 10px rgba(0, 210, 255, 0.4) !important;
}

/* Live Response Meter under Timer */
.live-response-meter {
    margin-top: 6px;
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(4, 18, 56, 0.8);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 8px;
    padding: 4px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.meter-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #90caf9;
}

.meter-bar-label strong {
    color: #ffd54f;
    font-weight: 800;
}

.meter-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.meter-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #00e676);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* KBC Audience Poll Results Overlay */
.audience-poll-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 30%, #0d2050 0%, #050d24 100%);
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 35px rgba(245, 176, 65, 0.5), inset 0 0 15px rgba(0, 210, 255, 0.2);
    border-radius: 18px;
    padding: 18px 24px;
    z-index: 100000;
    width: 480px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: zoomInPoll 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomInPoll {
    from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.poll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 176, 65, 0.3);
    padding-bottom: 8px;
}

.poll-header h3 {
    font-size: 15px;
    color: var(--gold-glow);
    font-weight: 800;
}

.btn-poll-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.poll-bars-grid {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 180px;
    padding: 10px 0 0 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.poll-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 55px;
    height: 100%;
    justify-content: flex-end;
    gap: 6px;
}

.poll-percent {
    font-size: 13px;
    font-weight: 800;
    color: #ffd54f;
}

.poll-bar-wrapper {
    width: 38px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.poll-bar-fill {
    width: 100%;
    border-radius: 6px 6px 0 0;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-bar-fill.bar-a { background: linear-gradient(to top, #c62828, #e53935); }
.poll-bar-fill.bar-b { background: linear-gradient(to top, #1565c0, #1e88e5); }
.poll-bar-fill.bar-c { background: linear-gradient(to top, #f57f17, #fbc02d); }
.poll-bar-fill.bar-d { background: linear-gradient(to top, #2e7d32, #43a047); }

.poll-col.correct-col .poll-bar-fill {
    box-shadow: 0 0 16px #00e676;
    border: 1.5px solid #00e676;
}

.poll-opt-label {
    font-size: 15px;
    font-weight: 900;
    color: #ffffff;
}

.poll-vote-count {
    font-size: 10px;
    color: var(--text-dim);
}

.poll-footer {
    display: flex;
    justify-content: center;
}

/* ============================================================
   Smart Board Mode (Second Monitor / Projector): Grand Cinematic Poll View
   Extra Large, Readable from 30ft away in Classroom
   ============================================================ */
body.smartboard-mode .audience-poll-container,
#sbAudiencePollOverlay {
    width: min(860px, 86vw) !important;
    max-width: 900px !important;
    padding: clamp(20px, 3vh, 32px) clamp(24px, 3vw, 42px) !important;
    border-radius: 24px !important;
    border-width: 3px !important;
    box-shadow: 0 0 50px rgba(245, 176, 65, 0.6), 0 0 100px rgba(0, 0, 0, 0.9), inset 0 0 25px rgba(0, 210, 255, 0.3) !important;
    gap: 22px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

body.smartboard-mode .audience-poll-container .poll-header,
#sbAudiencePollOverlay .poll-header {
    padding-bottom: 14px !important;
    border-bottom: 2px solid rgba(245, 176, 65, 0.4) !important;
}

body.smartboard-mode .audience-poll-container .poll-header h3,
#sbAudiencePollOverlay .poll-header h3 {
    font-size: clamp(20px, 2.2vw, 26px) !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
}

body.smartboard-mode .audience-poll-container .btn-poll-close,
#sbAudiencePollOverlay .btn-poll-close {
    width: 36px !important;
    height: 36px !important;
    font-size: 24px !important;
    border-radius: 50% !important;
    background: rgba(255, 82, 82, 0.2) !important;
    border: 1.5px solid rgba(255, 82, 82, 0.6) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, background-color 0.15s ease !important;
}

body.smartboard-mode .audience-poll-container .btn-poll-close:hover,
#sbAudiencePollOverlay .btn-poll-close:hover {
    background: #d32f2f !important;
    transform: scale(1.1) !important;
}

body.smartboard-mode .audience-poll-container .poll-bars-grid,
#sbAudiencePollOverlay .poll-bars-grid {
    height: clamp(260px, 35vh, 340px) !important;
    padding: 16px 20px 0 20px !important;
    border-bottom: 3px solid rgba(255, 255, 255, 0.25) !important;
}

body.smartboard-mode .audience-poll-container .poll-col,
#sbAudiencePollOverlay .poll-col {
    width: clamp(80px, 9vw, 110px) !important;
    gap: 10px !important;
}

body.smartboard-mode .audience-poll-container .poll-percent,
#sbAudiencePollOverlay .poll-percent {
    font-size: clamp(20px, 2.2vw, 26px) !important;
    font-weight: 900 !important;
    color: #ffd54f !important;
    text-shadow: 0 0 12px rgba(255, 213, 79, 0.6) !important;
}

body.smartboard-mode .audience-poll-container .poll-bar-wrapper,
#sbAudiencePollOverlay .poll-bar-wrapper {
    width: clamp(56px, 6vw, 75px) !important;
    height: clamp(180px, 24vh, 230px) !important;
    border-radius: 10px 10px 0 0 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

body.smartboard-mode .audience-poll-container .poll-bar-fill,
#sbAudiencePollOverlay .poll-bar-fill {
    border-radius: 10px 10px 0 0 !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2) !important;
}

body.smartboard-mode .audience-poll-container .poll-opt-label,
#sbAudiencePollOverlay .poll-opt-label {
    font-size: clamp(22px, 2.5vw, 30px) !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
}

body.smartboard-mode .audience-poll-container .poll-vote-count,
#sbAudiencePollOverlay .poll-vote-count {
    font-size: clamp(13px, 1.3vw, 16px) !important;
    font-weight: 700 !important;
    color: #90caf9 !important;
}

/* ============================================================
   Question Bank & Chapter Proof Viewer Styles
   ============================================================ */
.qbank-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 10px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.qbank-stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.qbank-stat-total {
    background: rgba(245, 176, 65, 0.18);
    border-color: var(--gold-primary);
    color: var(--gold-glow);
}

.qbank-stat-mcq {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196f3;
    color: #90caf9;
}

.qbank-stat-ar {
    background: rgba(156, 39, 176, 0.22);
    border-color: #ba68c8;
    color: #e1bee7;
}

.qbank-stat-fib {
    background: rgba(255, 152, 0, 0.2);
    border-color: #ff9800;
    color: #ffe0b2;
}

.qbank-stat-tf {
    background: rgba(0, 230, 118, 0.2);
    border-color: #00e676;
    color: #a7f3d0;
}

.qbank-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.qbank-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.qbank-filter-btn {
    background: rgba(12, 37, 94, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qbank-filter-btn:hover {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.25);
}

.qbank-filter-btn.active {
    background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    border-color: #7dd3fc !important;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5) !important;
}

.qbank-search-input {
    background: rgba(2, 8, 25, 0.9);
    border: 1px solid rgba(245, 176, 65, 0.4);
    border-radius: 6px;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12.5px;
    min-width: 220px;
    outline: none;
    transition: border-color 0.2s ease;
}

.qbank-search-input:focus {
    border-color: var(--cyan-accent);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

.qbank-scroll-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(ellipse at top, rgba(10, 28, 70, 0.85) 0%, rgba(2, 8, 25, 0.95) 100%);
    border: 1.5px solid rgba(245, 176, 65, 0.35);
    border-radius: 12px;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.75), 0 4px 18px rgba(0, 0, 0, 0.4);
    scrollbar-width: auto;
    scrollbar-color: #f5b041 rgba(0, 10, 30, 0.65);
}

.qbank-scroll-list::-webkit-scrollbar {
    width: 12px;
}

.qbank-scroll-list::-webkit-scrollbar-track {
    background: rgba(0, 10, 30, 0.65);
    border-radius: 8px;
    border: 1px solid rgba(245, 176, 65, 0.2);
    margin: 2px 0;
}

.qbank-scroll-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffd54f 0%, #f5b041 50%, #b78103 100%);
    border-radius: 8px;
    border: 2px solid rgba(5, 16, 45, 0.9);
    box-shadow: 0 0 8px rgba(245, 176, 65, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.qbank-scroll-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #fff3b0 0%, #ffd54f 50%, #f5b041 100%);
    border-color: rgba(10, 25, 60, 0.95);
    box-shadow: 0 0 12px rgba(255, 213, 79, 0.85);
}

/* Professional Studio Up Arrow Button */
.qbank-scroll-list::-webkit-scrollbar-button:single-button:vertical:decrement {
    height: 14px;
    width: 12px;
    background-color: rgba(8, 20, 50, 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpolygon points='5,2 1,7 9,7' fill='%23ffd54f'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 8px 8px;
    border-radius: 6px 6px 0 0;
    border: 1px solid rgba(245, 176, 65, 0.35);
    transition: all 0.15s ease;
}

.qbank-scroll-list::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
    background-color: rgba(245, 176, 65, 0.25);
    border-color: #ffd54f;
    box-shadow: 0 0 6px rgba(255, 213, 79, 0.5);
}

/* Professional Studio Down Arrow Button */
.qbank-scroll-list::-webkit-scrollbar-button:single-button:vertical:increment {
    height: 14px;
    width: 12px;
    background-color: rgba(8, 20, 50, 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpolygon points='5,8 1,3 9,3' fill='%23ffd54f'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 8px 8px;
    border-radius: 0 0 6px 6px;
    border: 1px solid rgba(245, 176, 65, 0.35);
    transition: all 0.15s ease;
}

.qbank-scroll-list::-webkit-scrollbar-button:single-button:vertical:increment:hover {
    background-color: rgba(245, 176, 65, 0.25);
    border-color: #ffd54f;
    box-shadow: 0 0 6px rgba(255, 213, 79, 0.5);
}

.qbank-card {
    background: rgba(10, 25, 60, 0.92);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.qbank-card:hover {
    border-color: var(--gold-glow);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(245, 176, 65, 0.25);
}

.qbank-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    cursor: pointer;
    user-select: none;
}

.qbank-qnum-badge {
    font-size: 13px;
    font-weight: 800;
    color: var(--gold-glow);
}

.qbank-star-badge {
    color: #ffd700;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.qbank-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.qbank-nature-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qbank-nature-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.qbank-nature-theory {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border: 1px solid #0284c7;
}

.qbank-nature-practical {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid #ca8a04;
}

.qbank-type-mcq { background: rgba(33, 150, 243, 0.25); color: #64b5f6; border: 1px solid #1e88e5; }
.qbank-type-ar  { background: rgba(156, 39, 176, 0.25); color: #ce93d8; border: 1px solid #ab47bc; }
.qbank-type-fib { background: rgba(255, 152, 0, 0.25); color: #ffb74d; border: 1px solid #fb8c00; }
.qbank-type-tf  { background: rgba(0, 230, 118, 0.25); color: #69f0ae; border: 1px solid #00c853; }

/* Focus Mode for Question Bank */
#questionBankModal.focus-mode-active .modal-box {
    min-width: 480px;
    min-height: 350px;
    max-width: calc(100vw - 32px) !important;
    max-height: var(--qbank-focus-max-h, 82vh) !important;
    height: auto;
    padding: 14px 18px 24px 18px !important;
    position: relative;
    box-sizing: border-box !important;
    overflow: visible !important;
}

#questionBankModal.focus-mode-active #qBankSummaryGrid,
#questionBankModal.focus-mode-active .qbank-controls-bar,
#questionBankModal.focus-mode-active .modal-actions {
    display: none !important;
}

#questionBankModal.focus-mode-active #qBankFocusCountBadge {
    display: inline-block !important;
}

#questionBankModal.focus-mode-active .qbank-scroll-list {
    flex: 1 1 0px !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
}

/* 2-way corner resize handle for Question Bank Focus View & Chapter Manager Modal */
.qbank-resize-corner-handle,
.chapter-resize-corner-handle {
    display: none;
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    color: var(--gold-glow);
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 0.75;
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
    user-select: none;
    z-index: 100020;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#questionBankModal.focus-mode-active .qbank-resize-corner-handle,
#chapterModal .chapter-resize-corner-handle,
#importModal .chapter-resize-corner-handle,
#classReorderModal .chapter-resize-corner-handle,
#subjectManagerModal .chapter-resize-corner-handle,
#bookManagerModal .chapter-resize-corner-handle,
#chapterReorderModal .chapter-resize-corner-handle {
    display: flex;
}

.qbank-resize-corner-handle:hover,
.qbank-resize-corner-handle:active,
.chapter-resize-corner-handle:hover,
.chapter-resize-corner-handle:active {
    opacity: 1;
    color: #ffffff;
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px rgba(255, 213, 79, 0.9));
}

.qbank-card-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
    border-radius: 4px;
    padding: 3px 6px;
    margin: 2px -6px;
}

.qbank-card-text:hover {
    color: #ffd54f;
    background: rgba(255, 213, 79, 0.1);
}

.btn-mini-q-edit {
    background: rgba(255, 213, 79, 0.12);
    border: 1px solid rgba(255, 213, 79, 0.45);
    color: #ffd54f;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini-q-edit:hover {
    background: rgba(255, 213, 79, 0.25);
    border-color: #ffd54f;
    transform: translateY(-1px);
}

.qbank-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    margin-top: 4px;
}

.qbank-opt-item {
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cfd8dc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qbank-opt-item.is-correct {
    background: rgba(0, 230, 118, 0.18);
    border-color: #00e676;
    color: #00e676;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.3);
}

.btn-mini-launch {
    background: linear-gradient(180deg, #16367c 0%, #0c204d 100%);
    border: 1px solid var(--gold-primary);
    color: var(--gold-glow);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-mini-launch:hover {
    background: #ffd54f;
    color: #051336;
}

/* Mini Lock/Unlock Toggle in Question Bank Modal */
.btn-mini-lock-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-mini-lock-toggle:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fca5a5;
}

.btn-mini-lock-toggle.is-locked {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fca5a5;
}

.btn-mini-lock-toggle.is-locked:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    color: #86efac;
}

.qbank-card.is-locked {
    opacity: 0.72;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(30, 15, 25, 0.6);
}

/* Book Badge in Question Bank & Cards */
.qbank-book-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(192, 132, 252, 0.22);
    color: #e9d5ff;
    border: 1px solid #c084fc;
}

.qbank-origin-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.2px;
}
.qbank-origin-master {
    background: rgba(255, 213, 79, 0.16);
    color: #ffd54f;
    border: 1px solid rgba(255, 213, 79, 0.45);
}
.qbank-origin-custom {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.55);
}
.qbank-card.is-custom-origin {
    border-left: 3px solid #38bdf8 !important;
}

.qbank-stat-book {
    background: rgba(192, 132, 252, 0.2);
    border-color: #c084fc;
    color: #e9d5ff;
}

/* Subject Manager Modal Row */
.subject-manager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(12, 37, 94, 0.6);
    border: 1px solid rgba(245, 176, 65, 0.35);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #ffffff;
    transition: all 0.2s ease;
}

.subject-manager-row:hover {
    border-color: #ffd54f;
    background: rgba(18, 52, 128, 0.85);
    box-shadow: 0 0 10px rgba(245, 176, 65, 0.25);
}

.subject-manager-row .subject-name-text {
    font-weight: 700;
    color: #ffd54f;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Class, Subject & Source Bar Specific Select Styling */
#modalClassBarContainer select,
#chapterModal select.chapter-dropdown {
    transform: none !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 140px !important;
    max-width: 220px !important;
    height: 32px !important;
    background-color: #071739 !important;
    color: #ffffff !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    outline: none !important;
}

#modalClassBarContainer select option,
#chapterModal select.chapter-dropdown option {
    background-color: #051336 !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

/* Book Manager Modal Row */
.book-manager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(12, 37, 94, 0.6);
    border: 1px solid rgba(192, 132, 252, 0.35);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #ffffff;
    transition: all 0.2s ease;
}

.book-manager-row:hover {
    border-color: #c084fc;
    background: rgba(18, 52, 128, 0.85);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
}

.book-manager-row .book-name-text {
    font-weight: 700;
    color: #e9d5ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chapter-book-pill {
    background: rgba(192, 132, 252, 0.18);
    border: 1px solid rgba(192, 132, 252, 0.5);
    color: #e9d5ff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    margin-left: 6px;
    white-space: nowrap;
}

/* Chapter Manager Modal Row */
.chapter-manager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(12, 37, 94, 0.6);
    border: 1px solid rgba(245, 176, 65, 0.35);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #ffffff;
    transition: all 0.2s ease;
}

.chapter-manager-row:hover {
    border-color: var(--gold-glow);
    background: rgba(18, 52, 128, 0.85);
    box-shadow: 0 0 10px rgba(245, 176, 65, 0.25);
}

.chapter-drag-handle,
.subject-drag-handle,
.book-drag-handle {
    cursor: grab;
    cursor: -webkit-grab;
    font-size: 16px;
    color: var(--text-dim);
    user-select: none;
    -webkit-user-select: none;
    padding: 0 4px;
    transition: color 0.2s, transform 0.15s;
    touch-action: none;
}

.chapter-drag-handle:hover,
.subject-drag-handle:hover,
.book-drag-handle:hover {
    color: var(--gold-glow);
    transform: scale(1.15);
}

.chapter-drag-handle:active,
.subject-drag-handle:active,
.book-drag-handle:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

/* Quick Up/Down Reorder Buttons */
.btn-row-move-up,
.btn-row-move-down {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 213, 79, 0.35);
    color: var(--gold-glow);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    user-select: none;
}
.btn-row-move-up:hover:not(:disabled),
.btn-row-move-down:hover:not(:disabled) {
    background: var(--gold-primary);
    color: #000000;
    border-color: var(--gold-primary);
    transform: scale(1.08);
}
.btn-row-move-up:disabled,
.btn-row-move-down:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-dim);
}

/* ============================================================
   Smart Board Viewport & Display Styles (ViewSonic Dual-Screen)
   ============================================================ */
body.smartboard-mode {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background-color: var(--bg-dark);
}

body.smartboard-mode .smartboard-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    padding: 0 clamp(16px, 2vw, 32px);
    overflow: hidden;
}

body.smartboard-mode .stage-center {
    flex: 0 1 auto !important;
    margin: 0 auto !important;
    padding-top: clamp(50px, 6.5vh, 75px) !important;
    padding-bottom: 0 !important;
    justify-content: flex-start !important;
    box-sizing: border-box;
}

/* Match the exact spacious margin below timer & badge to question box as seen on host screen */
body.smartboard-mode #timerBox {
    margin-bottom: clamp(14px, 2vh, 22px) !important;
}

/* Mode Badge & Remote Connect Button on Smartboard - Option A: Hidden */
.sb-mode-badge {
    display: none !important;
}

.sb-mode-badge:hover {
    background: rgba(20, 55, 135, 0.95);
    border-color: #ffd54f;
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(255, 213, 79, 0.6);
}

.sb-mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 8px #00e676;
}

/* Subtle Floating Fullscreen button on Smartboard screen */
.sb-fs-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(12, 37, 94, 0.45);
    border: 1.5px solid rgba(245, 176, 65, 0.45);
    color: #ffd54f;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0.35;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   Smart Board: Viewport Dead-Center & Full Intended Size
   Keeps the original, generous Smart Board scale completely intact
   ============================================================ */
body.smartboard-mode .student-turn-completed-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(560px, 92vw) !important;
    max-width: 560px !important;
    max-height: 88vh !important;
    z-index: 99999 !important;
    box-sizing: border-box !important;
}

body.smartboard-mode .turn-completed-popup-card {
    padding: clamp(18px, 2.8vh, 26px) clamp(20px, 2.8vw, 34px) clamp(24px, 3.8vh, 36px) clamp(20px, 2.8vw, 34px) !important;
    border-radius: 22px !important;
    box-sizing: border-box !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

body.smartboard-mode .turn-completed-trophy {
    font-size: clamp(28px, 3.6vh, 38px) !important;
    margin-bottom: 12px !important;
}

body.smartboard-mode .turn-completed-badge {
    font-size: clamp(12px, 1.1vw, 13.5px) !important;
    padding: 7px 18px 6px 18px !important;
    margin-bottom: 16px !important;
}

body.smartboard-mode .turn-completed-name {
    font-size: clamp(24px, 3vw, 34px) !important;
    margin-bottom: 10px !important;
}

body.smartboard-mode .turn-completed-stats-line {
    font-size: clamp(13px, 1.2vw, 15.5px) !important;
    margin-bottom: 18px !important;
}

body.smartboard-mode .turn-completed-scorecard {
    gap: clamp(6px, 0.8vw, 10px) !important;
}

body.smartboard-mode .turn-completed-scorecard .score-pill {
    padding: 5px 12px !important;
    font-size: clamp(12px, 1.05vw, 14px) !important;
    border-radius: 10px !important;
}

/* ============================================================
   Student Quota / Turn Completed Dramatic Center Stage Popup
   Sleek, Justified, 15-20% Compact Design - Zero-Shaking / Zero Student Bar Push
   ============================================================ */
.student-turn-completed-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 500;
    width: min(480px, 88vw);
    max-width: 480px;
    max-height: 82vh;
    pointer-events: auto;
    box-sizing: border-box;
    animation: popupPopZoom 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes popupPopZoom {
    0% {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.85);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0px);
    }
}

.turn-completed-popup-card {
    /* Multi-layered Deep Midnight Cyan Studio Backdrop - Crisp & Crystal Clear */
    background: radial-gradient(ellipse at center, #002c40 0%, #001724 60%, #000a12 100%);
    /* Glowing Brilliant Cyan Border matching mobile accuracy style */
    border: 2.5px solid #00e5ff;
    border-radius: 20px;
    padding: clamp(16px, 2.2vh, 22px) clamp(16px, 2vw, 24px) clamp(22px, 3.2vh, 30px) clamp(16px, 2vw, 24px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Rich, Stable & Luxurious Neon Cyan Glow */
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.6), 
                0 0 40px rgba(0, 180, 255, 0.3), 
                inset 0 0 15px rgba(0, 229, 255, 0.15),
                0 12px 30px rgba(0, 0, 0, 0.9);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    animation: popupBorderBreathe 4.5s infinite alternate ease-in-out;
}

@keyframes popupBorderBreathe {
    0% {
        border-color: #00e5ff;
        box-shadow: 0 0 20px rgba(0, 229, 255, 0.55), 
                    0 0 38px rgba(0, 180, 255, 0.28), 
                    inset 0 0 14px rgba(0, 229, 255, 0.14),
                    0 12px 30px rgba(0, 0, 0, 0.9);
    }
    100% {
        border-color: #5cf2ff;
        box-shadow: 0 0 28px rgba(0, 229, 255, 0.7), 
                    0 0 50px rgba(0, 180, 255, 0.38), 
                    inset 0 0 18px rgba(0, 229, 255, 0.2),
                    0 12px 30px rgba(0, 0, 0, 0.9);
    }
}

.turn-completed-trophy {
    font-size: clamp(24px, 3vh, 32px);
    margin: 0 auto 10px auto;
    display: block;
    width: auto;
    text-align: center;
    animation: pulseScaleStar 2s infinite ease-in-out;
    filter: drop-shadow(0 0 12px rgba(255, 213, 79, 0.85));
}

@keyframes pulseScaleStar {
    0%, 100% {
        transform: scale(0.92);
    }
    50% {
        transform: scale(1.15);
    }
}

.turn-completed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    background: linear-gradient(135deg, rgba(0, 36, 56, 0.95) 0%, rgba(0, 18, 30, 0.98) 100%);
    color: #ffd54f;
    border: 1.5px solid #ffd54f;
    font-size: clamp(10.5px, 0.95vw, 12px);
    font-weight: 900;
    letter-spacing: 1.6px;
    padding: 5px 15px 4px 15px;
    border-radius: 16px;
    margin: 0 auto 13px auto;
    box-shadow: 0 0 14px rgba(255, 213, 79, 0.45), 
                inset 0 0 8px rgba(255, 213, 79, 0.18), 
                0 4px 10px rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    text-shadow: 0 0 6px rgba(255, 213, 79, 0.8);
}

.turn-completed-name {
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 900;
    color: #00e5ff;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    /* Soft, pleasant accuracy cyan glow matching student mobile scorecard */
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.7),
                 0 0 20px rgba(0, 210, 255, 0.35),
                 0 2px 6px rgba(0, 0, 0, 0.85);
}

.turn-completed-stats-line {
    font-size: clamp(12px, 1.05vw, 13.5px);
    font-weight: 800;
    color: #e0f7fa;
    margin-bottom: 16px;
    letter-spacing: 0.4px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.turn-completed-scorecard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(5px, 0.7vw, 8px);
    flex-wrap: wrap;
    margin-bottom: 0;
}

.turn-completed-scorecard .score-pill {
    padding: 4px 10px;
    border-radius: 9px;
    font-size: clamp(11px, 0.92vw, 12.5px);
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.score-pill.pill-asked {
    background: rgba(33, 150, 243, 0.25);
    border: 1.5px solid #2196f3;
    color: #90caf9;
}

.score-pill.pill-correct {
    background: rgba(0, 230, 118, 0.25);
    border: 1.5px solid #00e676;
    color: #69f0ae;
}

.score-pill .tick-svg {
    display: inline-block;
    vertical-align: -2.5px;
    margin-right: 4px;
    filter: drop-shadow(0 0 4px #00ff88);
}

.score-pill.pill-wrong {
    background: rgba(255, 23, 68, 0.25);
    border: 1.5px solid #ff1744;
    color: #ff8a80;
}

.score-pill.pill-acc {
    background: rgba(0, 210, 255, 0.22);
    border: 1.5px solid #00e5ff;
    color: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

/* ============================================================
   👑 Host Laptop Only: Standby Next Student Prompt in Option Area
   (NEVER appears on Smart Board/Projector)
   ============================================================ */
.host-next-student-banner {
    position: absolute;
    top: calc(clamp(140px, 18vh, 180px) + (100% - clamp(140px, 18vh, 180px)) * 0.38);
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(580px, 86vw);
    max-width: 580px;
    margin: 0 auto;
    box-sizing: border-box;
    animation: bannerPopZoom 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    z-index: 100;
}

@keyframes bannerPopZoom {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.host-next-student-card {
    position: relative;
    background: linear-gradient(135deg, rgba(74, 4, 23, 0.96) 0%, rgba(136, 14, 79, 0.95) 50%, rgba(45, 0, 15, 0.98) 100%);
    border: 2px solid #ff4081;
    border-radius: 20px;
    padding: clamp(20px, 3vh, 30px) clamp(22px, 3vw, 36px);
    text-align: center;
    box-shadow: 0 0 25px rgba(255, 64, 129, 0.45),
                inset 0 0 16px rgba(255, 64, 129, 0.2),
                0 10px 25px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.btn-banner-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 64, 129, 0.45);
    background: rgba(0, 0, 0, 0.45);
    color: #ff80ab;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
}

.btn-banner-close:hover {
    background: rgba(255, 64, 129, 0.35);
    color: #ffffff;
    border-color: #ff4081;
    transform: scale(1.08);
}

.next-student-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid #ffd54f;
    color: #ffd54f;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.next-student-headline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ffffff;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 900;
    letter-spacing: 1.2px;
    text-shadow: 0 0 12px rgba(255, 64, 129, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9);
    margin-bottom: 22px;
}

.next-student-headline .next-student-icon {
    font-size: clamp(24px, 2.5vw, 30px);
    animation: handPointBounce 1.2s infinite alternate ease-in-out;
}

@keyframes handPointBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(5px); }
}

.next-student-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.host-banner-btn {
    border: none;
    border-radius: 12px;
    padding: clamp(10px, 1.4vh, 13px) clamp(20px, 2vw, 28px);
    min-height: clamp(48px, 6vh, 52px);
    font-size: clamp(12px, 1.15vw, 14.5px);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

.host-banner-btn:hover {
    transform: translateY(-2px);
}

.btn-banner-next {
    background: linear-gradient(180deg, #00e5ff 0%, #0097a7 100%);
    color: #001f29;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.btn-banner-next:hover {
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
}

.btn-banner-random {
    background: linear-gradient(180deg, #ffd54f 0%, #ff8f00 100%);
    color: #211500;
    box-shadow: 0 0 12px rgba(255, 213, 79, 0.5);
}

.btn-banner-random:hover {
    box-shadow: 0 0 20px rgba(255, 213, 79, 0.8);
}

body.smartboard-mode .host-next-student-banner,
body.smartboard-mode .host-reset-bank-banner {
    display: none !important;
}

/* ============================================================
   🔄 Host Laptop Only: Premium Question Bank Reset Confirmation Modal
   ============================================================ */
.host-reset-bank-banner {
    z-index: 105;
}

.host-reset-bank-card {
    background: linear-gradient(135deg, rgba(8, 25, 55, 0.98) 0%, rgba(15, 34, 75, 0.96) 50%, rgba(4, 15, 36, 0.99) 100%);
    border: 2px solid #00e5ff;
    border-radius: 20px;
    padding: clamp(20px, 3vh, 30px) clamp(22px, 3vw, 36px);
    text-align: center;
    box-shadow: 0 0 32px rgba(0, 229, 255, 0.45),
                inset 0 0 18px rgba(0, 229, 255, 0.2),
                0 12px 30px rgba(0, 0, 0, 0.9);
}

.reset-bank-badge {
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid #00e5ff;
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.reset-bank-headline {
    color: #ffffff;
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.75), 0 2px 4px rgba(0, 0, 0, 0.9);
    margin-bottom: 12px;
}

.reset-bank-message {
    color: #cbd5e1;
    font-size: clamp(13px, 1.25vw, 15.5px);
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 22px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.reset-bank-message b {
    color: #ffd54f;
    font-weight: 700;
}

.reset-count-gold {
    color: #ffd54f;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 213, 79, 0.6);
}

.reset-next-action-maroon {
    color: #ff3366;
    font-weight: 700;
    font-size: 1em;
    text-shadow: 0 0 12px rgba(255, 51, 102, 0.45);
    display: inline-block;
    margin-top: 6px;
}

.reset-bank-actions {
    gap: 16px;
}

.btn-banner-reset-confirm {
    background: linear-gradient(180deg, #00e5ff 0%, #0097a7 100%);
    color: #001f29;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.55);
    white-space: nowrap;
}

.btn-banner-reset-confirm:hover {
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.9);
}

.btn-banner-reset-choose-chapter {
    background: linear-gradient(180deg, #ffd54f 0%, #f59e0b 100%);
    color: #1e1b07;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(255, 213, 79, 0.55);
    border: none;
    white-space: nowrap;
}

.btn-banner-reset-choose-chapter:hover {
    background: linear-gradient(180deg, #ffe082 0%, #fbbf24 100%);
    box-shadow: 0 0 24px rgba(255, 213, 79, 0.9);
    transform: translateY(-2px);
}

.btn-banner-reset-cancel {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.btn-banner-reset-cancel:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   🌓 50-50 Lifeline Button & Student Roster Badges
   ============================================================ */
.host-btn.btn-50-50 {
    font-weight: 700;
    border-radius: 10px;
    transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.host-btn.btn-50-50.lifeline-available {
    background: linear-gradient(180deg, #1b387a 0%, #0d2252 100%);
    border: 1px solid rgba(255, 213, 79, 0.45) !important;
    background-clip: padding-box !important;
    color: #ffd54f;
    box-shadow: inset 0 1px 1px rgba(255, 242, 163, 0.18), 0 2px 5px rgba(0, 0, 0, 0.5);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.host-btn.btn-50-50.lifeline-available:hover {
    background: linear-gradient(180deg, #274b9b 0%, #15326f 100%);
    border: 1px solid rgba(255, 213, 79, 0.85) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(255, 213, 79, 0.4);
}

.host-btn.btn-50-50.lifeline-used {
    background: rgba(20, 25, 40, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.host-btn.btn-50-50.lifeline-confirm-pulse {
    background: linear-gradient(180deg, #d32f2f 0%, #8b0000 100%) !important;
    border-color: #ffd54f !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 6px rgba(255, 213, 79, 0.6), 0 0 6px rgba(255, 213, 79, 0.7), 0 0 8px rgba(239, 83, 80, 0.4) !important;
    animation: btn5050ConfirmPulse 0.9s infinite alternate;
    z-index: 2;
}

@keyframes btn5050ConfirmPulse {
    0% {
        transform: scale(1);
        box-shadow: inset 0 0 4px rgba(255, 213, 79, 0.4), 0 0 4px rgba(255, 213, 79, 0.5), 0 0 6px rgba(239, 83, 80, 0.3);
        border-color: #ffd54f;
    }
    100% {
        transform: scale(1);
        box-shadow: inset 0 0 10px rgba(255, 213, 79, 0.85), 0 0 7px rgba(255, 213, 79, 0.85), 0 0 10px rgba(239, 83, 80, 0.6);
        border-color: #ffffff;
    }
}

/* Lifeline circular badges on student cards & chips (Perfect 18px circles matching rectangular score badge height) */
.chip-lifeline-badge,
.wing-badge-lifeline {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 1.5px;
    line-height: 1;
    overflow: hidden;
    transition: all 0.2s ease;
}

.chip-lifeline-badge.ready,
.wing-badge-lifeline.ready {
    background: radial-gradient(circle, rgba(14, 116, 144, 0.45) 0%, rgba(8, 47, 73, 0.65) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.55) !important;
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.35) !important;
}

.chip-lifeline-badge.ready:hover,
.wing-badge-lifeline.ready:hover {
    border-color: #ffd54f !important;
    box-shadow: 0 0 8px rgba(255, 213, 79, 0.6) !important;
    transform: scale(1.08);
}

.chip-lifeline-badge.used,
.wing-badge-lifeline.used {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.45);
    font-size: 9.5px;
}

/* Symmetrical balancing for 50-50 badge inside student cards */
.wing-badge-lifeline.badge-5050,
.chip-lifeline-badge.badge-5050 {
    margin-left: 3.5px !important;
    margin-right: 1px !important;
}

.wing-badge-lifeline.badge-friend-help,
.chip-lifeline-badge.badge-friend-help {
    margin-left: 1px !important;
    margin-right: 1.5px !important;
}

/* ============================================================
   GLOBAL SMART DELAYED TOOLTIP STYLING
   ============================================================ */
.kbc-global-tooltip {
    position: fixed;
    z-index: 99999999;
    pointer-events: none;
    background: rgba(10, 22, 54, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(245, 176, 65, 0.55);
    border-radius: 6px;
    padding: 6px 11px;
    color: #f8fafc;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    max-width: 300px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), 0 0 10px rgba(245, 176, 65, 0.2);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    word-break: break-word;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.kbc-global-tooltip.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Studio Settings & Help Hub Modal Styles
   ============================================================ */
.settings-modal-box {
    border: 1.5px solid rgba(245, 176, 65, 0.6) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(245, 176, 65, 0.25) !important;
}

.settings-nav-bar {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 12px;
    gap: 6px;
}

.settings-nav-tab {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.settings-nav-tab:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.settings-nav-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(245, 176, 65, 0.3) 0%, rgba(212, 143, 24, 0.15) 100%);
    border-color: rgba(245, 176, 65, 0.65);
    box-shadow: 0 0 12px rgba(245, 176, 65, 0.3);
    font-weight: 700;
}

.settings-tab-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    max-height: calc(88vh - 170px);
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
    animation: fadeInTab 0.2s ease-in-out;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.sound-master-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 10px;
}

.sound-master-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sound-master-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gold-glow);
    white-space: nowrap;
}

.sound-volume-slider {
    width: 100%;
    cursor: pointer;
    accent-color: var(--gold-glow);
}

.sound-section-note {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--gold-glow);
    border-radius: 4px;
}

.sound-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
}

.sound-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.sound-card:hover {
    border-color: rgba(245, 176, 65, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.sound-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-card-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sound-card-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 2px 0;
}

.sound-card-info p {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
}

.sound-card-ctrls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sound-select {
    flex: 1;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    font-size: 12.5px !important;
    padding: 4px 8px !important;
}

.btn-sound-preview {
    padding: 6px 14px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    border: 1.5px solid #38bdf8;
    border-radius: 6px;
    color: #38bdf8;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sound-preview:hover {
    background: #38bdf8;
    color: #0f172a;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.btn-sound-preview.playing {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #000;
    animation: soundPulse 0.7s infinite alternate ease-in-out;
}

@keyframes soundPulse {
    from { transform: scale(1); box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
    to { transform: scale(1.05); box-shadow: 0 0 14px rgba(245, 158, 11, 0.8); }
}

.shortcuts-intro-note {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
    padding: 6px 12px;
    background: rgba(56, 189, 248, 0.1);
    border-left: 3px solid #38bdf8;
    border-radius: 4px;
}

.shortcuts-table-wrap {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.shortcuts-grid-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcuts-grid-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.shortcuts-grid-table tr:last-child {
    border-bottom: none;
}

.shortcuts-grid-table tr:hover {
    background: rgba(255, 215, 0, 0.08);
}

.shortcuts-grid-table td {
    padding: 7px 12px;
    font-size: 13px;
    vertical-align: middle;
}

.shortcut-key-col {
    width: 150px;
    white-space: nowrap;
}

.shortcut-desc-col {
    color: #e2e8f0;
    line-height: 1.4;
}

.support-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(245, 176, 65, 0.15) 0%, rgba(30, 58, 95, 0.4) 100%);
    border: 1.5px solid rgba(245, 176, 65, 0.4);
    border-radius: 10px;
}

.support-badge-icon {
    font-size: 32px;
}

.support-banner-text h3 {
    margin: 0 0 3px 0;
    font-size: 16px;
    color: var(--gold-glow);
    font-weight: 800;
}

.support-banner-text p {
    margin: 0;
    font-size: 12px;
    color: #cbd5e1;
}

.support-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.support-detail-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    align-items: flex-start;
}

.support-icon-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.support-item-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gold-glow);
    margin-bottom: 2px;
}

.support-link {
    font-size: 13.5px;
    font-weight: 700;
    color: #38bdf8;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 2px;
    transition: color 0.15s ease;
}

.support-link:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.support-item-sub {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

.support-item-text {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
}

.settings-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-save-status {
    font-size: 12px;
    font-weight: 600;
    color: #00e676;
    transition: opacity 0.3s ease;
}

/* ============================================================
   Quick Chapter Selection Modal
   ============================================================ */
#chapterQuickSelectModal,
body:not(.smartboard-mode) #chapterQuickSelectModal {
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding: 16px !important;
}

.quick-chapter-select-box {
    width: 90% !important;
    max-width: 540px !important;
    margin: auto !important;
    max-height: 85vh !important;
    overflow-y: visible !important;
    padding: 18px 22px 16px 22px !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #091c49 0%, #051336 100%) !important;
    border: 2px solid var(--gold-primary) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(245, 176, 65, 0.35) !important;
    animation: quickSelectModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes quickSelectModalPop {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.quick-chapter-select-body {
    margin-top: 4px;
}

.quick-chapter-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 4px 2px 1px;
}

.quick-chapter-list::-webkit-scrollbar {
    width: 6px;
}

.quick-chapter-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.quick-chapter-list::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 65, 0.4);
    border-radius: 3px;
}

.quick-chapter-list::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 176, 65, 0.7);
}

.quick-chapter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(16, 42, 113, 0.55) 0%, rgba(8, 24, 68, 0.75) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-left: 4px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    gap: 12px;
    transform: none !important;
}

.quick-chapter-row:hover {
    background: linear-gradient(180deg, #1e4599 0%, #112e70 100%);
    border-color: rgba(56, 189, 248, 0.75);
    border-left-color: rgba(56, 189, 248, 0.5);
    transform: none !important;
    box-shadow: 0 0 10px rgba(33, 75, 168, 0.45);
}

.quick-chapter-row.active {
    background: linear-gradient(180deg, #214ba8 0%, #13337a 100%) !important;
    border-color: rgba(56, 189, 248, 0.85) !important;
    border-left: 4px solid #38bdf8 !important;
    transform: none !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 14px rgba(56, 189, 248, 0.45) !important;
}

.quick-chapter-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.quick-chapter-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-chapter-badge {
    font-size: 11px;
    font-weight: 700;
    color: #7dd3fc;
    background: rgba(8, 24, 68, 0.7);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-quick-load-ch {
    background: linear-gradient(180deg, #c2185b 0%, #880e4f 100%);
    border: 1px solid rgba(255, 64, 129, 0.75);
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 800;
    padding: 5px 15px;
    border-radius: 7px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.btn-quick-load-ch:hover {
    background: linear-gradient(180deg, #e91e63 0%, #ad1457 100%);
    border-color: #ff80ab;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 0 14px rgba(255, 64, 129, 0.75);
    transform: none !important;
}

.btn-quick-load-ch:active {
    transform: none !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.quick-chapter-empty {
    padding: 20px;
    color: var(--text-dim);
    text-align: center;
    font-size: 13px;
    font-style: italic;
}

/* ============================================================
   TEACHERS HUB & LIVE ANALYTICS (STAGE 1 ENTERPRISE)
   ============================================================ */
.teachers-hub-modal-box {
    position: relative;
    max-width: 960px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #091326 0%, #0d1b38 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(56, 189, 248, 0.25) !important;
}

.th-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.th-stat-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.th-stat-val {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.th-stat-lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.th-form-card {
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.th-form-compact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.th-col-name {
    flex: 1 1 150px;
    min-width: 130px;
    max-width: 180px;
}

.th-col-phone {
    flex: 0 0 135px;
    width: 135px;
}

.th-col-city {
    flex: 1 1 140px;
    min-width: 120px;
    max-width: 170px;
}

.th-col-course {
    flex: 1 1 160px;
    min-width: 150px;
    max-width: 210px;
}

.th-col-subject {
    flex: 1 1 150px;
    min-width: 135px;
    max-width: 190px;
}

.th-col-btn {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    gap: 14px !important;
    margin-left: auto !important;
}

#btnThSaveTeacher {
    margin-left: auto;
}

.th-form-card.th-form-editing .th-col-btn {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 14px !important;
}

.th-form-card.th-form-editing #btnThSaveTeacher {
    margin: 0 auto !important;
}

.th-form-card.th-form-editing #btnThCancelEdit {
    margin-left: auto !important;
}

/* Multi-Select Dynamic Checkbox Pickers for Teachers Hub */
.th-picker-group {
    position: relative;
}

.th-picker-btn {
    height: 34px;
    padding: 0 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.th-picker-btn:hover {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.th-picker-btn.active {
    border-color: #ffd54f;
    box-shadow: 0 0 10px rgba(255, 213, 79, 0.35);
}

.th-picker-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.th-picker-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 220px;
    max-width: 280px;
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 15px rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    z-index: 10000;
    padding: 4px 0;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: thPickerFadeIn 0.12s ease-out;
}

@keyframes thPickerFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.th-picker-header {
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.th-picker-master-label,
.th-picker-header .th-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    color: #ffd54f;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s ease;
}

.th-picker-master-label:hover,
.th-picker-header .th-picker-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.th-picker-body {
    max-height: 185px;
    overflow-y: auto;
    padding: 4px 0;
}

.th-picker-body::-webkit-scrollbar {
    width: 5px;
}
.th-picker-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.4);
    border-radius: 4px;
}

.th-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #e2e8f0;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s ease;
}

.th-picker-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
}

.th-picker-item input[type="checkbox"] {
    accent-color: #38bdf8;
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* Assigned Scope Badge Hover & Edit Interaction */
.th-scope-badge {
    background: rgba(255, 213, 79, 0.15);
    color: #ffd54f;
    border: 1px solid rgba(255, 213, 79, 0.4);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.th-scope-badge:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

/* Edit Mode Pulse Animation on Form Card */
.th-form-card.th-form-editing {
    border-color: #38bdf8 !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(12, 74, 110, 0.25)) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), 0 0 10px rgba(255, 213, 79, 0.25) !important;
    animation: thFormEditPulse 1.4s infinite alternate ease-in-out;
}

@keyframes thFormEditPulse {
    0% {
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
        border-color: rgba(56, 189, 248, 0.5);
    }
    100% {
        box-shadow: 0 0 24px rgba(56, 189, 248, 0.6), 0 0 12px rgba(255, 213, 79, 0.35);
        border-color: #38bdf8;
    }
}

/* Universal Scope Configuration Glow on Dropdowns */
.th-picker-group.th-picker-highlight .th-picker-btn {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.7) !important;
    animation: thPickerGlowPulse 1.4s infinite alternate ease-in-out !important;
}

@keyframes thPickerGlowPulse {
    0% {
        box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
        border-color: #38bdf8;
    }
    100% {
        box-shadow: 0 0 18px rgba(56, 189, 248, 0.95), 0 0 10px rgba(255, 213, 79, 0.5);
        border-color: #ffd54f;
    }
}

.th-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2338bdf8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    padding-right: 28px !important;
}

.th-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: flex-end;
}

.th-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.th-form-label {
    font-size: 11px;
    font-weight: 700;
    color: #ffd54f;
}

.th-input {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 12.5px;
    height: 34px;
    box-sizing: border-box;
}

.th-input:focus {
    border-color: #38bdf8;
    outline: none;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.th-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.5);
}

.th-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.th-table th {
    background: rgba(15, 23, 42, 0.95);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 2;
}

.th-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    vertical-align: middle;
}

.th-table tr:hover td {
    background: rgba(56, 189, 248, 0.08);
}

.th-status-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: default;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.th-status-circle.live {
    background: rgba(34, 197, 94, 0.2);
    border: 1.5px solid rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

.th-status-circle.live .th-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    animation: thStatusPulse 2s infinite ease-in-out;
}

.th-status-circle.offline {
    background: rgba(148, 163, 184, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.th-status-circle.offline .th-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.th-status-circle.blocked {
    background: rgba(239, 68, 68, 0.18);
    border: 1.5px solid rgba(239, 68, 68, 0.7);
}

.th-status-circle.blocked .th-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

@keyframes thStatusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.75; }
}

.th-badge-live {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid #16a34a;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.th-badge-offline {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 600;
}

/* ============================================================
   TEACHER ONBOARDING OTP MODAL (CLASSROOM ACCESS GATE)
   ============================================================ */
.onboarding-modal-box {
    max-width: 480px !important;
    width: 90vw !important;
    background: linear-gradient(135deg, #091326 0%, #0d1e3d 100%) !important;
    border: 2px solid #ffd54f !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 213, 79, 0.3) !important;
    border-radius: 12px !important;
    padding: 24px 22px !important;
    text-align: center;
}

.onboarding-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffd54f;
    margin-bottom: 4px;
}

.onboarding-subtitle {
    font-size: 12.5px;
    color: #38bdf8;
    font-weight: 600;
    margin-bottom: 18px;
    line-height: 1.4;
}

.onboarding-step-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    text-align: left;
}

/* ============================================================
   STUDENTS HUB & VIRAL ANALYTICS MODAL (MASTER CONTROL)
   ============================================================ */
.students-hub-modal-box {
    position: relative;
    max-width: 960px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #130924 0%, #1a0f35 100%) !important;
    border: 1.5px solid rgba(192, 132, 252, 0.45) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 85, 247, 0.3) !important;
}

.sh-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sh-stat-card {
    background: rgba(24, 15, 46, 0.75);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sh-stat-val {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.sh-stat-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sh-universal-card {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(236, 72, 153, 0.12));
    border: 1.5px solid rgba(192, 132, 252, 0.45);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.sh-form-card {
    background: rgba(18, 10, 36, 0.7);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.sh-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: flex-end;
}

.sh-input {
    background: rgba(26, 16, 51, 0.9);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 6px;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 12.5px;
    height: 34px;
    box-sizing: border-box;
}

.sh-input:focus {
    border-color: #c084fc;
    outline: none;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}

.sh-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 380px;
    border: 1px solid rgba(192, 132, 252, 0.2);
    border-radius: 8px;
    background: rgba(15, 8, 30, 0.6);
}

.sh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.sh-table th {
    background: rgba(26, 16, 51, 0.95);
    color: #d8b4fe;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(192, 132, 252, 0.25);
    position: sticky;
    top: 0;
    z-index: 2;
}

.sh-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    vertical-align: middle;
}

.sh-table tr:hover td {
    background: rgba(168, 85, 247, 0.12);
}




/* ============================================================
   Teacher Huion Pen & Smart Canvas Overlay Styles
   ============================================================ */
.teacher-pen-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 8500;
    pointer-events: none;
    touch-action: none;
    display: block;
}

body.teacher-pen-active .teacher-pen-canvas {
    pointer-events: auto !important;
}

#btnTeacherPen.active {
    background: linear-gradient(180deg, #ffb300 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border: 1px solid #fde047 !important;
    box-shadow: 0 0 14px rgba(253, 224, 71, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.05) translateZ(0);
}

.teacher-pen-toolbar {
    position: fixed;
    right: 20px;
    top: 74px;
    bottom: auto;
    z-index: 9999;
    width: 220px;
    background: rgba(5, 19, 54, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 176, 65, 0.35) !important;
    background-clip: padding-box !important;
    border-radius: 12px;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.45), 0 8px 30px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    user-select: none;
    overflow: hidden;
    font-family: var(--font-main);
    touch-action: none;
}

.tpt-header {
    background: linear-gradient(90deg, rgba(12, 37, 94, 0.95) 0%, rgba(5, 19, 54, 0.95) 100%);
    border-bottom: 1px solid rgba(245, 176, 65, 0.25);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
}

.tpt-header:active {
    cursor: grabbing;
}

.tpt-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffd54f;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tpt-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tpt-btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
}

.tpt-btn-icon:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.tpt-btn-close:hover {
    background: #ef4444 !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
}

.tpt-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tpt-section-title {
    font-size: 10.5px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tpt-colors {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.tpt-color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--c);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.tpt-color-btn:hover {
    transform: scale(1.15);
}

.tpt-color-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 10px var(--c), inset 0 0 4px rgba(0, 0, 0, 0.5);
    transform: scale(1.22);
}

.tpt-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.tpt-tool-btn {
    position: relative;
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    text-align: center;
}

.tpt-tool-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.tpt-tool-btn.active {
    background: rgba(0, 210, 255, 0.2);
    border-color: #00d2ff;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

.tpt-dot {
    background: #e2e8f0;
    border-radius: 50%;
    display: block;
}

.dot-fine { width: 4px; height: 4px; }
.dot-med { width: 7px; height: 7px; }
.dot-thick { width: 11px; height: 11px; }
.tpt-emoji {
    font-size: 13.5px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transform: translateY(1.5px);
}

.tpt-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.tpt-action-btn {
    flex: 1;
    padding: 5px 0;
    background: rgba(30, 58, 138, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tpt-action-btn:hover {
    background: rgba(30, 58, 138, 0.85);
    border-color: #38bdf8;
    color: #ffffff;
}

.tpt-clear-btn:hover {
    background: rgba(220, 38, 38, 0.7) !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
}

.tpt-footer {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tpt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #cbd5e1;
    cursor: pointer;
}

.tpt-checkbox-label input {
    cursor: pointer;
    accent-color: #38bdf8;
}
/* Sub-drawer for Eraser & Highlighter 3 Sizes */
.tpt-subdrawer {
    background: rgba(4, 15, 42, 0.96);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 8px;
    padding: 6px 8px;
    margin-top: 2px;
    margin-bottom: 2px;
    box-shadow: inset 0 1px 1px rgba(255, 230, 160, 0.15), 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: tptSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tptSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tpt-subdrawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 5px;
    font-weight: 600;
}

.tpt-subdrawer-val {
    color: #38bdf8;
    font-weight: 700;
}

.tpt-sub-sizes {
    display: flex;
    gap: 4px;
}

.tpt-sub-btn {
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.tpt-sub-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tpt-sub-btn.active {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.tpt-sub-circle {
    border-radius: 50%;
    border: 1.5px dashed #f43f5e;
    background: rgba(244, 63, 94, 0.3);
    display: block;
}
.circle-sm { width: 7px; height: 7px; }
.circle-med { width: 13px; height: 13px; }
.circle-lg { width: 20px; height: 20px; }

.tpt-sub-bar {
    border-radius: 2px;
    background: #ffd54f;
    display: block;
}
.bar-sm { width: 20px; height: 2.5px; }
.bar-med { width: 20px; height: 5px; }
.bar-lg { width: 20px; height: 9px; }

.tpt-tool-btn .tpt-sub-arrow {
    position: absolute;
    right: 2px;
    bottom: 1.5px;
    font-size: 6px;
    line-height: 1;
    color: #94a3b8;
    opacity: 0.75;
    pointer-events: none;
}



/* ============================================================
   2-Way Corner Drag Resize Handles (Teachers Hub & Students Hub)
   ============================================================ */
.teachers-hub-resize-corner-handle,
.students-hub-resize-corner-handle {
    display: flex;
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
    user-select: none;
    z-index: 100020;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.teachers-hub-resize-corner-handle {
    color: #38bdf8;
}

.teachers-hub-resize-corner-handle:hover,
.teachers-hub-resize-corner-handle:active {
    opacity: 1;
    color: #ffffff;
    transform: scale(1.25);
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.9));
}

.students-hub-resize-corner-handle {
    color: #c084fc;
}

.students-hub-resize-corner-handle:hover,
.students-hub-resize-corner-handle:active {
    opacity: 1;
    color: #ffffff;
    transform: scale(1.25);
    filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.9));
}

.teachers-hub-modal-box .modal-body,
.students-hub-modal-box .modal-body {
    flex: 1 1 auto;
    min-height: 0;
}


/* Teachers Hub Action Buttons (Copy Link, WhatsApp, Save, Cancel) Matching Hover Effect */
#btnThSaveTeacher,
#btnThCopyUniversalLink,
#btnThShareUniversalWa,
#btnThCancelEdit {
    transition: all 0.15s ease !important;
}

#btnThSaveTeacher:hover,
#btnThCopyUniversalLink:hover,
#btnThShareUniversalWa:hover {
    filter: brightness(1.15) !important;
    transform: translateY(-1px) !important;
}

#btnThSaveTeacher:active,
#btnThCopyUniversalLink:active,
#btnThShareUniversalWa:active {
    filter: brightness(0.95) !important;
    transform: translateY(1px) !important;
}

#btnThCancelEdit {
    display: none;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
}

#btnThCancelEdit[style*="inline-flex"],
#btnThCancelEdit.active {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

#btnThCancelEdit:hover {
    filter: brightness(1.15) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.55) !important;
}

#btnThCancelEdit:active {
    filter: brightness(0.95) !important;
    transform: translateY(1px) !important;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4) !important;
}
