/* Question chrome: taskbar height + optional left tool rail (body.mm-question-active) */
:root {
    --mm-taskbar-height: 80px;
    --mm-tool-rail-width: 0px;
}
body.mm-question-active {
    --mm-tool-rail-width: 52px;
}

/* Question Template Layout */
.question-container {
    position: fixed !important; /* Fixed to participate in root stacking context with global canvases */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #FFFFFF; /* Clean white background */
    font-family: 'Oswald', sans-serif;
    overflow: hidden;
    z-index: 10000 !important; /* Above global annotation canvases (100-101) - force with !important */
    transform: translateZ(0); /* Force hardware acceleration and create stacking context */
    will-change: transform; /* Hint to browser for optimization */
    isolation: isolate !important; /* Create new stacking context to ensure children are above fixed canvases */
}

/* Ensure taskbar is always visible, even when question div is hidden */
.questionDiv .question-taskbar {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}
.questionDiv .question-tool-rail {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Taskbar in body (fallback) */
body > .question-taskbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10002; /* Above question container (10000) and equation divs (10001) */
}

body > .question-tool-rail {
    position: fixed;
    z-index: 10001;
}

/* Top Task Bar */
.question-taskbar {
    position: fixed; /* Changed from absolute to fixed to escape parent overflow: hidden */
    top: 0;
    left: 0;
    right: 0;
    height: var(--mm-taskbar-height, 80px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10002; /* Above interaction canvas (10001), equations (10000), and ink (9998-9999) */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /* Force visibility regardless of parent container state */
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    pointer-events: auto !important; /* Ensure taskbar buttons are clickable */
}

/* Left side of task bar */
.taskbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
    margin-right: 12px;
}

/* Right side of task bar (new question + progress + close only) */
.taskbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Solo teacher: easy / adaptive / hard segmented control (between title and actions) */
.taskbar-center.mm-solo-teacher-diff-toggle-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin: 0 8px;
}

.mm-solo-teacher-diff-toggle {
    display: inline-flex;
    align-items: stretch;
    background: #e5e7eb;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mm-solo-teacher-diff-toggle .mm-solo-diff-seg {
    border: none;
    background: transparent;
    color: #374151;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* match .taskbar-icon-button / taskbar-right controls */
}

.mm-solo-teacher-diff-toggle .mm-solo-diff-seg.is-selected {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.mm-solo-teacher-diff-toggle .mm-solo-diff-seg:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

.mm-solo-teacher-diff-toggle .mm-solo-diff-seg:not(.is-selected):hover {
    background: rgba(255, 255, 255, 0.55);
}

.mm-solo-teacher-diff-toggle-wrap.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mm-solo-teacher-diff-toggle-wrap.is-disabled .mm-solo-teacher-diff-toggle .mm-solo-diff-seg {
    cursor: not-allowed;
    pointer-events: none;
}

.mm-solo-teacher-diff-toggle-wrap.is-disabled .mm-solo-teacher-diff-toggle .mm-solo-diff-seg.is-selected {
    background: #9ca3af;
    color: #f3f4f6;
}

/* Ensure all taskbar icon buttons are aligned */
.taskbar-right .taskbar-icon-button,
.taskbar-right #helpVideoBtn,
.taskbar-right #notesBtn,
.taskbar-right .annotation-toggle-btn {
    vertical-align: middle;
}

/* Question Title — single line with ellipsis when needed */
.question-title {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #1f2937; /* Neutral-800 */
    text-shadow: none;
    margin: 0;
    /* Inset so the first glyph is not clipped at the left; .question-title-line uses overflow-x
       hidden + ellipsis (not overflow:both) so descenders are not clipped. */
    padding-inline-start: 0.15em;
    display: block;
    /* Slightly loose so Inter 800 descenders (g, y, p) are not tight against the line box */
    line-height: 1.38;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.question-title-line {
    display: block;
    white-space: nowrap;
    /* overflow:hidden clips descenders; only clip horizontal overflow for ellipsis */
    overflow-x: hidden;
    overflow-y: visible;
    text-overflow: ellipsis;
    max-width: 100%;
}

.question-title-top {
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #1f2937;
}

.question-title-bottom {
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 500;
    letter-spacing: 0.1px;
    color: #4b5563; /* Slightly lighter gray for the description */
    margin-top: 2px;
}

/* Question Value */
.question-value {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 600;
    color: #1f2937; /* Same as question title */
    margin-left: 12px;
    margin-right: 20px; /* Add space between value and New Question button */
    white-space: nowrap;
}

/* Task Bar Buttons */
.taskbar-button {
    background: #000EF9; /* Jeopardy blue to match the board */
    color: #FFCC00; /* Gold text like jeopardy money amounts */
    border: 2px solid #FFCC00; /* Gold border for definition */
    padding: 10px 16px;
    border-radius: 8px; /* Much more rectangular */
    font-size: 14px;
    font-weight: bold; /* Bold to match jeopardy style */
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    box-shadow: none; /* Remove modern shadow */
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    text-transform: uppercase; /* Game show style */
    letter-spacing: 1px; /* Spaced out like game show text */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.taskbar-button:hover {
    background: #FFCC00; /* Flip colors on hover */
    color: #000EF9;
    border-color: #000EF9;
    transform: none; /* Remove floating effect */
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); /* Subtle glow instead */
}

.taskbar-button:active {
    background: #FFD700; /* Slightly brighter gold when pressed */
    transform: scale(0.98); /* Subtle press effect */
}

/* Close Button (X) */
.close-button {
    background: #DC143C; /* Flat red instead of gradient */
    color: white;
    border: 2px solid white; /* White border for definition */
    width: 40px;
    height: 40px;
    border-radius: 6px; /* More rectangular, less circular */
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    box-shadow: none; /* Remove modern shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.close-button:hover {
    background: white; /* Flip to white background */
    color: #DC143C; /* Red text */
    border-color: #DC143C;
    transform: none; /* Remove floating and scaling */
    box-shadow: 0 0 8px rgba(220, 20, 60, 0.4); /* Subtle red glow */
}

/* Left vertical tool rail (help, leaderboard, calculator, annotation, more) */
.question-tool-rail {
    top: var(--mm-taskbar-height, 80px);
    left: 0;
    width: var(--mm-tool-rail-width, 0px);
    bottom: 0;
    background: rgba(252, 252, 253, 0.98);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 2px 0 16px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    pointer-events: auto;
    overflow: visible;
}

.question-tool-rail-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    padding: 10px 0;
    gap: 2px;
    width: 100%;
}

.taskbar-rail-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Calculator + annotation: shared pill background (more/options button stays below, ungrouped) */
.taskbar-rail-tools-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: calc(100% - 8px);
    max-width: 48px;
    margin: 2px auto;
    padding: 6px 4px;
    box-sizing: border-box;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    flex-shrink: 0;
}

.question-tool-rail .taskbar-rail-btn {
    margin: 0 !important;
}

/* Hover / focus label chip to the right of rail icons */
.question-tool-rail .taskbar-rail-btn {
    position: relative;
}
.question-tool-rail .taskbar-rail-btn::after {
    content: attr(data-mm-rail-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    border-radius: 8px;
    white-space: nowrap;
    max-width: min(240px, 70vw);
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10020;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: opacity 0.15s ease, visibility 0.15s ease;
}
.question-tool-rail .taskbar-rail-btn:hover::after,
.question-tool-rail .taskbar-rail-btn:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

/* Teacher copy: brief success flash (same spirit as notes save confirmation) */
#teacherCopyQuestionDocBtn.mm-teacher-copy-doc-btn-flash {
    background: #27ae60 !important;
    color: #fff !important;
    border-radius: 10px !important;
    transform: scale(1.06) !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}
#teacherCopyQuestionDocBtn.mm-teacher-copy-doc-btn-flash svg {
    stroke: #fff !important;
}

.taskbar-rail-more-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 4px 0 0 0 !important;
    border: none !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #1f2937 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}
.taskbar-rail-more-btn:hover {
    background: rgba(15, 23, 42, 0.08) !important;
    transform: scale(1.05);
}
.taskbar-rail-more-icon {
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
}

/* Overflow popover (notes, bug, fullscreen) */
.question-taskbar-overflow {
    min-width: 0;
    box-sizing: border-box;
    pointer-events: auto !important; /* Same idea as .annotation-tools-menu: hit-test the menu, not the question below */
}
.question-taskbar-overflow.is-open {
    /* Shrink-wrap to inner card; JS anchors left to rail.right so panel stays in viewport */
    display: inline-block;
    vertical-align: top;
    max-width: min(320px, calc(100vw - 16px));
}
.question-taskbar-overflow-inner {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    padding: 6px;
    min-width: 220px;
    box-sizing: border-box;
}
.taskbar-overflow-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    margin: 0 0 4px 0 !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    text-align: left !important;
    color: #1f2937 !important;
    transform: none !important;
    box-sizing: border-box !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}
.taskbar-overflow-item:last-child {
    margin-bottom: 0 !important;
}
.taskbar-overflow-item:hover {
    transform: none !important;
    background: rgba(13, 110, 253, 0.08) !important;
}
.taskbar-overflow-item svg {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
}
.taskbar-overflow-item-label {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Main Content Area — inset for taskbar + left tool rail */
.question-content {
    position: absolute;
    top: var(--mm-taskbar-height, 80px);
    left: var(--mm-tool-rail-width, 0px);
    right: 0;
    bottom: 0;
    padding: 20px 20px 10px;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch; /* Allow children to stretch to full width */
    justify-content: flex-start; /* Align to top instead of center */
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    transition: top 0.2s ease, left 0.2s ease; /* Smooth transition for layout changes */
    box-sizing: border-box; /* Include padding in width calculation */
    min-height: calc(100vh - var(--mm-taskbar-height, 80px)); /* Fill viewport below taskbar */
}

/* Many questions inject #foo-root .question-content { width:100% }. With the rule above, that
   combines with left: var(--mm-tool-rail-width) and over-constrains width so the panel extends
   past the viewport; overflow-x:hidden then clips the right edge. !important beats ID selectors
   that omit !important. (Questions using relative .question-content, e.g. C300, still layout correctly.) */
body.mm-question-active .question-container > .question-content {
    width: auto !important;
    min-width: 0;
}

/* A100: full-viewport p5 game lives directly in .questionDiv (no .question-content wrapper).
   Inset like .question-content so the fixed tool rail does not cover score / bucket labels. */
body.mm-question-active #A100.questionDiv {
    left: var(--mm-tool-rail-width, 0px);
    width: calc(100% - var(--mm-tool-rail-width, 0px));
    box-sizing: border-box;
    transition: left 0.2s ease, width 0.2s ease;
    overflow: hidden;
    min-height: 0;
    max-height: 100%;
    top: 0;
    bottom: 0;
    overscroll-behavior: none;
}

/* A100: no page/chain scroll — canvas is sized to the game area (Surface, fullscreen, dvh edge cases) */
html.mm-a100-question,
html.mm-a100-question body {
    overflow: hidden !important;
    height: 100%;
    max-height: 100dvh;
    overscroll-behavior: none;
}
html.mm-a100-question #mm-app-wrapper {
    max-height: 100dvh;
    overflow: hidden;
}
html.mm-a100-question #mm-app-content {
    overflow: hidden !important;
    max-height: 100dvh;
    min-height: 0;
    overscroll-behavior: none;
}
html.mm-a100-question #container {
    overflow: hidden;
    max-height: 100%;
    min-height: 0;
}
html.mm-a100-question #A100gameDiv {
    overflow: hidden;
    min-height: 0;
    touch-action: none;
    overscroll-behavior: none;
}
html.mm-a100-question #A100gameDiv canvas {
    touch-action: none;
    max-width: 100%;
    max-height: 100%;
}

/* When feedback is shown, constrain the instruction and input areas */
/* B300-specific feedback layout (restored for backward compatibility) */
.question-content.has-feedback .question-instruction {
    max-width: 60%;
    align-self: center;
}

.question-content.has-feedback .answer-input-area {
    max-width: 45%;
    align-self: center;
}

.question-content.has-feedback {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    padding: 20px;
    gap: 10px;
}

.question-content.has-feedback .feedback-display {
    position: static;
    right: unset;
    top: unset;
    transform: none;
    width: calc(35% - 10px);
    flex: 0 0 calc(35% - 10px);
    margin: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    font-size: 2.5em !important;
    padding: 12px;
}

.equation-annotation-container.has-feedback {
    width: calc(65% - 10px);
    flex: 0 0 calc(65% - 10px);
    margin: 0;
    align-self: stretch;
}

/* Question Instruction */
.question-instruction {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    width: 100%;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    color: #2c3e50;
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Student copy speedbump: prompt text only (never inputs / calculator). */
body.mm-student-session .question-instruction,
body.mm-student-session .question-instruction *:not(input):not(textarea):not([contenteditable="true"]),
body.mm-student-session .question-subinstruction,
body.mm-student-session .question-subinstruction *:not(input):not(textarea):not([contenteditable="true"]) {
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Touch-friendly native selects in questions (fix dropdown open on tap, e.g. Android) */
.question-container select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Answer Input Area */
.answer-input-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 18px 20px 16px; /* Slightly slimmer, keep comfortable hit area */
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 0; /* Avoid extra gap at bottom */
    margin-top: auto; /* Push to the bottom of the flex column */
    width: 100%;
    text-align: center;
    transition: all 0.3s ease; /* Smooth transition for resizing */
    flex-shrink: 0; /* Prevent from shrinking */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Input Section - contains the input and submit button */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Remove this rule - we want the answer-input-area to stay visible and just swap the input section for feedback */

.answer-input {
    width: 100%;
    max-width: 25%; /* Use percentage instead of fixed pixels */
    padding: 12px 20px; /* Reduced padding */
    border: 3px solid #e0e6ed;
    border-radius: 15px;
    font-size: 18px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

/* Submit Button */
.submit-button {
    background: #228B22; /* Flat forest green instead of gradient */
    color: #FFCC00; /* Gold text to match jeopardy theme */
    border: 2px solid #FFCC00; /* Gold border */
    padding: 12px 25px;
    border-radius: 8px; /* More rectangular */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    box-shadow: none; /* Remove modern shadow */
    margin-top: 15px;
    min-width: 12%;
    text-transform: uppercase; /* Game show style */
    letter-spacing: 1px;
}

.submit-button:hover:not(:disabled) {
    background: #FFCC00; /* Flip colors on hover */
    color: #228B22;
    border-color: #228B22;
    transform: none; /* Remove floating effect */
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); /* Subtle glow */
}

.submit-button:disabled {
    background: #666666; /* Flat gray */
    color: #CCCCCC;
    border-color: #CCCCCC;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    text-transform: none; /* Remove uppercase for disabled state */
}

/* Feedback Display - Now positioned within answer-input-area */
.feedback-display {
    display: none; /* Hidden by default */
    background: #f9f9f9 !important; /* Very light background */
    color: #222 !important;         /* Neutral dark font */
    font-size: 2em !important;      /* Increased font size for better readability */
    border-radius: 20px;            /* Match parent's border radius for curvy corners */
    padding: 20px;                  /* Match parent's padding */
    text-align: center;
    box-shadow: none;               /* Remove shadow to eliminate buffer */
    min-height: 120px;              /* Match input area height */
    width: calc(100% + 40px);      /* Compensate for negative margins */
    transition: all 0.3s ease;
    line-height: 1.3;               /* Tighter line height */
    font-family: inherit;
    /* Ensure it doesn't cause overflow */
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow: hidden;               /* Hide overflow instead of adding scrollbars */
    /* Remove fixed positioning - now flows naturally in the layout */
    position: static;
    margin: -20px;                  /* Negative margin to eliminate parent padding */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure it takes up the same space as the input section */
    flex-shrink: 0;
    box-sizing: border-box;
}

/* When feedback is shown, use flex layout instead of fixed positioning */
/* Complex feedback layout removed - feedback now appears in same area as input */

.feedback-display.feedback-correct {
    background: #e0ffe0 !important; /* Light green for correct */
    color: #222 !important;
    border-left: 5px solid #27ae60;
}

.feedback-display.feedback-incorrect {
    background: #fff0f0 !important; /* Light red for incorrect */
    color: #222 !important;
    border-left: 5px solid #e74c3c;
}

.feedback-display.feedback-almost {
    background: #fff8e0 !important; /* Light orange for almost correct */
    color: #222 !important;
    border-left: 5px solid #f39c12;
}

/* F200: smaller feedback font to fit in right panel */
#f200-feedbackDisplay {
    font-size: 1.4em !important;
}

/* Notes Modal */
.notes-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.notes-modal.show {
    display: flex;
}

.notes-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.notes-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    margin: 15px 0;
}

.notes-textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* YouTube Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.video-modal.show {
    display: flex;
}

.video-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.video-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Question Layouts */

/* A100 Sorting Game Styles */
.sorting-game-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1000px;
    width: 100%;
}

.number-pool {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.number-pool h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.number-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 60px;
}

.number-item {
    background: #000EF9; /* Jeopardy blue */
    color: #FFCC00; /* Gold text */
    border: 2px solid #FFCC00; /* Gold border */
    padding: 12px 20px;
    border-radius: 8px; /* More rectangular */
    font-size: 16px;
    font-weight: bold;
    cursor: grab;
    transition: all 0.2s ease; /* Faster transition */
    box-shadow: none; /* Remove modern shadow */
    text-transform: uppercase; /* Game show style */
    letter-spacing: 1px;
}

.number-item:hover {
    background: #FFCC00; /* Flip colors on hover */
    color: #000EF9;
    border-color: #000EF9;
    transform: none; /* Remove floating effect */
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); /* Subtle glow */
}

.number-item:active {
    cursor: grabbing;
    transform: scale(0.98); /* Subtle press effect */
}

.sorting-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.category-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.category-box h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    text-align: center;
}

.drop-zone {
    min-height: 150px;
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.drop-zone .number-item {
    background: #228B22; /* Green for items in drop zone */
    color: #FFCC00; /* Gold text */
    border-color: #FFCC00;
    box-shadow: 0 0 10px rgba(34, 139, 34, 0.3); /* Green glow */
}

.game-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

/* Multiple Choice Styles */
.multiple-choice-container {
    max-width: 800px;
    width: 100%;
}

.choice-option {
    background: #F8F9FA; /* Light background */
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px; /* More rectangular */
    box-shadow: none; /* Remove modern shadow */
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    border: 3px solid #DEE2E6; /* Light gray border */
    font-weight: bold; /* Bold text for game show feel */
}

.choice-option:hover {
    background: #000EF9; /* Jeopardy blue on hover */
    color: #FFCC00; /* Gold text */
    border-color: #FFCC00;
    transform: none; /* Remove floating effect */
    box-shadow: 0 0 10px rgba(0, 14, 249, 0.3); /* Subtle blue glow */
}

.choice-option.selected {
    background: #000EF9; /* Jeopardy blue when selected */
    color: #FFCC00; /* Gold text */
    border-color: #FFCC00;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4); /* Gold glow when selected */
}

.choice-option.correct {
    background: #228B22; /* Green for correct */
    color: #FFCC00; /* Gold text */
    border-color: #FFCC00;
    box-shadow: 0 0 15px rgba(34, 139, 34, 0.4); /* Green glow */
}

.choice-option.incorrect {
    background: #DC143C; /* Red for incorrect */
    color: white;
    border-color: white;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.4); /* Red glow */
}

/* Interactive Graph Styles */
.graph-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
}

.graph-canvas {
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    background: white;
    margin: 20px 0;
}



/* Animation for modal appearance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notes-modal.show .notes-content,
.video-modal.show .video-content {
    animation: modalFadeIn 0.3s ease-out;
} 

/* Centralized Taskbar Button Styles */
.taskbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.question-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.taskbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px; /* Ensure buttons don't extend past viewport edge */
}

/* Remove duplicate taskbar button styles - they're already defined above with jeopardy styling */

/* YouTube-style Help Video Button */
.youtube-button {
    background: #FF0000 !important; /* Flat YouTube red */
    color: white !important;
    border: 2px solid white !important; /* White border for consistency */
    border-radius: 8px !important; /* Rectangular like other buttons */
    box-shadow: none !important; /* Remove modern shadow */
    text-transform: uppercase !important; /* Game show style */
    letter-spacing: 1px !important;
}

.youtube-button:hover {
    background: white !important; /* Flip colors on hover */
    color: #FF0000 !important;
    border-color: #FF0000 !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3) !important; /* Subtle red glow */
}

.youtube-button .youtube-play {
    font-size: 16px;
    font-weight: bold;
    margin-right: 8px;
}

/* Larger Pencil Icon for Notes */
.pencil-icon {
    font-size: 18px;
    margin-right: 8px;
}

/* Video Modal Styles */
.video-modal {
    animation: fadeIn 0.3s ease-out;
}

.video-container {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Notes Panel Styles */
.notes-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #f8f9fa;
    border-left: 3px solid #dee2e6;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10012; /* Above help-video crown overlay (10011), below video modal (10020); above taskbar (10002) */
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
    font-family: 'Georgia', serif;
    min-width: 300px;
    max-width: 60vw;
    /* Ensure panel is visible and clickable */
    pointer-events: auto;
}

.notes-panel.open {
    right: 0 !important;
}

.notes-panel .notes-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.notes-panel .notes-icon {
    font-size: 20px;
    font-weight: 600;
}

.notes-panel .notes-close-btn {
    background: #DC143C; /* Flat red to match other close buttons */
    color: white;
    border: 2px solid white; /* White border for consistency */
    width: 30px;
    height: 30px;
    border-radius: 6px; /* More rectangular, less circular */
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease; /* Faster transition */
}

.notes-panel .notes-close-btn:hover {
    background: white; /* Flip colors on hover */
    color: #DC143C;
    border-color: #DC143C;
}

/* Notes Panel Content - more specific to avoid conflicts */
.notes-panel .notes-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Remove absolute positioning for resizable layout */
    position: relative;
    /* Remove padding for divider since we're using flexbox */
    /* Ensure proper alignment and spacing of flex items */
    align-items: stretch;
    justify-content: flex-start;
    /* Ensure all flex items are visible */
    min-height: 0;
}

/* Lined Paper Effect */
.notes-panel .lined-paper {
    /* Remove flex: 1 and use flex-basis instead */
    flex-basis: 60%; /* Default 60% height */
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    background: white;
    padding: 20px;
    margin: 10px;
    border-radius: 0px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    /* Create horizontal lines with a background image */
    background-image: 
        repeating-linear-gradient(
            transparent,
            transparent 24px,
            #c8d3e0 24px,
            #c8d3e0 25px
        );
    background-size: 100% 25px;
    background-attachment: local;
    /* Add scrolling for short screens */
    min-height: 100px; /* Reduced from 200px to allow more flexibility */
    max-height: 60vh; /* Add back max-height to prevent unnecessary scrollbars */
    overflow-y: auto;
    overflow-x: hidden;
    /* Ensure it doesn't create a conflicting stacking context */
    z-index: 1;
    /* Ensure proper ordering in flex container */
    order: 0;
    /* Ensure it doesn't overflow and hide the divider */
    max-width: 100%;
}

.notes-panel .lined-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    width: 1px;
    height: 100%;
    background: #ff6b6b;
    opacity: 0.8;
    pointer-events: none;
}

/* Paper holes */
.notes-panel .lined-paper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
     /* White arcs to block right side of holes (drawn last so they're on top) a bit to the right to cover the holes*/
     radial-gradient(circle at 27px 10%, rgba(255,255,255,1) 0,  rgba(255,255,255,1) 10px,  transparent 10px),
     radial-gradient(circle at 27px 50%, rgba(255,255,255,1) 0,  rgba(255,255,255,1) 10px,  transparent 10px),
     radial-gradient(circle at 27px 90%, rgba(255,255,255,1) 0,  rgba(255,255,255,1) 10px,  transparent 10px),
        /* Grey hole shadows (drawn first so they're behind) */
        radial-gradient(circle at 25px 10%, white 0, white 8px, rgba(0,0,0,0.1) 8px, rgba(0,0,0,0.1) 10px, transparent 10px),
        radial-gradient(circle at 25px 50%, white 0, white 8px, rgba(0,0,0,0.1) 8px, rgba(0,0,0,0.1) 10px, transparent 10px),
        radial-gradient(circle at 25px 90%, white 0, white 8px, rgba(0,0,0,0.1) 8px, rgba(0,0,0,0.1) 10px, transparent 10px);
       
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
}

.notes-panel .notes-textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    line-height: 25px;
    color: #2c3e50;
    resize: none;
    outline: none;
    padding: 0 0 0 20px;
    margin-left: 20px;
    /* Fix for backspace and editing issues */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    white-space: pre-wrap;
    word-wrap: break-word;
    /* Ensure proper text input */
    overflow-wrap: break-word;
    word-break: break-word;
    transform: translateY(-4px); /* Shift text up by 2px to align with lines */
}

.notes-panel .notes-textarea:focus {
    color: #2c3e50 !important;
}

/* Resizable divider between notes and sketch */
.notes-panel .notes-sketch-divider {
    position: relative;
    /* Tall enough for two grip lines + border (12px bar clipped the handles vertically) */
    height: 22px;
    min-height: 22px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #667eea, #5a67d8);
    cursor: ns-resize !important; /* Force cursor change */
    opacity: 1; /* Make it fully visible by default */
    transition: all 0.2s ease;
    z-index: 9999; /* Increased z-index to ensure it's always on top */
    /* Add some margin for visual separation */
    margin: 4px 10px; /* Reduced top/bottom margin from 8px to 4px */
    border-radius: 6px; /* Reduced from 8px to match smaller height */
    /* Add a subtle border for better visibility */
    border: 1px solid #5a67d8; /* Reduced from 2px to 1px */
    /* Add a subtle shadow for depth */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Reduced shadow */
    padding: 0;
    /* Center the two grip lines as flex items (::before / ::after) */
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    /* Ensure it doesn't grow or shrink in the flex container */
    flex-shrink: 0;
    flex-grow: 0;
    /* Force it to be visible and clickable */
    pointer-events: auto !important;
    /* Ensure it's positioned correctly between the two sections */
    order: 1; /* Place it between lined-paper (order: 0) and sketch-section (order: 2) */
    /* Force it to be visible initially */
    visibility: visible !important;
    width: calc(100% - 20px); /* Account for margins */
}

.notes-panel .notes-sketch-divider::before,
.notes-panel .notes-sketch-divider::after {
    content: '';
    flex-shrink: 0;
    width: 30px;
    height: 3px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 2px;
}

.notes-panel .notes-sketch-divider:hover {
    opacity: 1;
    background: linear-gradient(to bottom, #5a67d8, #4c51bf);
    min-height: 24px;
    height: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); /* Reduced shadow */
    transform: scaleY(1.08);
    transform-origin: center;
    cursor: ns-resize !important;
    /* Add a pulsing animation to draw attention */
    animation: dividerPulse 1.5s ease-in-out infinite;
}

/* Add a pulsing animation for the divider */
@keyframes dividerPulse {
    0%, 100% { 
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }
    50% { 
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }
}

/* Sketch Section */
.notes-panel .sketch-section {
    /* Remove flex: 1 and use flex-basis instead */
    flex-basis: 40%; /* Default 40% height */
    flex-shrink: 0;
    flex-grow: 0;
    margin: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* Add scrolling for short screens */
    min-height: 200px;
    max-height: 40vh; /* Add back max-height to prevent unnecessary scrollbars */
    overflow-y: auto;
    overflow-x: hidden;
    /* Ensure it doesn't create a conflicting stacking context */
    z-index: 1;
    /* Ensure proper ordering in flex container */
    order: 2;
    /* Ensure it doesn't overflow and hide the divider */
    max-width: 100%;
}

.notes-panel .sketch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f3f4;
    /* Keep header visible when scrolling */
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.notes-panel .sketch-header span {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.notes-panel .clear-sketch-btn {
    background: #DC143C; /* Flat red */
    color: white;
    border: 2px solid white; /* White border */
    padding: 5px 12px;
    border-radius: 6px; /* More rectangular */
    font-size: 12px;
    font-weight: bold; /* Bold for consistency */
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    text-transform: uppercase; /* Game show style */
    letter-spacing: 0.5px;
}

.notes-panel .clear-sketch-btn:hover {
    background: white; /* Flip colors */
    color: #DC143C;
    border-color: #DC143C;
}

.notes-panel .sketch-canvas {
    width: 100%;
    height: 150px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: crosshair;
    background: #fafbfc;
    transition: border-color 0.3s ease;
    /* Ensure canvas doesn't shrink when scrolling */
    flex-shrink: 0;
}

.notes-panel .sketch-canvas:hover {
    border-color: #667eea;
}



/* Notes Footer */
.notes-panel .notes-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.notes-panel .save-notes-btn {
    width: 100%;
    background: #000EF9; /* Jeopardy blue */
    color: #FFCC00; /* Gold text */
    border: 2px solid #FFCC00; /* Gold border */
    padding: 12px 20px;
    border-radius: 8px; /* More rectangular */
    font-size: 14px;
    font-weight: bold; /* Bold for consistency */
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    box-shadow: none; /* Remove modern shadow */
    text-transform: uppercase; /* Game show style */
    letter-spacing: 1px;
}

.notes-panel .save-notes-btn:hover {
    background: #FFCC00; /* Flip colors */
    color: #000EF9;
    border-color: #000EF9;
    transform: none; /* Remove floating effect */
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); /* Subtle glow */
}

.notes-panel .save-notes-btn:active {
    background: #FFD700; /* Slightly brighter gold when pressed */
    transform: scale(0.98); /* Subtle press effect */
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: 60px;
    justify-content: center;
    position: relative;
    flex-shrink: 0; /* Prevent indicator from shrinking */
}

.progress-checkmark {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.progress-text {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 20px;
    text-align: center;
}

.streak-flame {
    font-size: 20px;
    line-height: 1;
    margin-left: 4px;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(255, 69, 0, 0.4));
    transition: transform 0.3s ease, opacity 0.3s ease;
    vertical-align: middle;
}

/* Resize handle */
.notes-panel .notes-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    background: #667eea;
    cursor: ew-resize;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    z-index: 10001;
    /* Make it easier to grab */
    pointer-events: auto;
}

.notes-panel .notes-resize-handle:hover {
    opacity: 1;
    background: #5a67d8;
    width: 10px;
}

 

/* Equation Annotation Area */
.equation-annotation-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /*start at left of screen and span 100% of width when no feedback*/ 
    margin: 0;
    width: 100%;
    text-align: center;
    position: relative;
    min-height: 400px; /* Reduced minimum height */
    max-height: none; /* Allow it to grow to fill available space */
    height: auto;
    margin-top: 20px; /* Add buffer from top taskbar */
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease; /* Smooth transition for resizing */
    flex: 1 1 auto; /* Take up available space when no feedback */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Equation container no longer needs special feedback layout since feedback appears in same area as input */

.equation-annotation-container h2 {
    margin: 0 0 20px 0; /* Reduced margin */
    color: #2c3e50;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.equation-work-area {
    position: relative;
    flex: 1 1 auto;
    min-height: 200px; /* Reduced minimum height */
    max-height: none; /* Allow work area to fill remaining space */
    height: auto;
    background: #fafbfc;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    margin: 15px 0; /* Reduced margin */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px; /* Reduced padding */
    overflow: hidden; /* Prevent canvas overflow */
    margin-bottom: 0; /* Remove bottom margin to allow tools to be centered */
}

.equation-display {
    font-size: clamp(2em, 4vw, 3em); /* Responsive font size */
    font-weight: bold;
    color: #2c3e50;
    z-index: 2;
    position: relative;
    padding: 15px; /* Reduced padding */
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
    flex-shrink: 0; /* Prevent equation from shrinking */
    min-height: 80px; /* Ensure enough space for tools */
}

.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    cursor: crosshair;
}

.highlighter-canvas {
    z-index: 1;
}

.pen-canvas {
    z-index: 3;
}

.annotation-tools {
    display: flex;
    gap: 4px;
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
    background: none;
    padding: 0;
    border-radius: 0;
    /* Position relative to equation-annotation-container instead of equation-work-area */
}

.annotation-tool {
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    width: 44px !important;
    height: 44px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    position: relative !important;
    box-shadow: none !important;
    z-index: 11 !important;
}

.annotation-tool:hover {
    transform: scale(1.15) !important;
    filter: brightness(1.1) !important;
}

.annotation-tool.selected {
    transform: scale(1.2) !important;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6)) !important;
}

.annotation-tool.pen {
    color: #2c3e50;
}

.annotation-tool.highlighter {
    color: #f1c40f;
}

/* Tool icons using cartoony images - with !important to override inline styles */
.annotation-tool.pen::before {
    content: "" !important;
    background-image: url('Resources/transparent/pen.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 36px !important;
    height: 36px !important;
    display: block !important;
}

.annotation-tool.highlighter::before {
    content: "" !important;
    background-image: url('Resources/transparent/yellowhighlighter.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 36px !important;
    height: 36px !important;
    display: block !important;
}

.annotation-tool.eraser::before {
    content: "" !important;
    background-image: url('Resources/transparent/eraser.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 36px !important;
    height: 36px !important;
    display: block !important;
}

.annotation-tool.clear::before {
    content: "" !important;
    background-image: url('Resources/transparent/wastebasket.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 36px !important;
    height: 36px !important;
    display: block !important;
}

/* Tool labels */
.annotation-tool::after {
    content: attr(data-tool);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.annotation-tool:hover::after {
    opacity: 1;
}

/* Responsive Design for Desktop/Tablet Focus */
@media (max-width: 1200px) {
    .equation-annotation-container {
        min-height: 320px;
    }
    
    .equation-work-area {
        min-height: 180px;
    }
}

@media (max-height: 600px) {
    .equation-annotation-container {
        min-height: 260px;
        max-height: none;
    }
    
    .equation-work-area {
        min-height: 140px;
        max-height: none;
    }
    
    .equation-display {
        font-size: clamp(1.8em, 4vw, 2.5em);
    }
}

/* Responsive Design - Hide button text on narrow screens */
@media (max-width: 768px) {
    .taskbar-center.mm-solo-teacher-diff-toggle-wrap {
        margin: 0 4px;
    }
    .mm-solo-teacher-diff-toggle .mm-solo-diff-seg {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* Hide text spans in taskbar buttons, keep only symbols */
    #newQuestionBtnText,
    .taskbar-button span:not(:first-child) {
        display: none !important;
    }
    
    /* Hide "Help" text in YouTube button, keep play symbol */
    .youtube-button {
        min-width: 50px;
        padding: 10px 12px;
    }
    
    .youtube-button .youtube-play {
        margin-right: 0;
    }
    
    /* Minified new question: icon only, no button square - match taskbar icon size */
    #newQuestionBtn {
        background: transparent !important;
        border: none !important;
        min-width: 40px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 6px !important;
        box-shadow: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        align-self: center !important; /* Vertically centre in taskbar like other buttons */
        border-radius: 0 !important;
        color: #000EF9 !important; /* Blue refresh icon to match Jeopardy blue */
    }
    #newQuestionBtn:hover {
        background: transparent !important;
        border: none !important;
        color: #000EF9 !important;
        transform: scale(1.1);
    }
    #newQuestionBtn span:first-child {
        font-size: 36px !important; /* Same visual weight as other taskbar icons (36–40px) */
        line-height: 1 !important; /* Prevent emoji line-height from shifting vertical alignment */
        display: inline-flex !important;
        align-items: center !important;
    }
    
    /* Tighter spacing: minified new question icon close to progress checkmark (like full-sized) */
    .question-taskbar .taskbar-right .progress-indicator {
        margin-right: 4px;
    }
    .question-taskbar .taskbar-right #newQuestionBtn {
        margin-right: 6px;
        padding-left: 2px;
        padding-right: 2px;
    }
    
    /* Reduce button minimum width for mobile (other taskbar buttons) */
    .taskbar-button {
        min-width: 50px;
        padding: 10px 12px;
    }
    
    /* Adjust taskbar spacing */
    .taskbar-right {
        gap: 8px;
        padding-right: 15px; /* Smaller padding for tablets */
    }
    
    /* Make question title smaller on mobile */
    .question-title {
        font-size: 18px;
    }
    
    /* Make question value smaller on mobile */
    .question-value {
        font-size: 16px;
        margin-left: 8px;
        margin-right: 15px; /* Add space between value and New Question button on mobile */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .taskbar-button {
        min-width: 45px;
        padding: 8px 10px;
        font-size: 16px; /* Larger symbols on small screens */
    }
    
    /* New question stays icon-only, same size as other taskbar icons */
    #newQuestionBtn span:first-child {
        font-size: 24px !important;
    }
    
    /* Keep minified new question icon close to progress checkmark */
    .question-taskbar .taskbar-right .progress-indicator {
        margin-right: 4px;
    }
    .question-taskbar .taskbar-right #newQuestionBtn {
        margin-right: 6px;
        padding-left: 2px;
        padding-right: 2px;
    }
    
    .taskbar-right {
        gap: 6px;
        padding-right: 10px; /* Smaller padding for mobile */
    }
    
    .question-title {
        font-size: 16px;
    }
    
    .question-value {
        font-size: 14px;
        margin-left: 6px;
        margin-right: 12px; /* Add space between value and New Question button on small mobile */
    }
    
    .close-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
} 

/* Submission History Tooltip Styles */
.submission-history-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 999999;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress checkmark hover effect */
.progress-checkmark {
    transition: transform 0.2s ease;
}

.progress-checkmark:hover {
    transform: scale(1.1);
}

/* Ensure tooltip doesn't interfere with other elements */
.submission-history-tooltip * {
    pointer-events: none;
}

/* ============================================================================ */
/* ANNOTATION SYSTEM STYLES */
/* ============================================================================ */

/* Taskbar icon button base style - for all minimal icon buttons */
.taskbar-icon-button {
    background: transparent !important;
    border: none !important;
    padding: 6px !important; /* Slightly reduced padding for more compact look */
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    touch-action: manipulation !important; /* Optimize touch interactions */
    -webkit-tap-highlight-color: transparent !important; /* Remove tap highlight on mobile */
    flex-shrink: 0 !important; /* Prevent button from shrinking */
    margin: 0 2px !important; /* Small margin for consistent visual spacing */
}

/* ============================================================================
   TASKBAR LAYOUT FIXES
   - Prevent legacy .close-button rules (absolute positioning) from overlapping
     neighboring icons (e.g., fullscreen).
   - Make the icon cluster visually tight/adjacent to avoid "uneven gap" illusions
     caused by icon images with different built-in whitespace.
   ============================================================================ */

/* Keep the right side compact; use explicit margins for the larger groups */
.question-taskbar .taskbar-right {
    gap: 0 !important;
}

/* Preserve separation between the big controls and the icon cluster */
.question-taskbar .taskbar-right .taskbar-button,
.question-taskbar .taskbar-right .progress-indicator {
    margin-right: 12px;
}

/* Remove per-button margins so icons sit directly adjacent */
.question-taskbar .taskbar-right .taskbar-icon-button,
.question-taskbar .taskbar-right .annotation-toggle-btn,
.question-taskbar .taskbar-right .close-button {
    margin: 0 !important;
}

/* Force the taskbar close button to participate in flex layout */
.question-taskbar .close-button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
}

.taskbar-icon-button:hover {
    transform: scale(1.1) !important;
    background: transparent !important;
    border: none !important;
}

/* Size SVGs inside taskbar icon buttons. The question rail overrides this so Lucide strokes stay square. */
.taskbar-icon-button svg {
    width: 36px !important;
    height: 40px !important;
    flex-shrink: 0;
}

.question-tool-rail .taskbar-rail-btn {
    color: #1c2430;
}

.question-tool-rail .taskbar-rail-btn svg {
    width: 22px !important;
    height: 22px !important;
}

/* Leaderboard: 🏆 emoji — sized to sit with neighboring SVG icons */
.taskbar-trophy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    font-size: 28px;
    line-height: 1;
}

/* Annotation toggle button - minimal icon-only style */
.annotation-toggle-btn {
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.annotation-toggle-btn:hover {
    transform: scale(1.1);
    background: transparent !important;
}

.annotation-toggle-btn.active img,
.annotation-toggle-btn.active svg {
    filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.6));
}

.annotation-toggle-btn.tool-active {
    background: #dc2626 !important;
    border: 2px solid #991b1b !important;
    color: #fff;
}

.annotation-toggle-btn.tool-active img,
.annotation-toggle-btn.tool-active svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
}

.annotation-toggle-btn.tool-active:hover {
    background: #b91c1c !important;
}

.annotation-toggle-btn img {
    width: 30px;
    height: 30px;
    transition: all 0.2s ease;
    display: block;
}

/* Notes button - minimal icon-only style */
#notesBtn {
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#notesBtn:hover {
    transform: scale(1.1);
    background: transparent !important;
}

#notesBtn svg {
    width: 30px;
    height: 30px;
    stroke: #1f2937;
    transition: all 0.2s ease;
}

#notesBtn:hover svg {
    stroke: #000EF9;
}

/* Report Bug button - red bug icon */
#reportBugBtn {
    color: #dc2626;
}

#reportBugBtn:hover {
    color: #b91c1c;
}

#reportBugBtn svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
}

/* Help video button — same quiet stroke as the rest of the question rail */
#helpVideoBtn {
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0 !important;
    box-shadow: none !important;
    color: #1c2430;
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#helpVideoBtn:hover {
    background: rgba(15, 23, 42, 0.06) !important;
    box-shadow: none !important;
    transform: scale(1.1) !important;
}

/* Crown badge indicator for hard-tier help videos */
#helpVideoBtn {
    position: relative;
}

#helpVideoBtn .help-video-crown {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
    line-height: 1;
    background: rgba(255, 215, 0, 0.95);
    border: 1.5px solid #ffd700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
    pointer-events: none;
    animation: crownPulse 2s ease-in-out infinite;
}

@keyframes crownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#helpVideoBtn:hover .help-video-crown {
    animation: none;
    transform: scale(1.15);
    box-shadow: 0 3px 6px rgba(255, 215, 0, 0.5);
}

/* Crown overlay (fixed above taskbar) - enlarge on hover to show it's independently clickable */
#mm-help-video-crown-overlay {
    transition: transform 0.2s ease;
}
#mm-help-video-crown-overlay:hover {
    transform: scale(1.25);
}

/* Annotation tools menu */
/* Keep above ink canvases (10005-10006) and interaction layer for access */
.annotation-tools-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 10010 !important; /* Above ink layers (10005-10006) so controls stay clickable */
    pointer-events: auto !important; /* Ensure menu is always clickable */
    animation: menuSlideIn 0.2s ease-out;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.annotation-menu-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.annotation-tools-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.annotation-actions-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Tool buttons in menu */
.annotation-tool-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 50px;
    min-height: 52px; /* Accommodate 36px images + padding */
    position: relative;
    flex: 0 0 auto;
}

.annotation-tool-btn:hover {
    transform: scale(1.15);
    filter: brightness(1.1);
}

.annotation-tool-btn.active {
    background: transparent;
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6));
}

.annotation-tool-btn.active svg {
    stroke: #374151;
}

.annotation-tool-btn svg {
    width: 18px;
    height: 18px;
    stroke: #374151;
}

.annotation-tool-btn img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* Color indicator for pen */
.color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #000;
    position: absolute;
    bottom: 2px;
    right: 2px;
}

.annotation-tool-btn.active .color-indicator {
    border-color: white;
    box-shadow: 0 0 0 1px #000;
}

/* Divider */
.annotation-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 4px 0;
}

/* Slider container */
.annotation-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;
}

.annotation-slider-container label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    min-width: 35px;
}

.annotation-slider-container input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 1px solid #d1d5db;
}

.annotation-slider-container input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

.annotation-slider-container input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

.annotation-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFCC00;
    border: 3px solid #000EF9;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.annotation-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.annotation-slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFCC00;
    border: 3px solid #000EF9;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.annotation-slider-container input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.annotation-slider-container span {
    font-size: 12px;
    font-weight: 600;
    color: #000EF9;
    min-width: 25px;
    text-align: right;
}

/* Global annotation canvases - ink layers on top of everything */
#global-ink-highlighter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10005 !important; /* Above interaction canvas and question content */
}

#global-ink-pen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10006 !important; /* Above highlighter layer */
}

/* Transparent interaction canvas - captures clicks for drawing */
#global-ink-interaction {
    position: fixed;
    top: var(--mm-taskbar-height, 80px);
    left: var(--mm-tool-rail-width, 0px);
    width: calc(100% - var(--mm-tool-rail-width, 0px));
    height: calc(100% - var(--mm-taskbar-height, 80px));
    pointer-events: none; /* Controlled by JS when tools are active */
    z-index: 10004; /* Above question content but below ink layers */
    background: transparent;
}

/* Mobile responsive adjustments for annotation menu */
@media (max-width: 768px) {
    .annotation-tools-menu {
        right: 10px !important;
        max-width: calc(100vw - 20px);
    }
    
    .annotation-menu-content {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .annotation-tool-btn {
        flex: 0 0 auto;
        min-width: 45px;
        padding: 8px 10px;
    }
    
    .annotation-slider-container {
        width: 100%;
        flex-basis: 100%;
    }
    
    .annotation-divider {
        width: 100%;
        flex-basis: 100%;
    }
}

@media (max-width: 480px) {
    .annotation-toggle-btn {
        padding: 6px !important;
    }
    
    .annotation-toggle-btn svg,
    .annotation-toggle-btn img {
        width: 24px;
        height: 24px;
    }
    
    #notesBtn,
    #helpVideoBtn {
        padding: 5px !important;
        min-width: 28px !important;
        width: 28px !important;
        height: 28px !important;
    }
    
    #notesBtn svg {
        width: 24px;
        height: 24px;
    }
    
    #reportBugBtn svg,
    .taskbar-icon-button svg {
        width: 24px !important;
        height: 24px !important;
    }

    .question-tool-rail .taskbar-rail-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Global Button Themes */
/* Style 1: Tech/Sci-Fi */
body.theme-style-1 .taskbar-button,
body.theme-style-1 .submit-button,
body.theme-style-1 .number-item,
body.theme-style-1 .choice-option:hover,
body.theme-style-1 .choice-option.selected {
    background: linear-gradient(to bottom, #006064, #00323c);
    color: #00e5ff;
    border-color: #00e5ff;
    box-shadow: 0 0 5px #00e5ff;
    border-radius: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.65);
}

/* Style 2: Retro Wood */
body.theme-style-2 .taskbar-button,
body.theme-style-2 .submit-button,
body.theme-style-2 .number-item,
body.theme-style-2 .choice-option:hover,
body.theme-style-2 .choice-option.selected {
    background: #5d4037;
    color: #ffd700;
    border-color: #ffd700;
    border-width: 3px;
    border-radius: 2px;
    box-shadow: none;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.1) 10px, rgba(0,0,0,0.1) 20px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.55);
}

/* Style 3: Metallic (Default-ish but distinct) */
body.theme-style-3 .taskbar-button,
body.theme-style-3 .submit-button,
body.theme-style-3 .number-item,
body.theme-style-3 .choice-option:hover,
body.theme-style-3 .choice-option.selected {
    background: linear-gradient(to bottom, #b0bec5, #546e7a 50%, #b0bec5);
    color: #fff;
    border-color: #78909c;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Style 4: Jungle */
body.theme-style-4 .taskbar-button,
body.theme-style-4 .submit-button,
body.theme-style-4 .number-item,
body.theme-style-4 .choice-option:hover,
body.theme-style-4 .choice-option.selected {
    background: #33691e;
    color: #dcedc8;
    border-color: #558b2f;
    border-width: 3px;
    border-radius: 12px;
    border-style: solid;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.42);
}

/* Style 5: Pastel */
body.theme-style-5 .taskbar-button,
body.theme-style-5 .submit-button,
body.theme-style-5 .number-item,
body.theme-style-5 .choice-option:hover,
body.theme-style-5 .choice-option.selected {
    background: #f8bbd0;
    color: #444; /* Darker grey for readability */
    border-color: #fff;
    border-style: dashed;
    border-width: 3px;
    border-radius: 20px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2); /* Increased shadow for pop */
    font-weight: 800; /* Extra bold for readability */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.28);
}

/* Style 6: Classic Gameshow (Green with yellow border) */
body.theme-style-6 .taskbar-button,
body.theme-style-6 .submit-button,
body.theme-style-6 .number-item,
body.theme-style-6 .choice-option:hover,
body.theme-style-6 .choice-option.selected {
    background: #2e7d32; /* Green */
    color: #fdb813; /* Gold/Yellow text */
    border-color: #fdb813; /* Yellow border */
    border-width: 3px;
    border-radius: 5px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-weight: 700;
    text-shadow: 1px 1px 2px #000;
}

/* Style 7: Custom Theme */
body.theme-style-7 .taskbar-button,
body.theme-style-7 .submit-button,
body.theme-style-7 .number-item,
body.theme-style-7 .choice-option:hover,
body.theme-style-7 .choice-option.selected {
    background: linear-gradient(to bottom, var(--custom-primary, #4a90d9), var(--custom-secondary, #2d5a8a));
    color: var(--custom-text, #ffffff);
    border-color: var(--custom-accent, #ffd700);
    border-width: 3px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    text-shadow: 1px 1px 2px var(--custom-shadow, rgba(0,0,0,0.6));
}

/* Utility / in-question buttons (auto-adopted via JS)
   Kept lower-specificity so question-specific UI can override easily. */
:where(body.theme-style-1) .mm-themed-button {
    background: linear-gradient(to bottom, #007079, #004a57);
    color: #00e5ff;
    border-color: #00e5ff;
    border-width: 2px;
    border-radius: 12px;
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.35);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.55);
}

:where(body.theme-style-2) .mm-themed-button {
    /* Lighter than the main Retro Wood buttons (secondary/utility) */
    background: #8d6e63;
    color: #fff7d1;
    border-color: #ffd700;
    border-width: 2px;
    border-radius: 6px;
    box-shadow: none;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.06) 10px, rgba(0,0,0,0.06) 20px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
}

:where(body.theme-style-3) .mm-themed-button {
    background: linear-gradient(to bottom, #eceff1, #cfd8dc);
    color: #37474f;
    border-color: #78909c;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
}

:where(body.theme-style-4) .mm-themed-button {
    background: #558b2f;
    color: #f1f8e9;
    border-color: #33691e;
    border-width: 2px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

:where(body.theme-style-5) .mm-themed-button {
    background: #fce4ec;
    color: #444;
    border-color: #fff;
    border-style: dashed;
    border-width: 3px;
    border-radius: 16px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.22);
}

:where(body.theme-style-6) .mm-themed-button {
    background: #388e3c; /* Slightly lighter than primary gameshow green */
    color: #fdb813;
    border-color: #fdb813;
    border-width: 3px;
    border-radius: 5px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.45);
    font-weight: 700;
    text-shadow: 1px 1px 2px #000;
}

:where(body.theme-style-7) .mm-themed-button {
    background: linear-gradient(to bottom, var(--custom-primary, #4a90d9), var(--custom-secondary, #2d5a8a));
    color: var(--custom-text, #ffffff);
    border-color: var(--custom-accent, #ffd700);
    border-width: 3px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    text-shadow: 1px 1px 2px var(--custom-shadow, rgba(0,0,0,0.6));
}

/* Hover/Active States for Global Buttons matching themes */

/* Style 1: Tech/Sci-Fi Hover */
body.theme-style-1 .taskbar-button:hover,
body.theme-style-1 .submit-button:hover:not(:disabled),
body.theme-style-1 .number-item:hover {
    background: linear-gradient(to bottom, #00e5ff, #00acc1);
    color: #006064;
    border-color: #006064;
    box-shadow: 0 0 15px #00e5ff;
}

/* Style 2: Retro Wood Hover */
body.theme-style-2 .taskbar-button:hover,
body.theme-style-2 .submit-button:hover:not(:disabled),
body.theme-style-2 .number-item:hover {
    background: #8d6e63;
    color: #ffecb3;
    border-color: #ffecb3;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

/* Style 3: Metallic Hover */
body.theme-style-3 .taskbar-button:hover,
body.theme-style-3 .submit-button:hover:not(:disabled),
body.theme-style-3 .number-item:hover {
    background: linear-gradient(to bottom, #cfd8dc, #90a4ae 50%, #cfd8dc);
    color: #37474f;
    border-color: #37474f;
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
    text-shadow: none;
}

/* Style 4: Jungle Hover */
body.theme-style-4 .taskbar-button:hover,
body.theme-style-4 .submit-button:hover:not(:disabled),
body.theme-style-4 .number-item:hover {
    background: #558b2f;
    color: #f1f8e9;
    border-color: #33691e;
}

/* Style 5: Pastel Hover */
body.theme-style-5 .taskbar-button:hover,
body.theme-style-5 .submit-button:hover:not(:disabled),
body.theme-style-5 .number-item:hover {
    background: #f48fb1;
    color: #fff;
    border-color: #880e4f;
    box-shadow: 0 0 15px rgba(244, 143, 177, 0.6);
}

/* Style 6: Classic Gameshow Hover (Inverted colors) */
body.theme-style-6 .taskbar-button:hover,
body.theme-style-6 .submit-button:hover:not(:disabled),
body.theme-style-6 .number-item:hover {
    background: #fdb813; /* Gold/Yellow background */
    color: #2e7d32; /* Green text */
    border-color: #2e7d32; /* Green border */
    box-shadow: 0 0 10px rgba(253, 184, 19, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Style 7: Custom Theme Hover */
body.theme-style-7 .taskbar-button:hover,
body.theme-style-7 .submit-button:hover:not(:disabled),
body.theme-style-7 .number-item:hover {
    background: var(--custom-accent, #ffd700);
    color: var(--custom-hover-text, var(--custom-secondary, #2d5a8a));
    border-color: var(--custom-hover-border, var(--custom-secondary, #2d5a8a));
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    text-shadow: none;
}

/* Utility button hover states */
:where(body.theme-style-1) .mm-themed-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #00e5ff, #00acc1);
    color: #00323c;
    border-color: #00323c;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

:where(body.theme-style-2) .mm-themed-button:hover:not(:disabled) {
    background: #ffecb3;
    color: #5d4037;
    border-color: #5d4037;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.15);
}

:where(body.theme-style-3) .mm-themed-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #cfd8dc, #b0bec5);
    color: #263238;
    border-color: #37474f;
    box-shadow: 0 0 8px rgba(255,255,255,0.7);
}

:where(body.theme-style-4) .mm-themed-button:hover:not(:disabled) {
    background: #7cb342;
    color: #f1f8e9;
    border-color: #33691e;
}

:where(body.theme-style-5) .mm-themed-button:hover:not(:disabled) {
    background: #f48fb1;
    color: #fff;
    border-color: #880e4f;
    box-shadow: 0 0 12px rgba(244, 143, 177, 0.5);
}

:where(body.theme-style-6) .mm-themed-button:hover:not(:disabled) {
    background: #fdb813;
    color: #2e7d32;
    border-color: #2e7d32;
    box-shadow: 0 0 10px rgba(253, 184, 19, 0.75);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

:where(body.theme-style-7) .mm-themed-button:hover:not(:disabled) {
    background: var(--custom-accent, #ffd700);
    color: var(--custom-hover-text, var(--custom-secondary, #2d5a8a));
    border-color: var(--custom-hover-border, var(--custom-secondary, #2d5a8a));
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    text-shadow: none;
}

/* Keep disabled buttons visibly disabled across themes */
body.theme-style-1 .submit-button:disabled,
body.theme-style-2 .submit-button:disabled,
body.theme-style-3 .submit-button:disabled,
body.theme-style-4 .submit-button:disabled,
body.theme-style-5 .submit-button:disabled,
body.theme-style-6 .submit-button:disabled,
body.theme-style-7 .submit-button:disabled,
body.theme-style-1 .mm-themed-button:disabled,
body.theme-style-2 .mm-themed-button:disabled,
body.theme-style-3 .mm-themed-button:disabled,
body.theme-style-4 .mm-themed-button:disabled,
body.theme-style-5 .mm-themed-button:disabled,
body.theme-style-6 .mm-themed-button:disabled,
body.theme-style-7 .mm-themed-button:disabled {
    background: #666666;
    color: #CCCCCC;
    border-color: #CCCCCC;
    cursor: not-allowed;
    box-shadow: none;
    text-shadow: none;
    background-image: none;
    transform: none;
    filter: none;
    text-transform: none;
}

/* Universal themed button (used for in-question utility buttons) */
.mm-themed-button {
    background: #000EF9;
    color: #FFCC00;
    border: 2px solid #FFCC00;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0.2px;
}

.mm-themed-button:hover:not(:disabled) {
    background: #FFCC00;
    color: #000EF9;
    border-color: #000EF9;
}

.mm-themed-button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Subtle taskbar tint so it matches the selected theme (without competing with buttons) */
/* (Do not override taskbar positioning; it's already absolute/fixed above.) */
.question-taskbar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent;
    opacity: 0;
}

.question-taskbar > * {
    position: relative;
    z-index: 1;
}

body.theme-style-1 .question-taskbar::before { background: #00323c; opacity: 0.10; }
body.theme-style-2 .question-taskbar::before { background: #5d4037; opacity: 0.08; }
body.theme-style-3 .question-taskbar::before { background: #546e7a; opacity: 0.08; }
body.theme-style-4 .question-taskbar::before { background: #33691e; opacity: 0.08; }
body.theme-style-5 .question-taskbar::before { background: #f8bbd0; opacity: 0.12; }
body.theme-style-6 .question-taskbar::before { background: #2e7d32; opacity: 0.08; }
body.theme-style-7 .question-taskbar::before { background: var(--custom-secondary, #2d5a8a); opacity: 0.10; }